Flavor

(Difference between revisions)
Jump to: navigation, search
m (1 revision)
Line 1: Line 1:
 +
= GET /flavors/detail/''{id}'' =
 
This operation will return size details of a single flavor.
 
This operation will return size details of a single flavor.
 +
__TOC__
 +
== Request ==
 +
<code>GET /flavors/detail/''{id}''</code>
  
'''GET''' /flavors/detail/'''id'''
+
=== Parameters ===
 
+
== Parameters ==
+
 
; id
 
; id
 
: The unique identifier of the flavor to be retrieved. ''Note see warnings in [[Hypermedia]]''.
 
: The unique identifier of the flavor to be retrieved. ''Note see warnings in [[Hypermedia]]''.
  
== Result ==
+
== Response ==
=== JSON ===
+
 
 +
=== Status Code ===
 +
: 200 OK
 +
; Success
 +
 
 +
: 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.
 +
 
 +
: 403 Forbidden
 +
; The resource cannot be accessed by the user
 +
 
 +
: 404 Not Found
 +
; The requested resource does not exist
 +
 
 +
=== Response Body ===
 
  <nowiki>
 
  <nowiki>
{
+
{
  "flavor":
+
  "flavor":{
      {
+
    "name":"{display_flavor_name}",
        "name":"{display_flavor_name}",
+
    "links":[
        "links":[
+
      {"href":"</nowiki>{{APIBaseURL}}<nowiki>/flavors/{flavor_id}/", "rel":"self"}
            {
+
    ],
              "href":"http://{api_server}/flavors/{flavor_id}/",
+
    "vcpu":"1",
              "rel":"self"
+
    "ram":512,
            }
+
    "disk":10,
        ],
+
    "id":"{flavor_id}"
        "vcpu":"1",
+
  }
        "ram":512,
+
        "disk":10,
+
        "id":"{flavor_id}"
+
      }
+
 
}
 
}
 
</nowiki>
 
</nowiki>
  
 +
==== Parameters ====
 
; id - ''string''
 
; id - ''string''
 
: Unique identifier for this flavor.
 
: Unique identifier for this flavor.
Line 45: Line 58:
 
; vcpu - ''number''
 
; vcpu - ''number''
 
: Number of CPUs allocated with this flavor.
 
: Number of CPUs allocated with this flavor.
 
== Response Codes ==
 
:''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.
 
:''HTTP/1.1 403 Forbidden'' - The resource cannot be accessed by the user
 
