Fix Consumer API Reference Docs

Resolves some errors in the Consumer API Reference Documentation
including improper requests and missing headers. Also Updates
response codes.

Depends-On: Ib038047dc1b96194ea1b5ff63ae58b5c78d05ffd
Related-Bug: #1660074
Change-Id: I6f1af0b95d3800bf182f4d6bebcdebb8eb60ddd7
This commit is contained in:
Fernando Diaz
2017-01-27 06:30:27 +00:00
parent 8b93051df7
commit 773feeace4
2 changed files with 25 additions and 16 deletions

View File

@@ -104,7 +104,7 @@ This will return the following response:
{ {
"total": 3, "total": 3,
"next": "http://localhost:9311/v1/consumers?limit=1&offset=2", "next": "http://localhost:9311/v1/containers/74bbd3fd-9ba8-42ee-b87e-2eecf10e47b9/consumers?limit=1&offset=2",
"consumers": [ "consumers": [
{ {
"status": "ACTIVE", "status": "ACTIVE",
@@ -114,7 +114,7 @@ This will return the following response:
"created": "2015-10-15T21:17:08.092408" "created": "2015-10-15T21:17:08.092408"
} }
], ],
"previous": "http://localhost:9311/v1/consumers?limit=1&offset=0" "previous": "http://localhost:9311/v1/containers/74bbd3fd-9ba8-42ee-b87e-2eecf10e47b9/consumers?limit=1&offset=0"
} }
.. _delete_consumer: .. _delete_consumer:

View File

@@ -72,7 +72,7 @@ Request:
.. code-block:: javascript .. code-block:: javascript
GET {container_ref}/consumers?limit=1&offset=1 GET {container_ref}/consumers?limit=1\&offset=1
Headers: Headers:
X-Auth-Token: <token> X-Auth-Token: <token>
@@ -80,7 +80,7 @@ Request:
{ {
"total": 3, "total": 3,
"next": "http://localhost:9311/v1/consumers?limit=1&offset=2", "next": "http://localhost:9311/v1/containers/{container_ref}/consumers?limit=1&offset=2",
"consumers": [ "consumers": [
{ {
"status": "ACTIVE", "status": "ACTIVE",
@@ -90,7 +90,7 @@ Request:
"created": "2015-10-15T21:17:08.092408" "created": "2015-10-15T21:17:08.092408"
} }
], ],
"previous": "http://localhost:9311/v1/consumers?limit=1&offset=0" "previous": "http://localhost:9311/v1/containers/{container_ref}/consumers?limit=1&offset=0"
} }
.. _consumer_response_attributes: .. _consumer_response_attributes:
@@ -124,11 +124,13 @@ HTTP Status Codes
+------+-----------------------------------------------------------------------------+ +------+-----------------------------------------------------------------------------+
| Code | Description | | Code | Description |
+======+=============================================================================+ +======+=============================================================================+
| 200 | Successful Request | | 200 | OK. |
+------+-----------------------------------------------------------------------------+ +------+-----------------------------------------------------------------------------+
| 401 | Invalid X-Auth-Token or the token doesn't have permissions to this resource | | 401 | Invalid X-Auth-Token or the token doesn't have permissions to this resource.|
+------+-----------------------------------------------------------------------------+
| 403 | Forbidden. The user has been authenticated, but is not authorized to |
| | delete a consumer. This can be based on the user's role. |
+------+-----------------------------------------------------------------------------+ +------+-----------------------------------------------------------------------------+
.. _post_consumers: .. _post_consumers:
@@ -157,6 +159,7 @@ Request:
POST {container_ref}/consumers POST {container_ref}/consumers
Headers: Headers:
X-Auth-Token: <token> X-Auth-Token: <token>
Content-Type: application/json
Content: Content:
{ {
@@ -200,13 +203,13 @@ HTTP Status Codes
+------+-----------------------------------------------------------------------------+ +------+-----------------------------------------------------------------------------+
| Code | Description | | Code | Description |
+======+=============================================================================+ +======+=============================================================================+
| 200 | OK | | 200 | OK. |
+------+-----------------------------------------------------------------------------+ +------+-----------------------------------------------------------------------------+
| 400 | Bad Request | | 400 | Bad Request. |
+------+-----------------------------------------------------------------------------+ +------+-----------------------------------------------------------------------------+
| 401 | Invalid X-Auth-Token or the token doesn't have permissions to this resource | | 401 | Invalid X-Auth-Token or the token doesn't have permissions to this resource.|
+------+-----------------------------------------------------------------------------+ +------+-----------------------------------------------------------------------------+
| 403 | Forbidden. The user has been authenticated, but is not authorized to | | 403 | Forbidden. The user has been authenticated, but is not authorized to |
| | create a consumer. This can be based on the user's role or the | | | create a consumer. This can be based on the user's role or the |
| | project's quota. | | | project's quota. |
+------+-----------------------------------------------------------------------------+ +------+-----------------------------------------------------------------------------+
@@ -236,9 +239,10 @@ Request:
.. code-block:: javascript .. code-block:: javascript
POST {container_ref}/consumers DELETE {container_ref}/consumers
Headers: Headers:
X-Auth-Token: <token> X-Auth-Token: <token>
Content-Type: application/json
Content: Content:
{ {
@@ -278,9 +282,14 @@ HTTP Status Codes
+------+-----------------------------------------------------------------------------+ +------+-----------------------------------------------------------------------------+
| Code | Description | | Code | Description |
+======+=============================================================================+ +======+=============================================================================+
| 200 | OK | | 200 | OK. |
+------+-----------------------------------------------------------------------------+ +------+-----------------------------------------------------------------------------+
| 401 | Invalid X-Auth-Token or the token doesn't have permissions to this resource | | 400 | Bad Request. |
+------+-----------------------------------------------------------------------------+ +------+-----------------------------------------------------------------------------+
| 404 | Not Found | | 401 | Invalid X-Auth-Token or the token doesn't have permissions to this resource.|
+------+-----------------------------------------------------------------------------+
| 403 | Forbidden. The user has been authenticated, but is not authorized to |
| | delete a consumer. This can be based on the user's role. |
+------+-----------------------------------------------------------------------------+
| 404 | Consumer Not Found. |
+------+-----------------------------------------------------------------------------+ +------+-----------------------------------------------------------------------------+