FlavorList

(Difference between revisions)
Jump to: navigation, search
Line 22: Line 22:
 
         "links":[
 
         "links":[
 
             {
 
             {
               "href":"http://{server_name}/flavors/{flavor_id}/",
+
               "href":"http://{api_server}/flavors/{flavor_id}/",
 
               "rel":"self"
 
               "rel":"self"
 
             }
 
             }
Line 32: Line 32:
 
         "links":[
 
         "links":[
 
             {
 
             {
               "href":"http://{server_name}/flavors/{flavor_id}/",
+
               "href":"http://{api_server}/flavors/{flavor_id}/",
 
               "rel":"self"
 
               "rel":"self"
 
             }
 
             }
Line 60: Line 60:
  
 
'''Successfully list available flavors'''
 
'''Successfully list available flavors'''
:'''GET''' <nowiki>http://{api_url}/flavors</nowiki>
+
:'''GET''' <nowiki>http://{api_server}/flavors</nowiki>
  
 
''Request Headers:''
 
''Request Headers:''
Line 80: Line 80:
 
             "links": [
 
             "links": [
 
               {
 
               {
                 "href": "http://{server_name}/flavors/1/",  
+
                 "href": "http://{api_server}/flavors/1/",  
 
                 "rel": "self"
 
                 "rel": "self"
 
               },  
 
               },  
 
               {
 
               {
                 "href":  "http://{server_name}/flavors/1/",  
+
                 "href":  "http://{api_server}/flavors/1/",  
 
                 "rel": "bookmark"
 
                 "rel": "bookmark"
 
               }
 
               }
Line 94: Line 94:
 
             "links": [
 
             "links": [
 
               {
 
               {
                   "href": "http://{server_name}/flavors/3/",  
+
                   "href": "http://{api_server}/flavors/3/",  
 
                   "rel": "self"
 
                   "rel": "self"
 
               },  
 
               },  
 
               {
 
               {
                   "href": "http://{server_name}/flavors/3/",  
+
                   "href": "http://{api_server}/flavors/3/",  
 
                   "rel": "bookmark"}
 
                   "rel": "bookmark"}
 
             ],
 
             ],
Line 109: Line 109:
  
 
'''Unauthorized request'''
 
'''Unauthorized request'''
:'''GET''' <nowiki>http://{api_url}/flavors</nowiki>
+
:'''GET''' <nowiki>http://{api_server}/flavors</nowiki>
  
 
''Request Headers:''
 
''Request Headers:''

Revision as of 12:13, 18 April 2012

This operation will list all available flavors optionally limited by the query parameters.

GET /flavors?minDisk=diskInGB&minRam=ramInMB

Contents

Parameters

minDisk - int
Optional Only flavors with a disk size greater than or equal to minDisk will be returned. Specified in GB.
minRam - int
Optional Only flavors with a memory size greater than or equal to minRam will be returned. Specified in MB.

Also see Pagination

Result

JSON

{
   "flavors":[
      {
         "id":"{flavor_id}",
         "links":[
            {
               "href":"http://{api_server}/flavors/{flavor_id}/",
               "rel":"self"
            }
         ],
         "name":"{display_flavor_name}"
      },
      {
         "id":"{flavor_id}",
         "links":[
            {
               "href":"http://{api_server}/flavors/{flavor_id}/",
               "rel":"self"
            }
         ],
         "name":"{display_flavor_name}"
      }
   ]
}


id - string
Unique identifier for this flavor.
links - array
Hypermedia for this resource.
name - string
Display name for this flavor.

Response Codes

Success
HTTP/1.1 200 OK
Failure
HTTP/1.1 401 Unauthorized - This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.

Examples

Successfully list available flavors

GET http://{api_server}/flavors

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 200 OK

Response Body:

     {
       "flavors": [
          {
            "name": "Small", 
            "links": [
               {
                 "href": "http://{api_server}/flavors/1/", 
                 "rel": "self"
               }, 
               {
                 "href":  "http://{api_server}/flavors/1/", 
                 "rel": "bookmark"
               }
            ], 
            "id": "1"
          },
          {
            "name": "Large", 
            "links": [
               {
                  "href": "http://{api_server}/flavors/3/", 
                  "rel": "self"
               }, 
               {
                  "href": "http://{api_server}/flavors/3/", 
                  "rel": "bookmark"}
            ],
            "id": "3"
          }
       ]
    }


Unauthorized request

GET http://{api_server}/flavors

Request Headers:

   Content-Type:application/json

Response Code:

HTTP/1.1 401 Unauthorized

Response Body:

    401 Unauthorized
    This server could not verify that you are authorized to
    access the document you requested.  Either you supplied the
    wrong credentials (e.g., bad password), or your browser
    does not understand how to supply the credentials required.


blog comments powered by Disqus


Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox