Merge "Add backups extension to volume API v2"

This commit is contained in:
Jenkins
2014-04-19 02:13:34 +00:00
committed by Gerrit Code Review
9 changed files with 612 additions and 1 deletions

View File

@@ -5,7 +5,8 @@
xmlns:linkend="http://www.w3.org/1999/linkend"
xmlns:xref="http://www.w3.org/1999/xref"
xmlns:wadl="http://wadl.dev.java.net/2009/02"
version="5.0-extension RackBook-2.0" xml:id="blockstorage-v2" role="api-reference">
version="5.0-extension RackBook-2.0" xml:id="blockstorage-v2"
role="api-reference">
<title>Block Storage API v2.0</title>
<para>Manage volumes and snapshots for use with the Block Storage
API, also known as cinder services.</para>
@@ -62,4 +63,27 @@
</wadl:resource>
</wadl:resources>
</section>
<section xml:id="backups">
<title>Backups extension</title>
<wadl:resources xmlns:wadl="http://wadl.dev.java.net/2009/02">
<wadl:resource
href="../wadls/volume-api/src/v2/volume-backups-api-v2.wadl#backups">
<wadl:method href="#createBackup"/>
<wadl:method href="#listBackups"/>
</wadl:resource>
<wadl:resource
href="../wadls/volume-api/src/v2/volume-backups-api-v2.wadl#detail">
<wadl:method href="#listBackupsDetails"/>
</wadl:resource>
<wadl:resource
href="../wadls/volume-api/src/v2/volume-backups-api-v2.wadl#backup_id">
<wadl:method href="#showBackup"/>
<wadl:method href="#deleteBackup"/>
</wadl:resource>
<wadl:resource
href="../wadls/volume-api/src/v2/volume-backups-api-v2.wadl#restore">
<wadl:method href="#restoreBackup"/>
</wadl:resource>
</wadl:resources>
</section>
</chapter>

View File

@@ -0,0 +1,8 @@
{
"backup":{
"container":null,
"description":null,
"name":"backup001",
"volume_id":"64f5d2fb-d836-4063-b7e2-544d5c1ff607"
}
}

View File

@@ -0,0 +1,16 @@
{
"backup":{
"id":"deac8b8c-35c9-4c71-acaa-889c2d5d5c8e",
"links":[
{
"href":"http://localhost:8776/v2/c95fc3e4afe248a49a28828f286a7b38/backups/deac8b8c-35c9-4c71-acaa-889c2d5d5c8e",
"rel":"self"
},
{
"href":"http://localhost:8776/c95fc3e4afe248a49a28828f286a7b38/backups/deac8b8c-35c9-4c71-acaa-889c2d5d5c8e",
"rel":"bookmark"
}
],
"name":"backup001"
}
}

View File

@@ -0,0 +1,50 @@
{
"backups":[
{
"availability_zone":"az1",
"container":"volumebackups",
"created_at":"2013-04-02T10:35:27.000000",
"description":null,
"fail_reason":null,
"id":"2ef47aee-8844-490c-804d-2a8efe561c65",
"links":[
{
"href":"http://localhost:8776/v1/c95fc3e4afe248a49a28828f286a7b38/backups/2ef47aee-8844-490c-804d-2a8efe561c65",
"rel":"self"
},
{
"href":"http://localhost:8776/c95fc3e4afe248a49a28828f286a7b38/backups/2ef47aee-8844-490c-804d-2a8efe561c65",
"rel":"bookmark"
}
],
"name":"backup001",
"object_count":22,
"size":1,
"status":"available",
"volume_id":"e5185058-943a-4cb4-96d9-72c184c337d6"
},
{
"availability_zone":"az1",
"container":"volumebackups",
"created_at":"2013-04-02T10:21:48.000000",
"description":null,
"fail_reason":null,
"id":"4dbf0ec2-0b57-4669-9823-9f7c76f2b4f8",
"links":[
{
"href":"http://localhost:8776/v1/c95fc3e4afe248a49a28828f286a7b38/backups/4dbf0ec2-0b57-4669-9823-9f7c76f2b4f8",
"rel":"self"
},
{
"href":"http://localhost:8776/c95fc3e4afe248a49a28828f286a7b38/backups/4dbf0ec2-0b57-4669-9823-9f7c76f2b4f8",
"rel":"bookmark"
}
],
"name":"backup002",
"object_count":22,
"size":1,
"status":"available",
"volume_id":"e5185058-943a-4cb4-96d9-72c184c337d6"
}
]
}

