From 506aa1cf9c21b65cad4af9747c1d4e5fa29a9f9e Mon Sep 17 00:00:00 2001 From: zhongjun Date: Wed, 22 Nov 2017 11:18:28 +0800 Subject: [PATCH] Add count info in /shares and /shares/detail API doc Added support for display count info in share list and detail APIs Doc. Depends-On: I12c41a46140b04f26565d8934e0326480477c612 Partially-Implements bp add-amount-info-in-list-api Change-Id: I25c41a46190b04f26565d8934e0326480477c613 --- api-ref/source/parameters.yaml | 14 ++++++++++++++ .../samples/shares-list-detailed-response.json | 1 + api-ref/source/samples/shares-list-response.json | 1 + api-ref/source/shares.inc | 4 ++++ 4 files changed, 20 insertions(+) diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml index b5c2d1a43c..f68a3b7a51 100644 --- a/api-ref/source/parameters.yaml +++ b/api-ref/source/parameters.yaml @@ -516,6 +516,13 @@ user_id_query: in: query required: false type: string +with_count: + description: | + Whether to show ``count`` in API response or not, default is ``False``. + in: query + required: false + type: boolean + min_version: 2.42 zone_1: description: | The availability zone. @@ -940,6 +947,13 @@ consistent_snapshot_support: required: true type: string min_version: 2.34 +count: + description: | + The total count of requested resource before pagination is applied. + in: body + required: false + type: integer + min_version: 2.42 create_share_from_snapshot_support: description: | Boolean extra spec used for filtering of back ends by diff --git a/api-ref/source/samples/shares-list-detailed-response.json b/api-ref/source/samples/shares-list-detailed-response.json index 217c1df8ee..2db63d7e9f 100644 --- a/api-ref/source/samples/shares-list-detailed-response.json +++ b/api-ref/source/samples/shares-list-detailed-response.json @@ -78,4 +78,5 @@ "volume_type": "default", } ] + "count": 10 } diff --git a/api-ref/source/samples/shares-list-response.json b/api-ref/source/samples/shares-list-response.json index 3e148d5248..3ff7167348 100644 --- a/api-ref/source/samples/shares-list-response.json +++ b/api-ref/source/samples/shares-list-response.json @@ -29,4 +29,5 @@ "name": "Share1" } ] + "count": 10 } diff --git a/api-ref/source/shares.inc b/api-ref/source/shares.inc index 77a4b69dd8..035a684b50 100644 --- a/api-ref/source/shares.inc +++ b/api-ref/source/shares.inc @@ -119,6 +119,7 @@ Request - export_location_path: export_location_path_query - name~: name_inexact_query - description~: description_inexact_query + - with_count: with_count Response parameters ------------------- @@ -128,6 +129,7 @@ Response parameters - id: id_4 - links: links - name: name + - count: count Response example ---------------- @@ -174,6 +176,7 @@ Request - export_location_path: export_location_path_query - name~: name_inexact_query - description~: description_inexact_query + - with_count: with_count Response parameters ------------------- @@ -207,6 +210,7 @@ Response parameters - created_at: created_at_4 - share_proto: share_proto - volume_type: volume_type + - count: count Response example ----------------