Merge from trunk
[plcapi.git] / trunk / PLC / Methods / SliceCreate.py
diff --git a/trunk/PLC/Methods/SliceCreate.py b/trunk/PLC/Methods/SliceCreate.py
new file mode 100644 (file)
index 0000000..cc30b52
--- /dev/null
@@ -0,0 +1,25 @@
+from PLC.Faults import *
+from PLC.Method import Method
+from PLC.Parameter import Parameter, Mixed
+from PLC.Auth import Auth
+from PLC.Slices import Slice, Slices
+from PLC.Methods.AddSlice import AddSlice
+
+class SliceCreate(AddSlice):
+    """
+    Deprecated. See AddSlice.
+    """
+
+    status = "deprecated"
+    
+    accepts = [
+        Auth(),
+        Slice.fields['name'],
+        AddSlice.accepts[1]
+        ]
+    
+    returns = Parameter(int, 'New slice_id (> 0) if successful')
+
+    def call(self, auth, name, slice_fields = {}):
+        slice_fields['name'] = name
+        return AddSlice.call(self, auth, slice_fields)