nova/api-ref/source/os-flavor-extra-specs.inc
jichenjc 4f4841d1d5 Complete Verification of os-flavor-extra-specs
verified the API doc for os-flavor-extra-specs,
changes the sequence of GET/POST,
Also, remove some common error code like 500, 503 etc

Part of bp:api-ref-in-rst

Change-Id: I14c02e42f2cbb7979436add78feb19a41944a1c7
2016-04-23 21:55:29 +08:00

157 lines
3.7 KiB
ReStructuredText

.. -*- rst -*-
.. needs:parameter_verification
.. needs:example_verification
.. needs:body_verification
======================================================
Flavors extra-specs (flavors, os-flavor-extra-specs)
======================================================
Lists, creates, deletes, and updates the extra-specs or keys for a
flavor.
List Extra Specs For A Flavor
=============================
.. rest_method:: GET /v2.1/{tenant_id}/flavors/{flavor_id}/os-extra_specs
Lists all extra specs for a flavor, by ID.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id
- flavor_id: flavor_id
Response
--------
**Example List Extra Specs For A Flavor: JSON response**
.. literalinclude:: ../../doc/api_samples/flavor-extra-specs/flavor-extra-specs-list-resp.json
:language: javascript
Create Extra Specs For A Flavor
===============================
.. rest_method:: POST /v2.1/{tenant_id}/flavors/{flavor_id}/os-extra_specs
Creates extra specs for a flavor, by ID.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404), conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id
- flavor_id: flavor_id
**Example Create Extra Specs For A Flavor: JSON request**
.. literalinclude:: ../../doc/api_samples/flavor-extra-specs/flavor-extra-specs-create-req.json
:language: javascript
Response
--------
**Example Create Extra Specs For A Flavor: JSON response**
.. literalinclude:: ../../doc/api_samples/flavor-extra-specs/flavor-extra-specs-create-resp.json
:language: javascript
Show An Extra Spec For A Flavor
===============================
.. rest_method:: GET /v2.1/{tenant_id}/flavors/{flavor_id}/os-extra_specs/{flavor_extra_spec_key}
Shows an extra spec, by key, for a flavor, by ID.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id
- flavor_id: flavor_id
- flavor_extra_spec_key: flavor_extra_spec_key
Response
--------
**Example Show An Extra Spec For A Flavor: JSON response**
.. literalinclude:: ../../doc/api_samples/flavor-extra-specs/flavor-extra-specs-get-resp.json
:language: javascript
Update An Extra Spec For A Flavor
=================================
.. rest_method:: PUT /v2.1/{tenant_id}/flavors/{flavor_id}/os-extra_specs/{flavor_extra_spec_key}
Updates an extra spec, by key, for a flavor, by ID.
Normal response codes: 200
Error response codes: badRequest(400), uauthorized(401), forbidden(403)
itemNotFound(404), conflict(409)
Request
-------
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id
- flavor_id: flavor_id
- flavor_extra_spec_key: flavor_extra_spec_key
**Example Update An Extra Spec For A Flavor: JSON request**
.. literalinclude:: ../../doc/api_samples/flavor-extra-specs/flavor-extra-specs-update-req.json
:language: javascript
Response
--------
**Example Update An Extra Spec For A Flavor: JSON response**
.. literalinclude:: ../../doc/api_samples/flavor-extra-specs/flavor-extra-specs-update-resp.json
:language: javascript
Delete An Extra Spec For A Flavor
=================================
.. rest_method:: DELETE /v2.1/{tenant_id}/flavors/{flavor_id}/os-extra_specs/{flavor_extra_spec_key}
Deletes an extra spec, by key, for a flavor, by ID.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- tenant_id: tenant_id
- flavor_id: flavor_id
- flavor_extra_spec_key: flavor_extra_spec_key
Response
--------