View File

@@ -0,0 +1,32 @@
{
"backups":[
{
"id":"2ef47aee-8844-490c-804d-2a8efe561c65",
"links":[
{
"href":"http://localhost:8776/v1/c95fc3e4afe248a49a28828f286a7b38/backups/2ef47aee-8844-490c-804d-2a8efe561c65",
"rel":"self"
},
{
"href":"http://localhost:8776/c95fc3e4afe248a49a28828f286a7b38/backups/2ef47aee-8844-490c-804d-2a8efe561c65",
"rel":"bookmark"
}
],
"name":"backup001"
},
{
"id":"4dbf0ec2-0b57-4669-9823-9f7c76f2b4f8",
"links":[
{
"href":"http://localhost:8776/v1/c95fc3e4afe248a49a28828f286a7b38/backups/4dbf0ec2-0b57-4669-9823-9f7c76f2b4f8",
"rel":"self"
},
{
"href":"http://localhost:8776/c95fc3e4afe248a49a28828f286a7b38/backups/4dbf0ec2-0b57-4669-9823-9f7c76f2b4f8",
"rel":"bookmark"
}
],
"name":"backup002"
}
]
}

View File

@@ -0,0 +1,5 @@
{
"restore":{
"volume_id":"64f5d2fb-d836-4063-b7e2-544d5c1ff607"
}
}

View File

@@ -0,0 +1,6 @@
{
"restore":{
"backup_id":"2ef47aee-8844-490c-804d-2a8efe561c65",
"volume_id":"795114e8-7489-40be-a978-83797f2c1dd3"
}
}

View File

@@ -0,0 +1,25 @@
{
"backup":{
"availability_zone":"az1",
"container":"volumebackups",
"created_at":"2013-04-02T10:35:27.000000",
"description":null,
"fail_reason":null,
"id":"2ef47aee-8844-490c-804d-2a8efe561c65",
"links":[
{
"href":"http://localhost:8776/v1/c95fc3e4afe248a49a28828f286a7b38/backups/2ef47aee-8844-490c-804d-2a8efe561c65",
"rel":"self"
},
{
"href":"http://localhost:8776/c95fc3e4afe248a49a28828f286a7b38/backups/2ef47aee-8844-490c-804d-2a8efe561c65",
"rel":"bookmark"
}
],
"name":"backup001",
"object_count":22,
"size":1,
"status":"available",
"volume_id":"e5185058-943a-4cb4-96d9-72c184c337d6"
}
}

View File

