From be7b20ba836196f378d450556a09b7585d09d6af Mon Sep 17 00:00:00 2001 From: Atsushi SAKAI Date: Tue, 4 Aug 2015 22:01:14 +0900 Subject: [PATCH] Update image sort flag documentation multiple sort_key 1405184 sort dir each key 1431682 new syntax sort 1431756 Change-Id: I81f4114f801f779bc80cfe592e979eaf91aec645 Closes-Bug: #1405184 Closes-Bug: #1431682 Closes-Bug: #1431756 --- api-ref/src/wadls/image-api/src/v2/common.ent | 32 +++++++++++++----- .../wadls/image-api/src/v2/os-image-v2.wadl | 33 +++++++++++++++---- 2 files changed, 51 insertions(+), 14 deletions(-) diff --git a/api-ref/src/wadls/image-api/src/v2/common.ent b/api-ref/src/wadls/image-api/src/v2/common.ent index 276a1c17b..4a77ec2d2 100644 --- a/api-ref/src/wadls/image-api/src/v2/common.ent +++ b/api-ref/src/wadls/image-api/src/v2/common.ent @@ -164,12 +164,13 @@ style="query" required="false" type="xsd:string" default="ALL"> - Sort key. Results will be sorted by the requested image - attribute. Accepted values are name, - status, container_format, - disk_format, size, - id, created_at, and - updated_at. Default is created_at. + + Sorts by the requested image attribute. Accepted values are + name, status, container_format, + disk_format, size, id, + created_at, and updated_at. Default is + created_at. The API uses the natural sorting direction of + the image attribute that is provided as the sort_key. @@ -178,11 +179,26 @@ - Sort direction. A valid value is asc (ascending) or - desc (descending). Default is desc. + Sorts by one or more sets of attribute and sort direction combinations. + If you omit the sort direction in a set, default is desc. + + + + + Sorts by one or more attribute and sort direction combinations. You can + also set multiple sort keys and directions. Default direction is + desc. + + + For example: + GET /v2/images?sort=name:asc,status:desc + + - You can sort the results of this operation by using - the sort_key and sort_dir - parameters. The API uses the natural sorting of - whatever image attribute is provided as the - sort_key. - You can see a list of VM images which status is in active, queued, or saving. + + You can use query parameters to sort the results of this operation. + + + + + sort_key. Sorts by the requested image + attribute. Sorts in the natural sorting direction of the image attribute that + is provided as the sort_key. + + + sort_dir. Sorts in a specified sort direction. + + + sort. Sorts by one or more sets of attribute + and sort direction combinations. If you omit the sort direction in a set, + default is desc. + + + + To specify the sort_key and + sort_dir query parameters to sort the results: + + GET /v2/images?sort_key=name&sort_dir=asc&sort_key=status&sort_dir=desc + To specify the sort query parameter to sort the results: + + GET /v2/images?sort=name:asc,status:desc