fix calling convention
authorMark Huang <mlhuang@cs.princeton.edu>
Sun, 29 Oct 2006 16:08:33 +0000 (16:08 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Sun, 29 Oct 2006 16:08:33 +0000 (16:08 +0000)
PLC/Methods/AddNodeToNodeGroup.py
PLC/Methods/DeleteNodeFromNodeGroup.py
Test.py
doc/PLCAPI.pdf

index 9036195..b2c5678 100644 (file)
@@ -17,10 +17,10 @@ class AddNodeToNodeGroup(Method):
 
     accepts = [
         Auth(),
+       Mixed(Node.fields['node_id'],
+             Node.fields['hostname']),
         Mixed(NodeGroup.fields['nodegroup_id'],
              NodeGroup.fields['name']),
-       Mixed(Node.fields['node_id'],
-             Node.fields['hostname'])
         ]
 
     returns = Parameter(int, '1 if successful')
@@ -29,7 +29,7 @@ class AddNodeToNodeGroup(Method):
     object_type = 'NodeGroup'
     object_ids = []
 
-    def call(self, auth, nodegroup_id_or_name, node_id_or_hostname):
+    def call(self, auth, node_id_or_hostname, nodegroup_id_or_name):
         # Get node info
        nodes = Nodes(self.api, [node_id_or_hostname])
        if not nodes:
index 1e61fe5..70c05ce 100644 (file)
@@ -16,15 +16,15 @@ class DeleteNodeFromNodeGroup(Method):
 
     accepts = [
         Auth(),
+       Mixed(Node.fields['node_id'],
+             Node.fields['hostname']),
         Mixed(NodeGroup.fields['nodegroup_id'],
              NodeGroup.fields['name']),
-       Mixed(Node.fields['node_id'],
-             Node.fields['hostname'])
         ]
 
     returns = Parameter(int, '1 if successful')
 
-    def call(self, auth, nodegroup_id_or_name, node_id_or_hostname):
+    def call(self, auth, node_id_or_hostname, nodegroup_id_or_name):
         # Get node info
        nodes = Nodes(self.api, [node_id_or_hostname])
        if not nodes:
diff --git a/Test.py b/Test.py
index 5e60be7..daa2576 100755 (executable)
--- a/Test.py
+++ b/Test.py
@@ -5,7 +5,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id: Test.py,v 1.12 2006/10/25 14:32:31 mlhuang Exp $
+# $Id$
 #
 
 from pprint import pprint
@@ -509,8 +509,8 @@ for site_id in site_ids:
 
         # Add to node groups
         for nodegroup_id in nodegroup_ids:
-            print "AddNodeToNodeGroup(%d, %d)" % (nodegroup_id, node_id),
-            AddNodeToNodeGroup(admin, nodegroup_id, node_id)
+            print "AddNodeToNodeGroup(%d, %d)" % (node_id, nodegroup_id),
+            AddNodeToNodeGroup(admin, node_id, nodegroup_id)
             print "=> OK"
         
 print "GetNodes",
@@ -948,8 +948,8 @@ print "=> []"
 for node_id in node_ids:
     # Remove from node groups
     for nodegroup_id in nodegroup_ids:
-        print "DeleteNodeFromNodeGroup(%d, %d)" % (nodegroup_id, node_id),
-        DeleteNodeFromNodeGroup(admin, nodegroup_id, node_id)
+        print "DeleteNodeFromNodeGroup(%d, %d)" % (node_id, nodegroup_id),
+        DeleteNodeFromNodeGroup(admin, node_id, nodegroup_id)
         print "=> OK"
     node = GetNodes(admin, [node_id])[0]
     assert not node['nodegroup_ids']
index e0c845e..4822c1d 100644 (file)
Binary files a/doc/PLCAPI.pdf and b/doc/PLCAPI.pdf differ