- hack xmlrpclib so that it can marshal subclasses of built-in types (e.g., Row)
[plcapi.git] / PLC / Methods / GetSliceAttributeTypes.py
1 from PLC.Method import Method
2 from PLC.Parameter import Parameter, Mixed
3 from PLC.Auth import PasswordAuth
4 from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
5
6 class GetSliceAttributeTypes(Method):
7     """
8     Return an array of structs containing details about all possible
9     slice and node attributes. If attribute_id_or_name_list is
10     specified, only the specified attributes will be queried.
11     """
12
13     roles = ['admin', 'pi', 'user', 'tech']
14
15     accepts = [
16         PasswordAuth(),
17         [Mixed(SliceAttributeType.fields['attribute_type_id'],
18                SliceAttributeType.fields['name'])],
19         ]
20
21     returns = [SliceAttributeType.fields]
22
23     def call(self, auth, attribute_type_id_or_name_list = None):
24         return SliceAttributeTypes(self.api, attribute_type_id_or_name_list).values()