Add checkpoints api-ref

add api reference of checkpoints.

Change-Id: I7ac3f3ece7a2a1d3cb8737ee71e4c968e9a71cb6
This commit is contained in:
zhangshuai 2016-09-20 11:38:01 +08:00
parent aaf98478e7
commit 5c326e71a3
7 changed files with 358 additions and 0 deletions

View File

@ -7,3 +7,4 @@ Data Protection API V1
.. rest_expand_all::
.. include:: karbor-v1-plans.inc
.. include:: karbor-v1-checkpoints.inc

View File

@ -0,0 +1,224 @@
.. -*- rst -*-
===========
Checkpoints
===========
This API enables the Karbor user to access and manage the checkpoints stored in
the protection provider:
- List all checkpoints given a Bank ID.
- Show Information on a given checkpoint ID.
- Delete a checkpoint.
- Create a checkpoint.
When you perform the above operation, these status values are possible:
+-----------------+----------------------------------------------------------+
| Status | Description |
+=================+==========================================================+
| error | A checkpoint creation error occurred. |
+-----------------+----------------------------------------------------------+
| protecting | The checkpoint is being created. |
+-----------------+----------------------------------------------------------+
| available | The checkpoint is created, and available. |
+-----------------+----------------------------------------------------------+
| deleting | The checkpoint is being deleted. |
+-----------------+----------------------------------------------------------+
| deleted | The checkpoint is deleted. |
+-----------------+----------------------------------------------------------+
| error-deleting | A checkpoint deletion error occurred. |
+-----------------+----------------------------------------------------------+
List checkpoints
================
.. rest_method:: GET /v1/{tenant_id}/providers/{provider_id}/checkpoints
List all the checkpoints offered at the given provider, or part of checkpoints
limited by ``?limit={limit_num}`` by ``GET`` method.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id
- provider_id: provider_id_1
Response
--------
.. rest_parameters:: parameters.yaml
- X-Openstack-Request-Id: request_id
- checkpoints: checkpoint_list
- id: checkpoint_id
- project_id: tenant_id_1
- status: checkpoint_status
- protection_plan: plan
- resource_graph: resource_graph
- checkpoints_links: links
Response Example
----------------
.. literalinclude:: ./samples/checkpoints-list-response.json
:language: javascript
Create checkpoint
=================
.. rest_method:: POST /v1/{tenant_id}/providers/{provider_id}/checkpoints
Execute the protect operation for the specified plan and create a checkpoint
at a given provider.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id
- provider_id: provider_id_1
- checkpoint: checkpoint
- plan_id: plan_id
Request Example
---------------
.. literalinclude:: ./samples/checkpoint-create-request.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- X-Openstack-Request-Id: request_id
- checkpoint: checkpoint
- id: checkpoint_id
- project_id: tenant_id_1
- status: checkpoint_status
- protection_plan: plan
- resource_graph: resource_graph
Response Example
----------------
.. literalinclude:: ./samples/checkpoint-create-response.json
:language: javascript
Show checkpoint
===============
.. rest_method:: GET /v1/{tenant_id}/providers/{provider_id}/checkpoints/{checkpoint_id}
Shows the information about the specified checkpoint offered at a given
provider.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id
- provider_id: provider_id_1
- checkpoint_id: checkpoint_id_1
Response
--------
.. rest_parameters:: parameters.yaml
- X-Openstack-Request-Id: request_id
- checkpoint: checkpoint
- id: checkpoint_id
- project_id: tenant_id_1
- status: checkpoint_status
- protection_plan: plan
- resource_graph: resource_graph
Response Example
----------------
.. literalinclude:: ./samples/checkpoint-create-response.json
:language: javascript
Delete checkpoint
=================
.. rest_method:: DELETE /v1/{tenant_id}/providers/{provider_id}/checkpoints/{checkpoint_id}
Deletes a specific checkpoint.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 202
Request
-------
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id
- provider_id: provider_id_1
- checkpoint_id: checkpoint_id_1
Response
--------
Empty dict
Response Example
----------------
.. literalinclude:: ./samples/checkpoint-delete-response.json
:language: javascript

View File

