Method | URI | Description |
---|---|---|
POST | /v1.1/{tenant_id}/os-volumes/{volume_id} | Creates a volume. |
Normal response codes: 201
This table shows the URI parameters for the create volume request:
Name | Type | Description |
---|---|---|
| String | The unique identifier of the tenant or account. |
| 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.
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.