diff --git a/api-ref/source/v3/parameters.yaml b/api-ref/source/v3/parameters.yaml index f328de97324..9ba961b4402 100644 --- a/api-ref/source/v3/parameters.yaml +++ b/api-ref/source/v3/parameters.yaml @@ -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 diff --git a/api-ref/source/v3/samples/snapshot-metadata-show-key-response.json b/api-ref/source/v3/samples/snapshot-metadata-show-key-response.json new file mode 100644 index 00000000000..ebd589c1b2d --- /dev/null +++ b/api-ref/source/v3/samples/snapshot-metadata-show-key-response.json @@ -0,0 +1,5 @@ +{ + "meta": { + "name": "test" + } +} diff --git a/api-ref/source/v3/samples/snapshot-metadata-update-key-request.json b/api-ref/source/v3/samples/snapshot-metadata-update-key-request.json new file mode 100644 index 00000000000..023712fce45 --- /dev/null +++ b/api-ref/source/v3/samples/snapshot-metadata-update-key-request.json @@ -0,0 +1,5 @@ +{ + "meta": { + "name": "new_name" + } +} diff --git a/api-ref/source/v3/samples/snapshot-metadata-update-key-response.json b/api-ref/source/v3/samples/snapshot-metadata-update-key-response.json new file mode 100644 index 00000000000..023712fce45 --- /dev/null +++ b/api-ref/source/v3/samples/snapshot-metadata-update-key-response.json @@ -0,0 +1,5 @@ +{ + "meta": { + "name": "new_name" + } +} diff --git a/api-ref/source/v3/volumes-v3-snapshots.inc b/api-ref/source/v3/volumes-v3-snapshots.inc index aa356289ad9..597be57c201 100644 --- a/api-ref/source/v3/volumes-v3-snapshots.inc +++ b/api-ref/source/v3/volumes-v3-snapshots.inc @@ -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