From 0d371e98bb694d8b0ba05fc8c414eafa7b8ff267 Mon Sep 17 00:00:00 2001 From: "jeremy.zhang" Date: Wed, 17 Jan 2018 08:48:54 +0800 Subject: [PATCH] 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 --- api-ref/source/v3/parameters.yaml | 82 +++++++++-------- .../samples/volume-type-default-response.json | 11 +++ .../v3/samples/volume-type-show-request.json | 9 -- .../v3/samples/volume-type-show-response.json | 2 +- api-ref/source/v3/volumes-v3-types.inc | 87 +++++++++++++------ 5 files changed, 118 insertions(+), 73 deletions(-) create mode 100644 api-ref/source/v3/samples/volume-type-default-response.json delete mode 100644 api-ref/source/v3/samples/volume-type-show-request.json diff --git a/api-ref/source/v3/parameters.yaml b/api-ref/source/v3/parameters.yaml index b8fb601d6be..9ce16070933 100644 --- a/api-ref/source/v3/parameters.yaml +++ b/api-ref/source/v3/parameters.yaml @@ -897,12 +897,6 @@ description_14: in: body required: false type: string -description_15: - description: | - The volume type description. - in: body - required: false - type: string description_16: description: | The group snapshot description. @@ -970,6 +964,18 @@ description_group_true: in: body required: true 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: description: | The time when attachment is detached. @@ -1049,14 +1055,7 @@ extra_info: in: body required: false type: string -extra_specs: - 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: +extra_specs_volume_type_optional: description: | A key and value pair that contains additional specifications that are associated with the volume type. Examples @@ -1065,6 +1064,13 @@ extra_specs_1: in: body required: false 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: description: | If the backup failed, the reason for the failure. @@ -1403,12 +1409,6 @@ is_incremental: in: body required: false type: boolean -is_public: - description: - Whether the volume type is publicly visible. - in: body - required: false - type: boolean is_public_1: description: Whether the group is publicly visible. @@ -1421,6 +1421,18 @@ is_public_2: in: body required: false 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: description: | Filter by up/down status. @@ -1834,12 +1846,6 @@ name_6: in: body required: false type: string -name_7: - description: | - The name of the volume type. - in: body - required: true - type: string name_8: description: | The volume name. @@ -1852,18 +1858,24 @@ name_9: in: body required: true type: string -name_10: - description: | - The name of the volume type. - in: body - required: false - type: string name_optional: description: | The name of the Volume Backup. in: body required: false 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: description: | Link associated to the extension. @@ -2053,12 +2065,6 @@ os-volume-replication:extended_status_1: in: body required: false 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: description: | The ``os-volume_upload_image`` action. This diff --git a/api-ref/source/v3/samples/volume-type-default-response.json b/api-ref/source/v3/samples/volume-type-default-response.json new file mode 100644 index 00000000000..828b82bf6c4 --- /dev/null +++ b/api-ref/source/v3/samples/volume-type-default-response.json @@ -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" + } + } +} diff --git a/api-ref/source/v3/samples/volume-type-show-request.json b/api-ref/source/v3/samples/volume-type-show-request.json deleted file mode 100644 index a91f2e94d63..00000000000 --- a/api-ref/source/v3/samples/volume-type-show-request.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "volume_type": { - "id": "289da7f8-6440-407c-9fb4-7db01ec49164", - "name": "vol-type-001", - "extra_specs": { - "capabilities": "gpu" - } - } -} diff --git a/api-ref/source/v3/samples/volume-type-show-response.json b/api-ref/source/v3/samples/volume-type-show-response.json index 7a0420f201a..72b9ec98382 100644 --- a/api-ref/source/v3/samples/volume-type-show-response.json +++ b/api-ref/source/v3/samples/volume-type-show-response.json @@ -3,7 +3,7 @@ "id": "6685584b-1eac-4da6-b5c3-555430cf68ff", "name": "vol-type-001", "description": "volume type 001", - "is_public": "true", + "is_public": true, "extra_specs": { "capabilities": "gpu" } diff --git a/api-ref/source/v3/volumes-v3-types.inc b/api-ref/source/v3/volumes-v3-types.inc index 4b931bfa3e3..06738a2eff1 100644 --- a/api-ref/source/v3/volumes-v3-types.inc +++ b/api-ref/source/v3/volumes-v3-types.inc @@ -36,9 +36,9 @@ Request - project_id: project_id_path - volume_type_id: volume_type_id - volume_type: volume_type_1 - - name: name_10 - - description: description_15 - - is_public: is_public + - name: name_volume_type_optional + - description: description_volume_type_optional + - is_public: is_public_volume_type_optional Request Example --------------- @@ -53,10 +53,10 @@ Response Parameters .. rest_parameters:: parameters.yaml - volume_type: volume_type_1 - - is_public: is_public - - extra_specs: extra_specs - - description: description_15 - - name: name_7 + - 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 ---------------- @@ -84,7 +84,7 @@ Request - project_id: project_id_path - volume_type_id: volume_type_id - - extra_specs: extra_specs + - extra_specs: extra_specs_volume_type_required Request Example --------------- @@ -98,7 +98,7 @@ Response Parameters .. rest_parameters:: parameters.yaml - - extra_specs: extra_specs + - extra_specs: extra_specs_volume_type_required Response Example @@ -132,7 +132,7 @@ Response Parameters .. rest_parameters:: parameters.yaml - - extra_specs: extra_specs + - extra_specs: extra_specs_volume_type_required Response Example @@ -249,10 +249,10 @@ Response Parameters .. rest_parameters:: parameters.yaml - volume_type: volume_type_1 - - is_public: is_public - - extra_specs: extra_specs - - description: description_15 - - name: name_7 + - 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 @@ -262,6 +262,43 @@ Response Example :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 ~~~~~~~~~~~~~~~~~~~~ @@ -310,8 +347,8 @@ Response Parameters .. rest_parameters:: parameters.yaml - volume_types: volume_types - - extra_specs: extra_specs - - name: name_7 + - extra_specs: extra_specs_volume_type_required + - name: name_volume_type_required Response Example ---------------- @@ -337,10 +374,10 @@ Request - volume_type: volume_type_1 - project_id: project_id_path - - name: name_7 - - os-volume-type-access:is_public: is_public - - description: description_15 - - extra_specs: extra_specs_1 + - name: name_volume_type_required + - os-volume-type-access:is_public: is_public_volume_type_optional + - description: description_volume_type_optional + - extra_specs: extra_specs_volume_type_optional Request Example --------------- @@ -355,12 +392,12 @@ Response Parameters .. rest_parameters:: parameters.yaml - volume_type: volume_type_1 - - is_public: is_public - - extra_specs: extra_specs - - description: description_15 - - name: name_7 + - is_public: is_public_volume_type_required + - extra_specs: extra_specs_volume_type_required + - description: description_volume_type_required + - name: name_volume_type_required - 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 ----------------