- Change .py files to use 4-space indents and no hard tab characters.
[plcapi.git] / PLC / Methods / GetSlices.py
index f496356..22e5e1e 100644 (file)
@@ -1,4 +1,5 @@
 # $Id$
+# $URL$
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
 from PLC.Filter import Filter
@@ -7,7 +8,7 @@ from PLC.Persons import Person, Persons
 from PLC.Sites import Site, Sites
 from PLC.Slices import Slice, Slices
 
-class v43GetSlices(Method):
+class GetSlices(Method):
     """
     Returns an array of structs containing details about slices. If
     slice_filter is specified and is an array of slice identifiers or
@@ -36,8 +37,8 @@ class v43GetSlices(Method):
     returns = [Slice.fields]
 
     def call(self, auth, slice_filter = None, return_fields = None):
-       # If we are not admin, make sure to return only viewable
-       # slices.
+        # If we are not admin, make sure to return only viewable
+        # slices.
         if isinstance(self.caller, Person) and \
            'admin' not in self.caller['roles']:
             # Get slices that we are able to view
@@ -70,41 +71,7 @@ class v43GetSlices(Method):
         # Remove slice_id if not specified
         if added_fields:
             for slice in slices:
-               if 'slice_id' in slice:
-                   del slice['slice_id']
+                if 'slice_id' in slice:
+                    del slice['slice_id']
 
         return slices
-
-class v42GetSlices(v43GetSlices):
-    """
-    Legacy wrapper for v43GetSlices.
-    """
-
-    def call(self, auth, slice_filter = None, return_fields = None):
-        # convert nodenetwork_ids -> interface_ids
-        if slice_filter <> None and isinstance(slice_filter, dict) and \
-               slice_filter.has_key('slice_attribute_ids') and \
-               not slice_filter.has_key('slice_tag_ids'):
-            slice_filter['slice_tag_ids']=slice_filter['slice_attribute_ids']
-        slices = v43GetSlices.call(self,auth,slice_filter,return_fields)
-        # add in a slice_tag_ids -> slice_attribute_ids
-        for slice in slices:
-            if slice.has_key('slice_tag_ids'):
-                slice['slice_attribute_ids']=slice['slice_tag_ids']
-        return slices
-
-class GetSlices(v42GetSlices):
-    """
-    Returns an array of structs containing details about slices. If
-    slice_filter is specified and is an array of slice identifiers or
-    slice names, or a struct of slice attributes, only slices matching
-    the filter will be returned. If return_fields is specified, only the
-    specified details will be returned.
-
-    Users may only query slices of which they are members. PIs may
-    query any of the slices at their sites. Admins and nodes may query
-    any slice. If a slice that cannot be queried is specified in
-    slice_filter, details about that slice will not be returned.
-    """
-
-    pass