manila/api-ref/source/share-metadata.inc
junboli acf8c99e9b Use rest_status_code for api-ref response codes
Rather than our freeform way of listing response codes in our
api-ref, we should be using the os-api-ref extension option to
get nicely formatted response code listings.

https://docs.openstack.org/os-api-ref/latest/usage.html#rest-status-code

Change-Id: Ibafafa2f9c3b301b5cdd9b1cb3b8b6d678faa731
2018-03-24 01:07:16 +00:00

186 lines
2.8 KiB
ReStructuredText

.. -*- rst -*-
==============
Share metadata
==============
Shows, sets, updates, and unsets share metadata.
Show share metadata
===================
.. rest_method:: GET /v2/{tenant_id}/shares/{share_id}/metadata
Shows the metadata for a share.
Response codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
- 404
Request
-------
.. rest_parameters:: parameters.yaml
- share_id: share_id
- tenant_id: tenant_id_path
Response parameters
-------------------
.. rest_parameters:: parameters.yaml
- metadata: metadata_3
Response example
----------------
.. literalinclude:: samples/share-show-metadata-response.json
:language: javascript
Set share metadata
==================
.. rest_method:: POST /v2/{tenant_id}/shares/{share_id}/metadata
Sets the metadata on a share.
Response codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
- 404
- 409
Request
-------
.. rest_parameters:: parameters.yaml
- metadata: metadata_2
- share_id: share_id
- tenant_id: tenant_id_path
Request example
---------------
.. literalinclude:: samples/share-set-metadata-request.json
:language: javascript
Response parameters
-------------------
.. rest_parameters:: parameters.yaml
- metadata: metadata
Response example
----------------
.. literalinclude:: samples/share-set-metadata-response.json
:language: javascript
Update share metadata
=====================
.. rest_method:: PUT /v2/{tenant_id}/shares/{share_id}/metadata
Updates the metadata for a share.
Response codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
- 404
Request
-------
.. rest_parameters:: parameters.yaml
- metadata: metadata_2
- share_id: share_id
- tenant_id: tenant_id_path
Request example
---------------
.. literalinclude:: samples/share-update-metadata-request.json
:language: javascript
Response parameters
-------------------
.. rest_parameters:: parameters.yaml
- metadata: metadata_3
Response example
----------------
.. literalinclude:: samples/share-update-metadata-response.json
:language: javascript
Unset share metadata
====================
.. rest_method:: DELETE /v2/{tenant_id}/shares/{share_id}/metadata/{key}
Un-sets the metadata on a share.
To unset a metadata key value, specify only the key name in the
URI.
Response codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
- 404
Request
-------
.. rest_parameters:: parameters.yaml
- share_id: share_id
- tenant_id: tenant_id_path
- key: metadata_key_request