Branch 5.0 for module PLCAPI created from tag PLCAPI-4.2-8
[plcapi.git] / PLC / Methods / AdmGetSiteNodes.py
index 6deb610..b366c80 100644 (file)
@@ -2,14 +2,15 @@ from PLC.Faults import *
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
 from PLC.Sites import Site, Sites
-from PLC.Auth import PasswordAuth
+from PLC.Auth import Auth
 
 class AdmGetSiteNodes(Method):
     """
     Deprecated. See GetSites.
 
-    Return a dictionary containing a list of node_ids for each of the
-    sites specified.
+    Return a struct containing an array of node_ids for each of the
+    sites specified. Note that the keys of the struct are strings, not
+    integers, because of XML-RPC marshalling limitations.
 
     Admins may retrieve details about all nodes on a site by not specifying
     site_id_or_name or by specifying an empty list. Users and
@@ -22,16 +23,16 @@ class AdmGetSiteNodes(Method):
     roles = ['admin', 'pi', 'user', 'tech']
 
     accepts = [
-        PasswordAuth(),
+        Auth(),
         [Mixed(Site.fields['site_id'],
                Site.fields['name'])],
         ]
 
-    returns = { Site.fields['site_id']: Site.fields['node_ids'] }
+    returns = dict
 
     def call(self, auth, site_id_or_name_list = None):
         # Get site information
-       sites = Sites(self.api, site_id_or_name_list).values()  
+       sites = Sites(self.api, site_id_or_name_list)   
        if not sites:
             raise PLCInvalidArgument, "No such site"