@ -8,6 +8,18 @@ request_id:
type: UUID
# variables in path
checkpoint_id_1:
description: |
The UUID of a checkpoint.
in: path
required: true
type: UUID
provider_id_1:
description: |
The UUID of a provider.
in: path
required: true
type: UUID
tenant_id:
description: |
The UUID of the tenant in a multi-tenancy cloud.
@ -20,6 +32,31 @@ tenant_id:
# variables in body
checkpoint:
description: |
A ``checkpoint`` object.
in: body
required: true
type: object
checkpoint_id:
description: |
The UUID of the checkpoint.
in: body
required: true
type: UUID
checkpoint_list:
description: |
The list of ``checkpoint`` objects.
in: body
required: true
type: array
checkpoint_status:
description: |
The status of checkpoint. A valid value is ``error``, ``protecting``,
``available``, ``deleting``, ``deleted`` or ``error-deleting``.
in: body
required: true
type: string
links:
description: |
Links for transfer.
@ -80,6 +117,12 @@ provider_id:
in: body
required: true
type: UUID
resource_graph:
description: |
The resource graph of protection plan corresponding to the checkpoint.
in: body
required: true
type: array
resources:
description: |
The list of all resources in plan.
@ -92,3 +135,9 @@ resources_1:
in: body
required: false
type: array
tenant_id_1:
description: |
The UUID of the tenant in a multi-tenancy cloud.
in: body
required: true
type: string

View File

@ -0,0 +1,5 @@
{
"checkpoint": {
"plan_id": "3523a271-68aa-42f5-b9ba-56e5200a2ebb"
}
}

View File

@ -0,0 +1,35 @@
{
"checkpoint": {
"id": "dcb20606-ad71-40a3-80e4-ef0fafdad0c3",
"project_id": "e486a2f49695423ca9c47e589b948108",
"status": "available",
"protection_plan": {
"id": "3523a271-68aa-42f5-b9ba-56e5200a2ebb",
"name": "My 3 tier application",
"provider_id": "cf56bd3e-97a7-4078-b6d5-f36246333fd9",
"resources": [
{
"id": "99777fdd-8a5b-45ab-ba2c-52420008103f",
"type": "OS::Glance::Image",
"name": "cirros-0.3.4-x86_64-uec"
},
{
"id": "cb4ef2ff-10f5-46c9-bce4-cf7a49c65a01",
"type": "OS::Nova::Server",
"name": "App server"
},
{
"id": "25336116-f38e-4c22-81ad-e9b7bd71ba51",
"type": "OS::Cinder::Volume",
"name": "System volume"
},
{
"id": "33b6bb0b-1157-4e66-8553-1c9e14b1c7ba",
"type": "OS::Cinder::Volume",
"name": "Data volume"
}
]
},
"resource_graph": "[{'0x3': ['OS::Cinder::Volume', '33b6bb0b-1157-4e66-8553-1c9e14b1c7ba', 'Data volume'], '0x2': ['OS::Cinder::Volume', '25336116-f38e-4c22-81ad-e9b7bd71ba51', 'System volume'], '0x1': ['OS::Nova::Server', 'cb4ef2ff-10f5-46c9-bce4-cf7a49c65a01', 'App server'], '0x0': ['OS::Glance::Image', '99777fdd-8a5b-45ab-ba2c-52420008103f', 'cirros-0.3.4-x86_64-uec']}, [['0x1', ['0x0']]]]"
}
}

View File

@ -0,0 +1 @@
{}

View File

@ -0,0 +1,43 @@
{
"checkpoints": [
{
"id": "dcb20606-ad71-40a3-80e4-ef0fafdad0c3",
"project_id": "e486a2f49695423ca9c47e589b948108",
"status": "available",
"protection_plan": {
"id": "3523a271-68aa-42f5-b9ba-56e5200a2ebb",
"name": "My 3 tier application",
"provider_id": "cf56bd3e-97a7-4078-b6d5-f36246333fd9",
"resources": [
{
"id": "99777fdd-8a5b-45ab-ba2c-52420008103f",
"type": "OS::Glance::Image",
"name": "cirros-0.3.4-x86_64-uec"
},
{
"id": "cb4ef2ff-10f5-46c9-bce4-cf7a49c65a01",
"type": "OS::Nova::Server",
"name": "App server"
},
{
"id": "25336116-f38e-4c22-81ad-e9b7bd71ba51",
"type": "OS::Cinder::Volume",
"name": "System volume"
},
{
"id": "33b6bb0b-1157-4e66-8553-1c9e14b1c7ba",
"type": "OS::Cinder::Volume",
"name": "Data volume"
}
]
},
"resource_graph": "[{'0x3': ['OS::Cinder::Volume', '33b6bb0b-1157-4e66-8553-1c9e14b1c7ba', 'Data volume'], '0x2': ['OS::Cinder::Volume', '25336116-f38e-4c22-81ad-e9b7bd71ba51', 'System volume'], '0x1': ['OS::Nova::Server', 'cb4ef2ff-10f5-46c9-bce4-cf7a49c65a01', 'App server'], '0x0': ['OS::Glance::Image', '99777fdd-8a5b-45ab-ba2c-52420008103f', 'cirros-0.3.4-x86_64-uec']}, [['0x1', ['0x0']]]]"
}
],
"checkpoints_links": [
{
"href": "/v1/{project_id}/checkpoints?limit={limit_num}&marker=dcb20606-ad71-40a3-80e4-ef0fafdad0c3",
"rel": "next"
}
]
}