nodenetworks cannot be referred to by ip (may be NULL)
authorMark Huang <mlhuang@cs.princeton.edu>
Fri, 10 Nov 2006 19:30:10 +0000 (19:30 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Fri, 10 Nov 2006 19:30:10 +0000 (19:30 +0000)
PLC/Methods/AdmDeleteNodeNetwork.py
PLC/Methods/DeleteNodeNetwork.py
PLC/Methods/UpdateNodeNetwork.py
PLC/__init__.py

index 8750104..d566504 100644 (file)
@@ -17,9 +17,8 @@ class AdmDeleteNodeNetwork(DeleteNodeNetwork):
         Auth(),
         Mixed(Node.fields['node_id'],
              Node.fields['hostname']),
-       Mixed(NodeNetwork.fields['nodenetwork_id'],
-             NodeNetwork.fields['ip'])
+       NodeNetwork.fields['nodenetwork_id']
         ]
 
-    def call(self, auth, node_id_or_hostname, nodenetwork_id_or_ip):
-        return DeleteNodeNetwork.call(self, auth, nodenetwork_id_or_ip)
+    def call(self, auth, node_id_or_hostname, nodenetwork_id):
+        return DeleteNodeNetwork.call(self, auth, nodenetwork_id)
index 05463df..d14a5b1 100644 (file)
@@ -7,11 +7,10 @@ from PLC.NodeNetworks import NodeNetwork, NodeNetworks
 
 class DeleteNodeNetwork(Method):
     """
-    Delete an existing Node Network. Nodenetwork_id must be associated to 
-    node_id and not be associated with a different node.
+    Deletes an existing node network interface.
 
-    ins may delete any node network. PIs and techs can only delete 
-    nodenetworks for thier nodes.
+    Admins may delete any node network. PIs and techs may only delete
+    node network interfaces associated with nodes at their sites.
 
     Returns 1 if successful, faults otherwise.
     """
@@ -20,15 +19,14 @@ class DeleteNodeNetwork(Method):
 
     accepts = [
         Auth(),
-       Mixed(NodeNetwork.fields['nodenetwork_id'],
-             NodeNetwork.fields['ip'])
+       NodeNetwork.fields['nodenetwork_id']
         ]
 
     returns = Parameter(int, '1 if successful')
 
-    def call(self, auth, nodenetwork_id_or_ip):
+    def call(self, auth, nodenetwork_id):
         # Get node network information
-        nodenetworks = NodeNetworks(self.api, [nodenetwork_id_or_ip])
+        nodenetworks = NodeNetworks(self.api, [nodenetwork_id])
         if not nodenetworks:
             raise PLCInvalidArgument, "No such node network"
        nodenetwork = nodenetworks[0]
index c4df647..149c541 100644 (file)
@@ -10,15 +10,15 @@ can_update = lambda (field, value): field not in \
 
 class UpdateNodeNetwork(Method):
     """
-    Updates an existing node network. Any values specified in update_fields 
-    are used, otherwise defaults are used. Acceptable values for method are
-    dhcp and static. If type is static, the parameter update_fields must
-    be present and ip, gateway, network, broadcast, netmask, and dns1 must
-    all be specified. If type is dhcp, these parameters, even if
-    specified, are ignored.
+    Updates an existing node network. Any values specified in
+    nodenetwork_fields are used, otherwise defaults are
+    used. Acceptable values for method are dhcp and static. If type is
+    static, then ip, gateway, network, broadcast, netmask, and dns1
+    must all be specified in nodenetwork_fields. If type is dhcp,
+    these parameters, even if specified, are ignored.
     
     PIs and techs may only update networks associated with their own
-    nodes. ins may update any node network.
+    nodes. Admins may update any node network.
  
     Returns 1 if successful, faults otherwise.
     """
@@ -29,18 +29,17 @@ class UpdateNodeNetwork(Method):
 
     accepts = [
         Auth(),
-       Mixed(NodeNetwork.fields['nodenetwork_id'],
-             NodeNetwork.fields['ip']),
+       NodeNetwork.fields['nodenetwork_id'],
        nodenetwork_fields
         ]
 
     returns = Parameter(int, '1 if successful')
 
-    def call(self, auth, nodenetwork_id_or_ip, nodenetwork_fields):
+    def call(self, auth, nodenetwork_id, nodenetwork_fields):
         nodenetwork_fields = dict(filter(can_update, nodenetwork_fields.items()))
 
        # Get node network information
-       nodenetworks = NodeNetworks(self.api, [nodenetwork_id_or_ip])
+       nodenetworks = NodeNetworks(self.api, [nodenetwork_id])
        if not nodenetworks:
             raise PLCInvalidArgument, "No such node network"
 
index 2a4362d..98ab7af 100644 (file)
@@ -1 +1 @@
-all = 'Addresses AddressTypes API Auth BootStates ConfFiles Config Debug Events Faults Filter ForeignNodes Keys KeyTypes Messages Method NetworkMethods NetworkTypes NodeGroups NodeNetworks Nodes Parameter PCUs Peers Persons POD PostgreSQL Roles Sessions Sites SliceAttributes SliceAttributeTypes SliceInstantiations Slices Table'.split()
+all = 'API AddressTypes Addresses Auth BootStates ConfFiles Config Debug Events Faults Filter ForeignNodes KeyTypes Keys Messages Method NetworkMethods NetworkTypes NodeGroups NodeNetworks Nodes PCUs POD Parameter Peers Persons PostgreSQL Roles Sessions Sites SliceAttributeTypes SliceAttributes SliceInstantiations Slices Table'.split()