X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FSliceCreate.py;h=e75250567f6d8a2f73c84034590b33209ba5256f;hb=19d4a01ccf66af9e00914351b3eacd5fc880f988;hp=a7494548e3cf0c0056664450191932c7233f80cc;hpb=77f6b38241def521ad03ccf4ebebde73b3fd169a;p=plcapi.git diff --git a/PLC/Methods/SliceCreate.py b/PLC/Methods/SliceCreate.py index a749454..e752505 100644 --- a/PLC/Methods/SliceCreate.py +++ b/PLC/Methods/SliceCreate.py @@ -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,15 @@ class SliceCreate(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)