Commit 0a37de5f authored by René Nussbaumer's avatar René Nussbaumer

Adding RAPI call to deactivate-disks for an instance

Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 2197b66f
......@@ -203,6 +203,8 @@ def GetHandlers(node_name_pattern, instance_name_pattern, job_id_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,
re.compile(r'^/2/instances/(%s)/deactivate-disks$' % instance_name_pattern):
rlib2.R_2_instances_name_deactivate_disks,
"/2/jobs": rlib2.R_2_jobs,
re.compile(r'/2/jobs/(%s)$' % job_id_pattern):
......
......@@ -668,6 +668,21 @@ class R_2_instances_name_activate_disks(baserlib.R_Generic):
return baserlib.SubmitJob([op])
class R_2_instances_name_deactivate_disks(baserlib.R_Generic):
"""/2/instances/[instance_name]/deactivate-disks resource.
"""
def PUT(self):
"""Deactivate disks for an instance.
"""
instance_name = self.items[0]
op = opcodes.OpDeActivateInstanceDisks(instance_name=instance_name)
return baserlib.SubmitJob([op])
class _R_Tags(baserlib.R_Generic):
""" Quasiclass for tagging resources
......
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