(most) all functions now take SessionAuth in addition to PasswordAuth
[plcapi.git] / PLC / Methods / SliceCreate.py
index a749454..27b4611 100644 (file)
@@ -1,3 +1,8 @@
+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):
@@ -6,3 +11,13 @@ class SliceCreate(AddSlice):
     """
 
     status = "deprecated"
+    
+    accepts = [
+        Auth(),
+        Slice.fields['name'],
+        AddSlice.accepts[1]
+        ]
+
+    def call(self, auth, name, slice_fields = {}):
+        slice_fields['name'] = name
+        return AddSlice.call(self, auth, slice_fields)