diff --git a/api-ref/source/v3/group-type-specs.inc b/api-ref/source/v3/group-type-specs.inc new file mode 100644 index 00000000000..b284ffcfbfd --- /dev/null +++ b/api-ref/source/v3/group-type-specs.inc @@ -0,0 +1,191 @@ +.. -*- rst -*- + +Group type specs +================ + +Create group specs for a group type +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. rest_method:: POST /v3/{project_id}/group_types/{group_type_id}/group_specs + +Create group specs for a group type, if the specification key already exists in group specs, +this API will update the specification as well. + + +Normal response codes: 202 +Error response codes: badRequest(400), forbidden(403), itemNotFound(404) + + +Request +------- + +.. rest_parameters:: parameters.yaml + + - group_specs: group_specs_2 + - group_type_id: group_type_id_1 + - project_id: project_id_path + +Request Example +--------------- + +.. literalinclude:: ./samples/group-type-specs-create-request.json + :language: javascript + + + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - group_specs: group_specs_2 + + +Response Example +---------------- + +.. literalinclude:: ./samples/group-type-specs-create-response.json + :language: javascript + + +List type specs +================ + +List group specs for a group type +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. rest_method:: GET /v3/{project_id}/group_types/{group_type_id}/group_specs + +List all the group specs for a group type, + + +Normal response codes: 200 +Error response codes: itemNotFound(404), forbidden(403) + + +Request +------- + +.. rest_parameters:: parameters.yaml + + - group_type_id: group_type_id_1 + - project_id: project_id_path + + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - group_specs: group_specs_2 + + +Response Example +---------------- + +.. literalinclude:: ./samples/group-type-specs-list-response.json + :language: javascript + + +Show type spec +============== + +Show one specific group spec for a group type +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. rest_method:: GET /v3/{project_id}/group_types/{group_type_id}/group_specs/{spec_id} + +Show a group spec for a group type, + + +Normal response codes: 200 +Error response codes: itemNotFound(404), forbidden(403) + + +Request +------- + +.. rest_parameters:: parameters.yaml + + - group_type_id: group_type_id_1 + - project_id: project_id_path + - spec_id: spec_id + + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - spec: spec_value + +Response Example +---------------- + +.. literalinclude:: ./samples/group-type-specs-show-response.json + :language: javascript + + +Update type spec +================ + +Update one specific group spec for a group type +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. rest_method:: PUT /v3/{project_id}/group_types/{group_type_id}/group_specs/{spec_id} + +Update a group spec for a group type, + + +Normal response codes: 202 +Error response codes: itemNotFound(404), forbidden(403) + + +Request +------- + +.. rest_parameters:: parameters.yaml + + - group_type_id: group_type_id_1 + - project_id: project_id_path + - spec_id: spec_id + - spec: spec_value + + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - spec: spec_value + +Response Example +---------------- + +.. literalinclude:: ./samples/group-type-specs-update-response.json + :language: javascript + + +Delete type spec +================ + +Delete one specific group spec for a group type +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. rest_method:: DELETE /v3/{project_id}/group_types/{group_type_id}/group_specs/{spec_id} + +Delete a group spec for a group type, + + +Normal response codes: 202 +Error response codes: itemNotFound(404), forbidden(403) + + +Request +------- + +.. rest_parameters:: parameters.yaml + + - group_type_id: group_type_id_1 + - project_id: project_id_path + - spec_id: spec_id diff --git a/api-ref/source/v3/group-types.inc b/api-ref/source/v3/group-types.inc index 21c3c037c09..6cebbac96d2 100644 --- a/api-ref/source/v3/group-types.inc +++ b/api-ref/source/v3/group-types.inc @@ -52,55 +52,6 @@ Response Example :language: javascript -Create group specs for a group type -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. rest_method:: POST /v3/{project_id}/group_types/{group_type_id}/group_specs - -Create group specs for a group type. - - -Normal response codes: 202 -Error response codes: badRequest(400), forbidden(403), itemNotFound(404) - - -Request -------- - -.. rest_parameters:: parameters.yaml - - - group_specs: group_specs - - group_type: group_type - - group_type_id: group_type_id - - project_id: project_id_path - -Request Example ---------------- - -.. literalinclude:: ./samples/group-type-specs-create-request.json - :language: javascript - - - -Response Parameters -------------------- - -.. rest_parameters:: parameters.yaml - - - is_public: is_public - - group_specs: group_specs - - description: description - - group_type: group_type - - name: name - - -Response Example ----------------- - -.. literalinclude:: ./samples/group-type-show-response.json - :language: javascript - - Show group type details ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/api-ref/source/v3/index.rst b/api-ref/source/v3/index.rst index 37ad9b33810..a4b524bb48c 100644 --- a/api-ref/source/v3/index.rst +++ b/api-ref/source/v3/index.rst @@ -39,6 +39,7 @@ Block Storage API V3 (CURRENT) .. include:: groups.inc .. include:: group-snapshots.inc .. include:: group-types.inc +.. include:: group-type-specs.inc .. include:: hosts.inc .. include:: limits.inc .. include:: messages.inc diff --git a/api-ref/source/v3/parameters.yaml b/api-ref/source/v3/parameters.yaml index eda41dda7d4..1da9078f282 100644 --- a/api-ref/source/v3/parameters.yaml +++ b/api-ref/source/v3/parameters.yaml @@ -80,6 +80,12 @@ group_type_id: in: path required: false type: string +group_type_id_1: + description: | + The UUID for an existing group type. + in: path + required: true + type: string hostname: description: | The name of the host that hosts the storage back @@ -357,6 +363,12 @@ sort_key_group_snapshot: required: false type: string min_version: 3.29 +spec_id: + description: | + The id (key) of the group specification. + in: query + required: true + type: string status_query: description: | Filters results by a status. Default=None. @@ -898,6 +910,13 @@ group_specs: in: body required: false type: object +group_specs_2: + description: | + A set of key and value pairs that contains the + specifications for a group type. + in: body + required: true + type: object group_type: description: | A ``group_type`` object. @@ -1977,6 +1996,12 @@ source_volid_1: in: body required: true type: string +spec_value: + description: | + The value of the group specification corresponding to the specified key. + in: body + required: true + type: string specs: description: | A ``specs`` object. diff --git a/api-ref/source/v3/samples/group-type-specs-create-request.json b/api-ref/source/v3/samples/group-type-specs-create-request.json index f4324aba0cc..03b7282d955 100644 --- a/api-ref/source/v3/samples/group-type-specs-create-request.json +++ b/api-ref/source/v3/samples/group-type-specs-create-request.json @@ -1,6 +1,6 @@ { "group_specs": { "key1": "value1", - "key2": "value2", + "key2": "value2" } } diff --git a/api-ref/source/v3/samples/group-type-specs-create-response.json b/api-ref/source/v3/samples/group-type-specs-create-response.json new file mode 100644 index 00000000000..03b7282d955 --- /dev/null +++ b/api-ref/source/v3/samples/group-type-specs-create-response.json @@ -0,0 +1,6 @@ +{ + "group_specs": { + "key1": "value1", + "key2": "value2" + } +} diff --git a/api-ref/source/v3/samples/group-type-specs-list-response.json b/api-ref/source/v3/samples/group-type-specs-list-response.json new file mode 100644 index 00000000000..03b7282d955 --- /dev/null +++ b/api-ref/source/v3/samples/group-type-specs-list-response.json @@ -0,0 +1,6 @@ +{ + "group_specs": { + "key1": "value1", + "key2": "value2" + } +} diff --git a/api-ref/source/v3/samples/group-type-specs-show-response.json b/api-ref/source/v3/samples/group-type-specs-show-response.json new file mode 100644 index 00000000000..513df0922ff --- /dev/null +++ b/api-ref/source/v3/samples/group-type-specs-show-response.json @@ -0,0 +1,3 @@ +{ + "key1": "value1" +} diff --git a/api-ref/source/v3/samples/group-type-specs-update-response.json b/api-ref/source/v3/samples/group-type-specs-update-response.json new file mode 100644 index 00000000000..513df0922ff --- /dev/null +++ b/api-ref/source/v3/samples/group-type-specs-update-response.json @@ -0,0 +1,3 @@ +{ + "key1": "value1" +}