3.42.3. Create volume

 
MethodURIDescription
POST/v1.1/{tenant_id}/os-volumes/{volume_id}

Creates a volume.

Normal response codes: 201

 3.42.3.1. Request

This table shows the URI parameters for the create volume request:

NameTypeDescription

{tenant_id}

​String

The unique identifier of the tenant or account.

{volume_id}

​String

The unique identifier for a volume.

 

Example 3.344. Create volume: JSON request

{
    "volume": {
        "display_name": "vol-001",
        "display_description": "Another volume.",
        "size": 30,
        "volume_type": "289da7f8-6440-407c-9fb4-7db01ec49164",
        "metadata": {"contents": "junk"},
        "availability_zone": "us-east1"
     }
}

 

Example 3.345. Create volume: XML request

<?xml version="1.0" encoding="UTF-8"?>
<volume xmlns="http://docs.openstack.org/volume/api/v1"
        display_name="vol-001"
        display_description="Another volume."
        size="30"
        volume_type="289da7f8-6440-407c-9fb4-7db01ec49164"
        availability_zone="us-east1">
    <metadata>
        <meta key="contents">junk</meta>
    </metadata>
</volume>

This operation does not require a request body.

 3.42.3.2. Response

 

Example 3.346. Create volume: JSON response

{
    "volume": {
        "id": "521752a6-acf6-4b2d-bc7a-119f9148cd8c",
        "display_name": "vol-001",
        "display_description": "Another volume.",
        "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"
     }
}

 

Example 3.347. Create volume: XML response

<?xml version="1.0" encoding="UTF-8"?>
<volume xmlns="http://docs.openstack.org/volume/api/v1"
        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"
        availability_zone="us-east1"
        created_at="2012-02-14T20:53:07Z">
    <metadata>
        <meta key="contents">junk</meta>
    </metadata>
</volume>

This operation does not return a response body.

Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page


loading table of contents...