[api-ref] Add snapshot metadata key api

The patch did:
1. Add the missing GET/DELETE/PUT api-ref for snapshot metadata key.
2. Fix snapshot_id description.

Change-Id: I817b1ccffd5e929bcf78b913d666073596b93612
This commit is contained in:
wangxiyuan 2017-06-19 10:10:10 +08:00
parent 2b6bc7d8b8
commit f89614d2e2
5 changed files with 128 additions and 8 deletions

View File

@ -132,11 +132,11 @@ resource:
in: path
required: false
type: string
snapshot_id_1:
snapshot_id_path:
description: |
The UUID of the snapshot.
in: path
required: false
required: true
type: string
transfer_id:
description: |
@ -1135,6 +1135,12 @@ meta:
in: body
required: true
type: object
meta_1:
description: |
The metadata key and value pair for the snapshot.
in: body
required: true
type: object
metadata:
description: |
One or more metadata key and value pairs for the

View File

@ -0,0 +1,5 @@
{
"meta": {
"name": "test"
}
}

View File

@ -0,0 +1,5 @@
{
"meta": {
"name": "new_name"
}
}

View File

@ -0,0 +1,5 @@
{
"meta": {
"name": "new_name"
}
}

View File

@ -186,7 +186,7 @@ Request
.. rest_parameters:: parameters.yaml
- project_id: project_id_path
- snapshot_id: snapshot_id
- snapshot_id: snapshot_id_path
Response Parameters
@ -235,7 +235,7 @@ Request
- metadata: metadata
- project_id: project_id_path
- snapshot_id: snapshot_id
- snapshot_id: snapshot_id_path
Request Example
---------------
@ -269,7 +269,7 @@ Request
- metadata: metadata
- project_id: project_id_path
- snapshot_id: snapshot_id
- snapshot_id: snapshot_id_path
Request Example
---------------
@ -303,7 +303,7 @@ Request
.. rest_parameters:: parameters.yaml
- project_id: project_id_path
- snapshot_id: snapshot_id
- snapshot_id: snapshot_id_path
Response Parameters
@ -351,7 +351,7 @@ Request
- description: description
- name: name
- project_id: project_id_path
- snapshot_id: snapshot_id
- snapshot_id: snapshot_id_path
Request Example
---------------
@ -399,4 +399,103 @@ Request
.. rest_parameters:: parameters.yaml
- project_id: project_id_path
- snapshot_id: snapshot_id
- snapshot_id: snapshot_id_path
Show a snapshot's metadata for a specific key
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. rest_method:: GET /v3/{project_id}/snapshot/{snapshot_id}/metadata/{key}
Shows metadata for a snapshot for a specific key.
Normal response codes: 200
Request
-------
.. rest_parameters:: parameters.yaml
- project_id: project_id_path
- snapshot_id: snapshot_id_path
- key: key_2
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- meta: meta_1
Response Example
----------------
.. literalinclude:: ./samples/snapshot-metadata-show-key-response.json
:language: javascript
Delete a snapshot's metadata
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. rest_method:: DELETE /v3/{project_id}/snapshots/{snapshot_id}/metadata/{key}
Deletes metadata for a snapshot.
Normal response codes: 200
Request
-------
.. rest_parameters:: parameters.yaml
- project_id: project_id_path
- snapshot_id: snapshot_id_path
- key: key_1
Update a snapshot's metadata for a specific key
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. rest_method:: PUT /v3/{project_id}/snapshots/{snapshot_id}/metadata/{key}
Update metadata for a snapshot for a specific key.
Normal response codes: 200
Request
-------
.. rest_parameters:: parameters.yaml
- project_id: project_id_path
- snapshot_id: snapshot_id_path
- key: key_3
- meta: meta_1
Request Example
---------------
.. literalinclude:: ./samples/snapshot-metadata-update-key-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- meta: meta_1
Response Example
----------------
.. literalinclude:: ./samples/snapshot-metadata-update-key-response.json
:language: javascript