From 92a90efaf85241e1570f6461ab117506509ee6a6 Mon Sep 17 00:00:00 2001 From: wangzhenyu Date: Wed, 15 Mar 2017 07:09:46 +0800 Subject: [PATCH] Add API documentation for volume detach in v3. Change-Id: Id8211478bf093b28ea568f741c6e8b34f3696e0c Closes-Bug: #1671372 --- api-ref/source/v3/parameters.yaml | 6 ++++ .../v3/samples/volume-detach-request.json | 6 ++++ .../source/v3/volumes-v3-volumes-actions.inc | 36 +++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 api-ref/source/v3/samples/volume-detach-request.json diff --git a/api-ref/source/v3/parameters.yaml b/api-ref/source/v3/parameters.yaml index 37c6222ccdf..bc72869e1d4 100644 --- a/api-ref/source/v3/parameters.yaml +++ b/api-ref/source/v3/parameters.yaml @@ -1206,6 +1206,12 @@ os-attach: in: body required: true type: object +os-detach: + description: | + The ``os-detach`` action. + in: body + required: true + type: object os-extend: description: | The ``os-extend`` action. diff --git a/api-ref/source/v3/samples/volume-detach-request.json b/api-ref/source/v3/samples/volume-detach-request.json new file mode 100644 index 00000000000..88f4119a324 --- /dev/null +++ b/api-ref/source/v3/samples/volume-detach-request.json @@ -0,0 +1,6 @@ +{ + "os-detach": { + "attachment_id": "d8777f54-84cf-4809-a679-468ffed56cf1" + } +} + diff --git a/api-ref/source/v3/volumes-v3-volumes-actions.inc b/api-ref/source/v3/volumes-v3-volumes-actions.inc index 8b090abcc6a..478b21e4c96 100644 --- a/api-ref/source/v3/volumes-v3-volumes-actions.inc +++ b/api-ref/source/v3/volumes-v3-volumes-actions.inc @@ -195,6 +195,42 @@ Request Example +Detach volume from server +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. rest_method:: POST /v3/{project_id}/volumes/{volume_id}/action + +Detaches a volume from a server. Specify the ``os-detach`` action in the request body. + +Preconditions + +- Volume status must be ``in-use``. + +Normal response codes: 202 + + +Request +------- + +.. rest_parameters:: parameters.yaml + + - attachment_id: attachment_id + - os-detach: os-detach + - project_id: project_id_path + - volume_id: volume_id + +Request Example +--------------- + +.. literalinclude:: ./samples/volume-detach-request.json + :language: javascript + + + + + + + Unmanage a volume ~~~~~~~~~~~~~~~~~