Merge "Add reactivate and deactivate methods for Image v2"

This commit is contained in:
Jenkins
2015-05-31 05:56:20 +00:00
committed by Gerrit Code Review
12 changed files with 96 additions and 0 deletions

View File

@@ -45,6 +45,14 @@
<wadl:method href="#updateImage-v2"/>
<wadl:method href="#deleteImage-v2"/>
</wadl:resource>
<wadl:resource
href="../wadls/image-api/src/v2/os-image-v2.wadl#reactivate">
<wadl:method href="#reactivateImage-v2"/>
</wadl:resource>
<wadl:resource
href="../wadls/image-api/src/v2/os-image-v2.wadl#deactivate">
<wadl:method href="#deactivateImage-v2"/>
</wadl:resource>
</wadl:resources>
</section>
<section xml:id="image-data-v2">

View File

@@ -42,6 +42,14 @@
<method href="#getImage-v2"/>
<method href="#updateImage-v2"/>
<method href="#deleteImage-v2"/>
<resource id="actions" path="actions">
<resource id="reactivate" path="reactivate">
<method href="#reactivateImage-v2"/>
</resource>
<resource id="deactivate" path="deactivate">
<method href="#deactivateImage-v2"/>
</resource>
</resource>
<resource id="file" path="file">
<method href="#storeImageFile-v2"/>
<method href="#getImageFile-v2"/>
@@ -499,6 +507,65 @@
</representation>
</response>
</method>
<method name="POST" id="reactivateImage-v2">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Reactivate image">
<para role="shortdesc">Reactivates a specified image.
(Since Image API v2.0.)
</para>
<para>
The reactivate operation returns an error if the image status is
not <code>active</code> or <code>deactivated</code>.
</para>
<para>Preconditions</para>
<itemizedlist>
<listitem>
<para>The specified image must exist.</para>
</listitem>
</itemizedlist>
</wadl:doc>
<response status="200">
<representation mediaType="application/json">
<wadl:doc xml:lang="EN"
xmlns="http://docbook.org/ns/docbook">
<xsdxt:code
href="samples/image-details-response.json"/>
</wadl:doc>
</representation>
</response>
</method>
<method name="POST" id="deactivateImage-v2">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Deactivate image">
<para role="shortdesc">Deactivates a specified image.
(Since Image API v2.0.)
</para>
<para>
If you try to download a deactivated image, the 403 Forbidden
error is returned. Also, image locations are not visible for
deactivated images unless the user is an administrative user.
</para>
<para>
The deactivate operation returns an error if the image status is
not <code>active</code> or <code>deactivated</code>.
</para>
<para>Preconditions</para>
<itemizedlist>
<listitem>
<para>The specified image must exist.</para>
</listitem>
</itemizedlist>
</wadl:doc>
<response status="200">
<representation mediaType="application/json">
<wadl:doc xml:lang="EN"
xmlns="http://docbook.org/ns/docbook">
<xsdxt:code
href="samples/image-details-deactivate-response.json"/>
</wadl:doc>
</representation>
</response>
</method>
<method name="DELETE" id="deleteImage-v2">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Delete image">

View File

@@ -0,0 +1,21 @@
{
"status": "deactivated",
"name": "cirros-0.3.2-x86_64-disk",
"tags": [],
"container_format": "bare",
"created_at": "2014-05-05T17:15:10Z",
"disk_format": "qcow2",
"updated_at": "2014-05-05T17:15:11Z",
"visibility": "public",
"self": "/v2/images/1bea47ed-f6a9-463b-b423-14b9cca9ad27",
"min_disk": 0,
"protected": false,
"id": "1bea47ed-f6a9-463b-b423-14b9cca9ad27",
"file": "/v2/images/1bea47ed-f6a9-463b-b423-14b9cca9ad27/file",
"checksum": "64d7c1cd2b6f60c92c14662941cb7913",
"owner": "5ef70662f8b34079a6eddb8da9d75fe8",
"size": 13167616,
"min_ram": 0,
"schema": "/v2/schemas/image",
"virtual_size": "None"
}

View File

View File