Skip to content
Snippets Groups Projects
Commit 2197b66f authored by René Nussbaumer's avatar René Nussbaumer
Browse files

Adding RAPI call for activate-disks on an instance


Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent d8f5a37d
No related branches found
No related tags found
No related merge requests found
......@@ -201,6 +201,8 @@ def GetHandlers(node_name_pattern, instance_name_pattern, job_id_pattern):
rlib2.R_2_instances_name_shutdown,
re.compile(r'^/2/instances/(%s)/startup$' % instance_name_pattern):
rlib2.R_2_instances_name_startup,
re.compile(r'^/2/instances/(%s)/activate-disks$' % instance_name_pattern):
rlib2.R_2_instances_name_activate_disks,
"/2/jobs": rlib2.R_2_jobs,
re.compile(r'/2/jobs/(%s)$' % job_id_pattern):
......
......@@ -649,6 +649,25 @@ class R_2_instances_name_replace_disks(baserlib.R_Generic):
return baserlib.SubmitJob([op])
class R_2_instances_name_activate_disks(baserlib.R_Generic):
"""/2/instances/[instance_name]/activate-disks resource.
"""
def PUT(self):
"""Activate disks for an instance.
The URI might contain ignore_size to ignore current recorded size.
"""
instance_name = self.items[0]
ignore_size = bool(self._checkIntVariable('ignore_size'))
op = opcodes.OpActivateInstanceDisks(instance_name=instance_name,
ignore_size=ignore_size)
return baserlib.SubmitJob([op])
class _R_Tags(baserlib.R_Generic):
""" Quasiclass for tagging resources
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment