valence/api-ref/source/valence-api-v1-flavors.inc
praveenraj e790b6e58d Renamed /flavor to /flavors
When you do GET /v1
it returns the list of supported APIs with their links.
ie.
 "flavors" : [
    {
       "href" : "http://127.0.0.1:8181/v1/flavors/",
       "rel" : "self"
    },
    {
       "rel" : "bookmark",
       "href" : "http://127.0.0.1:8181/flavors/"
    }
but actually,
flavor apis are implemented at /flavor than /flavors.
Now /flavor has been renamed to /flavors.

This closes bug #1642801
Change-Id: I28297234561b06c22b6b083452368e3ba5c74e98
2016-12-05 14:24:23 +05:30

91 lines
1.5 KiB
ReStructuredText

.. -*- rst -*-
============
Flavors
============
List, Searching of Flavors through the ``/v1/flavors``
List Flavor
============
.. rest_method:: GET /v1/flavor/
Leaving this empty for discussion due to there isn't a DB to keep generated flavor.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401), forbidden(403)
Request
-------
Response
--------
**Example list of Flavor :**
.. literalinclude:: mockup/flavor-list-response.json
:language: javascript
Generate Flavor
===============
.. rest_method:: POST /v1/flavors
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401), forbidden(403), 404, 409
Request
-------
.. rest_parameters:: parameters.yaml
- criterial: criteria_list
**Example generate flavor :**
.. literalinclude:: mockup/flavor-post.json
:language: javascript
Response
---------
**Example list of Flavor :**
.. literalinclude:: mockup/flavor-post-response.json
:language: javascript
List Flavor criteria
=====================
.. rest_method:: GET /v1/flavors/criteria
Get all supported flavor generation criteria along with their description.
Normal response codes: 200
Error response codes: unauthorized(401), forbidden(403)
Request
-------
Response
--------
.. rest_parameters:: parameters.yaml
- criteria: criteria_object
**Example JSON representation of a Compute System:**
.. literalinclude:: mockup/flavor-criteria-get-response.json
:language: javascript