- search by ip
authorMark Huang <mlhuang@cs.princeton.edu>
Fri, 20 Oct 2006 18:16:10 +0000 (18:16 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Fri, 20 Oct 2006 18:16:10 +0000 (18:16 +0000)
PLC/Methods/DeleteNodeNetwork.py
PLC/Methods/GetNodeNetworks.py

index 7b546de..47910e3 100644 (file)
@@ -21,14 +21,14 @@ class DeleteNodeNetwork(Method):
     accepts = [
         PasswordAuth(),
        Mixed(NodeNetwork.fields['nodenetwork_id'],
-             NodeNetwork.fields['hostname'])
+             NodeNetwork.fields['ip'])
         ]
 
     returns = Parameter(int, '1 if successful')
 
-    def call(self, auth, nodenetwork_id_or_hostname):
+    def call(self, auth, nodenetwork_id_or_ip):
         # Get node network information
-        nodenetworks = NodeNetworks(self.api, [nodenetwork_id_or_hostname]).values()
+        nodenetworks = NodeNetworks(self.api, [nodenetwork_id_or_ip]).values()
         if not nodenetworks:
             raise PLCInvalidArgument, "No such node network"
        nodenetwork = nodenetworks[0]
index 1bc6ef2..9d0b4df 100644 (file)
@@ -7,7 +7,7 @@ from PLC.Auth import PasswordAuth
 class GetNodeNetworks(Method):
     """
     Return an array of structs contain details about node network
-    interfaces. If nodenetwork_id_or_hostname_list is specified, only
+    interfaces. If nodenetwork_id_or_ip_list is specified, only
     the specified node network interfaces will be queried.
     """
 
@@ -16,13 +16,13 @@ class GetNodeNetworks(Method):
     accepts = [
         PasswordAuth(),
         [Mixed(NodeNetwork.fields['nodenetwork_id'],
-               NodeNetwork.fields['hostname'])]
+               NodeNetwork.fields['ip'])]
         ]
 
     returns = [NodeNetwork.fields]
 
-    def call(self, auth, nodenetwork_id_or_hostname_list = None):
-        nodenetworks = NodeNetworks(self.api, nodenetwork_id_or_hostname_list).values()
+    def call(self, auth, nodenetwork_id_or_ip_list = None):
+        nodenetworks = NodeNetworks(self.api, nodenetwork_id_or_ip_list).values()
 
         # Cast from NodeNetwork to real dict
         nodenetworks = [dict(nodenetwork) for nodenetwork in nodenetworks]