nova/api-ref/source/os-volumes.inc
Sean Dague c9f5ad3bcf remove /v2.1/{tenant_id} from all urls
As discussed at summit, the version part of the URL is not really
relevant, or a thing a user should be filling out themselves, this
should instead be set by the service catalog and extracted from the
token.

This removes it's reference in all documented REST urls, and adds a
new section describing how one gets the base URL for all calls.

Change-Id: I4306b8c3de0225e54f3909dd8a1fb293c4e5944c
2016-06-03 08:47:33 -04:00

257 lines
4.9 KiB
ReStructuredText

.. -*- rst -*-
.. needs:parameter_verification
.. needs:example_verification
.. needs:body_verification
=============================================
Volume extension (os-volumes, os-snapshots)
=============================================
Manages volumes and snapshots for use with the Compute API.
List Volumes
============
.. rest_method:: GET /os-volumes
Lists the volumes associated with the account.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401), forbidden(403)
Response
--------
**Example List Volumes: JSON response**
.. literalinclude:: ../../doc/api_samples/os-volumes/os-volumes-index-resp.json
:language: javascript
Create Volume
=============
.. rest_method:: POST /os-volumes
Creates a volume.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401),
forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- volume: volume
- display_name: display_name
- display_description: display_description
- size: size
- volume_type: volume_type
- metadata: metadata
- availability_zone: availability_zone
- snapshot_id: snapshot_id
**Example Create Volume: JSON request**
.. literalinclude:: ../../doc/api_samples/os-volumes/os-volumes-post-req.json
:language: javascript
Response
--------
**Example Create Volume: JSON response**
.. literalinclude:: ../../doc/api_samples/os-volumes/os-volumes-post-resp.json
:language: javascript
List Volumes With Details
=========================
.. rest_method:: GET /os-volumes/detail
Lists all volumes with details.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401), forbidden(403)
Response
--------
**Example List Volumes With Details: JSON response**
.. literalinclude:: ../../doc/api_samples/os-volumes/os-volumes-detail-resp.json
:language: javascript
Show Volume Details
===================
.. rest_method:: GET /os-volumes/{volume_id}
Shows details for a volume.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401),
forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- volume_id: volume_id
Response
--------
**Example Show Volume Details: JSON response**
.. literalinclude:: ../../doc/api_samples/os-volumes/os-volumes-get-resp.json
:language: javascript
Delete Volume
=============
.. rest_method:: DELETE /os-volumes/{volume_id}
Deletes a volume.
Normal response codes: 202
Error response codes: badRequest(400), unauthorized(401),
forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- volume_id: volume_id
Response
--------
List Snapshots
==============
.. rest_method:: GET /os-snapshots
Lists snapshots.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401), forbidden(403)
Response
--------
**Example List Snapshots: JSON response**
.. literalinclude:: ../../doc/api_samples/os-volumes/snapshots-list-resp.json
:language: javascript
Create Snapshot
===============
.. rest_method:: POST /os-snapshots
Creates a snapshot.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401), forbidden(403)
Request
-------
.. rest_parameters:: parameters.yaml
- snapshot: snapshot
**Example Create Snapshot: JSON request**
.. literalinclude:: ../../doc/api_samples/os-volumes/snapshot-create-req.json
:language: javascript
Response
--------
**Example Create Snapshot: JSON response**
.. literalinclude:: ../../doc/api_samples/os-volumes/snapshot-create-resp.json
:language: javascript
List Snapshots With Details
===========================
.. rest_method:: GET /os-snapshots/detail
Lists all snapshots with details.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401), forbidden(403)
Response
--------
**Example List Snapshots With Details: JSON response**
.. literalinclude:: ../../doc/api_samples/os-volumes/snapshots-detail-resp.json
:language: javascript
Show Snapshot Details
=====================
.. rest_method:: GET /os-snapshots/{snapshot_id}
Shows details for a snapshot.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401),
forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- snapshot_id: snapshot_id
Response
--------
**Example Show Snapshot Details: JSON response**
.. literalinclude:: ../../doc/api_samples/os-volumes/snapshots-show-resp.json
:language: javascript
Delete Snapshot
===============
.. rest_method:: DELETE /os-snapshots/{snapshot_id}
Deletes a snapshot from the account.
This operation is asynchronous. You must list snapshots repeatedly to determine whether the snapshot was deleted.
Normal response codes: 202
Error response codes: badRequest(400), unauthorized(401),
forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- snapshot_id: snapshot_id
Response
--------