Tweak api-ref doc for projects

This patch adds the status code table into the api-ref doc for projects.
It brings in a 'status.yaml' file that could be shared by other *.inc
files.

Change-Id: Ic536a4dd686cf9bde70b91f5575e8f3053fd1295
This commit is contained in:
tengqm 2016-09-09 01:49:37 -04:00
parent ae4473b5c2
commit 830b01fb3c
2 changed files with 164 additions and 30 deletions
api-ref/source/v3

@ -36,12 +36,21 @@ Relationship: ``http://docs.openstack.org/api/openstack-identity/3/rel/projects`
Lists projects.
Normal response codes: 200
Response Codes
--------------
Error response codes: 413,405,404,403,401,400,503
.. rest_status_code:: success status.yaml
Request
-------
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
@ -81,14 +90,24 @@ Create project
Relationship: ``http://docs.openstack.org/api/openstack-identity/3/rel/projects``
Creates a project, including a project acting as a domain.
Creates a project, where the project may act as a domain.
Normal response codes: 201
Response Codes
--------------
Error response codes: 413,415,405,404,403,401,400,503,409
.. rest_status_code:: success status.yaml
Request
-------
- 201
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
- 409
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
@ -103,9 +122,13 @@ Request
Request Examples
----------------
Sample for creating a regular project:
.. literalinclude:: ./samples/admin/project-create-request.json
:language: javascript
Sample for creating a project that also acts as a domain:
.. literalinclude:: ./samples/admin/project-create-domain-request.json
:language: javascript
@ -124,7 +147,6 @@ Response Parameters
- name: project_name_response_body
- parent_id: project_parent_id_response_body
Show project details
====================
@ -134,12 +156,22 @@ Relationship: ``http://docs.openstack.org/api/openstack-identity/3/rel/project``
Shows details for a project.
Normal response codes: 200
Response Codes
--------------
Error response codes: 413,405,404,403,401,400,503
.. rest_status_code:: success status.yaml
Request
-------
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
- 404
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
@ -192,12 +224,23 @@ Relationship: ``http://docs.openstack.org/api/openstack-identity/3/rel/project``
Updates a project.
Normal response codes: 200
Response Codes
--------------
Error response codes: 413,415,405,404,403,401,400,503,409
.. rest_status_code:: success status.yaml
Request
-------
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
- 404
- 409
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
@ -246,12 +289,22 @@ Relationship: ``http://docs.openstack.org/api/openstack-identity/3/rel/project``
Deletes a project.
Normal response codes: 204
Response Codes
--------------
Error response codes: 413,415,405,404,403,401,400,503,409
.. rest_status_code:: success status.yaml
Request
-------
- 204
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
- 404
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
@ -278,12 +331,23 @@ If you perform this action against a project that acts as a domain
(``is_domain`` is set to ``true``), this call fails and returns the
``Forbidden (403)`` response code.
Normal response codes: 200
Response Codes
--------------
Error response codes: 413,415,405,404,403,401,400,503,409
.. rest_status_code:: success status.yaml
Request
-------
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
- 404
- 409
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
@ -332,12 +396,22 @@ A project subtree includes all projects beneath the parent project
in the hierarchy. You must disable all the projects in the subtree
before you perform this operation.
Normal response codes: 204
Response Codes
--------------
Error response codes: 413,415,405,404,403,401,400,503,409
.. rest_status_code:: success status.yaml
Request
-------
- 204
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
- 404
Request Parameters
------------------
.. rest_parameters:: parameters.yaml

@ -0,0 +1,60 @@
# Success Codes
200:
default: |
Request was successful.
201:
default: |
Resource was created and is ready to use.
202:
default: |
Request was accepted for processing, but the processing has not been
completed. A 'location' header is included in the response which contains
a link to check the progress of the request.
204:
default: |
The server has fulfilled the request by deleting the resource.
300:
default: |
There are multiple choices for resources. The request has to be more
specific to successfully retrieve one of these resources.
# Error Codes
400:
default: |
Some content in the request was invalid.
401:
default: |
User must authenticate before making a request.
403:
default: |
Policy does not allow current user to do this operation.
404:
default: |
The requested resource could not be found.
405:
default: |
Method is not valid for this endpoint.
406:
default: |
The requested API version is not supported by the API.
409:
default: |
This operation conflicted with another operation on this resource.
413:
default: |
The request is larger than the server is willing or able to process.
415:
default: |
The request entity has a media type which the server or resource does
not support.
500:
default: |
Something went wrong inside the service. This should not happen usually.
If it does happen, it means the server has experienced some serious
problems.
503:
default: |
Service is not available. This is mostly caused by service configuration
errors which prevents the service from successful start up.