Commit 54d4c13b authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

RAPI client: Wrap /2/redistribute-config resource


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent 08c11c40
......@@ -236,7 +236,7 @@ def GenericCurlConfig(verbose=False, use_signal=False,
return _ConfigCurl
class GanetiRapiClient(object):
class GanetiRapiClient(object): # pylint: disable-msg=R0904
"""Ganeti RAPI client.
"""
......@@ -481,6 +481,16 @@ class GanetiRapiClient(object):
return self._SendRequest(HTTP_GET, "/%s/info" % GANETI_RAPI_VERSION,
None, None)
def RedistributeConfig(self):
"""Tells the cluster to redistribute its configuration files.
@return: job id
"""
return self._SendRequest(HTTP_PUT,
"/%s/redistribute-config" % GANETI_RAPI_VERSION,
None, None)
def ModifyCluster(self, **kwargs):
"""Modifies cluster parameters.
......
......@@ -1078,6 +1078,13 @@ class GanetiRapiClientTests(testutils.GanetiTestCase):
self.assertEqual(data["maintain_node_health"], mnh)
self.assertEqual(self.rapi.CountPending(), 0)
def testRedistributeConfig(self):
self.rapi.AddResponse("3364")
job_id = self.client.RedistributeConfig()
self.assertEqual(job_id, 3364)
self.assertItems([])
self.assertHandler(rlib2.R_2_redist_config)
def testGrowInstanceDisk(self):
for idx, wait_for_sync in enumerate([None, False, True]):
amount = 128 + (512 * idx)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment