From 9519e203086ecf71fc348fec47d60c9e92c3b84f Mon Sep 17 00:00:00 2001 From: "jeremy.zhang" Date: Wed, 20 Jun 2018 17:00:22 +0800 Subject: [PATCH] Add v3 api-ref for updating snapshot status This patch adds v3 api-ref for updating relative fields to status of a snapshot. Change-Id: I24b8a05c814eb6a69ce957c75b8d168576774380 --- api-ref/source/v3/parameters.yaml | 12 ++++++ .../snapshot-status-update-request.json | 6 +++ .../v3/volumes-v3-snapshots-actions.inc | 37 ++++++++++++++++++- 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 api-ref/source/v3/samples/snapshot-status-update-request.json diff --git a/api-ref/source/v3/parameters.yaml b/api-ref/source/v3/parameters.yaml index 9a5c2f0785d..40465764cd0 100644 --- a/api-ref/source/v3/parameters.yaml +++ b/api-ref/source/v3/parameters.yaml @@ -2059,6 +2059,12 @@ os-unset_image_metadata: in: body required: true type: object +os-update_snapshot_status: + description: | + The ``os-update_snapshot_status`` action. + in: body + required: true + type: object os-vol-host-attr:host: description: | Current back-end of the volume. @@ -2483,6 +2489,12 @@ snapshot_id_4: in: body required: true type: string +snapshot_progress: + description: | + A percentage value for snapshot build progress. + in: body + required: false + type: string snapshots_number: description: | The number of snapshots that are allowed for each project. diff --git a/api-ref/source/v3/samples/snapshot-status-update-request.json b/api-ref/source/v3/samples/snapshot-status-update-request.json new file mode 100644 index 00000000000..7790715abfb --- /dev/null +++ b/api-ref/source/v3/samples/snapshot-status-update-request.json @@ -0,0 +1,6 @@ +{ + "os-update_snapshot_status": { + "status": "creating", + "progress": "80%" + } +} diff --git a/api-ref/source/v3/volumes-v3-snapshots-actions.inc b/api-ref/source/v3/volumes-v3-snapshots-actions.inc index 3657fa30b8a..6835b67e9ad 100644 --- a/api-ref/source/v3/volumes-v3-snapshots-actions.inc +++ b/api-ref/source/v3/volumes-v3-snapshots-actions.inc @@ -3,7 +3,8 @@ Snapshot actions (snapshots, action) ==================================== -Administrator only. Resets status for a snapshot. +Administrator only, depending on policy settings. +Resets, updates status for a snapshot. Reset a snapshot's status @@ -36,3 +37,37 @@ Request Example .. literalinclude:: ./samples/snapshot-status-reset-request.json :language: javascript + + +Update status of a snapshot +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. rest_method:: POST /v3/{project_id}/snapshots/{snapshot_id}/action + +Update fields related to the status of a snapshot. +Specify the ``os-update_snapshot_status`` action in the request body. + +Response codes +-------------- + +.. rest_status_code:: success ../status.yaml + + - 202 + + +Request +------- + +.. rest_parameters:: parameters.yaml + + - project_id: project_id_path + - snapshot_id: snapshot_id_path + - os-update_snapshot_status: os-update_snapshot_status + - status: status_2 + - progress: snapshot_progress + +Request Example +--------------- + +.. literalinclude:: ./samples/snapshot-status-update-request.json + :language: javascript