Merge "Add documentation for Glance Metadata Definitions Catalog - Tags"

This commit is contained in:
Jenkins 2015-05-13 23:21:20 +00:00 committed by Gerrit Code Review
commit bceb389a4d
13 changed files with 579 additions and 57 deletions

View File

@ -189,6 +189,26 @@
</wadl:resource>
</wadl:resources>
</section>
<section xml:id="os-metadef-tag-v2">
<title>Metadata definition tags</title>
<para>
Creates, lists, gets details for, updates, and deletes metadata
definition tags. (Since API v2.0.)
</para>
<wadl:resources xmlns:wadl="http://wadl.dev.java.net/2009/02">
<wadl:resource href="../wadls/image-api/src/v2/os-metadef-tag-v2.wadl#tags">
<wadl:method href="#createTags-v2"/>
<wadl:method href="#listTags-v2"/>
<wadl:method href="#deleteAllTags-v2"/>
</wadl:resource>
<wadl:resource href="../wadls/image-api/src/v2/os-metadef-tag-v2.wadl#tag_name">
<wadl:method href="#addTag-v2"/>
<wadl:method href="#getTag-v2"/>
<wadl:method href="#updateTag-v2"/>
<wadl:method href="#deleteTag-v2"/>
</wadl:resource>
</wadl:resources>
</section>
<section xml:id="os-metadef-schemas-v2">
<title>Metadata definition schemas</title>
<para>
@ -221,6 +241,14 @@
<wadl:method href="#getMetadefPropertiesSchema"/>
</wadl:resource>
<wadl:resource
href="../wadls/image-api/src/v2/os-metadef-schemas-v2.wadl#tag">
<wadl:method href="#getMetadefTagSchema"/>
</wadl:resource>
<wadl:resource
href="../wadls/image-api/src/v2/os-metadef-schemas-v2.wadl#tags">
<wadl:method href="#getMetadefTagsSchema"/>
</wadl:resource>
<wadl:resource
href="../wadls/image-api/src/v2/os-metadef-schemas-v2.wadl#resource_type">
<wadl:method href="#getMetadefResTypeAssocSchema"/>
</wadl:resource>

View File

@ -887,4 +887,40 @@
empty schema (anything goes).
</para>
</wadl:doc>
</param>'>
<!ENTITY metadefTagsParameter '
<param xmlns="http://wadl.dev.java.net/2009/02" name="tags"
style="plain" required="true" type="xsd:string">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xmlns:wadl="http://wadl.dev.java.net/2009/02" xml:lang="EN">
<para>A list of <code>tag</code> dictionary objects.</para>
</wadl:doc>
</param>'>
<!ENTITY metadefTagNameParameter '
<param xmlns="http://wadl.dev.java.net/2009/02" name="name"
style="plain" required="true" type="xsd:string">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xmlns:wadl="http://wadl.dev.java.net/2009/02" xml:lang="EN">
<para>Name of the <code>tag</code>.</para>
</wadl:doc>
</param>'>
<!ENTITY metadefTagListSortParameters '
<param xmlns="http://wadl.dev.java.net/2009/02" name="sort_key"
style="query" required="false" type="xsd:string" default="ALL">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xmlns:wadl="http://wadl.dev.java.net/2009/02" xml:lang="EN">
<para>Sort key. Use attributes like <code>name</code>
for sorting. Default is <code>created_at</code>.
</para>
</wadl:doc>
</param>
<param xmlns="http://wadl.dev.java.net/2009/02" name="sort_dir"
style="query" required="false" type="xsd:string" default="ALL">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xmlns:wadl="http://wadl.dev.java.net/2009/02" xml:lang="EN">
<para>Sort direction. Valid values are <code>asc</code>
(ascending) and <code>desc</code> (descending). Default is
<code>desc</code>.
</para>
</wadl:doc>
</param>'>

View File

