Merge "Merge API docs with Craton RTD"
This commit is contained in:
commit
ae085caebd
|
@ -0,0 +1,14 @@
|
|||
Craton's API Reference Guide
|
||||
============================
|
||||
Contents:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
cells
|
||||
devices
|
||||
hosts
|
||||
networks
|
||||
net-devices
|
||||
net-interfaces
|
||||
regions
|
|
@ -0,0 +1,336 @@
|
|||
.. _cells:
|
||||
|
||||
=====
|
||||
Cells
|
||||
=====
|
||||
|
||||
Definition of cell
|
||||
|
||||
Create Cell
|
||||
===========
|
||||
:POST: /v1/cells
|
||||
|
||||
Create a new Cell
|
||||
|
||||
Normal response codes: OK(200)
|
||||
|
||||
Error response codes: invalid request(400), validation exception(405)
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+------------+------+---------+-------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+============+======+=========+=========================+
|
||||
| name | boody| string | Unique name of the cell |
|
||||
+------------+------+---------+-------------------------+
|
||||
| region_id | body | integer | Unique ID of the region |
|
||||
+------------+------+---------+-------------------------+
|
||||
| labels | body | string | User defined labels |
|
||||
+------------+------+---------+-------------------------+
|
||||
| note | body | string | Note used for governance|
|
||||
+------------+------+---------+-------------------------+
|
||||
| data | body | object | User defined data |
|
||||
+------------+------+---------+-------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
.. todo:: **Example Create Cell**
|
||||
|
||||
..literalinclude:: ./doc/api_samples/cells/cells-create-req.json
|
||||
:language: javascript
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
+-----------+------+---------+-------------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+===========+======+=========+===============================+
|
||||
| cell | body | object | - id |
|
||||
| | | | - name |
|
||||
| | | | - region_id |
|
||||
| | | | - labels |
|
||||
| | | | - note |
|
||||
| | | | - data |
|
||||
+-----------+------+---------+-------------------------------+
|
||||
| id | body | integer | Unique ID of the cell |
|
||||
+-----------+------+---------+-------------------------------+
|
||||
| name | body | string | Unique name of the cell |
|
||||
+-----------+------+---------+-------------------------------+
|
||||
| region_id | body | integer | Unique ID of the cell's region|
|
||||
+-----------+------+---------+-------------------------------+
|
||||
| labels | body | string | User defined labels |
|
||||
+-----------+------+---------+-------------------------------+
|
||||
| note | body | string | Note used for governance |
|
||||
+-----------+------+---------+-------------------------------+
|
||||
| data | body | object | User defined data |
|
||||
+-----------+------+---------+-------------------------------+
|
||||
|
||||
.. todo:: **Example Create Cell**
|
||||
|
||||
..literalinclude:: ./doc/api_samples/cells/cells-create-resp.json
|
||||
:language: javascript
|
||||
|
||||
List Cells
|
||||
==========
|
||||
|
||||
:GET: /v1/cells?region_id=
|
||||
|
||||
Gets all Cells
|
||||
|
||||
Normal response codes: OK(200)
|
||||
|
||||
Error response codes: invalid request(400), cell not found(404), validation exception(405)
|
||||
|
||||
Default response: unexpected error
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+-----------+-------+--------+---------+----------------------------------+
|
||||
| Name | In | Type | Required| Description |
|
||||
+===========+=======+========+=========+==================================+
|
||||
| region_id | query | string | No | ID of the region to get cells for|
|
||||
+-----------+-------+--------+---------+----------------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
+------------+------+---------+-------------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+============+======+=========+===============================+
|
||||
| cells | body | array | Array of cell objects |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| id | body | integer | Unique ID of the cell |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| name | body | string | Unique name of the cell |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| region_id | body | integer | Unique ID of the cell's region|
|
||||
+------------+------+---------+-------------------------------+
|
||||
| labels | body | string | User defined labels |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| note | body | string | Note used for governance |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| data | body | object | User defined data |
|
||||
+------------+------+---------+-------------------------------+
|
||||
|
||||
.. todo:: **Example List Cells**
|
||||
|
||||
..literalinclude:: ./doc/api_samples/cells/cells-list-resp.json
|
||||
:language: javascript
|
||||
|
||||
.. todo:: **Example Unexpected Error**
|
||||
|
||||
..literalinclude:: ./api_samples/errors/errors-unexpected-resp.json
|
||||
:language: javascript
|
||||
|
||||
Update Cells
|
||||
============
|
||||
|
||||
:PUT: /v1/cells/{id}
|
||||
|
||||
Update an existing cell
|
||||
|
||||
Normal response codes: OK(200)
|
||||
|
||||
Error response codes: invalid request(400), cell not found(404), validation exception(405)
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+----------+------+---------+------------------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+==========+======+=========+====================================+
|
||||
| name | body | string | Unique name of the cell |
|
||||
+----------+------+---------+------------------------------------+
|
||||
| region_id| body | integer | Unique ID of the cell's region |
|
||||
+----------+------+---------+------------------------------------+
|
||||
| labels | body | string | User defined labels |
|
||||
+----------+------+---------+------------------------------------+
|
||||
| note | body | string | Note used for governance |
|
||||
+----------+------+---------+------------------------------------+
|
||||
| data | body | object | User defined data |
|
||||
+----------+------+---------+------------------------------------+
|
||||
| id | path | integer | Unique ID of the cell to be updated|
|
||||
+----------+------+---------+------------------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
.. todo:: **Example Update Cell**
|
||||
|
||||
..literalinclude:: ./api_samples/cells/cells-update-req.json
|
||||
:language: javascript
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
+----------+------+---------+-------------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+==========+======+=========+===============================+
|
||||
| cell | body | object | - id |
|
||||
| | | | - name |
|
||||
| | | | - region_id |
|
||||
| | | | - labels |
|
||||
| | | | - note |
|
||||
| | | | - data |
|
||||
+----------+------+---------+-------------------------------+
|
||||
| id | body | integer | Unique ID of the cell |
|
||||
+----------+------+---------+-------------------------------+
|
||||
| name | body | string | Unique name of the cell |
|
||||
+----------+------+---------+-------------------------------+
|
||||
| region_id| body | integer | Unique ID of the cell's region|
|
||||
+----------+------+---------+-------------------------------+
|
||||
| labels | body | string | User defined labels |
|
||||
+----------+------+---------+-------------------------------+
|
||||
| note | body | string | Note used for governance |
|
||||
+----------+------+---------+-------------------------------+
|
||||
| data | body | object | User defined data |
|
||||
+----------+------+---------+-------------------------------+
|
||||
|
||||
.. todo:: **Example Update Cell**
|
||||
|
||||
..literalinclude:: ./api_samples/cells/cells-update-resp.json
|
||||
:language: javascript
|
||||
|
||||
Update Cell Data
|
||||
================
|
||||
|
||||
:PUT: /v1/cells/{id}/data
|
||||
|
||||
Update user defined data for the cell
|
||||
|
||||
Normal response codes: OK(200)
|
||||
|
||||
Error response codes: invalid request(400), cell not found(404), validation exception(405)
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+--------+------+---------+------------------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+========+======+=========+====================================+
|
||||
| key | body | string | Identifier |
|
||||
+--------+------+---------+------------------------------------+
|
||||
| value | body | object | Data |
|
||||
+--------+------+---------+------------------------------------+
|
||||
| id | path | integer | Unique ID of the cell to be updated|
|
||||
+--------+------+---------+------------------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
.. todo:: **Example Update Cell Data**
|
||||
|
||||
..literalinclude:: ./api_samples/cells/cells-upadate—data-req.json
|
||||
:language: javascript
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
+--------+------+---------+-------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+========+======+=========+=========================+
|
||||
| key | body | string | Identifier |
|
||||
+--------+------+---------+-------------------------+
|
||||
| value | body | object | Data |
|
||||
+--------+------+---------+-------------------------+
|
||||
|
||||
.. todo:: **Example Update Cell Data**
|
||||
|
||||
..literalinclude:: ./api_samples/cells/cells-update-data-resp.json
|
||||
:language: javascript
|
||||
|
||||
Delete Cell
|
||||
===========
|
||||
|
||||
:DELETE: /v1/cells/{id}
|
||||
|
||||
Deletes an existing record of a Cell
|
||||
|
||||
Normal response codes: no content(204)
|
||||
|
||||
Error response codes: invalid request(400), cell not found(404)
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+--------+------+---------+------------------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+========+======+=========+====================================+
|
||||
| id | path | integer | Unique ID of the cell to be deleted|
|
||||
+--------+------+---------+------------------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
No body content is returned on a successful DELETE
|
||||
|
||||
Delete Cell Data
|
||||
================
|
||||
|
||||
:DELETE: /v1/cells/{id}/data
|
||||
|
||||
Delete existing key/value data for the cell
|
||||
|
||||
Normal response codes: no content(204)
|
||||
|
||||
Error response codes: invalid request(400), cell not found(404) validation exception(405)
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+--------+------+---------+-------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+========+======+=========+=========================+
|
||||
| id | path | integer | Unique ID of the cell |
|
||||
+--------+------+---------+-------------------------+
|
||||
| key | body | string | Identifier to be deleted|
|
||||
+--------+------+---------+-------------------------+
|
||||
| value | body | object | Data to be deleted |
|
||||
+--------+------+---------+-------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
No body content is returned on a successful DELETE
|
|
@ -25,6 +25,7 @@ on_read_the_docs = os.environ.get('READTHEDOCS') == 'True'
|
|||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.graphviz',
|
||||
'sphinx.ext.todo'
|
||||
]
|
||||
if not on_read_the_docs:
|
||||
extensions.append('oslosphinx')
|
||||
|
@ -80,5 +81,8 @@ latex_documents = [
|
|||
u'OpenStack Foundation', 'manual'),
|
||||
]
|
||||
|
||||
# If true, todo and todolist produce output.
|
||||
todo_include_todos = True
|
||||
|
||||
# Example configuration for intersphinx: refer to the Python standard library.
|
||||
#intersphinx_mapping = {'http://docs.python.org/': None}
|
||||
|
|
|
@ -0,0 +1,409 @@
|
|||
.. _hosts:
|
||||
|
||||
=====
|
||||
Hosts
|
||||
=====
|
||||
|
||||
Definition of host
|
||||
|
||||
Create Host
|
||||
===========
|
||||
|
||||
:POST: /v1/hosts
|
||||
|
||||
Create a new host
|
||||
|
||||
Normal response codes: OK(200)
|
||||
|
||||
Error response codes: invalid request(400), validation exception(405)
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+------------+------+---------+-------------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+============+======+=========+===============================+
|
||||
| name | body | string | Unique name of the host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| cell_id | body | integer | Unique ID of the host's cell |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| region_id | body | integer | Unique ID of the host's region|
|
||||
+------------+------+---------+-------------------------------+
|
||||
| parent_id | body | integer | ID of the host's parent |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| ip_address | body | string | IP address of the host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| device_type| body | string | Type of host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| active | body | boolean | State of host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| labels | body | string | User defined labels |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| note | body | string | Note used for governance |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| data | body | object | User defined data |
|
||||
+------------+------+---------+-------------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
.. todo:: **Example Create Host**
|
||||
|
||||
..literalinclude:: ./api_samples/hosts/hosts-create-req.json
|
||||
:language: javascript
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
+------------+------+---------+-------------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+============+======+=========+===============================+
|
||||
| host | body | object | - id |
|
||||
| | | | - name |
|
||||
| | | | - cell_id |
|
||||
| | | | - region_id |
|
||||
| | | | - parent_id |
|
||||
| | | | - ip_address |
|
||||
| | | | - device_type |
|
||||
| | | | - active |
|
||||
| | | | - labels |
|
||||
| | | | - note |
|
||||
| | | | - data |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| id | body | integer | Unique ID of the host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| name | body | string | Unique name of the host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| cell_id | body | integer | Unique ID of the host's cell |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| region_id | body | integer | Unique ID of the host's region|
|
||||
+------------+------+---------+-------------------------------+
|
||||
| parent_id | body | integer | ID of the host's parent |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| ip_address | body | string | IP address of the host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| device_type| body | string | Type of host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| active | body | boolean | State of host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| labels | body | string | User defined labels |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| note | body | string | Note used for governance |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| data | body | object | User defined data |
|
||||
+------------+------+---------+-------------------------------+
|
||||
|
||||
.. todo:: **Example Create Host**
|
||||
|
||||
..literalinclude:: ./api_samples/hosts/hosts-create-resp.json
|
||||
:language: javascript
|
||||
|
||||
List Hosts
|
||||
==========
|
||||
|
||||
:GET: /v1/hosts?region_id=
|
||||
|
||||
Gets all Host
|
||||
|
||||
Normal response codes: OK(200)
|
||||
|
||||
Error response codes: invalid request(400), host not found(404), validation exception(405)
|
||||
|
||||
Default response: unexpected error
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+------------+------+---------+---------+------------------------------+
|
||||
| Name | In | Type | Required| Description |
|
||||
+============+======+=========+=========+==============================+
|
||||
| region_id | query| integer | Yes | ID of the region to get hosts|
|
||||
+------------+------+---------+---------+------------------------------+
|
||||
| limit | query| integer | No | Number of host to return |
|
||||
| | | | | Ranging from 1 - 10000 |
|
||||
+------------+------+---------+---------+------------------------------+
|
||||
| name | query| string | No | Name of the host to get |
|
||||
+------------+------+---------+---------+------------------------------+
|
||||
| cell_id | query| integer | No | Name of the cell to get |
|
||||
+------------+------+---------+---------+------------------------------+
|
||||
| ip | query| string | No | IP address of the host to get|
|
||||
+------------+------+---------+---------+------------------------------+
|
||||
| device_type| query| string | No | Type of host to get |
|
||||
+------------+------+---------+---------+------------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
+------------+------+---------+-------------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+============+======+=========+===============================+
|
||||
| hosts | body | array | array of host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| id | body | integer | Unique ID of the host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| name | body | string | Unique name of the host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| cell_id | body | integer | Unique ID of the host's cell |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| region_id | body | integer | Unique ID of the host's region|
|
||||
+------------+------+---------+-------------------------------+
|
||||
| parent_id | body | integer | ID of the host's parent |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| ip_address | body | string | IP address of the host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| device_type| body | string | Type of host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| active | body | boolean | State of host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| labels | body | string | User defined labels |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| note | body | string | Note used for governance |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| data | body | object | User defined data |
|
||||
+------------+------+---------+-------------------------------+
|
||||
|
||||
.. todo:: **Example List Host**
|
||||
|
||||
..literalinclude:: ./api_samples/hosts/hosts-list-resp.json
|
||||
:language: javascript
|
||||
|
||||
.. todo:: **Example Unexpected Error**
|
||||
|
||||
..literalinclude:: ./api_samples/errors/errors-unexpected-resp.json
|
||||
:language: javascript
|
||||
|
||||
Update Hosts
|
||||
============
|
||||
|
||||
:PUT: /v1/hosts/{id}
|
||||
|
||||
Update an existing host
|
||||
|
||||
Normal response codes: OK(200)
|
||||
|
||||
Error response codes: invalid request(400), host not found(404), validation exception(405)
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+------------+------+---------+------------------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+============+======+=========+====================================+
|
||||
| name | body | string | Unique name of the host |
|
||||
+------------+------+---------+------------------------------------+
|
||||
| cell_id | body | integer | Unique ID of the host's cell |
|
||||
+------------+------+---------+------------------------------------+
|
||||
| region_id | body | integer | Unique ID of the host's region |
|
||||
+------------+------+---------+------------------------------------+
|
||||
| parent_id | body | integer | ID of the host's parent |
|
||||
+------------+------+---------+------------------------------------+
|
||||
| ip_address | body | string | IP address of the host |
|
||||
+------------+------+---------+------------------------------------+
|
||||
| device_type| body | string | Type of host |
|
||||
+------------+------+---------+------------------------------------+
|
||||
| active | body | boolean | State of host |
|
||||
+------------+------+---------+------------------------------------+
|
||||
| labels | body | string | User defined labels |
|
||||
+------------+------+---------+------------------------------------+
|
||||
| note | body | string | Note used for governance |
|
||||
+------------+------+---------+------------------------------------+
|
||||
| data | body | object | User defined data |
|
||||
+------------+------+---------+------------------------------------+
|
||||
| id | path | integer | Unique ID of the host to be updated|
|
||||
+------------+------+---------+------------------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
.. todo:: **Example Update Host**
|
||||
|
||||
..literalinclude:: ./api_samples/hosts/hosts-update-req.json
|
||||
:language: javascript
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
+------------+------+---------+-------------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+============+======+=========+===============================+
|
||||
| host | body | object | - id |
|
||||
| | | | - name |
|
||||
| | | | - cell_id |
|
||||
| | | | - region_id |
|
||||
| | | | - parent_id |
|
||||
| | | | - ip_address |
|
||||
| | | | - device_type |
|
||||
| | | | - active |
|
||||
| | | | - labels |
|
||||
| | | | - note |
|
||||
| | | | - data |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| id | body | integer | Unique ID of the host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| name | body | string | Unique name of the host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| cell_id | body | integer | Unique ID of the host's cell |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| region_id | body | integer | Unique ID of the host's region|
|
||||
+------------+------+---------+-------------------------------+
|
||||
| parent_id | body | integer | ID of the host's parent |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| ip_address | body | string | IP address of the host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| device_type| body | string | Type of host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| active | body | boolean | State of host |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| labels | body | string | User defined labels |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| note | body | string | Note used for governance |
|
||||
+------------+------+---------+-------------------------------+
|
||||
| data | body | object | User defined data |
|
||||
+------------+------+---------+-------------------------------+
|
||||
|
||||
.. todo:: **Example Update Host**
|
||||
|
||||
..literalinclude:: ./api_samples/hosts/hosts-update-resp.json
|
||||
:language: javascript
|
||||
|
||||
Update Host Data
|
||||
================
|
||||
|
||||
:PUT: /v1/hosts/{id}/data
|
||||
|
||||
Update user defined data for the host
|
||||
|
||||
Normal response codes: OK(200)
|
||||
|
||||
Error response codes: invalid request(400), host not found(404), validation exception(405)
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+--------+------+---------+------------------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+========+======+=========+====================================+
|
||||
| key | body | string | Identifier |
|
||||
+--------+------+---------+------------------------------------+
|
||||
| value | body | object | Data |
|
||||
+--------+------+---------+------------------------------------+
|
||||
| id | path | integer | Unique ID of the host to be updated|
|
||||
+--------+------+---------+------------------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
.. todo:: **Example Update Host Data**
|
||||
|
||||
..literalinclude:: ./api_samples/hosts/hosts-upadate—data-req.json
|
||||
:language: javascript
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
+--------+------+---------+-------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+========+======+=========+=========================+
|
||||
| key | body | string | Identifier |
|
||||
+--------+------+---------+-------------------------+
|
||||
| value | body | object | Data |
|
||||
+--------+------+---------+-------------------------+
|
||||
|
||||
|
||||
.. todo:: **Example Update Host Data**
|
||||
|
||||
..literalinclude:: ./api_samples/hosts/hosts-update-data-resp.json
|
||||
:language: javascript
|
||||
|
||||
Delete Host
|
||||
===========
|
||||
|
||||
:DELETE: /v1/hosts/{id}
|
||||
|
||||
Deletes an existing record of a Host
|
||||
|
||||
Normal response codes: no content(204)
|
||||
|
||||
Error response codes: invalid request(400), host not found(404)
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+--------+------+---------+------------------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+========+======+=========+====================================+
|
||||
| id | path | integer | Unique ID of the host to be deleted|
|
||||
+--------+------+---------+------------------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
No body content is returned on a successful DELETE
|
||||
|
||||
Delete Host Data
|
||||
================
|
||||
|
||||
:DELETE: /v1/hosts/{id}/data
|
||||
|
||||
Delete existing key/value data for the Host
|
||||
|
||||
Normal response codes: no content(204)
|
||||
|
||||
Error response codes: invalid request(400), host not found(404) validation exception(405)
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+--------+------+---------+-------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+========+======+=========+=========================+
|
||||
| id | path | integer | Unique ID of the host |
|
||||
+--------+------+---------+-------------------------+
|
||||
| key | body | string | Identifier to be deleted|
|
||||
+--------+------+---------+-------------------------+
|
||||
| value | body | object | Data to be deleted |
|
||||
+--------+------+---------+-------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
No body content is returned on a successful DELETE
|
|
@ -4,7 +4,7 @@
|
|||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to Craton's documentation!
|
||||
========================================================
|
||||
==================================
|
||||
|
||||
Craton is a new project planned for OpenStack inclusion.
|
||||
Craton supports deploying and operating OpenStack clouds by providing
|
||||
|
@ -49,5 +49,5 @@ Indices and Tables
|
|||
|
||||
|
||||
License
|
||||
==================
|
||||
=======
|
||||
Craton is licensed under the `Apache license <http://www.apache.org/licenses/LICENSE-2.0>`_
|
||||
|
|
|
@ -0,0 +1,331 @@
|
|||
.. _regions:
|
||||
|
||||
=======
|
||||
Regions
|
||||
=======
|
||||
|
||||
Definition of region
|
||||
|
||||
Create Region
|
||||
=============
|
||||
|
||||
:POST: /v1/region
|
||||
|
||||
Creates a new Region
|
||||
|
||||
Normal response codes: OK(200)
|
||||
|
||||
Error response codes: invalid request(400), validation exception(405)
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+-------+------+---------+--------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+=======+======+=========+==========================+
|
||||
| name | body | string | Unique name of the region|
|
||||
+-------+------+---------+--------------------------+
|
||||
| labels| body | string | User defined labels |
|
||||
+-------+------+---------+--------------------------+
|
||||
| note | body | string | Note used for governance |
|
||||
+-------+------+---------+--------------------------+
|
||||
| data | body | object | User defined data |
|
||||
+-------+------+---------+--------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
.. todo:: **Example Create Region**
|
||||
|
||||
..literalinclude:: ./api_samples/regions/regions-create-req.json
|
||||
:language: javascript
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
+-----------+------+---------+--------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+===========+======+=========+==========================+
|
||||
| region | body | object | - id |
|
||||
| | | | - name |
|
||||
| | | | - cells |
|
||||
| | | | - labels |
|
||||
| | | | - note |
|
||||
| | | | - data |
|
||||
+-----------+------+---------+--------------------------+
|
||||
| id | body | integer | Unique ID of the region |
|
||||
+-----------+------+---------+--------------------------+
|
||||
| name | body | string | Unique name of the region|
|
||||
+-----------+------+---------+--------------------------+
|
||||
| cells | body | array | Array of cells |
|
||||
+-----------+------+---------+--------------------------+
|
||||
| labels | body | string | User defined labels |
|
||||
+-----------+------+---------+--------------------------+
|
||||
| note | body | string | Note used for governance |
|
||||
+-----------+------+---------+--------------------------+
|
||||
| data | body | object | User defined data |
|
||||
+-----------+------+---------+--------------------------+
|
||||
|
||||
.. todo:: **Example Create Region**
|
||||
|
||||
..literalinclude:: ./api_samples/regions/regions-create-resp.json
|
||||
:language: javascript
|
||||
|
||||
List Regions
|
||||
============
|
||||
|
||||
:GET: /v1/regions
|
||||
|
||||
Gets all Regions
|
||||
|
||||
Normal response codes: OK(200)
|
||||
|
||||
Error response codes: invalid request(400), validation exception(405)
|
||||
|
||||
Default response: unexpected error
|
||||
|
||||
Request
|
||||
-------
|
||||
No parameters
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
+-----------+------+---------+--------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+===========+======+=========+==========================+
|
||||
| regions | body | array | Array of regions |
|
||||
+-----------+------+---------+--------------------------+
|
||||
| id | body | integer | Unique ID of the region |
|
||||
+-----------+------+---------+--------------------------+
|
||||
| name | body | string | Unique name of the region|
|
||||
+-----------+------+---------+--------------------------+
|
||||
| cells | body | array | Array of cells in region |
|
||||
+-----------+------+---------+--------------------------+
|
||||
| labels | body | string | User defined labels |
|
||||
+-----------+------+---------+--------------------------+
|
||||
| note | body | string | Note used for governance |
|
||||
+-----------+------+---------+--------------------------+
|
||||
| data | body | object | User defined data |
|
||||
+-----------+------+---------+--------------------------+
|
||||
|
||||
.. todo:: **Example List Regions**
|
||||
|
||||
..literalinclude:: ./api_samples/regions/regions-list-resp.json
|
||||
:language: javascript
|
||||
|
||||
.. todo:: **Example Unexpected Error**
|
||||
|
||||
..literalinclude:: ./api_samples/errors/errors-unexpected-resp.json
|
||||
:language: javascript
|
||||
|
||||
Update Region
|
||||
=============
|
||||
|
||||
:PUT: /v1/regions/{id}
|
||||
|
||||
Update an existing region
|
||||
|
||||
Normal response codes: OK(200)
|
||||
|
||||
Error response codes: invalid request(400), region not found(404), validation exception(405)
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+-----------+------+---------+--------------------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+===========+======+=========+======================================+
|
||||
| name | body | string | Unique name of the region |
|
||||
+-----------+------+---------+--------------------------------------+
|
||||
| cells | body | array | Array of cells in region |
|
||||
+-----------+------+---------+--------------------------------------+
|
||||
| labels | body | string | User defined labels |
|
||||
+-----------+------+---------+--------------------------------------+
|
||||
| note | body | string | Note used for governance |
|
||||
+-----------+------+---------+--------------------------------------+
|
||||
| data | body | object | User defined data |
|
||||
+-----------+------+---------+--------------------------------------+
|
||||
| id | path | integer | Unique ID of the region to be updated|
|
||||
+-----------+------+---------+--------------------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
.. todo:: **Example Update Region**
|
||||
|
||||
..literalinclude:: ./api_samples/regions/regions-update-req.json
|
||||
:language: javascript
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
+-----------+------+---------+--------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+===========+======+=========+==========================+
|
||||
| region | body | object | - id |
|
||||
| | | | - name |
|
||||
| | | | - cells |
|
||||
| | | | - labels |
|
||||
| | | | - note |
|
||||
| | | | - data |
|
||||
+-----------+------+---------+--------------------------+
|
||||
| id | body | integer | Unique ID of the region |
|
||||
+-----------+------+---------+--------------------------+
|
||||
| name | body | string | Unique name of the region|
|
||||
+-----------+------+---------+--------------------------+
|
||||
| cells | body | array | Array of cells in region |
|
||||
+-----------+------+---------+--------------------------+
|
||||
| labels | body | string | User defined labels |
|
||||
+-----------+------+---------+--------------------------+
|
||||
| note | body | string | Note used for governance |
|
||||
+-----------+------+---------+--------------------------+
|
||||
| data | body | object | User defined data |
|
||||
+-----------+------+---------+--------------------------+
|
||||
|
||||
.. todo:: **Example Update Region**
|
||||
|
||||
..literalinclude:: ./api_samples/regions/regions-update-resp.json
|
||||
:language: javascript
|
||||
|
||||
Update Region Data
|
||||
==================
|
||||
|
||||
:PUT: /v1/regions/{id}/data
|
||||
|
||||
Update user defined data for the region
|
||||
|
||||
Normal response codes: OK(200)
|
||||
|
||||
Error response codes: invalid request(400), region not found(404), validation exception(405)
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+----------+------+---------+--------------------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+==========+======+=========+======================================+
|
||||
| key | body | string | Identifier |
|
||||
+----------+------+---------+--------------------------------------+
|
||||
| value | body | object | Data |
|
||||
+----------+------+---------+--------------------------------------+
|
||||
| id | path | integer | Unique ID of the region to be updated|
|
||||
+----------+------+---------+--------------------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
.. todo:: **Example Update Region Data**
|
||||
|
||||
..literalinclude:: ./api_samples/regions/regions-upadate—data-req.json
|
||||
:language: javascript
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
+--------+------+---------+-------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+========+======+=========+=========================+
|
||||
| key | body | string | Identifier |
|
||||
+--------+------+---------+-------------------------+
|
||||
| value | body | object | Data |
|
||||
+--------+------+---------+-------------------------+
|
||||
|
||||
|
||||
.. todo:: **Example Update Region Data**
|
||||
|
||||
..literalinclude:: ./api_samples/regions/regions-update-data-resp.json
|
||||
:language: javascript
|
||||
|
||||
Delete Region
|
||||
=============
|
||||
|
||||
:DELETE: /v1/regions/{id}
|
||||
|
||||
Deletes an existing record of a Region
|
||||
|
||||
Normal response codes: no content(204)
|
||||
|
||||
Error response codes: invalid request(400), region not found(404)
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+------+------+---------+--------------------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+======+======+=========+======================================+
|
||||
| id | path | integer | Unique ID of the region to be deleted|
|
||||
+------+------+---------+--------------------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: applicaton/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
No body content is returned on a successful DELETE
|
||||
|
||||
Delete Region Data
|
||||
==================
|
||||
|
||||
:DELETE: /v1/regions/{id}/data
|
||||
|
||||
Delete existing key/value data for the region
|
||||
|
||||
Normal response codes: no content(204)
|
||||
|
||||
Error response codes: invalid request(400), region not found(404) validation exception(405)
|
||||
|
||||
Request
|
||||
-------
|
||||
|
||||
+-------+------+---------+-------------------------+
|
||||
| Name | In | Type | Description |
|
||||
+=======+======+=========+=========================+
|
||||
| id | path | integer | Unique ID of the region |
|
||||
+-------+------+---------+-------------------------+
|
||||
| key | body | string | Identifier to be deleted|
|
||||
+-------+------+---------+-------------------------+
|
||||
| value | body | object | Data to be deleted |
|
||||
+-------+------+---------+-------------------------+
|
||||
|
||||
Required Header
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
- Content-Type: application/json
|
||||
- X-Auth-Token
|
||||
- X-Auth-User
|
||||
- X-Auth-Project
|
||||
|
||||
Response
|
||||
--------
|
||||
|
||||
No body content is returned on a successful DELETE
|
Loading…
Reference in New Issue