Add GET servers API sorting REST API

Add sort_key and sort_dir discription
I add v2.1 only, if needed I plan to add v2 also.
But for v2 case, it need to existence "os-server-sort-keys" API.

Change-Id: I3d97652c925ef106421245a3a359b47949334240
Closes-Bug: #1398288
This commit is contained in:
Atsushi SAKAI 2015-08-10 19:43:43 +09:00 committed by Diane Fleming
parent e937f2a354
commit cafe8a20ae
3 changed files with 63 additions and 3 deletions

View File

@ -480,6 +480,62 @@
xml:lang="EN"> xml:lang="EN">
<para>Filters the results by a specified host name in string format.</para> <para>Filters the results by a specified host name in string format.</para>
</wadl:doc> </wadl:doc>
</param>
<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>
Sorts by the requested server attribute. Default is
<code>created</code>. You can specify multiple pairs of sort key and
sort direction query parameters. If you omit the sort direction in a
pair, the API uses the natural sorting direction of the server attribute
that is provided as the <code>sort_key</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. A valid value is <code>asc</code> (ascending) or
<code>desc</code> (descending). Default is <code>desc</code>. You can
specify multiple pairs of sort key and sort direction query parameters. If
you omit the sort direction in a pair, the API uses the natural sorting
direction of the server attribute that is provided as the
<code>sort_key</code>.
</para>
</wadl:doc>
</param>'>
<!-- Server Details Parameters -->
<!ENTITY serverListDetailsParameters '
<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>
Sorts by the requested server attribute. Default is
<code>created</code>. You can specify multiple pairs of sort key and
sort direction query parameters. If you omit the sort direction in a
pair, the API uses the natural sorting direction of the server attribute
that is provided as the <code>sort_key</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. A valid value is <code>asc</code> (ascending) or
<code>desc</code> (descending). Default is <code>desc</code>. You can
specify multiple pairs of sort key and sort direction query parameters. If
you omit the sort direction in a pair, the API uses the natural sorting
direction of the server attribute that is provided as the
<code>sort_key</code>.
</para>
</wadl:doc>
</param>'> </param>'>
<!-- Servers Extended Attributes Parameters --> <!-- Servers Extended Attributes Parameters -->
<!ENTITY GetListServersDetailQueryParameters ' <!ENTITY GetListServersDetailQueryParameters '

View File

@ -77,9 +77,15 @@
<method name="GET" id="returnListDetailServers"> <method name="GET" id="returnListDetailServers">
<wadl:doc xml:lang="EN" title="List details for servers" <wadl:doc xml:lang="EN" title="List details for servers"
xmlns="http://docbook.org/ns/docbook"> xmlns="http://docbook.org/ns/docbook">
<para role="shortdesc">List details for servers. <para role="shortdesc">
Lists details for servers.
</para> </para>
</wadl:doc> </wadl:doc>
<request>
<representation mediaType="application/json">
&serverListDetailsParameters;
</representation>
</request>
<response status="200"> <response status="200">
<representation mediaType="application/json"> <representation mediaType="application/json">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"> <wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook">

View File

@ -189,11 +189,9 @@
<wadl:doc xmlns="http://docbook.org/ns/docbook" <wadl:doc xmlns="http://docbook.org/ns/docbook"
xmlns:wadl="http://wadl.dev.java.net/2009/02" xml:lang="EN"> xmlns:wadl="http://wadl.dev.java.net/2009/02" xml:lang="EN">
<para> <para>
Sorts by one or more attribute and sort direction combinations. You can Sorts by one or more attribute and sort direction combinations. You can
also set multiple sort keys and directions. Default direction is also set multiple sort keys and directions. Default direction is
<code>desc</code>. <code>desc</code>.
</para> </para>
<para>For example:</para> <para>For example:</para>
<programlisting language="json">GET /v2/images?sort=name:asc,status:desc</programlisting> <programlisting language="json">GET /v2/images?sort=name:asc,status:desc</programlisting>