@ -59,6 +59,14 @@
path="properties">
<method href="#getMetadefPropertiesSchema"/>
</resource>
<resource id="tag" type="#SchemaList"
path="tag">
<method href="#getMetadefTagSchema"/>
</resource>
<resource id="tags" type="#SchemaList"
path="tags">
<method href="#getMetadefTagsSchema"/>
</resource>
<resource id="resource_type" type="#SchemaList"
path="resource_type">
<method href="#getMetadefResTypeAssocSchema"/>
@ -78,12 +86,15 @@
<method name="GET" id="getMetadefNamespaceSchema">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Get Metadata definition namespace schema">
<para role="shortdesc">Gets a json-schema document that
represents a metadata definition namespace entity. (Since API v2.1.)</para>
<para>The following schema is solely an example. Consider
only the response to the API call as
authoritative.</para>
title="Get metadata definition namespace schema">
<para role="shortdesc">
Gets a JSON schema document that represents a metadata
definition namespace entity. (Since API v2.1.)
</para>
<para>
The following schema document is an example. The authoritative
response is the actual response to the API call.
</para>
</wadl:doc>
<response status="200">
<representation mediaType="application/json">
@ -98,14 +109,18 @@
</method>
<method name="GET" id="getMetadefNamespacesSchema">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Get Metadata definition namespaces schema">
<para role="shortdesc">Gets a json-schema document that
represents a metadata definition namespace(s) entity. (Since API v2.1.)</para>
<para>A namespaces entity is a container of namespace
entities.</para>
<para>The following schema is solely an example. Consider
only the response to the API call as
authoritative.</para>
title="Get metadata definition namespaces schema">
<para role="shortdesc">
Gets a JSON schema document that represents a metadata
definition namespaces entity. (Since API v2.1.)
</para>
<para>
A namespaces entity is a container for namespace entities.
</para>
<para>
The following schema document is an example. The authoritative
response is the actual response to the API call.
</para>
</wadl:doc>
<response status="200">
<representation mediaType="application/json">
@ -120,12 +135,15 @@
</method>
<method name="GET" id="getMetadefObjectSchema">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Get Metadata definition object schema">
<para role="shortdesc">Gets a json-schema document that
represents a metadata definition object entity. (Since API v2.1.)</para>
<para>The following schema is solely an example. Consider
only the response to the API call as
authoritative.</para>
title="Get metadata definition object schema">
<para role="shortdesc">
Gets a JSON schema document that represents a metadata
definition object entity. (Since API v2.1.)
</para>
<para>
The following schema document is an example. The authoritative
response is the actual response to the API call.
</para>
</wadl:doc>
<response status="200">
<representation mediaType="application/json">
@ -140,14 +158,18 @@
</method>
<method name="GET" id="getMetadefObjectsSchema">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Get Metadata definition objects schema">
<para role="shortdesc">Gets a json-schema document that
represents a metadata definition object(s) entity. (Since API v2.1.)</para>
<para>An objects entity is a container of object
entities.</para>
<para>The following schema is solely an example. Consider
only the response to the API call as
authoritative.</para>
title="Get metadata definition objects schema">
<para role="shortdesc">
Gets a JSON schema document that represents a metadata
definition objects entity. (Since API v2.1.)
</para>
<para>
An objects entity is a container for object entities.
</para>
<para>
The following schema document is an example. The authoritative
response is the actual response to the API call.
</para>
</wadl:doc>
<response status="200">
<representation mediaType="application/json">
@ -162,12 +184,15 @@
</method>
<method name="GET" id="getMetadefPropertySchema">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Get Metadata definition property schema">
<para role="shortdesc">Gets a json-schema document that
represents a metadata definition property entity. (Since API v2.1.)</para>
<para>The following schema is solely an example. Consider
only the response to the API call as
authoritative.</para>
title="Get metadata definition property schema">
<para role="shortdesc">
Gets a JSON schema document that represents a metadata
definition property entity. (Since API v2.1.)
</para>
<para>
The following schema document is an example. The authoritative
response is the actual response to the API call.
</para>
</wadl:doc>
<response status="200">
<representation mediaType="application/json">
@ -182,14 +207,18 @@
</method>
<method name="GET" id="getMetadefPropertiesSchema">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Get Metadata definition properties schema">
<para role="shortdesc">Gets a json-schema document that
represents a metadata definition properties entity. (Since API v2.1.)</para>
<para>An properties entity is a container of property
entities.</para>
<para>The following schema is solely an example. Consider
only the response to the API call as
authoritative.</para>
title="Get metadata definition properties schema">
<para role="shortdesc">
Gets a JSON schema document that represents a metadata
definition properties entity. (Since API v2.1.)
</para>
<para>
A properties entity is a container for property entities.
</para>
<para>
The following schema document is an example. The authoritative
response is the actual response to the API call.
</para>
</wadl:doc>
<response status="200">
<representation mediaType="application/json">
@ -202,17 +231,67 @@
</representation>
</response>
</method>
<method name="GET" id="getMetadefTagSchema">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Get metadata definition tag schema">
<para role="shortdesc">
Gets a JSON schema document that represents a metadata
definition tag entity. (Since API v2.1.)
</para>
<para>
The following schema document is an example. The authoritative
response is the actual response to the API call.
</para>
</wadl:doc>
<response status="200">
<representation mediaType="application/json">
<wadl:doc xml:lang="EN"
xmlns="http://docbook.org/ns/docbook">
<xsdxt:code
href="samples/schema-metadef-tag-get-response.json"
/>
</wadl:doc>
</representation>
</response>
</method>
<method name="GET" id="getMetadefTagsSchema">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Get metadata definition tags schema">
<para role="shortdesc">
Gets a JSON schema document that represents a metadata
definition tags entity. (Since API v2.1.)
</para>
<para>
A tags entity is a container for tag entities.
</para>
<para>
The following schema document is an example. The authoritative
response is the actual response to the API call.
</para>
</wadl:doc>
<response status="200">
<representation mediaType="application/json">
<wadl:doc xml:lang="EN"
xmlns="http://docbook.org/ns/docbook">
<xsdxt:code
href="samples/schema-metadef-tags-get-response.json"
/>
</wadl:doc>
</representation>
</response>
</method>
<method name="GET" id="getMetadefResTypeAssocSchema">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Get Metadata definition namespace resource type association schema">
title="Get metadata definition namespace resource type association schema">
<para role="shortdesc">
Gets a json-schema document that represents a metadata
definition namespace resource type association entity. (Since
API v2.1.)
Gets a JSON schema document that represents a metadata
definition namespace resource type association entity.
(Since API v2.1.)
</para>
<para>
The following schema document is an example. The authoritative
response is the actual response to the API call.
</para>
<para>The following schema is solely an example. Consider
only the response to the API call as
authoritative.</para>
</wadl:doc>
<response status="200">
<representation mediaType="application/json">
@ -227,17 +306,20 @@
</method>
<method name="GET" id="getMetadefResTypeAssocsSchema">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Get Metadata definition namespace resource type association(s) schema">
title="Get metadata definition namespace resource type associations schema">
<para role="shortdesc">
Gets a json-schema document that represents a metadata
definition namespace resource type association(s) entity.
Gets a JSON schema document that represents a metadata
definition namespace resource type associations entity.
(Since API v2.1.)
</para>
<para>A resource type associations entity is a container of resource type association
entities.</para>
<para>The following schema is solely an example. Consider
only the response to the API call as
authoritative.</para>
<para>
A resource type associations entity is a container for
resource type association entities.
</para>
<para>
The following schema document is an example. The authoritative
response is the actual response to the API call.
</para>
</wadl:doc>
<response status="200">
<representation mediaType="application/json">

View File

@ -0,0 +1,246 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- (C) 2015 OpenStack Foundation, All Rights Reserved -->
<!--*******************************************************-->
<!-- Import Common XML Entities -->
<!-- -->
<!-- You can resolve the entities with xmllint -->
<!-- -->
<!-- xmllint -noent os-image-2.2.wadl -->
<!--*******************************************************-->
<!DOCTYPE application [
<!ENTITY % common SYSTEM "common.ent">
%common;
<!ENTITY % common_project SYSTEM "../../../common_project.ent">
%common_project;
]>
<application xmlns="http://wadl.dev.java.net/2009/02"
xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
xmlns:db="http://docbook.org/ns/docbook"
xmlns:common="http://docs.openstack.org/common/api/v1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wadl="http://wadl.dev.java.net/2009/02"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:imageapi="http://docs.openstack.org/image/api/v2"
xmlns:csapi="http://docs.openstack.org/image/api/v2">
<grammars>
<include href="xsd/api.xsd"/>
<include href="xsd/api-common.xsd"/>
</grammars>
<!--*******************************************************-->
<!-- All Resources -->
<!--*******************************************************-->
<resources base="https://glance.example.com/"
xml:id="os-metadef-tag-v2">
<resource id="v2" path="//v2">
<resource id="metadefs" path="metadefs">
<resource id="namespaces" path="namespaces">
<resource path="{namespace}" id="namespace">
<resource id="tags" type="#TagList" path="tags">
<method href="#createTags-v2"/>
<method href="#listTags-v2"/>
<method href="#deleteAllTags-v2"/>
<resource path="{name}" id="tag_name">
<method href="#addTag-v2"/>
<method href="#getTag-v2"/>
<method href="#updateTag-v2"/>
<method href="#deleteTag-v2"/>
</resource>
</resource>
</resource>
</resource>
</resource>
</resource>
</resources>
<!--*******************************************************-->
<!-- All Methods -->
<!--*******************************************************-->
<!-- Property methods -->
<method name="POST" id="createTags-v2">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Create tags">
<para role="shortdesc">
Creates one or more tag definitions in a specified namespace.
</para>
</wadl:doc>
<request>
<representation mediaType="application/json">
<wadl:doc xml:lang="EN"
xmlns="http://docbook.org/ns/docbook">
<xsdxt:code
href="samples/metadef-tag-create-req.json"/>
</wadl:doc>
&metadefNamespaceParameter;
&metadefTagsParameter;
&metadefTagNameParameter;
</representation>
</request>
<response status="201">
<representation mediaType="application/json">
<wadl:doc xml:lang="EN"
xmlns="http://docbook.org/ns/docbook">
<xsdxt:code
href="samples/metadef-tag-create-response.json"/>
</wadl:doc>
&metadefTagsParameter;
&metadefTagNameParameter;
</representation>
</response>
</method>
<method name="GET" id="listTags-v2">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="List tags">
<para role="shortdesc">Lists the tag definitions within
a namespace.</para>
<para>To manually paginate through the list of tags, use
the <code>limit</code> and <code>marker</code>
parameters.</para>
<para>To sort the results of this operation use the
<code>sort_key</code> and <code>sort_dir</code> parameters.
The API uses the natural sort order of the tag attribute
of the specified <code>sort_key</code> parameter.</para>
</wadl:doc>
<request>
<representation mediaType="application/json">
&metadefNamespaceParameter;
&limitMarkerReqParameter;
&metadefTagListSortParameters; </representation>
</request>
<response status="200">
<representation mediaType="application/json">
<wadl:doc xml:lang="EN"
xmlns="http://docbook.org/ns/docbook">
<xsdxt:code
href="samples/metadef-tag-list-response.json"/>
</wadl:doc>
&metadefTagsParameter;
&metadefTagNameParameter;
</representation>
</response>
</method>
<method name="DELETE" id="deleteAllTags-v2">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Delete all tag definitions">
<para role="shortdesc">
Deletes all tag definitions within a namespace.
</para>
<para>
You cannot delete tags in a namespace with the 'protected'
attribute set to true (boolean); the response returns
the HTTP 403 status code.
</para>
<para>
You must first set the <code>protected</code> attribute to
false (boolean) on the namespace and then perform the delete.
The response is empty and returns the HTTP 204 status code.
</para>
</wadl:doc>
<request>
<representation mediaType="application/json">
&metadefNamespaceParameter;
</representation>
</request>
<response status="204"/>
<response status="403"/>
</method>
<method name="POST" id="addTag-v2">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Add tag definition">
<para role="shortdesc">
Adds a specified tag to the list of namespace tag definitions.
</para>
</wadl:doc>
<request>
<representation mediaType="application/json">
&metadefNamespaceParameter;
&metadefTagNameParameter;
</representation>
</request>
<response status="200">
<representation mediaType="application/json">
<wadl:doc xml:lang="EN"
xmlns="http://docbook.org/ns/docbook">
<xsdxt:code
href="samples/metadef-tag-add-response.json"/>
</wadl:doc> &metadefTagNameParameter;
</representation>
</response>
</method>
<method name="GET" id="getTag-v2">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Get tag definition">
<para role="shortdesc">Gets a definition for the specified tag.
</para>
<para>The response body shows a single tag entity.</para>
</wadl:doc>
<request>
<representation mediaType="application/json">
&metadefNamespaceParameter;
&metadefTagNameParameter;
</representation>
</request>
<response status="200">
<representation mediaType="application/json">
<wadl:doc xml:lang="EN"
xmlns="http://docbook.org/ns/docbook">
<xsdxt:code
href="samples/metadef-tag-details-response.json"/>
</wadl:doc> &metadefTagNameParameter;
</representation>
</response>
</method>
<method name="PUT" id="updateTag-v2">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Update tag definition">
<para role="shortdesc">
Renames a specified tag definition.
</para>
</wadl:doc>
<request>
<representation mediaType="application/json">
<wadl:doc xml:lang="EN"
xmlns="http://docbook.org/ns/docbook">
<xsdxt:code href="samples/metadef-tag-update-req.json"/>
</wadl:doc>
&metadefNamespaceParameter;
&metadefTagNameParameter;
</representation>
</request>
<response status="200">
<representation mediaType="application/json">
<wadl:doc xml:lang="EN"
xmlns="http://docbook.org/ns/docbook">
<xsdxt:code
href="samples/metadef-tag-update-response.json"/>
</wadl:doc>
&metadefTagNameParameter;
</representation>
</response>
</method>
<method name="DELETE" id="deleteTag-v2">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Delete tag definition">
<para role="shortdesc">
Deletes a specified tag definition within a namespace.
</para>
<para>
You cannot delete tags in a namespace with the 'protected'
attribute set to true (boolean); the response returns
the HTTP 403 status code.
</para>
<para>
You must first set the <code>protected</code> attribute to
false (boolean) on the namespace and then perform the delete.
The response is empty and returns the HTTP 204 status code.
</para>
</wadl:doc>
<request>
<representation mediaType="application/json">
&metadefNamespaceParameter;
&metadefTagNameParameter;
</representation>
</request>
<response status="204"/>
<response status="403"/>
</method>
</application>

