[api-ref] Refactor consistency group API

This patch refactors consistency group API to make it clear to
understand and maintain.

Change-Id: I5b48f354cb32d2606e6eaf2c01c49a333921ff4f
This commit is contained in:
Ha Van Tu 2016-09-09 09:31:31 +07:00
parent 3f922aab6e
commit 8eaf23982c
2 changed files with 224 additions and 116 deletions

View File

@ -40,10 +40,10 @@ Request
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id_1
- all_tenants: all_tenants_1
- limit: limit_1
- offset: offset_1
- tenant_id: tenant_id_path
- all_tenants: cg_all_tenants_query
- limit: cg_limit_query
- offset: cg_offset_query
Response parameters
-------------------
@ -52,9 +52,9 @@ Response parameters
- consistency_groups: consistency_groups
- consistency_group: consistency_group
- id: id_2
- name: name_7
- link: link
- id: cg_id_response
- name: cg_name_response
- link: cg_links
Response example
----------------
@ -78,10 +78,10 @@ Request
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id_1
- all_tenants: all_tenants_1
- limit: limit_1
- offset: offset_1
- tenant_id: tenant_id_path
- all_tenants: cg_all_tenants_query
- limit: cg_limit_query
- offset: cg_offset_query
Response parameters
-------------------
@ -90,18 +90,18 @@ Response parameters
- consistency_groups: consistency_groups
- consistency_group: consistency_group
- id: id_2
- status: status
- links: link
- name: name_7
- description: description_6
- source_cgsnapshot_id: source_cgsnapshot_id
- created_at: created_at_1
- share_network_id: share_network_id
- host: host
- project_id: project_id_2
- share_server_id: share_server_id
- share_types: share_types_1
- id: cg_id_response
- status: cg_status
- links: cg_links
- name: cg_name_response
- description: cg_description_response
- source_cgsnapshot_id: cg_snapshot_id
- created_at: cg_created_at
- share_network_id: cg_share_network_id
- host: cg_host
- project_id: cg_project_id
- share_server_id: cg_share_server_id
- share_types: cg_share_types_response
Response example
----------------
@ -126,8 +126,8 @@ Request
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id_1
- consistency_group_id: consistency_group_id_7
- tenant_id: tenant_id_path
- consistency_group_id: cg_id_path
Response parameters
-------------------
@ -135,18 +135,18 @@ Response parameters
.. rest_parameters:: parameters.yaml
- consistency_group: consistency_group
- id: id_2
- status: status
- links: link
- name: name_7
- description: description_6
- source_cgsnapshot_id: source_cgsnapshot_id
- created_at: created_at_1
- share_network_id: share_network_id
- host: host
- project_id: project_id_2
- share_server_id: share_server_id
- share_types: share_types_1
- id: cg_id_response
- status: cg_status
- links: cg_links
- name: cg_name_response
- description: cg_description_response
- source_cgsnapshot_id: cg_snapshot_id
- created_at: cg_created_at
- share_network_id: cg_share_network_id
- host: cg_host
- project_id: cg_project_id
- share_server_id: cg_share_server_id
- share_types: cg_share_types_response
Response example
----------------
@ -173,12 +173,12 @@ Request
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id_1
- share_types: share_types
- name: name_2
- description: description_2
- share_network_id: share_network_id_1
- source_cgsnapshot_id: source_cgsnapshot_id
- tenant_id: tenant_id_path
- share_types: cg_share_types_request
- name: cg_name_request
- description: cg_description_request
- share_network_id: cg_share_network_id
- source_cgsnapshot_id: cg_snapshot_id
Request example
---------------
@ -193,18 +193,18 @@ Response parameters
.. rest_parameters:: parameters.yaml
- consistency_group: consistency_group
- id: id_2
- status: status
- links: link
- name: name_7
- description: description_6
- source_cgsnapshot_id: source_cgsnapshot_id
- created_at: created_at_1
- share_network_id: share_network_id
- host: host
- project_id: project_id_2
- share_server_id: share_server_id
- share_types: share_types_1
- id: cg_id_response
- status: cg_status
- links: cg_links
- name: cg_name_response
- description: cg_description_response
- source_cgsnapshot_id: cg_snapshot_id
- created_at: cg_created_at
- share_network_id: cg_share_network_id
- host: cg_host
- project_id: cg_project_id
- share_server_id: cg_share_server_id
- share_types: cg_share_types_response
Response example
@ -236,10 +236,10 @@ Request
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id_1
- consistency_group_id: consistency_group_id_7
- name: name_2
- description: description_2
- tenant_id: tenant_id
- consistency_group_id: cg_id_path
- name: cg_name_request
- description: cg_description_request
Request example
---------------
@ -253,18 +253,18 @@ Response parameters
.. rest_parameters:: parameters.yaml
- consistency_group: consistency_group
- id: id_2
- status: status
- links: link
- name: name_7
- description: description_6
- source_cgsnapshot_id: source_cgsnapshot_id
- created_at: created_at_1
- id: cg_id_response
- status: cg_status
- links: cg_links
- name: cg_name_response
- description: cg_description_response
- source_cgsnapshot_id: cg_snapshot_id
- created_at: cg_created_at
- share_network_id: share_network_id
- host: host
- project_id: project_id_2
- share_server_id: share_server_id
- share_types: share_types_1
- host: cg_host
- project_id: cg_project_id
- share_server_id: cg_share_server_id
- share_types: cg_share_types_response
Response example
----------------
@ -292,8 +292,8 @@ Request
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id_1
- consistency_group_id: consistency_group_id_7
- tenant_id: tenant_id_path
- consistency_group_id: cg_id_path
- reset_status: reset_status
- os-reset_status: os-reset_status
- status: status
@ -324,8 +324,8 @@ Request
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id_1
- consistency_group_id: consistency_group_id_7
- tenant_id: tenant_id_path
- consistency_group_id: cg_id_path
- os-force_delete: os-force_delete
- force_delete: force_delete
@ -351,5 +351,5 @@ Request
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id_1
- consistency_group_id: consistency_group_id_7
- tenant_id: tenant_id_path
- consistency_group_id: cg_id_path

