Add the description about service api to api-ref

This patch adds the decription about service api to api-ref.

Change-Id: I9b5d765fdf9f627b73556e9799bd188e3d9b8505
Partially-Implements: blueprint zun-api-doc
This commit is contained in:
miaohb 2017-05-27 16:22:54 +08:00
parent 8d4325f829
commit 16f83bd01d
5 changed files with 193 additions and 0 deletions

View File

@ -68,6 +68,12 @@ report_count:
in: body
required: true
type: integer
service:
description: |
A Zun services.
in: body
required: true
type: dict
services:
description: |
A list of Zun services.

View File

@ -0,0 +1,8 @@
{
"service": {
"disabled": true,
"binary": "zun-compute",
"host": "host1",
"disabled_reason": "abc"
}
}

View File

@ -0,0 +1,8 @@
{
"service":{
"disabled": false,
"binary": "zun-compute",
"host": "tecs",
"disabled_reason": null
}
}

View File

@ -0,0 +1,7 @@
{
"service": {
"binary": "zun-compute",
"host": "tecs",
"forced_down": true
}
}

View File

@ -48,3 +48,167 @@ Response Example
.. literalinclude:: samples/service-get-resp.json
:language: javascript
Delete container management service
===================================
.. rest_method:: DELETE /v1/services
Delete the specified Zun service.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 401
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
- binary: binary
- host: host
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
Enable container management service
===================================
.. rest_method:: PUT /v1/services/enable
Enable the specified Zun service.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 401
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
- binary: binary
- host: host
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- service: service
- host: host
- binary: binary
- disabled: disabled
- disabled_reason: disabled_reason
Response Example
----------------
.. literalinclude:: samples/service-enable-resp.json
:language: javascript
Disable container management service
====================================
.. rest_method:: PUT /v1/services/disable
Disable the specified Zun service.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 401
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
- binary: binary
- host: host
- disabled_reason: disabled_reason
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- service: service
- host: host
- binary: binary
- disabled: disabled
- disabled_reason: disabled_reason
Response Example
----------------
.. literalinclude:: samples/service-disable-resp.json
:language: javascript
Force down container management service
=======================================
.. rest_method:: PUT /v1/services/force_down
Force the specified Zun service to down or unset it.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 401
Request Parameters
------------------
.. rest_parameters:: parameters.yaml
- binary: binary
- host: host
- forced_down: forced_down
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- service: service
- host: host
- binary: binary
- forced_down: forced_down
Response Example
----------------
.. literalinclude:: samples/service-forcedown-resp.json
:language: javascript