Flavor

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
m (1 revision: Release 86)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
= GET /accounts/''{accountId}''/flexcloud/flavors/detail/''{id}'' =
 
This operation will return size details of a single flavor.
 
This operation will return size details of a single flavor.
 
+
__TOC__
=='''GET''' /flavors/detail/'''id'''==
+
== Request ==
 +
<code>GET /accounts/''{accountId}''/flexcloud/flavors/detail/''{id}''</code>
  
 
=== Parameters ===
 
=== Parameters ===
 +
; accountId - ''string''
 +
: The selected account Id.
 +
 
; 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>/accounts/{accountId}/flexcloud/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,
+
}</nowiki>
        "disk":10,
+
        "id":"{flavor_id}"
+
      }
+
}
+
</nowiki>
+
  
 +
==== Parameters ====
 
; id - ''string''
 
; id - ''string''
 
: Unique identifier for this flavor.
 
: Unique identifier for this flavor.
Line 46: Line 61:
 
: Number of CPUs allocated with this flavor.
 
: Number of CPUs allocated with this flavor.
  
=== Response Codes ===
+
== Examples ==
:''HTTP/1.1 200 OK''
+
  
; Failure:
+
=== Successfully view flavor details ===
:''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.
+
'''Request'''
:''HTTP/1.1 403 Forbidden'' - The resource cannot be accessed by the user
+
  <nowiki>
