X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FGetSliceAttributeTypes.py;h=bc8f1ed1cdded9a84621703465bcafb1a83fba8e;hb=a74854dd38cb742b8fdc0d0cda7fff738a95312c;hp=a0db661e2cb43c6874f70f5e6d17df4ec991ee73;hpb=1f8c38dd1357c93e4be8d94456b7274a591d2db4;p=plcapi.git diff --git a/PLC/Methods/GetSliceAttributeTypes.py b/PLC/Methods/GetSliceAttributeTypes.py index a0db661..bc8f1ed 100644 --- a/PLC/Methods/GetSliceAttributeTypes.py +++ b/PLC/Methods/GetSliceAttributeTypes.py @@ -1,24 +1,30 @@ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed +from PLC.Filter import Filter from PLC.Auth import Auth from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes class GetSliceAttributeTypes(Method): """ - Return an array of structs containing details about all possible - slice and node attributes. If attribute_id_or_name_list is - specified, only the specified attributes will be queried. + Returns an array of structs containing details about slice + attribute types. If attribute_type_filter is specified and + is an array of slice attribute type identifiers, or a + struct of slice attribute type attributes, only slice attribute + types matching the filter will be returned. If return_fields is + specified, only the specified details will be returned. """ - roles = ['admin', 'pi', 'user', 'tech'] + roles = ['admin', 'pi', 'user', 'tech', 'node'] accepts = [ Auth(), - [Mixed(SliceAttributeType.fields['attribute_type_id'], - SliceAttributeType.fields['name'])], + Mixed([Mixed(SliceAttributeType.fields['attribute_type_id'], + SliceAttributeType.fields['name'])], + Filter(SliceAttributeType.fields)), + Parameter([str], "List of fields to return", nullok = True) ] returns = [SliceAttributeType.fields] - def call(self, auth, attribute_type_id_or_name_list = None): - return SliceAttributeTypes(self.api, attribute_type_id_or_name_list).values() + def call(self, auth, attribute_type_filter = None, return_fields = None): + return SliceAttributeTypes(self.api, attribute_type_filter, return_fields)