diff --git a/doc/rapi.rst b/doc/rapi.rst index e3bfc53fa7957f84aff9c455bea15cb9648950ee..d2f7aeaded15021ffd76ffaea098b3bdcf6cc970 100644 --- a/doc/rapi.rst +++ b/doc/rapi.rst @@ -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. diff --git a/lib/rapi/connector.py b/lib/rapi/connector.py index eeae01e5835ba96117c6240618fb677cc1791973..4f932b0daf0a139b980bf0d8901c3b5f6626486b 100644 --- a/lib/rapi/connector.py +++ b/lib/rapi/connector.py @@ -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, } diff --git a/lib/rapi/rlib2.py b/lib/rapi/rlib2.py index 63ecf1f6dbe651b192fe4413a9142baad2e6904e..345d693c3e2cb6be7ea231a1ec76ff4406193696 100644 --- a/lib/rapi/rlib2.py +++ b/lib/rapi/rlib2.py @@ -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.