The cinder.api.v3.attachments Module

The volumes attachments api.

class AttachmentsController(ext_mgr=None)

Bases: cinder.api.openstack.wsgi.Controller

The Attachments API controller for the OpenStack API.

allowed_filters = set(['instance_id', 'status', 'attach_status', 'volume_id'])
create(req, body)

Create an attachment.

This method can be used to create an empty attachment (reserve) or to create and initialize a volume attachment based on the provided input parameters.

If the caller does not yet have the connector information but needs to reserve an attachment for the volume (ie Nova BootFromVolume) the create can be called with just the volume-uuid and the server identifier. This will reserve an attachment, mark the volume as reserved and prevent any new attachment_create calls from being made until the attachment is updated (completed).

The alternative is that the connection can be reserved and initialized all at once with a single call if the caller has all of the required information (connector data) at the time of the call.

NOTE: In Nova terms server == instance, the server_id parameter referenced below is the uuid of the Instance, for non-nova consumers this can be a server uuid or some other arbitrary unique identifier.

Expected format of the input parameter ‘body’:

{
    "attachment":
    {
        "volume_uuid": "volume-uuid",
        "instance_uuid": "nova-server-uuid",
        "connector": None|<connector-object>,
    }
}

Example connector:

{
    "connector":
    {
        "initiator": "iqn.1993-08.org.debian:01:cad181614cec",
        "ip":"192.168.1.20",
        "platform": "x86_64",
        "host": "tempest-1",
        "os_type": "linux2",
        "multipath": False,
        "mountpoint": "/dev/vdb",
        "mode": None|"rw"|"ro",
    }
}

NOTE all that’s required for a reserve is volume_uuid and a instance_uuid.

returns: A summary view of the attachment object

delete(req, id)

Delete an attachment.

Disconnects/Deletes the specified attachment, returns a list of any known shared attachment-id’s for the effected backend device.

returns: A summary list of any attachments sharing this connection

detail(req)

Return a detailed list of attachments.

index(req)

Return a summary list of attachments.

show(req, id)

Return data about the given attachment.

update(req, id, body)

Update an attachment record.

Update a reserved attachment record with connector information and set up the appropriate connection_info from the driver.

Expected format of the input parameter ‘body’:


{

“attachment”: {

“connector”: {

“initiator”: “iqn.1993-08.org.debian:01:cad181614cec”, “ip”:”192.168.1.20”, “platform”: “x86_64”, “host”: “tempest-1”, “os_type”: “linux2”, “multipath”: False, “mountpoint”: “/dev/vdb”, “mode”: None|”rw”|”ro”,

}

}

versioned_methods = {'index': [<cinder.api.openstack.versioned_method.VersionedMethod object at 0x7fcf7f4745d0>], 'show': [<cinder.api.openstack.versioned_method.VersionedMethod object at 0x7fcf7f474510>], 'create': [<cinder.api.openstack.versioned_method.VersionedMethod object at 0x7fcf7f474750>], 'update': [<cinder.api.openstack.versioned_method.VersionedMethod object at 0x7fcf7f474810>], 'detail': [<cinder.api.openstack.versioned_method.VersionedMethod object at 0x7fcf7f474690>], 'delete': [<cinder.api.openstack.versioned_method.VersionedMethod object at 0x7fcf7f4748d0>]}
wsgi_actions = {}
wsgi_extensions = []
create_resource(ext_mgr)

Create the wsgi resource for this controller.