diff --git a/api-ref/source/v3/index.rst b/api-ref/source/v3/index.rst index 5da726f0c86..9e37d421665 100644 --- a/api-ref/source/v3/index.rst +++ b/api-ref/source/v3/index.rst @@ -52,3 +52,6 @@ Block Storage API V3 (CURRENT) .. include:: quota-classes.inc .. include:: quota-sets.inc .. include:: worker-cleanup.inc + +.. valid values for boolean parameters. +.. include:: valid-boolean-values.inc \ No newline at end of file diff --git a/api-ref/source/v3/parameters.yaml b/api-ref/source/v3/parameters.yaml index a24b991b56c..80b8122c27a 100644 --- a/api-ref/source/v3/parameters.yaml +++ b/api-ref/source/v3/parameters.yaml @@ -433,6 +433,7 @@ alias: allow_attached_volume: description: | Whether to allow failover if any volumes are 'in-use'. + See :ref:`valid boolean values ` in: body required: true type: boolean @@ -602,6 +603,7 @@ bootable: description: | Enables or disables the bootable attribute. You can boot an instance from a bootable volume. + See :ref:`valid boolean values ` in: body required: true type: boolean @@ -609,6 +611,7 @@ bootable_1: description: | Enables or disables the bootable attribute. You can boot an instance from a bootable volume. + See :ref:`valid boolean values ` in: body required: false type: boolean @@ -815,6 +818,7 @@ delete-volumes: description: | If set to ``true``, allows deletion of a group as well as all volumes in the group. + See :ref:`valid boolean values ` in: body required: false type: boolean @@ -975,6 +979,7 @@ detached_at: disabled: description: | Filter by disabled status. + See :ref:`valid boolean values ` in: body required: false type: boolean @@ -1072,6 +1077,7 @@ force: description: | Indicates whether to backup, even if the volume is attached. Default is ``false``. + See :ref:`valid boolean values ` in: body required: false type: boolean @@ -1093,6 +1099,7 @@ force_4: description: | Enables or disables upload of a volume that is attached to an instance. Default=False. + See :ref:`valid boolean values ` in: body required: false type: boolean @@ -1375,7 +1382,7 @@ incremental: description: | The backup mode. A valid value is ``true`` for incremental backup mode or ``false`` for full backup mode. Default - is ``false``. + is ``false``. See :ref:`valid boolean values ` in: body required: false type: boolean @@ -1402,6 +1409,7 @@ is_incremental: is_public_group_type_optional: description: | Whether the group type is publicly visible. + See :ref:`valid boolean values ` in: body required: false type: boolean @@ -1414,6 +1422,7 @@ is_public_group_type_required: is_public_volume_type_optional: description: | Whether the volume type is publicly visible. + See :ref:`valid boolean values ` in: body required: false type: boolean @@ -1426,6 +1435,7 @@ is_public_volume_type_required: is_up: description: | Filter by up/down status. + See :ref:`valid boolean values ` in: body required: false type: boolean @@ -1745,7 +1755,7 @@ multiattach_req: To enable this volume to attach to more than one server, set this value to ``true``. Default is ``false``. Note that support for multiattach volumes depends on the volume - type being used. + type being used. See :ref:`valid boolean values ` in: body required: false type: boolean @@ -2179,6 +2189,7 @@ properties: protected: description: | Whether the new image is protected. Default=False. + See :ref:`valid boolean values ` in: body required: false type: boolean diff --git a/api-ref/source/v3/valid-boolean-values.inc b/api-ref/source/v3/valid-boolean-values.inc new file mode 100644 index 00000000000..1e9b68a5112 --- /dev/null +++ b/api-ref/source/v3/valid-boolean-values.inc @@ -0,0 +1,12 @@ +.. -*- rst -*- + +.. _valid-boolean-values: + +Valid boolean values +==================== + +Following is the list of valid values for boolean parameters. + +[True, ‘True’, ‘TRUE’, ‘true’, ‘1’, ‘ON’, ‘On’, ‘on’, ‘YES’, +‘Yes’, ‘yes’, ‘y’, ‘t’, False, ‘False’, ‘FALSE’, ‘false’, ‘0’, +‘OFF’, ‘Off’, ‘off’, ‘NO’, ‘No’, ‘no’, ‘n’, ‘f’] \ No newline at end of file diff --git a/releasenotes/notes/json-schema-validation-0d22576bd556f4e0.yaml b/releasenotes/notes/json-schema-validation-0d22576bd556f4e0.yaml new file mode 100644 index 00000000000..112eaa9b227 --- /dev/null +++ b/releasenotes/notes/json-schema-validation-0d22576bd556f4e0.yaml @@ -0,0 +1,26 @@ +--- +other: + - | + Added schema validation support using jsonschema `[json-schema-validation]`_ + for all supported v3 APIs. + + Following APIs were accepting boolean parameters with leading and trailing + white spaces (for e.g. " true "). But now with schema validation support, + all these boolean parameters henceforth will not accept leading and trailing + whitespaces to maintain consistency. + + * Generic volume groups: + + * delete group: "POST /v3/{project_id}/groups/{group_id}/action" + + * failover replication: "POST /v3/{project_id}/groups/{group_id}/action" + * Volume Snapshots: + + * create a snapshot: "POST /v3/{project_id}/snapshots" + * Volume_actions: + + * set bootable: "POST /v3/{project_id}/volumes/{volume_id}/action" + + * volume readonly update: "POST /v3/{project_id}/volumes/{volume_id}/action" + + .. _`[json-schema-validation]`: https://blueprints.launchpad.net/cinder/+spec/json-schema-validation