X-Git-Url: http://git.onelab.eu/?p=plcapi.git;a=blobdiff_plain;f=trunk%2FPLC%2FMethods%2FGetSliceInstantiations.py;fp=trunk%2FPLC%2FMethods%2FGetSliceInstantiations.py;h=174c2095d2de354d7167f99f4e2687ed0bb35569;hp=0000000000000000000000000000000000000000;hb=5a4c1b1278ffa01e630fde47f7c54888ed20a576;hpb=cee5ab52df1c9f38b6eaff2dd354cb22f59028c7 diff --git a/trunk/PLC/Methods/GetSliceInstantiations.py b/trunk/PLC/Methods/GetSliceInstantiations.py new file mode 100644 index 0000000..174c209 --- /dev/null +++ b/trunk/PLC/Methods/GetSliceInstantiations.py @@ -0,0 +1,21 @@ +from PLC.Faults import * +from PLC.Method import Method +from PLC.Parameter import Parameter, Mixed +from PLC.SliceInstantiations import SliceInstantiation, SliceInstantiations +from PLC.Auth import Auth + +class GetSliceInstantiations(Method): + """ + Returns an array of all valid slice instantiation states. + """ + + roles = ['admin', 'pi', 'user', 'tech', 'node'] + + accepts = [ + Auth() + ] + + returns = [SliceInstantiation.fields['instantiation']] + + def call(self, auth): + return [slice_instantiation['instantiation'] for slice_instantiation in SliceInstantiations(self.api)]