Merge "[api-ref] Add snapshot metadata key api"

This commit is contained in:
Jenkins 2017-06-28 00:18:31 +00:00 committed by Gerrit Code Review
commit 3046f75968
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

@ -188,7 +188,7 @@ Request
.. rest_parameters:: parameters.yaml
- project_id: project_id_path
- snapshot_id: snapshot_id
- snapshot_id: snapshot_id_path
Response Parameters
@ -237,7 +237,7 @@ Request
- metadata: metadata
- project_id: project_id_path
- snapshot_id: snapshot_id
- snapshot_id: snapshot_id_path
Request Example
---------------
@ -271,7 +271,7 @@ Request
- metadata: metadata
- project_id: project_id_path
- snapshot_id: snapshot_id
- snapshot_id: snapshot_id_path
Request Example
---------------
@ -305,7 +305,7 @@ Request
.. rest_parameters:: parameters.yaml
- project_id: project_id_path
- snapshot_id: snapshot_id
- snapshot_id: snapshot_id_path
Response Parameters
@ -353,7 +353,7 @@ Request
- description: description
- name: name
- project_id: project_id_path
- snapshot_id: snapshot_id
- snapshot_id: snapshot_id_path
Request Example
---------------
@ -401,4 +401,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