Show volume information

Overview

Shows information for a specified volume.

Classification

  • Show

API Operation Object

  • os-volumes

Synchronous / Asynchronous

  • -

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/{tenant_id}/os-volumes/{volume_id}

HTTP Request Header

Format

Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: <token_id>
Content-Type: application/json

HTTP Request Body

Format

  • none

Request Parameter

Request Parameters
name style format description required/optional
tenant_id URI String The unique identifier of the tenant or account. required
volume_id URI String The unique identifier for a volume. required

Response

HTTP Response Header

Format

HTTP/1.1 <response_code> <message>       (ex. 200 OK)
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

    • skip auto insert field such as "X-Compute-Request-Id" and "Content-Length", "Date"

Response Code

Response Codes
response code condition
200 normal end
400 badRequest
401 unauthorized
403 forbidden
404 itemNotFound
405 badMethod
413 overLimit
503 serviceUnavailable

HTTP Response Body

Format

{
    "volume": {
        "id": "<id>",
        "display_name": "<display_name>",
        "display_description": "<display_description>",
        "status": "<status>",
        "size": <size>,
        "volume_type": "<volume_type>",
        "metadata": {
            "contents": "<contents>"
        },
        "availability_zone": "<availability_zone>",
        "snapshot_id": <snapshot_id>,
        "attachments": [],
        "created_at": "<created_at>"
    }
}

Response Parameter

Response Parameters
item format description
id UUID The volume ID.
display_name String The volume name.
display_description String The volume description.
status String The volume status.
size String The size of the volume, in gigabytes (GB).
volume_type String The unique identifier for a volume type.
contents String One or more metadata key and value pairs to associate with the volume.
availability_zone String The availability zone.
snapshot_id String The unique identifier for a snapshot.
attachments list One or more instance attachments.
created_at time/date Date and time when the volume was created.

Sample API Request and Response

Sample API Request

Request URI

https://example.com/v2/{tenant_id}/os-volumes/{volume_id}

Request Header

Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: ajk3adjiown02
Content-Type: application/json

Request Body

  • none

Sample API Response

Response Header

HTTP/1.1 200 OK
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

    • skip auto insert field such as "X-Compute-Request-Id" and "Content-Length", "Date"

Response Body

{
    "volume": {
        "id": "521752a6-acf6-4b2d-bc7a-119f9148cd8c",
        "display_name": "vol-001",
        "display_description": "Another volume.",
        "status": "active",
        "size": 30,
        "volume_type": "289da7f8-6440-407c-9fb4-7db01ec49164",
        "metadata": {
            "contents": "junk"
        },
        "availability_zone": "us-east1",
        "snapshot_id": null,
        "attachments": [],
        "created_at": "2012-02-14T20:53:07Z"
    }
}

Execution Example

HTTP Request

GET /v2/ad355aa6ed3e4cf5ae0fa0df652bc291/os-volumes/f21c7efb-ea04-4de8-a9c6-53ee1680238c HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: ebbd28fada8b4d23be04d60b912d8144
Content-type: application/json
Accept: application/json

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 325
X-Compute-Request-Id: req-f92dddcd-1bae-4504-8161-14d74dfa716e
Date: Thu, 15 Oct 2015 05:43:53 GMT

{"volume": {"status": "error", "displayDescription": null, "availabilityZone": "nova", "displayName": null, "attachments": [{}], "volumeType": "lvmdriver-1", "snapshotId": null, "metadata": {"key2": "val2", "key1": "val1"}, "id": "f21c7efb-ea04-4de8-a9c6-53ee1680238c", "createdAt": "2015-10-15T05:42:56.000000", "size": 20}}

Error Execution Example

HTTP Request

GET /v2/ad355aa6ed3e4cf5ae0fa0df652bc290/os-volumes/f21c7efb-ea04-4de8-a9c6-53ee1680238c HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: ebbd28fada8b4d23be04d60b912d8144
Content-type: application/json
Accept: application/json

HTTP Response

HTTP/1.1 400 Bad Request
Content-Length: 188
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-603bcafd-2485-4703-aa86-09edab135f01
Date: Thu, 15 Oct 2015 06:01:31 GMT

{"badRequest": {"message": "Malformed request URL: URL's project_id 'ad355aa6ed3e4cf5ae0fa0df652bc290' doesn't match Context's project_id 'ad355aa6ed3e4cf5ae0fa0df652bc291'", "code": 400}}