Fix api-ref for v3 volume types

This patch dome some fixs on api-ref for v3 volume types, including:

1. add api-ref and sample file for show default volume type API
2. remove unused sample file: volume-type-show-request.json
3. fix parameters: 'name', 'extra_specs', 'is_public', 'description',
and 'os-volume-type-access:is_public'

Change-Id: I6fdcb66d3a56643a5e71bcd68f4bcdc08fc4866b
This commit is contained in:
jeremy.zhang 2018-01-17 08:48:54 +08:00
parent 335c55766f
commit 0d371e98bb
5 changed files with 118 additions and 73 deletions

View File

@ -897,12 +897,6 @@ description_14:
in: body in: body
required: false required: false
type: string type: string
description_15:
description: |
The volume type description.
in: body
required: false
type: string
description_16: description_16:
description: | description: |
The group snapshot description. The group snapshot description.
@ -970,6 +964,18 @@ description_group_true:
in: body in: body
required: true required: true
type: string type: string
description_volume_type_optional:
description: |
The volume type description.
in: body
required: false
type: string
description_volume_type_required:
description: |
The volume type description.
in: body
required: true
type: string
detached_at: detached_at:
description: | description: |
The time when attachment is detached. The time when attachment is detached.
@ -1049,14 +1055,7 @@ extra_info:
in: body in: body
required: false required: false
type: string type: string
extra_specs: extra_specs_volume_type_optional:
description: |
A set of key and value pairs that contains the
specifications for a volume type.
in: body
required: true
type: object
extra_specs_1:
description: | description: |
A key and value pair that contains additional A key and value pair that contains additional
specifications that are associated with the volume type. Examples specifications that are associated with the volume type. Examples
@ -1065,6 +1064,13 @@ extra_specs_1:
in: body in: body
required: false required: false
type: object type: object
extra_specs_volume_type_required:
description: |
A set of key and value pairs that contains the
specifications for a volume type.
in: body
required: true
type: object
fail_reason: fail_reason:
description: | description: |
If the backup failed, the reason for the failure. If the backup failed, the reason for the failure.
@ -1403,12 +1409,6 @@ is_incremental:
in: body in: body
required: false required: false
type: boolean type: boolean
is_public:
description:
Whether the volume type is publicly visible.
in: body
required: false
type: boolean
is_public_1: is_public_1:
description: description:
Whether the group is publicly visible. Whether the group is publicly visible.
@ -1421,6 +1421,18 @@ is_public_2:
in: body in: body
required: false required: false
type: boolean type: boolean
is_public_volume_type_optional:
description: |
Whether the volume type is publicly visible.
in: body
required: false
type: boolean
is_public_volume_type_required:
description: |
Whether the volume type is publicly visible.
in: body
required: true
type: boolean
is_up: is_up:
description: | description: |
Filter by up/down status. Filter by up/down status.
@ -1834,12 +1846,6 @@ name_6:
in: body in: body
required: false required: false
type: string type: string
name_7:
description: |
The name of the volume type.
in: body
required: true
type: string
name_8: name_8:
description: | description: |
The volume name. The volume name.
@ -1852,18 +1858,24 @@ name_9:
in: body in: body
required: true required: true
type: string type: string
name_10:
description: |
The name of the volume type.
in: body
required: false
type: string
name_optional: name_optional:
description: | description: |
The name of the Volume Backup. The name of the Volume Backup.
in: body in: body
required: false required: false
type: string type: string
name_volume_type_optional:
description: |
The name of the volume type.
in: body
required: false
type: string
name_volume_type_required:
description: |
The name of the volume type.
in: body
required: true
type: string
namespace: namespace:
description: | description: |
Link associated to the extension. Link associated to the extension.
@ -2053,12 +2065,6 @@ os-volume-replication:extended_status_1:
in: body in: body
required: false required: false
type: string type: string
os-volume-type-access:is_public:
description: |
Make type accessible to the public.
in: body
required: false
type: boolean
os-volume_upload_image: os-volume_upload_image:
description: | description: |
The ``os-volume_upload_image`` action. This The ``os-volume_upload_image`` action. This

View File

@ -0,0 +1,11 @@
{
"volume_type": {
"id": "6685584b-1eac-4da6-b5c3-555430cf68ff",
"name": "volume-type-test",
"description": "default volume type",
"is_public": true,
"extra_specs": {
"volume_backend_name": "rbd"
}
}
}

View File

@ -1,9 +0,0 @@
{
"volume_type": {
"id": "289da7f8-6440-407c-9fb4-7db01ec49164",
"name": "vol-type-001",
"extra_specs": {
"capabilities": "gpu"
}
}
}

View File