:''HTTP/1.1 404 Not Found''' - The requested resource does not exist
 
  
 
== Examples ==
 
== Examples ==
'''Successfully view flavor details'''
 
:'''GET''' <nowiki>http://{api_server}/flavors/1</nowiki>
 
  
''Request Headers:''
+
=== Successfully view flavor details ===
    Content-Type:application/json
+
'''Request'''
    Charset=UTF-8
+
<nowiki>
    Authorization:Base64-encoded username & password string
+
GET /flavors/1
 
+
Authorization: Basic {Base64-encoded username:password string}
''Response Code:''
+
</nowiki>
<pre>HTTP/1.1 200 OK</pre>
+
  
''Response Body:''
+
'''Response'''
 
  <nowiki>
 
  <nowiki>
    {
+
200 OK
      "flavor":
+
 
          {
+
{
            "name":"Small",  
+
  "flavor":{
            "links":[
+
    "name":"Small",  
                {
+
    "links":[
                  "href":"http://{api_server}/flavors/1/",  
+
      {"href":"</nowiki>{{APIBaseURL}}<nowiki>/flavors/1/", "rel":"self"}
                  "rel":"self"
+
    ],  
                }
+
    "vcpu":"1",  
            ],  
+
    "ram":512,  
            "vcpu":"1",  
+
    "disk":10,  
            "ram":512,  
+
    "id":"1"
            "disk":10,  
+
  }
            "id":"1"
+
}
          }
+
      }
+
 
</nowiki>
 
</nowiki>
  
'''Failure while trying to make an unauthorized request'''
+
=== Failure while trying to make an unauthorized request ===
:'''GET''' <nowiki>http://{api_server}/flavors/{flavor_id}</nowiki>
+
'''Request'''
 +
<nowiki>
 +
GET /flavors/1
 +
Authorization: Basic {invalid authorization}
 +
</nowiki>
  
''Request Headers:''
+
'''Response'''
    Content-Type:application/json
+
<nowiki>
    Charset=UTF-8
+
401 Unauthorized
    Authorization:Base64-encoded <span style="color:red">fake_authentication_string</span>
+
</nowiki>
  
''Response Code:''
+
=== Failure while trying to access a flavor that is not allowed for this user ===
<pre>HTTP/1.1 401 Unauthorized</pre>
+
'''Request'''
 +
<nowiki>
 +
GET /flavors/101
 +
Authorization: Basic {Base64-encoded username:password string}
 +
</nowiki>
  
''Response Body:''
+
'''Response'''
    401 Unauthorized
+
  <nowiki>
    This server could not verify that you are authorized to
+
403 Forbidden
    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.
+
  
 +
{
 +
  "forbidden": {
 +
    "message": "forbidden",
 +
    "code": 403,
 +
    "details": "",
 +
    "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 +
  }
 +
}
 +
</nowiki>
  
'''Failure while trying to access a flavor that is not allowed for this user'''
+
=== Failure while trying to access a flavor that does not exist ===
:'''GET''' <nowiki>http://{api_server}/flavors/{flavor_id}</nowiki>
+
'''Request'''
 
+
<nowiki>
''Request Headers:''
+
GET /flavors/missing_flavor_id
    Content-Type:application/json
+
Authorization: Basic {Base64-encoded username:password string}
    Charset=UTF-8
+
</nowiki>
    Authorization:Base64-encoded username & password string
+
 
+
''Response Code:''
+
<pre>HTTP/1.1 403 Forbidden</pre>
+
  
''Response Body:''
+
'''Response'''
 
  <nowiki>
 
  <nowiki>
    {
+
404 Not Found
        "forbidden":
+
        {
+
            "message": "forbidden",
+
            "code": 403,
+
            "details": "",
+
            "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
+
        }
+
    }</nowiki>
+
  
 +
{
 +
  "itemNotFound": {
 +
    "message": "Resource not found",
 +
    "code": 404,
 +
    "details": "",
 +
    "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 +
  }
 +
}
 +
</nowiki>
  
'''Failure while trying to access a flavor that does not exist'''
+
== See also ==
:'''GET''' http(s)://{api_server}/flavors/{<span style="color:red">fake_flavor_id</span>}
+
* [[FlexCloud Server|FlexCloud Server API]]
 
+
* [[Common Features]]
''Request Headers:''
+
    Content-Type:application/json
+
    Charset=UTF-8
+
    Authorization:Base64-encoded username & password string
+
 
+
''Response Code:''
+
<pre>HTTP/1.1 404 Not Found</pre>
+
 
+
''Response Body:''
+
<nowiki>
+
    {
+
        "itemNotFound":
+
        {
+
            "message": "Resource not found",
+
            "code": 404,
+
            "details": "",
+
            "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
+
        }
+
    }</nowiki>
+
  
 +
{{disqus}}
 
[[Category:Hostway API]]
 
[[Category:Hostway API]]
 
[[Category:FlexCloud Server API]]
 
[[Category:FlexCloud Server API]]

Revision as of 12:50, 24 May 2013

GET /flavors/detail/{id}

This operation will return size details of a single flavor.

Contents

Request

GET /flavors/detail/{id}

Parameters

id
The unique identifier of the flavor to be retrieved. Note see warnings in Hypermedia.

Response

Status Code

200 OK
Success
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.
403 Forbidden
The resource cannot be accessed by the user
404 Not Found
The requested resource does not exist

Response Body

{
  "flavor":{
    "name":"{display_flavor_name}",
    "links":[
      {"href":"https://api.hostway.com/flavors/{flavor_id}/", "rel":"self"}
    ],
    "vcpu":"1",
    "ram":512,
    "disk":10,
    "id":"{flavor_id}"
  }
}

Parameters

id - string
Unique identifier for this flavor.
links - array
Hypermedia for this resource.
name - string
Display name for this flavor.
ram - number
Memory allocated with this flavor. Specified in MB.
disk - number
Disk space allocated with this flavor. Specified in GB.
vcpu - number
Number of CPUs allocated with this flavor.

Examples

Successfully view flavor details

Request

GET /flavors/1
Authorization: Basic {Base64-encoded username:password string}
 

Response

200 OK

{
  "flavor":{
    "name":"Small", 
    "links":[
      {"href":"https://api.hostway.com/flavors/1/", "rel":"self"}
    ], 
    "vcpu":"1", 
    "ram":512, 
    "disk":10, 
    "id":"1"
  }
}

Failure while trying to make an unauthorized request

Request

GET /flavors/1
Authorization: Basic {invalid authorization}
 

Response

401 Unauthorized
 

Failure while trying to access a flavor that is not allowed for this user

Request

GET /flavors/101
Authorization: Basic {Base64-encoded username:password string}
 

Response

403 Forbidden

{
  "forbidden": {
    "message": "forbidden",
    "code": 403,
    "details": "",
    "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
  }
}
 

Failure while trying to access a flavor that does not exist

Request

GET /flavors/missing_flavor_id
Authorization: Basic {Base64-encoded username:password string}
 

Response

404 Not Found

{
  "itemNotFound": {
    "message": "Resource not found",
    "code": 404,
    "details": "",
    "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
  }
}
 

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox