From 6892dd6047c95b702beb8d3230d9eaa02c680231 Mon Sep 17 00:00:00 2001 From: "jeremy.zhang" Date: Thu, 18 Jan 2018 16:15:03 +0800 Subject: [PATCH] Fix api-ref for v3 volume group types This patch is mainly to fix api-ref for v3 volume group types, including: 1. add description and example for the API: show defaut group type 2. fix parameters: 'is_public' and 'description' 3. remove unused sample file: group-type-show-request.json Change-Id: I29f160d8ed24473debb345b4ea91ee0545d711b1 --- api-ref/source/v3/group-types.inc | 68 +++++++++++++++---- api-ref/source/v3/parameters.yaml | 34 ++++++---- .../samples/group-type-default-response.json | 9 +++ .../v3/samples/group-type-show-request.json | 9 --- .../v3/samples/group-type-update-request.json | 2 +- 5 files changed, 83 insertions(+), 39 deletions(-) create mode 100644 api-ref/source/v3/samples/group-type-default-response.json delete mode 100644 api-ref/source/v3/samples/group-type-show-request.json diff --git a/api-ref/source/v3/group-types.inc b/api-ref/source/v3/group-types.inc index 67ff6c0c9c4..9b6a2198130 100644 --- a/api-ref/source/v3/group-types.inc +++ b/api-ref/source/v3/group-types.inc @@ -3,6 +3,8 @@ Group types =========== +To create a generic volume group, you must specify a group type. + Update group type ~~~~~~~~~~~~~~~~~ @@ -11,8 +13,6 @@ Update group type Updates a group type. -To create a generic volume group, you must specify a group type. - Normal response codes: 200 Error response codes: badRequest(400), forbidden(403), itemNotFound(404), @@ -28,8 +28,8 @@ Request - group_type_id: group_type_id_1 - group_type: group_type - name: name_16 - - description: description_12 - - is_public: is_public_2 + - description: description_group_type_optional + - is_public: is_public_group_type_optional Request Example --------------- @@ -45,9 +45,9 @@ Response Parameters - group_type: group_type - id: group_type_id_2 - - is_public: is_public_1 + - is_public: is_public_group_type_required - group_specs: group_specs - - description: description_12 + - description: description_group_type_required - name: name_16 Response Example @@ -86,9 +86,9 @@ Response Parameters - group_type: group_type - id: group_type_id_2 - name: name_16 - - is_public: is_public_1 + - is_public: is_public_group_type_required - group_specs: group_specs - - description: description_12 + - description: description_group_type_required Response Example @@ -98,6 +98,46 @@ Response Example :language: javascript +Show default group type details +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. rest_method:: GET /v3/{project_id}/group_types/default + +Shows details for the default group type if configured. + + +Normal response codes: 200 + +Error response codes: itemNotFound(404) + +Request +------- + +.. rest_parameters:: parameters.yaml + + - project_id: project_id_path + + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - group_type: group_type + - id: group_type_id_2 + - name: name_16 + - is_public: is_public_group_type_required + - group_specs: group_specs + - description: description_group_type_required + + +Response Example +---------------- + +.. literalinclude:: ./samples/group-type-default-response.json + :language: javascript + + Delete group type ~~~~~~~~~~~~~~~~~ @@ -149,7 +189,7 @@ Response Parameters - group_types: group_types - id: group_type_id_2 - - group_specs: group_specs_2 + - group_specs: group_specs - name: name_16 Response Example @@ -166,8 +206,6 @@ Create group type Creates a group type. -To create a generic volume group, you must specify a group type. - Normal response codes: 202 @@ -183,8 +221,8 @@ Request - project_id: project_id_path - group_type: group_type - name: name_16 - - description: description_12 - - is_public: is_public_2 + - description: description_group_type_optional + - is_public: is_public_group_type_optional - group_specs: group_specs Request Example @@ -201,9 +239,9 @@ Response Parameters - group_type: group_type - id: group_type_id_2 - - is_public: is_public_1 + - is_public: is_public_group_type_required - group_specs: group_specs - - description: description_12 + - description: description_group_type_required - name: name_16 diff --git a/api-ref/source/v3/parameters.yaml b/api-ref/source/v3/parameters.yaml index 9ce16070933..96d04dcc6d5 100644 --- a/api-ref/source/v3/parameters.yaml +++ b/api-ref/source/v3/parameters.yaml @@ -879,12 +879,6 @@ description_11: in: body required: false type: string -description_12: - description: | - The group type description. - in: body - required: false - type: string description_13: description: | The group description. @@ -964,6 +958,18 @@ description_group_true: in: body required: true type: string +description_group_type_optional: + description: | + The group type description. + in: body + required: false + type: string +description_group_type_required: + description: | + The group type description. + in: body + required: true + type: string description_volume_type_optional: description: | The volume type description. @@ -1409,18 +1415,18 @@ is_incremental: in: body required: false type: boolean -is_public_1: - description: - Whether the group is publicly visible. - in: body - required: false - type: boolean -is_public_2: - description: +is_public_group_type_optional: + description: | Whether the group type is publicly visible. in: body required: false type: boolean +is_public_group_type_required: + description: | + Whether the group type is publicly visible. + in: body + required: true + type: boolean is_public_volume_type_optional: description: | Whether the volume type is publicly visible. diff --git a/api-ref/source/v3/samples/group-type-default-response.json b/api-ref/source/v3/samples/group-type-default-response.json new file mode 100644 index 00000000000..920dbc79373 --- /dev/null +++ b/api-ref/source/v3/samples/group-type-default-response.json @@ -0,0 +1,9 @@ +{ + "group_type": { + "id": "7270c56e-6354-4528-8e8b-f54dee2232c8", + "name": "group-type-test", + "description": "default group type", + "is_public": "true", + "group_specs": {} + } +} diff --git a/api-ref/source/v3/samples/group-type-show-request.json b/api-ref/source/v3/samples/group-type-show-request.json deleted file mode 100644 index 77ff6329c8a..00000000000 --- a/api-ref/source/v3/samples/group-type-show-request.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "group_type": { - "id": "289da7f8-6440-407c-9fb4-7db01ec49164", - "name": "grp-type-001", - "group_specs": { - "consistent_group_snapshot_enabled": " False" - } - } -} diff --git a/api-ref/source/v3/samples/group-type-update-request.json b/api-ref/source/v3/samples/group-type-update-request.json index 5478412efdc..1569c689a27 100644 --- a/api-ref/source/v3/samples/group-type-update-request.json +++ b/api-ref/source/v3/samples/group-type-update-request.json @@ -2,6 +2,6 @@ "group_type": { "name": "grp-type-001", "description": "group type 0001", - "is_public": true, + "is_public": true } }