@ -3,7 +3,7 @@
"id": "6685584b-1eac-4da6-b5c3-555430cf68ff", "id": "6685584b-1eac-4da6-b5c3-555430cf68ff",
"name": "vol-type-001", "name": "vol-type-001",
"description": "volume type 001", "description": "volume type 001",
"is_public": "true", "is_public": true,
"extra_specs": { "extra_specs": {
"capabilities": "gpu" "capabilities": "gpu"
} }

View File

@ -36,9 +36,9 @@ Request
- project_id: project_id_path - project_id: project_id_path
- volume_type_id: volume_type_id - volume_type_id: volume_type_id
- volume_type: volume_type_1 - volume_type: volume_type_1
- name: name_10 - name: name_volume_type_optional
- description: description_15 - description: description_volume_type_optional
- is_public: is_public - is_public: is_public_volume_type_optional
Request Example Request Example
--------------- ---------------
@ -53,10 +53,10 @@ Response Parameters
.. rest_parameters:: parameters.yaml .. rest_parameters:: parameters.yaml
- volume_type: volume_type_1 - volume_type: volume_type_1
- is_public: is_public - is_public: is_public_volume_type_required
- extra_specs: extra_specs - extra_specs: extra_specs_volume_type_required
- description: description_15 - description: description_volume_type_required
- name: name_7 - name: name_volume_type_required
Response Example Response Example
---------------- ----------------
@ -84,7 +84,7 @@ Request
- project_id: project_id_path - project_id: project_id_path
- volume_type_id: volume_type_id - volume_type_id: volume_type_id
- extra_specs: extra_specs - extra_specs: extra_specs_volume_type_required
Request Example Request Example
--------------- ---------------
@ -98,7 +98,7 @@ Response Parameters
.. rest_parameters:: parameters.yaml .. rest_parameters:: parameters.yaml
- extra_specs: extra_specs - extra_specs: extra_specs_volume_type_required
Response Example Response Example
@ -132,7 +132,7 @@ Response Parameters
.. rest_parameters:: parameters.yaml .. rest_parameters:: parameters.yaml
- extra_specs: extra_specs - extra_specs: extra_specs_volume_type_required
Response Example Response Example
@ -249,10 +249,10 @@ Response Parameters
.. rest_parameters:: parameters.yaml .. rest_parameters:: parameters.yaml
- volume_type: volume_type_1 - volume_type: volume_type_1
- is_public: is_public - is_public: is_public_volume_type_required
- extra_specs: extra_specs - extra_specs: extra_specs_volume_type_required
- description: description_15 - description: description_volume_type_required
- name: name_7 - name: name_volume_type_required
Response Example Response Example
@ -262,6 +262,43 @@ Response Example
:language: javascript :language: javascript
Show default volume type
~~~~~~~~~~~~~~~~~~~~~~~~
.. rest_method:: GET /v3/{project_id}/types/default
Shows details for the default volume type if configured.
Normal response codes: 200
Request
-------
.. rest_parameters:: parameters.yaml
- project_id: project_id_path
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- volume_type: volume_type_1
- is_public: is_public_volume_type_required
- extra_specs: extra_specs_volume_type_required
- description: description_volume_type_required
- name: name_volume_type_required
Response Example
----------------
.. literalinclude:: ./samples/volume-type-default-response.json
:language: javascript
Delete a volume type Delete a volume type
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
@ -310,8 +347,8 @@ Response Parameters
.. rest_parameters:: parameters.yaml .. rest_parameters:: parameters.yaml
- volume_types: volume_types - volume_types: volume_types
- extra_specs: extra_specs - extra_specs: extra_specs_volume_type_required
- name: name_7 - name: name_volume_type_required
Response Example Response Example
---------------- ----------------
@ -337,10 +374,10 @@ Request
- volume_type: volume_type_1 - volume_type: volume_type_1
- project_id: project_id_path - project_id: project_id_path
- name: name_7 - name: name_volume_type_required
- os-volume-type-access:is_public: is_public - os-volume-type-access:is_public: is_public_volume_type_optional
- description: description_15 - description: description_volume_type_optional
- extra_specs: extra_specs_1 - extra_specs: extra_specs_volume_type_optional
Request Example Request Example
--------------- ---------------
@ -355,12 +392,12 @@ Response Parameters
.. rest_parameters:: parameters.yaml .. rest_parameters:: parameters.yaml
- volume_type: volume_type_1 - volume_type: volume_type_1
- is_public: is_public - is_public: is_public_volume_type_required
- extra_specs: extra_specs - extra_specs: extra_specs_volume_type_required
- description: description_15 - description: description_volume_type_required
- name: name_7 - name: name_volume_type_required
- id: volume_type_id_body - id: volume_type_id_body
- os-volume-type-access:is_public: os-volume-type-access:is_public - os-volume-type-access:is_public: is_public_volume_type_required
Response Example Response Example
---------------- ----------------