@@ -0,0 +1,445 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- (C) 2012-2014 OpenStack Foundation, All Rights Reserved -->
<application xmlns="http://wadl.dev.java.net/2009/02"
xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
xmlns:csapi="http://docs.openstack.org/api/openstack-block-storage/2.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wadl="http://wadl.dev.java.net/2009/02">
<resources base="https://volume.example.com/"
xml:id="volume-backups-v2">
<resource id="version" path="v2">
<resource id="tenant_id" path="{tenant_id}">
<param name="tenant_id" style="template"
type="xsd:string">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The unique identifier of the tenant or
account.</para></wadl:doc>
</param>
<resource id="backups" path="backups">
<method href="#createBackup"/>
<method href="#listBackups"/>
<resource path="detail" id="detail">
<method href="#listBackupsDetails"/>
</resource>
<resource path="{backup_id}" id="backup_id">
<param name="backup_id" style="template"
required="true" type="csapi:UUID">
<wadl:doc
xmlns="http://docbook.org/ns/docbook"
xml:lang="EN"><para>The unique
identifier for a
backup.</para></wadl:doc>
</param>
<method href="#showBackup"/>
<method href="#deleteBackup"/>
<resource path="restore" id="restore">
<method href="#restoreBackup"/>
</resource>
</resource>
</resource>
</resource>
</resource>
</resources>
<method name="POST" id="createBackup">
<wadl:doc xmlns="http://docbook.org/ns/docbook" xml:lang="EN"
title="Create backup">
<para role="shortdesc">Creates a Block Storage backup from
a volume.</para>
</wadl:doc>
<request>
<param name="backup" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>A <code>backup</code>
object.</para></wadl:doc>
</param>
<param name="container" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The container name or
null.</para></wadl:doc>
</param>
<param name="name" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The backup name.</para></wadl:doc>
</param>
<param name="description" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The backup description or
null.</para></wadl:doc>
</param>
<param name="volume_id" style="plain" type="csapi:uuid"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The ID of the volume that you want to back
up.</para></wadl:doc>
</param>
<representation mediaType="application/json">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<xsdxt:code
href="samples/backup_create_request.json"/>
</wadl:doc>
</representation>
</request>
<response status="202">
<param name="backup" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>A <code>backup</code>
object.</para></wadl:doc>
</param>
<param name="id" style="plain" type="csapi:uuid"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The ID of the backup.</para></wadl:doc>
</param>
<param name="links" style="plain" type="xsd:dict"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>Links for the backup.</para></wadl:doc>
</param>
<param name="name" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The backup name.</para></wadl:doc>
</param>
<representation mediaType="application/json">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<xsdxt:code
href="samples/backup_create_response.json"/>
</wadl:doc>
</representation>
</response>
</method>
<method name="GET" id="listBackups">
<wadl:doc xmlns="http://docbook.org/ns/docbook" xml:lang="EN"
title="List backups">
<para role="shortdesc">Lists backups defined in Block
Storage to which the tenant who submits the request
has access.</para>
</wadl:doc>
<response status="200">
<param name="backups" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>A <code>backups</code>
object.</para></wadl:doc>
</param>
<param name="id" style="plain" type="csapi:uuid"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The ID of the backup.</para></wadl:doc>
</param>
<param name="links" style="plain" type="xsd:dict"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>Links for the backup.</para></wadl:doc>
</param>
<param name="name" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The backup name.</para></wadl:doc>
</param>
<representation mediaType="application/json">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<xsdxt:code
href="samples/backup_list_simple_response.json"
/>
</wadl:doc>
</representation>
</response>
</method>
<method name="GET" id="listBackupsDetails">
<wadl:doc xmlns="http://docbook.org/ns/docbook" xml:lang="EN"
title="List backups (detailed)">
<para role="shortdesc">Lists detailed information for
backups defined in Block Storage to which the tenant
who submits the request has access.</para>
</wadl:doc>
<response status="200">
<param name="backups" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>A <code>backups</code>
object.</para></wadl:doc>
</param>
<param name="availability_zone" style="plain"
type="xsd:string" required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The availability zone.</para></wadl:doc>
</param>
<param name="container" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The container name or
null.</para></wadl:doc>
</param>
<param name="created_at" style="plain"
type="xsd:timestamp" required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The date and time when the backup was
created.</para></wadl:doc>
</param>
<param name="description" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The backup description or
null.</para></wadl:doc>
</param>
<param name="fail_reason" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>If the backup failed, the reason for the
failure. Otherwise, null.</para></wadl:doc>
</param>
<param name="id" style="plain" type="csapi:uuid"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The ID of the backup.</para></wadl:doc>
</param>
<param name="links" style="plain" type="xsd:dict"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>Links for the backup.</para></wadl:doc>
</param>
<param name="name" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The backup name.</para></wadl:doc>
</param>
<param name="object_count" style="plain" type="xsd:int"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The number of objects in the
backup.</para></wadl:doc>
</param>
<param name="size" style="plain" type="xsd:int"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The size of the backup, in
GB.</para></wadl:doc>
</param>
<param name="status" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The backup status, such as
available.</para></wadl:doc>
</param>
<param name="volume_id" style="plain" type="csapi:uuid"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The ID of the volume from which the backup
was created.</para></wadl:doc>
</param>
<representation mediaType="application/json">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<xsdxt:code
href="samples/backup_list_detail_response.json"
/>
</wadl:doc>
</representation>
</response>
</method>
<method name="GET" id="showBackup">
<wadl:doc xmlns="http://docbook.org/ns/docbook" xml:lang="EN"
title="Show backup details">
<para role="shortdesc">Shows details for a specified
backup.</para>
</wadl:doc>
<response status="200">
<param name="backup" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>A <code>backup</code>
object.</para></wadl:doc>
</param>
<param name="availability_zone" style="plain"
type="xsd:string" required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The availability zone.</para></wadl:doc>
</param>
<param name="container" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The container name or
null.</para></wadl:doc>
</param>
<param name="created_at" style="plain"
type="xsd:timestamp" required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The date and time when the backup was
created.</para></wadl:doc>
</param>
<param name="description" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The backup description or
null.</para></wadl:doc>
</param>
<param name="fail_reason" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>If the backup failed, the reason for the
failure. Otherwise, null.</para></wadl:doc>
</param>
<param name="id" style="plain" type="csapi:uuid"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The ID of the backup.</para></wadl:doc>
</param>
<param name="links" style="plain" type="xsd:dict"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>Links for the backup.</para></wadl:doc>
</param>
<param name="name" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The backup name.</para></wadl:doc>
</param>
<param name="object_count" style="plain" type="xsd:int"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The number of objects in the
backup.</para></wadl:doc>
</param>
<param name="size" style="plain" type="xsd:int"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The size of the backup, in
GB.</para></wadl:doc>
</param>
<param name="status" style="plain" type="xsd:string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The backup status, such as
available.</para></wadl:doc>
</param>
<param name="volume_id" style="plain" type="csapi:uuid"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<para>The ID of the volume from which the backup
was created.</para></wadl:doc>
</param>
<representation mediaType="application/json">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<xsdxt:code
href="samples/backup_show_response.json"/>
</wadl:doc>
</representation>
</response>
</method>
<method name="DELETE" id="deleteBackup">
<wadl:doc xmlns="http://docbook.org/ns/docbook" xml:lang="EN"
title="Delete backup">
<para role="shortdesc">Deletes a specified backup.</para>
</wadl:doc>
<response status="202"/>
</method>
<method name="POST" id="restoreBackup">
<wadl:doc xmlns="http://docbook.org/ns/docbook" xml:lang="EN"
title="Restore backup">
<para role="shortdesc">Restores a Block Storage backup to
an existing or new Block Storage volume.</para>
</wadl:doc>
<request>
<param name="restore" style="plain" type="string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN"><para>The <code>restore</code>
action.</para>
</wadl:doc>
</param>
<param name="volume_id" style="plain" type="string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN"><para>The ID of the volume to which
you want to restore a backup.</para>
</wadl:doc>
</param>
<representation mediaType="application/json">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<xsdxt:code
href="samples/backup_restore_request.json"/>
</wadl:doc>
</representation>
</request>
<response status="202">
<param name="restore" style="plain" type="string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN"><para>The <code>restore</code>
action.</para>
</wadl:doc>
</param>
<param name="backup_id" style="plain" type="string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN"><para>The ID of the backup.</para>
</wadl:doc>
</param>
<param name="volume_id" style="plain" type="string"
required="true">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN"><para>The ID of the volume to which
the backup was restored.</para>
</wadl:doc>
</param>
<representation mediaType="application/json">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xml:lang="EN">
<xsdxt:code
href="samples/backup_restore_response.json"/>
</wadl:doc>
</representation>
</response>
</method>
</application>