Add RAPI resource to redistribute config
authorMichael Hanselmann <hansmi@google.com>
Thu, 3 Sep 2009 14:05:33 +0000 (16:05 +0200)
committerMichael Hanselmann <hansmi@google.com>
Thu, 3 Sep 2009 15:45:16 +0000 (17:45 +0200)
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Luca Bigliardi <shammash@google.com>

doc/rapi.rst
lib/rapi/connector.py
lib/rapi/rlib2.py

index e3bfc53..d2f7aea 100644 (file)
@@ -190,6 +190,20 @@ Example::
       }
     }
 
+
+``/2/redistribute-config``
+++++++++++++++++++++++++++
+
+Redistribute configuration to all nodes.
+
+It supports the following commands: ``PUT``.
+
+``PUT``
+~~~~~~~
+
+Redistribute configuration to all nodes. The result will be a job id.
+
+
 ``/2/instances``
 ++++++++++++++++
 
@@ -398,7 +412,7 @@ Example::
 Add a set of tags.
 
 The request as a list of strings should be ``PUT`` to this URI. The
-result willl be a job id.
+result will be a job id.
 
 It supports the ``dry-run`` argument.
 
index eeae01e..4f932b0 100644 (file)
@@ -201,6 +201,7 @@ def GetHandlers(node_name_pattern, instance_name_pattern, job_id_pattern):
     "/2/tags": rlib2.R_2_tags,
     "/2/info": rlib2.R_2_info,
     "/2/os": rlib2.R_2_os,
+    "/2/redistribute-config": rlib2.R_2_redist_config,
     }
 
 
index 63ecf1f..345d693 100644 (file)
@@ -116,6 +116,17 @@ class R_2_os(baserlib.R_Generic):
     return [row[0] for row in diagnose_data if row[1]]
 
 
+class R_2_redist_config(baserlib.R_Generic):
+  """/2/redistribute-config resource.
+
+  """
+  def PUT(self):
+    """Redistribute configuration to all nodes.
+
+    """
+    return baserlib.SubmitJob([opcodes.OpRedistributeConfig()])
+
+
 class R_2_jobs(baserlib.R_Generic):
   """/2/jobs resource.