Merge "Update image sort flag documentation"

This commit is contained in:
Jenkins 2015-08-07 13:47:47 +00:00 committed by Gerrit Code Review
commit 16abccb7e2
2 changed files with 51 additions and 14 deletions

View File

@ -164,12 +164,13 @@
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. Results will be sorted by the requested image
attribute. Accepted values are <code>name</code>,
<code>status</code>, <code>container_format</code>,
<code>disk_format</code>, <code>size</code>,
<code>id</code>, <code>created_at</code>, and
<code>updated_at</code>. Default is <code>created_at</code>.
<para>
Sorts by the requested image attribute. Accepted values are
<code>name</code>, <code>status</code>, <code>container_format</code>,
<code>disk_format</code>, <code>size</code>, <code>id</code>,
<code>created_at</code>, and <code>updated_at</code>. Default is
<code>created_at</code>. The API uses the natural sorting direction of
the image attribute that is provided as the <code>sort_key</code>.
</para>
</wadl:doc>
</param>
@ -178,11 +179,26 @@
<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>.
Sorts by one or more sets of attribute and sort direction combinations.
If you omit the sort direction in a set, default is <code>desc</code>.
</para>
</wadl:doc>
</param>
<param xmlns="http://wadl.dev.java.net/2009/02" name="sort"
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 one or more attribute and sort direction combinations. You can
also set multiple sort keys and directions. Default direction is
<code>desc</code>.
</para>
<para>For example:</para>
<programlisting language="json">GET /v2/images?sort=name:asc,status:desc</programlisting>
</wadl:doc>
</param>
<param xmlns="http://wadl.dev.java.net/2009/02" name="tag"
style="query" required="false" type="xsd:string" default="ALL">
<wadl:doc xmlns="http://docbook.org/ns/docbook"

View File

@ -148,16 +148,37 @@
filters the container to include only images that are
between 1 and 4 MB.
</para>
<para>You can sort the results of this operation by using
the <code>sort_key</code> and <code>sort_dir</code>
parameters. The API uses the natural sorting of
whatever image attribute is provided as the
<code>sort_key</code>.
</para>
<para>You can see a list of VM images which status is in
<code>active</code>, <code>queued</code>, or
<code>saving</code>.
</para>
<para>
You can use query parameters to sort the results of this operation.
</para>
<itemizedlist>
<listitem>
<para>
<code>sort_key</code>. Sorts by the requested image
attribute. Sorts in the natural sorting direction of the image attribute that
is provided as the <code>sort_key</code>.
</para>
</listitem>
<listitem><para><code>sort_dir</code>. Sorts in a specified sort direction.</para></listitem>
<listitem>
<para>
<code>sort</code>. Sorts by one or more sets of attribute
and sort direction combinations. If you omit the sort direction in a set,
default is <code>desc</code>.
</para>
</listitem>
</itemizedlist>
<para>To specify the <code>sort_key</code> and
<code>sort_dir</code> query parameters to sort the results:
</para>
<programlisting language="json">GET /v2/images?sort_key=name&amp;sort_dir=asc&amp;sort_key=status&amp;sort_dir=desc</programlisting>
<para>To specify the <code>sort</code> query parameter to sort the results:
</para>
<programlisting language="json">GET /v2/images?sort=name:asc,status:desc</programlisting>
</wadl:doc>
<request>
<representation mediaType="application/json">