:''HTTP/1.1 404 Not Found''' - The requested resource does not exist
+
GET /accounts/{accountId}/flexcloud/flavors/1
 +
Authorization: Basic {Base64-encoded username:password string}</nowiki>
  
=== Examples ===
+
'''Response'''
'''Successfully view flavor details'''
+
<nowiki>
:'''GET''' <nowiki>http://{api_server}/flavors/1</nowiki>
+
200 OK
  
''Request Headers:''
+
{
     Content-Type:application/json
+
  "flavor":{
     Charset=UTF-8
+
     "name":"Small",
     Authorization:Base64-encoded username & password string
+
    "links":[
 +
      {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/1/", "rel":"self"}
 +
     ],
 +
     "vcpu":"1",
 +
    "ram":512,
 +
    "disk":10,
 +
    "id":"1"
 +
  }
 +
}</nowiki>
  
''Response Code:''
+
=== Failure while trying to make an unauthorized request ===
<pre>HTTP/1.1 200 OK</pre>
+
'''Request'''
 +
<nowiki>
 +
GET /accounts/{accountId}/flexcloud/flavors/1
 +
Authorization: Basic {invalid authorization}</nowiki>
  
''Response Body:''
+
'''Response'''
 
  <nowiki>
 
  <nowiki>
    {
+
401 Unauthorized</nowiki>
      "flavor":
+
          {
+
            "name":"Small",
+
            "links":[
+
                {
+
                  "href":"http://{api_server}/flavors/1/",
+
                  "rel":"self"
+
                }
+
            ],
+
            "vcpu":"1",
+
            "ram":512,
+
            "disk":10,
+
            "id":"1"
+
          }
+
      }
+
</nowiki>
+
  
'''Failure while trying to make an unauthorized request'''
+
=== Failure while trying to access a flavor that is not allowed for this user ===
:'''GET''' <nowiki>http://{api_server}/flavors/{flavor_id}</nowiki>
+
'''Request'''
 +
<nowiki>
 +
GET /accounts/{accountId}/flexcloud/flavors/101
 +
Authorization: Basic {Base64-encoded username:password string}</nowiki>
  
''Request Headers:''
+
'''Response'''
    Content-Type:application/json
+
<nowiki>
    Charset=UTF-8
+
403 Forbidden
    Authorization:Base64-encoded <span style="color:red">fake_authentication_string</span>
+
  
''Response Code:''
+
{
<pre>HTTP/1.1 401 Unauthorized</pre>
+
  "forbidden": {
 +
    "message": "forbidden",
 +
    "code": 403,
 +
    "details": "",
 +
    "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 +
  }
 +
}</nowiki>
  
''Response Body:''
+
=== Failure while trying to access a flavor that does not exist ===
    401 Unauthorized
+
'''Request'''
    This server could not verify that you are authorized to
+
  <nowiki>
    access the document you requested. Either you supplied the
+
GET /accounts/{accountId}/flexcloud/flavors/missing_flavor_id
    wrong credentials (e.g., bad password), or your browser
+
Authorization: Basic {Base64-encoded username:password string} </nowiki>
    does not understand how to supply the credentials required.
+
  
 +
'''Response'''
 +
<nowiki>
 +
404 Not Found
  
'''Failure while trying to access a flavor that is not allowed for this user'''
+
{
:'''GET''' <nowiki>http://{api_server}/flavors/{flavor_id}</nowiki>
+
  "itemNotFound": {
 +
    "message": "Resource not found",
 +
    "code": 404,
 +
    "details": "",
 +
    "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 +
  }
 +
} </nowiki>
  
''Request Headers:''
+
=== Account not found ===
    Content-Type:application/json
+
'''Request'''
    Charset=UTF-8
+
<nowiki>
    Authorization:Base64-encoded username & password string
+
GET /accounts/fake/flexcloud/flavors/101
 +
Authorization: Basic {Base64-encoded username:password string}</nowiki>
  
''Response Code:''
+
'''Response'''
<pre>HTTP/1.1 403 Forbidden</pre>
+
<nowiki>
 
+
{
''Response Body:''
+
    "itemNotFound": {
    {"forbidden": {"message": "forbidden", "code": 403, "details": ""}}
+
        "guid": "23684df5-0532-4794-802d-fdc82e4e7e7c",
 
+
        "message": "Resource not found",
 
+
        "code": 404,
'''Failure while trying to access a flavor that does not exist'''
+
        "details": ""
:'''GET''' http(s)://{api_server}/flavors/{<span style="color:red">fake_flavor_id</span>}
+
    }
 +
}</nowiki>
  
''Request Headers:''
+
== Alternative URI /flavors/detail/{id} ==
    Content-Type:application/json
+
An alternative way to execute this call is to omit the ''accountId'' portion of the URI. In this case the system assumes the request is executed for the account identified in the [[Authentication|authorization header]].
    Charset=UTF-8
+
    Authorization:Base64-encoded username & password string
+
  
''Response Code:''
+
<code>GET /flavors/detail/{id}</code>
<pre>HTTP/1.1 404 Not Found</pre>
+
 
+
''Response Body:''
+
    {"itemNotFound": {"message": "Resource not found", "code": 404, "details": ""}}
+
  
 +
== See also ==
 +
* [[FlexCloud Server|FlexCloud Server API]]
 +
* [[Common Features]]
  
 +
{{disqus}}
 
[[Category:Hostway API]]
 
[[Category:Hostway API]]
 
[[Category:FlexCloud Server API]]
 
[[Category:FlexCloud Server API]]
 
<!--  THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING-->
 
 
{{#widget:DISQUS
 
|id=hostway
 
|uniqid={{PAGENAME}}
 
|url={{fullurl:{{PAGENAME}}}}
 
}}
 
 
<!--  ########################################################################### -->
 

Latest revision as of 12:00, 11 October 2013

[edit] GET /accounts/{accountId}/flexcloud/flavors/detail/{id}

This operation will return size details of a single flavor.

Contents

[edit] Request

GET /accounts/{accountId}/flexcloud/flavors/detail/{id}

[edit] Parameters

accountId - string
The selected account Id.
id
The unique identifier of the flavor to be retrieved. Note see warnings in Hypermedia.

[edit] Response

[edit] 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

[edit] Response Body

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

[edit] 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.

[edit] Examples

[edit] Successfully view flavor details

Request

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

Response

200 OK

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

[edit] Failure while trying to make an unauthorized request

Request

GET /accounts/{accountId}/flexcloud/flavors/1
Authorization: Basic {invalid authorization}

Response

401 Unauthorized

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

Request

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

Response

403 Forbidden

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

[edit] Failure while trying to access a flavor that does not exist

Request

GET /accounts/{accountId}/flexcloud/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"
  }
} 

[edit] Account not found

Request

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

Response

{
    "itemNotFound": {
        "guid": "23684df5-0532-4794-802d-fdc82e4e7e7c",
        "message": "Resource not found",
        "code": 404,
        "details": ""
    }
}

[edit] Alternative URI /flavors/detail/{id}

An alternative way to execute this call is to omit the accountId portion of the URI. In this case the system assumes the request is executed for the account identified in the authorization header.

GET /flavors/detail/{id}

[edit] See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox