5ead13913f
verified the API doc for os-server-groups, Also, remove some common error code like 500, 503 etc detail log: http://paste.openstack.org/show/495341/ Part of bp:api-ref-in-rst Change-Id: I0654ef2e1c937d1328b9ab4c434596035d53e0ee
162 lines
3.2 KiB
ReStructuredText
162 lines
3.2 KiB
ReStructuredText
.. -*- rst -*-
|
|
.. needs:parameter_verification
|
|
.. needs:example_verification
|
|
.. needs:body_verification
|
|
|
|
==================================
|
|
Server groups (os-server-groups)
|
|
==================================
|
|
|
|
Lists, shows information for, creates, and deletes server groups.
|
|
|
|
List Server Groups
|
|
==================
|
|
|
|
.. rest_method:: GET /v2.1/{tenant_id}/os-server-groups
|
|
|
|
Lists all server groups for the tenant.
|
|
|
|
Administrative users can use the ``all_projects`` query parameter to list all server groups for all projects.
|
|
|
|
Normal response codes: 200
|
|
|
|
Error response codes: unauthorized(401), forbidden(403)
|
|
|
|
Request
|
|
-------
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
- tenant_id: tenant_id
|
|
|
|
Query Parameters
|
|
~~~~~~~~~~~~~~~~
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
- all_projects: all_projects
|
|
|
|
Response
|
|
--------
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
- server_groups: server_groups
|
|
- id: server_group_id
|
|
- name: name
|
|
- policies: policies
|
|
- members: members
|
|
- metadata: metadata
|
|
- project_id: project_id
|
|
- user_id: user_id
|
|
|
|
**Example List Server Groups: JSON response**
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-server-groups/server-groups-list-resp.json
|
|
:language: javascript
|
|
|
|
Create Server Group
|
|
===================
|
|
|
|
.. rest_method:: POST /v2.1/{tenant_id}/os-server-groups
|
|
|
|
Creates a server group.
|
|
|
|
Normal response codes: 200
|
|
|
|
Error response codes: badRequest(400), unauthorized(401), forbidden(403)
|
|
|
|
Request
|
|
-------
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
- tenant_id: tenant_id
|
|
- name: name
|
|
- policies: policies
|
|
|
|
**Example Create Server Group: JSON request**
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-server-groups/server-groups-post-req.json
|
|
:language: javascript
|
|
|
|
Response
|
|
--------
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
- server_groups: server_groups
|
|
- id: server_group_id
|
|
- name: name
|
|
- policies: policies
|
|
- members: members
|
|
- metadata: metadata
|
|
- project_id: project_id
|
|
- user_id: user_id
|
|
|
|
**Example Create Server Group: JSON response**
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-server-groups/server-groups-post-resp.json
|
|
:language: javascript
|
|
|
|
Show Server Group Details
|
|
=========================
|
|
|
|
.. rest_method:: GET /v2.1/{tenant_id}/os-server-groups/{server_group_id}
|
|
|
|
Shows details for a server group.
|
|
|
|
Normal response codes: 200
|
|
|
|
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
|
|
|
|
Request
|
|
-------
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
- tenant_id: tenant_id
|
|
- server_group_id: server_group_id
|
|
|
|
Response
|
|
--------
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
- server_groups: server_groups
|
|
- id: server_group_id
|
|
- name: name
|
|
- policies: policies
|
|
- members: members
|
|
- metadata: metadata
|
|
- project_id: project_id
|
|
- user_id: user_id
|
|
|
|
**Example Show Server Group Details: JSON response**
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-server-groups/server-groups-get-resp.json
|
|
:language: javascript
|
|
|
|
Delete Server Group
|
|
===================
|
|
|
|
.. rest_method:: DELETE /v2.1/{tenant_id}/os-server-groups/{server_group_id}
|
|
|
|
Deletes a server group.
|
|
|
|
Normal response codes: 204
|
|
|
|
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
|
|
|
|
Request
|
|
-------
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
- tenant_id: tenant_id
|
|
- server_group_id: server_group_id
|
|
|
|
Response
|
|
--------
|
|
|