Merge "Add missing volume APIs"

This commit is contained in:
Zuul 2018-06-12 12:40:52 +00:00 committed by Gerrit Code Review
commit 38492b1bba
8 changed files with 280 additions and 0 deletions

@ -1937,6 +1937,12 @@ os-backup-project-attr:project_id:
required: true
type: string
min_version: 3.18
os-begin_detaching:
description: |
The ``os-begin_detaching`` action.
in: body
required: true
type: object
os-detach:
description: |
The ``os-detach`` action.
@ -1973,6 +1979,18 @@ os-force_detach:
in: body
required: true
type: object
os-initialize_connection:
description: |
The ``os-initialize_connection`` action.
in: body
required: true
type: object
os-reserve:
description: |
The ``os-reserve`` action.
in: body
required: true
type: object
os-reset_status:
description: |
The ``os-reset_status`` action.
@ -1985,6 +2003,12 @@ os-retype:
in: body
required: true
type: object
os-roll_detaching:
description: |
The ``os-roll_detaching`` action.
in: body
required: true
type: object
OS-SCH-HNT:scheduler_hints:
description: |
The dictionary of data to send to the scheduler.
@ -2009,6 +2033,12 @@ os-show_image_metadata:
in: body
require: true
type: object
os-terminate_connection:
description: |
The ``os-terminate_connection`` action.
in: body
require: true
type: object
os-unmanage:
description: |
The ``os-unmanage`` action. This action removes
@ -2016,6 +2046,12 @@ os-unmanage:
in: body
required: true
type: object
os-unreserve:
description: |
The ``os-unreserve`` action.
in: body
required: true
type: object
os-unset_image_metadata:
description: |
The ``os-unset_image_metadata`` action. This

@ -0,0 +1,3 @@
{
"os-begin_detaching": {}
}

@ -0,0 +1,13 @@
{
"os-initialize_connection": {
"connector":{
"platform":"x86_64",
"host": "node2",
"do_local_attach": false,
"ip": "192.168.13.101",
"os_type": "linux2",
"multipath": false,
"initiator": "iqn.1994-05.com.redhat:d16cbb5d31e5"
}
}
}

@ -0,0 +1,3 @@
{
"os-reserve": {}
}

@ -0,0 +1,3 @@
{
"os-roll_detaching": {}
}

@ -0,0 +1,13 @@
{
"os-terminate_connection": {
"connector": {
"platform": "x86_64",
"host": "node2",
"do_local_attach": false,
"ip": "192.168.13.101",
"os_type": "linux2",
"multipath": false,
"initiator": "iqn.1994-05.com.redhat:d16cbb5d31e5"
}
}
}

@ -0,0 +1,3 @@
{
"os-unreserve":{}
}

@ -590,3 +590,209 @@ Response Example
.. literalinclude:: ./samples/volume-upload-to-image-response.json
:language: javascript
Reserve volume
~~~~~~~~~~~~~~
.. rest_method:: POST /v3/{project_id}/volumes/{volume_id}/action
Mark volume as reserved. Specify the ``os-reserve`` action in the
request body.
Preconditions
- Volume status must be ``available``.
Response codes
--------------
.. rest_status_code:: success ../status.yaml
- 202
Request
-------
.. rest_parameters:: parameters.yaml
- project_id: project_id_path
- volume_id: volume_id_path
- os-reserve: os-reserve
Request Example
---------------
.. literalinclude:: ./samples/volume-reserve-request.json
:language: javascript
Unmark volume as reserved.
~~~~~~~~~~~~~~~~~~~~~~~~~~
.. rest_method:: POST /v3/{project_id}/volumes/{volume_id}/action
Unmark volume as reserved. Specify the ``os-unreserve`` action in
the request body.
Response codes
--------------
.. rest_status_code:: success ../status.yaml
- 202
Request
-------
.. rest_parameters:: parameters.yaml
- project_id: project_id_path
- volume_id: volume_id_path
- os-unreserve: os-unreserve
Request Example
---------------
.. literalinclude:: ./samples/volume-unreserve-request.json
:language: javascript
Update volume status to detaching
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. rest_method:: POST /v3/{project_id}/volumes/{volume_id}/action
Update volume status to 'detaching'.. Specify the ``os-begin_detaching`` action
in the request body.
Response codes
--------------
.. rest_status_code:: success ../status.yaml
- 202
Request
-------
.. rest_parameters:: parameters.yaml
- project_id: project_id_path
- volume_id: volume_id_path
- os-begin_detaching: os-begin_detaching
Request Example
---------------
.. literalinclude:: ./samples/volume-begin-detaching-request.json
:language: javascript
Roll back volume status to in-use
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. rest_method:: POST /v3/{project_id}/volumes/{volume_id}/action
Roll back volume status to 'in-use'. Specify the ``os-roll_detaching`` action
in the request body.
Response codes
--------------
.. rest_status_code:: success ../status.yaml
- 202
Request
-------
.. rest_parameters:: parameters.yaml
- project_id: project_id_path
- volume_id: volume_id_path
- os-roll_detaching: os-roll_detaching
Request Example
---------------
.. literalinclude:: ./samples/volume-roll-detaching-request.json
:language: javascript
Terminate volume attachment
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. rest_method:: POST /v3/{project_id}/volumes/{volume_id}/action
Terminate volume attachment. Specify the ``os-terminate_connection``
action in the request body.
Preconditions
- Volume status must be ``in-use``.
Response codes
--------------
.. rest_status_code:: success ../status.yaml
- 202
Request
-------
.. rest_parameters:: parameters.yaml
- project_id: project_id_path
- volume_id: volume_id_path
- os-terminate_connection: os-terminate_connection
- connector: connector
Request Example
---------------
.. literalinclude:: ./samples/volume-terminate-connection-request.json
:language: javascript
Initialize volume attachment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. rest_method:: POST /v3/{project_id}/volumes/{volume_id}/action
Initialize volume attachment. Specify the ``os-initialize_connection``
action in the request body.
Response codes
--------------
.. rest_status_code:: success ../status.yaml
- 202
Request
-------
.. rest_parameters:: parameters.yaml
- project_id: project_id_path
- volume_id: volume_id_path
- os-initialize_connection: os-initialize_connection
- connector: connector
Request Example
---------------
.. literalinclude:: ./samples/volume-initialize-connection-request.json
:language: javascript