Update api-ref and release notes for schema validation

This patch adds a reno for validate boolean parameters with spaces.
Also adds valid values in api-ref for boolean parameters that user
can pass in request body.

Implements: bp/json-schema-validation
Change-Id: Iff4b2906dba93a238d720a218fcf7a9f78b96a37
This commit is contained in:
Neha Alhat 2018-05-23 10:20:07 +05:30 committed by Pooja Jadhav
parent b52d26a361
commit d98dbf4da8
4 changed files with 54 additions and 2 deletions

View File

@ -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

View File

@ -433,6 +433,7 @@ alias:
allow_attached_volume:
description: |
Whether to allow failover if any volumes are 'in-use'.
See :ref:`valid boolean values <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <valid-boolean-values>`
in: body
required: false
type: boolean

View File

@ -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]

View File

@ -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