Remove attach/detach code from cinderclient
Attach and Detach actions are done in the novaclient, however during the creation of Cinder a number of these methods were copied into the Cinder client. This is dead code and just adds confusion, so let's rip it out. Change-Id: Ib96fe0cac26f19e7d9f2aa01c71ba9762e4f8b8e Fixes: bug #1071003
This commit is contained in:
@@ -197,52 +197,6 @@ class VolumeManager(base.ManagerWithFind):
|
|||||||
|
|
||||||
self._update("/volumes/%s" % base.getid(volume), body)
|
self._update("/volumes/%s" % base.getid(volume), body)
|
||||||
|
|
||||||
def create_server_volume(self, server_id, volume_id, device):
|
|
||||||
"""
|
|
||||||
Attach a volume identified by the volume ID to the given server ID
|
|
||||||
|
|
||||||
:param server_id: The ID of the server
|
|
||||||
:param volume_id: The ID of the volume to attach.
|
|
||||||
:param device: The device name
|
|
||||||
:rtype: :class:`Volume`
|
|
||||||
"""
|
|
||||||
body = {'volumeAttachment': {'volumeId': volume_id,
|
|
||||||
'device': device}}
|
|
||||||
return self._create("/servers/%s/os-volume_attachments" % server_id,
|
|
||||||
body, "volumeAttachment")
|
|
||||||
|
|
||||||
def get_server_volume(self, server_id, attachment_id):
|
|
||||||
"""
|
|
||||||
Get the volume identified by the attachment ID, that is attached to
|
|
||||||
the given server ID
|
|
||||||
|
|
||||||
:param server_id: The ID of the server
|
|
||||||
:param attachment_id: The ID of the attachment
|
|
||||||
:rtype: :class:`Volume`
|
|
||||||
"""
|
|
||||||
return self._get("/servers/%s/os-volume_attachments/%s" % (server_id,
|
|
||||||
attachment_id,), "volumeAttachment")
|
|
||||||
|
|
||||||
def get_server_volumes(self, server_id):
|
|
||||||
"""
|
|
||||||
Get a list of all the attached volumes for the given server ID
|
|
||||||
|
|
||||||
:param server_id: The ID of the server
|
|
||||||
:rtype: list of :class:`Volume`
|
|
||||||
"""
|
|
||||||
return self._list("/servers/%s/os-volume_attachments" % server_id,
|
|
||||||
"volumeAttachments")
|
|
||||||
|
|
||||||
def delete_server_volume(self, server_id, attachment_id):
|
|
||||||
"""
|
|
||||||
Detach a volume identified by the attachment ID from the given server
|
|
||||||
|
|
||||||
:param server_id: The ID of the server
|
|
||||||
:param attachment_id: The ID of the attachment
|
|
||||||
"""
|
|
||||||
self._delete("/servers/%s/os-volume_attachments/%s" %
|
|
||||||
(server_id, attachment_id,))
|
|
||||||
|
|
||||||
def _action(self, action, volume, info=None, **kwargs):
|
def _action(self, action, volume, info=None, **kwargs):
|
||||||
"""
|
"""
|
||||||
Perform a volume "action."
|
Perform a volume "action."
|
||||||
|
Reference in New Issue
Block a user