View File

@ -0,0 +1,5 @@
{
"created_at": "2015-05-09T01:12:31Z",
"name": "added-sample-tag",
"updated_at": "2015-05-09T01:12:31Z"
}

View File

@ -0,0 +1,13 @@
{
"tags": [
{
"name": "sample-tag1"
},
{
"name": "sample-tag2"
},
{
"name": "sample-tag3"
}
]
}

View File

@ -0,0 +1,13 @@
{
"tags": [
{
"name": "sample-tag1"
},
{
"name": "sample-tag2"
},
{
"name": "sample-tag3"
}
]
}

View File

@ -0,0 +1,5 @@
{
"created_at": "2015-05-06T23:16:12Z",
"name": "sample-tag2",
"updated_at": "2015-05-06T23:16:12Z"
}

View File

@ -0,0 +1,13 @@
{
"tags": [
{
"name": "sample-tag1"
},
{
"name": "sample-tag2"
},
{
"name": "sample-tag3"
}
]
}

View File

@ -0,0 +1,3 @@
{
"name": "new-tag-name"
}

View File

@ -0,0 +1,3 @@
{
"name": "new-tag-name"
}

View File

@ -0,0 +1,22 @@
{
"additionalProperties": false,
"required": [
"name"
],
"name": "tag",
"properties": {
"created_at": {
"type": "string",
"description": "Date and time of tag creation (READ-ONLY)",
"format": "date-time"
},
"name": {
"type": "string"
},
"updated_at": {
"type": "string",
"description": "Date and time of the last tag modification (READ-ONLY)",
"format": "date-time"
}
}
}

View File

@ -0,0 +1,53 @@
{
"name": "tags",
"links": [
{
"href": "{first}",
"rel": "first"
},
{
"href": "{next}",
"rel": "next"
},
{
"href": "{schema}",
"rel": "describedby"
}
],
"properties": {
"next": {
"type": "string"
},
"schema": {
"type": "string"
},
"first": {
"type": "string"
},
"tags": {
"items": {
"additionalProperties": false,
"required": [
"name"
],
"name": "tag",
"properties": {
"created_at": {
"type": "string",
"description": "Date and time of tag creation (READ-ONLY)",
"format": "date-time"
},
"name": {
"type": "string"
},
"updated_at": {
"type": "string",
"description": "Date and time of the last tag modification (READ-ONLY)",
"format": "date-time"
}
}
},
"type": "array"
}
}
}