Add restores api-ref

add api reference of restores.

Change-Id: Id9fb4ceca4c423fc06bd1f40f374455d9c1453ce
This commit is contained in:
zhangshuai 2016-09-22 11:35:10 +08:00
parent 7793322269
commit 55bf2e0a7f
6 changed files with 274 additions and 0 deletions

View File

@ -12,3 +12,4 @@ Data Protection API V1
.. include:: karbor-v1-triggers.inc
.. include:: karbor-v1-scheduled-operations.inc
.. include:: karbor-v1-checkpoints.inc
.. include:: karbor-v1-restores.inc

View File

@ -0,0 +1,182 @@
.. -*- rst -*-
========
Restores
========
This API enables the Karbor user restore a checkpoint on to a restore target:
- List all restores by a given project.
- Create restored system from a checkpoint.
- Show the information of a given restore operation.
When you perform the above operation, these status values are possible:
+-----------------+----------------------------------------------------------+
| Status | Description |
+=================+==========================================================+
| started | A restore operation is in progress. |
+-----------------+----------------------------------------------------------+
| success | A restore operation is success. |
+-----------------+----------------------------------------------------------+
| failed | A restore operation is failed. |
+-----------------+----------------------------------------------------------+
List restores
=============
.. rest_method:: GET /v1/{tenant_id}/restores
List all restores started, success or failed, triggered by a given project,
or part of the protection plans 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
Response
--------
.. rest_parameters:: parameters.yaml
- X-Openstack-Request-Id: request_id
- restores: restore_list
- id: restore_id
- project_id: tenant_id_1
- provider_id: provider_id
- checkpoint_id: checkpoint_id
- restore_target: restore_target
- parameters: restore_parameters
- status: restore_status
- restores_links: links
Response Example
----------------
.. literalinclude:: ./samples/restores-list-response.json
:language: javascript
Create restore
==============
.. rest_method:: POST /v1/{tenant_id}/restores
Start a restore operation.
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
- restore: restore
- provider_id: provider_id
- checkpoint_id: checkpoint_id
- restore_target: restore_target
- parameters: restore_parameters
Request Example
---------------
.. literalinclude:: ./samples/restore-create-request.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- X-Openstack-Request-Id: request_id
- restore: restore
- id: restore_id
- project_id: tenant_id_1
- provider_id: provider_id
- checkpoint_id: checkpoint_id
- restore_target: restore_target
- parameters: restore_parameters
- status: restore_status
Response Example
----------------
.. literalinclude:: ./samples/restore-create-response.json
:language: javascript
Show restore
============
.. rest_method:: GET /v1/{tenant_id}/restores/{restore_id}
Show the information of a given restore operation.
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
- restore_id: restore_id_1
Response
--------
.. rest_parameters:: parameters.yaml
- X-Openstack-Request-Id: request_id
- restore: restore
- id: restore_id
- project_id: tenant_id_1
- provider_id: provider_id
- checkpoint_id: checkpoint_id
- restore_target: restore_target
- parameters: restore_parameters
- status: restore_status
Response Example
----------------
.. literalinclude:: ./samples/restore-create-response.json
:language: javascript

View File

@ -38,6 +38,12 @@ resource_id:
in: path
required: true
type: UUID
restore_id_1:
description: |
The UUID of the restore.
in: path
required: true
type: UUID
tenant_id:
description: |
The UUID of the tenant in a multi-tenancy cloud.
@ -288,6 +294,44 @@ resources_1:
in: body
required: false
type: array
restore:
description: |
A ``restore`` object.
in: body
required: true
type: object
restore_id:
description: |
The UUID of the restore.
in: body
required: true
type: UUID
restore_list:
description: |
The list of ``restore`` objects.
in: body
required: true
type: array
restore_parameters:
description: |
The specified parameters for restore, it may include "``username``" and
"``password``" for target.
in: body
required: true
type: dict
restore_status:
description: |
The status of restore. A valid value is "``started``" "``success``" or
"``failed``".
in: body
required: true
type: string
restore_target:
description: |
The target of the restore operation.
in: body
required: true
type: string
schema_extended_info:
description: |
The extended info schema for provider.

View File

@ -0,0 +1,11 @@
{
"restore": {
"provider_id": "cf56bd3e-97a7-4078-b6d5-f36246333fd9",
"checkpoint_id": "dcb20606-ad71-40a3-80e4-ef0fafdad0c3",
"restore_target": "http://192.168.1.2:35357/v2.0/",
"parameters": {
"username": "admin",
"password": "secretadmin"
}
}
}

View File

@ -0,0 +1,14 @@
{
"restore": {
"id": "22b82aa7-9179-4c71-bba2-caf5c0e68db7",
"project_id": "e486a2f49695423ca9c47e589b948108",
"provider_id": "cf56bd3e-97a7-4078-b6d5-f36246333fd9",
"checkpoint_id": "dcb20606-ad71-40a3-80e4-ef0fafdad0c3",
"restore_target": "http://192.168.1.2:35357/v2.0/",
"parameters": {
"username": "admin",
"password": "***"
},
"status": "success"
}
}

View File

@ -0,0 +1,22 @@
{
"restores": [
{
"id": "22b82aa7-9179-4c71-bba2-caf5c0e68db7",
"project_id": "e486a2f49695423ca9c47e589b948108",
"provider_id": "cf56bd3e-97a7-4078-b6d5-f36246333fd9",
"checkpoint_id": "dcb20606-ad71-40a3-80e4-ef0fafdad0c3",
"restore_target": "http://192.168.1.2:35357/v2.0/",
"parameters": {
"username": "admin",
"password": "***"
},
"status": "success"
}
],
"restores_links": [
{
"href": "/v1/{project_id}/restores?limit={limit_num}&marker=22b82aa7-9179-4c71-bba2-caf5c0e68db7",
"rel": "next"
}
]
}