summaryrefslogtreecommitdiff
path: root/api-ref
diff options
context:
space:
mode:
authorMridula Joshi <mrjoshi@redhat.com>2022-01-12 13:01:15 +0000
committerAbhishek Kekane <akekane@redhat.com>2022-02-16 05:46:47 +0000
commita34764ecac0ab0c3dc8ecd2d923e05ee2275b72b (patch)
tree29ca5d40820ad3584162e7112138ccb89ff964ed /api-ref
parent88c43d47151dfb4818933d4c6b98731a2cc9b529 (diff)
downloadglance-a34764ecac0ab0c3dc8ecd2d923e05ee2275b72b.tar.gz
Added a new API to expose store info
This patch adds a new API to glance ``GET /v2/info/stores/detail`` to expose the stores specific details about the store like store type and other specific store properties.This operation will be admin only and validated by the new policy rule ``stores_info_detail`` which defaults to admin only Implements: blueprint expose-store-specific-info Change-Id: I6882fd2381e6ae245fd8c61bf9f4d52df2b216f5
Diffstat (limited to 'api-ref')
-rw-r--r--api-ref/source/v2/discovery-parameters.yaml25
-rw-r--r--api-ref/source/v2/discovery.inc36
-rw-r--r--api-ref/source/v2/samples/stores-list-detail-response.json19
3 files changed, 80 insertions, 0 deletions
diff --git a/api-ref/source/v2/discovery-parameters.yaml b/api-ref/source/v2/discovery-parameters.yaml
index b4b4d3d6e..205d6378e 100644
--- a/api-ref/source/v2/discovery-parameters.yaml
+++ b/api-ref/source/v2/discovery-parameters.yaml
@@ -18,3 +18,28 @@ stores:
in: body
required: true
type: array
+stores-detail:
+ description: |
+ A list of store objects, where each store object may contain the
+ following fields:
+
+ ``id``
+ Operator-defined identifier for the store.
+ ``type``
+ Specify the type of store.
+ ``description``
+ Operator-supplied description of this store.
+ ``default`` (optional)
+ Only present on the default store. This is the store where image
+ data is placed if you do not indicate a specific store when supplying
+ data to the Image Service. (See the :ref:`Image data <image-data>`
+ and :ref:`Interoperable image import <image-import-process>` sections
+ for more information.)
+ ``read-only`` (optional)
+ Included only when the store is read only.
+ ``properties``
+ Contains store specific properties
+ in: body
+ required: true
+ type: array
+
diff --git a/api-ref/source/v2/discovery.inc b/api-ref/source/v2/discovery.inc
index 134428024..e1401bd83 100644
--- a/api-ref/source/v2/discovery.inc
+++ b/api-ref/source/v2/discovery.inc
@@ -126,3 +126,39 @@ Response Example
.. literalinclude:: samples/usage-response.json
:language: json
+
+List stores detail
+~~~~~~~~~~~~~~~~~~
+
+.. rest_method:: GET /v2/info/stores/detail
+
+Lists all the backend stores, with detail, accessible to admins,
+for non-admin user API will return bad request.
+
+Normal response codes: 200
+
+Error response codes: 403, 404
+
+
+Request
+-------
+
+There are no request parameters.
+
+This call does not allow a request body.
+
+
+Response Parameters
+-------------------
+
+.. rest_parameters:: discovery-parameters.yaml
+
+ - stores: stores-detail
+
+
+Response Example
+----------------
+
+.. literalinclude:: samples/stores-list-detail-response.json
+ :language: json
+
diff --git a/api-ref/source/v2/samples/stores-list-detail-response.json b/api-ref/source/v2/samples/stores-list-detail-response.json
new file mode 100644
index 000000000..f377518f5
--- /dev/null
+++ b/api-ref/source/v2/samples/stores-list-detail-response.json
@@ -0,0 +1,19 @@
+{
+ "stores": [
+ {
+ "id":"reliable",
+ "type": "rbd",
+ "description": "More expensive store with data redundancy",
+ "default": true,
+ "properties": {
+ "pool": "pool1"
+ }
+ },
+ {
+ "id":"cheap",
+ "type": "file",
+ "description": "Less expensive store for seldom-used images",
+ "properties": {}
+ }
+ ]
+}