1 from PLC.Method import Method
2 from PLC.Parameter import Parameter, Mixed
3 from PLC.Auth import PasswordAuth
4 from PLC.Attributes import Attribute, Attributes
6 class GetAttributes(Method):
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.
13 roles = ['admin', 'pi', 'user', 'tech']
17 [Mixed(Attribute.fields['attribute_id'],
18 Attribute.fields['name'])],
21 returns = [Attribute.fields]
23 def call(self, auth, attribute_id_or_name_list = None):
24 # Get slice attribute information
25 attributes = Attributes(self.api, attribute_id_or_name_list).values()
27 # Turn each attribute into a real dict.
28 attributes = [dict(attribute) for attribute in attributes]