View File

@ -8,6 +8,18 @@ api_version:
type: string
description: >
The API version as returned in the links from the ``GET /`` call.
cg_id_path:
description: |
The UUID of the consistency group.
in: path
required: true
type: string
cg_share_network_id_path:
description: |
The UUID of the share network.
in: path
required: true
type: string
cgsnapshot_id:
description: |
The UUID of the consistency group snapshot.
@ -101,6 +113,12 @@ tenant_id_1:
in: path
required: true
type: string
tenant_id_path:
description: |
The tenant ID in a multi-tenancy cloud.
in: path
required: true
type: string
# variables in query
all_tenants:
@ -111,15 +129,6 @@ all_tenants:
in: query
required: false
type: boolean
all_tenants_1:
description: |
(Admin only). Defines whether to list consistency groups for
all tenants. Set to ``1`` to list consistency groups for all
tenants. Set to ``0`` to list consistency groups only for the
current tenant.
in: query
required: false
type: boolean
all_tenants_2:
description: |
(Admin only). Defines whether to list consistency group snapshots
@ -148,6 +157,28 @@ capabilities_1:
in: query
required: false
type: string
cg_all_tenants_query:
description: |
(Admin only). Defines whether to list consistency groups for
all tenants. Set to ``1`` to list consistency groups for all
tenants. Set to ``0`` to list consistency groups only for the
current tenant.
in: query
required: false
type: boolean
cg_limit_query:
description: |
The maximum number of consistency groups to return.
in: query
required: false
type: integer
cg_offset_query:
description: |
The offset to define start point of consistency
group listing.
in: query
required: false
type: integer
consistency_group_id_3:
description: |
(Since API v2.4) The UUID of the consistency
@ -196,12 +227,6 @@ limit:
in: query
required: false
type: integer
limit_1:
description: |
The maximum number of consistency groups to return.
in: query
required: false
type: integer
limit_2:
description: |
The maximum number of consistency groups snapshots
@ -242,13 +267,7 @@ offset:
in: query
required: false
type: integer
offset_1:
description: |
The offset to define start point of consistency
group listing.
in: query
required: false
type: integer
offset_2:
description: |
The offset to define start point of consistency
@ -590,6 +609,113 @@ capabilities:
in: body
required: true
type: object
cg_created_at:
description: |
The date and time stamp when the consistency group was created.
The date and time stamp format is `ISO 8601
<https://en.wikipedia.org/wiki/ISO_8601>`_:
::
CCYY-MM-DDThh:mm:ss±hh:mm
The ``±hh:mm`` value, if included, returns the time zone as an
offset from UTC.
For example, ``2015-08-27T09:49:58-05:00``.
in: body
required: true
type: string
cg_description_request:
description: |
The consistency group description.
in: body
required: false
type: string
cg_description_response:
description: |
The consistency group description.
in: body
required: true
type: string
cg_host:
description: |
The consistency group host name.
in: body
required: true
type: string
cg_id_response:
description: |
The UUID of the consistency group.
in: body
required: true
type: string
cg_links:
description: |
The consistency group links.
in: body
required: true
type: array
cg_name_request:
description: |
The consistency group name.
in: body
required: false
type: string
cg_name_response:
description: |
The consistency group name.
in: body
required: true
type: string
cg_project_id:
description: |
The ID of the project in which the consistency
group snapshot was created.
in: body
required: true
type: string
cg_share_network_id:
description: |
The UUID of the share network.
in: body
required: true
type: string
cg_share_server_id:
description: |
The UUID of the share server.
in: body
required: true
type: string
cg_share_types_request:
description: |
A list of share type IDs.
in: body
required: false
type: array
cg_share_types_response:
description: |
A list of share type IDs.
in: body
required: true
type: array
cg_snapshot_id:
description: |
The consistency group snapshot ID. A valid value
is ``null`` or the ID of the consistency group snapshot, if the
consistency group was created from a snapshot.
in: body
required: true
type: string
cg_status:
description: |
The consistency group status. A valid value is
``creating``, ``available``, ``error``, ``deleting``, or
``error_deleting``.
in: body
required: true
type: string
cgsnapshot:
description: |
The ``cgsnapshot`` object
@ -1387,12 +1513,6 @@ id_16:
in: body
required: true
type: string
id_2:
description: |
The consistency group ID.
in: body
required: true
type: string
id_3:
description: |
The security service ID.
@ -1468,12 +1588,6 @@ is_public:
in: body
required: false
type: boolean
link:
description: |
The share links.
in: body
required: true
type: array
link_1:
description: |
The share links
@ -1660,12 +1774,6 @@ name_6:
in: body
required: true
type: string
name_7:
description: |
The consistency group name.
in: body
required: true
type: string
name_8:
description: |
The consistency group snapshot name.