1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.Sites import Site, Sites
5 from PLC.Auth import Auth
7 class AdmGetSiteNodes(Method):
9 Deprecated. See GetSites.
11 Return a struct containing an array of node_ids for each of the
12 sites specified. Note that the keys of the struct are strings, not
13 integers, because of XML-RPC marshalling limitations.
15 Admins may retrieve details about all nodes on a site by not specifying
16 site_id_or_name or by specifying an empty list. Users and
17 techs may only retrieve details about themselves. PIs may retrieve
18 details about themselves and others at their sites.
23 roles = ['admin', 'pi', 'user', 'tech']
27 [Mixed(Site.fields['site_id'],
28 Site.fields['name'])],
33 def call(self, auth, site_id_or_name_list = None):
34 # Get site information
35 sites = Sites(self.api, site_id_or_name_list)
37 raise PLCInvalidArgument, "No such site"
39 # Convert to {str(site_id): [node_id]}
42 site_nodes[str(site['site_id'])] = site['node_ids']