FlavorList

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:
This operation will list all available flavors optionally limited by the query parameters.
+
= GET /accounts/''{accountId}''/flexcloud/flavors?minDisk=''{diskInGB}''&minRam=''{ramInMB}'' =
 +
Lists all available flavors optionally limited by the query parameters.
 +
__TOC__
 +
== Request ==
 +
<code>GET /accounts/''{accountId}''/flexcloud/flavors?minDisk=''{diskInGB}''&minRam=''{ramInMB}''</code>
  
=='''GET''' /flavors?''minDisk=diskInGB&minRam=ramInMB''==
+
=== URI Parameters ===
 +
; accountId - ''string''
 +
: The selected account Id.
  
=== Parameters ===
 
 
; minDisk - ''int''
 
; minDisk - ''int''
 
: ''Optional'' Only flavors with a disk size greater than or equal to minDisk will be returned. Specified in GB.
 
: ''Optional'' Only flavors with a disk size greater than or equal to minDisk will be returned. Specified in GB.
Line 12: Line 17:
 
''Also see [[Pagination]]''
 
''Also see [[Pagination]]''
  
=== Result ===
+
== Response ==
==== JSON ====
+
 
 +
=== Status Code ===
 +
; 200 OK
 +
: Success
 +
 
 +
; 401 Unauthorized
 +
: Failure - 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.
 +
 
 +
; 404 Not Found
 +
: Failure - Resource does not exists
 +
 
 +
=== Response Body ===
 
  <nowiki>
 
  <nowiki>
 
{
 
{
  "flavors":[
+
  "flavors":[
      {
+
    {
        "id":"{flavor_id}",
+
      "id":"{flavor_id}",
        "links":[
+
      "links":[
            {
+
        {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", "rel":"self"}
              "href":"http://{api_server}/flavors/{flavor_id}/",
+
      ],
              "rel":"self"
+
      "name":"{display_flavor_name}"
            }
+
    },
        ],
+
    {
        "name":"{display_flavor_name}"
+
      "id":"{flavor_id}",
      },
+
      "links":[
      {
+
        {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", "rel":"self"}
        "id":"{flavor_id}",
+
      ],
        "links":[
+
      "name":"{display_flavor_name}"
            {
+
    }
              "href":"http://{api_server}/flavors/{flavor_id}/",
+
  ]
              "rel":"self"
+
}</nowiki>
            }
+
        ],
+
        "name":"{display_flavor_name}"
+
      }
+
  ]
+
}
+
</nowiki>
+
  
 +
==== Parameters ====
 
; id - ''string''
 
; id - ''string''
 
: Unique identifier for this flavor.
 
: Unique identifier for this flavor.
Line 50: Line 60:
 
: Display name for this flavor.
 
: Display name for this flavor.
  
=== Response Codes ===
+
== Examples ==
; 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.
+
=== Successfully list available flavors ===
 +
'''Request'''
 +
<nowiki>
 +
GET /accounts/{accountId}/flexcloud/flavors
 +
Authorization: Basic {Base64-encoded username:password string}</nowiki>
  
=== Examples ===
+
'''Response'''
 +
<nowiki>
 +
200 OK
  
'''Successfully list available flavors'''
+
{
:'''GET''' <nowiki>http://{api_server}/flavors</nowiki>
+
  "flavors": [
 +
    {
 +
      "name": "Small",
 +
      "links": [
 +
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/1/", "rel": "self"},
 +
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/1/", "rel": "bookmark"}
 +
      ],
 +
      "id": "1"
 +
    },
 +
    {
 +
      "name": "Large",
 +
      "links": [
 +
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/3/", "rel": "self"},
 +
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/3/", "rel": "bookmark"}
 +
      ],
 +
      "id": "3"
 +
    }
 +
  ]
 +
}</nowiki>
  
''Request Headers:''
+
=== Failure while trying to make an unauthorized request ===
    Content-Type:application/json
+
'''Request'''
    Charset=UTF-8
+
<nowiki>
    Authorization:Base64-encoded username & password string
+
GET /accounts/{accountId}/flexcloud/flavors
 +
Authorization: Basic {invalid authorization}</nowiki>
  
''Response Code:''
+
'''Response'''
<pre>HTTP/1.1 200 OK</pre>
+
<nowiki>
 +
401 Unauthorized</nowiki>
  
''Response Body:''
+
=== Account not found ===
 +
'''Request'''
 
  <nowiki>
 
  <nowiki>
    {
+
GET /accounts/fake/flexcloud/flavors
      "flavors": [
+
Authorization: Basic {Base64-encoded username:password string}</nowiki>
          {
+
 
            "name": "Small",
+
'''Response'''
            "links": [
+
<nowiki>
              {
+
{
                "href": "http://{api_server}/flavors/1/",
+
    "itemNotFound": {
                "rel": "self"
+
        "guid": "23684df5-0532-4794-802d-fdc82e4e7e7c",
              },
+
        "message": "Resource not found",
              {
+
        "code": 404,
                "href": "http://{api_server}/flavors/1/",
+
        "details": ""
                "rel": "bookmark"
+
              }
+
            ],
+
            "id": "1"
+
          },
+
          {
+
            "name": "Large",
+
            "links": [
+
              {
+
                  "href": "<nowiki>http://{api_server}/flavors/3/</nowiki>",  
+
                  "rel": "self"
+
              },  
+
              {
+
                  "href": "<nowiki>http://{api_server}/flavors/3/",  
+
                  "rel": "bookmark"}
+
            ],
+
            "id": "3"
+
          }
+
      ]
+
 
     }
 
     }
</nowiki>
+
}</nowiki>
  
'''Failure while trying to make an unauthorized request'''
+
== See also ==
:'''GET''' <nowiki>http://{api_server}/flavors</nowiki>
+
* [[FlexCloud Server|FlexCloud Server API]]
 +
* [[Common Features]]
  
''Request Headers:''
+
== Alternative URI /flavors ==
    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 <span style="color:red">fake_authentication_string</span>
+
  
''Response Code:''
+
<code>GET /accounts/{accountId}/flexcloud/flavors</code>
<pre>HTTP/1.1 401 Unauthorized</pre>
+
 
+
''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.
+
  
 +
{{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 11:00, 11 October 2013

[edit] GET /accounts/{accountId}/flexcloud/flavors?minDisk={diskInGB}&minRam={ramInMB}

Lists all available flavors optionally limited by the query parameters.

Contents

[edit] Request

GET /accounts/{accountId}/flexcloud/flavors?minDisk={diskInGB}&minRam={ramInMB}

[edit] URI Parameters

accountId - string
The selected account Id.
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

[edit] Response

[edit] Status Code

200 OK
Success
401 Unauthorized
Failure - 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.
404 Not Found
Failure - Resource does not exists

[edit] Response Body

{
  "flavors":[
    {
      "id":"{flavor_id}",
      "links":[
        {"href":"https://api.hostway.com/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", "rel":"self"}
      ],
      "name":"{display_flavor_name}"
    },
    {
      "id":"{flavor_id}",
      "links":[
        {"href":"https://api.hostway.com/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", "rel":"self"}
      ],
      "name":"{display_flavor_name}"
    }
  ]
}

[edit] Parameters

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

[edit] Examples

[edit] Successfully list available flavors

Request

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

Response

200 OK

{
  "flavors": [
    {
      "name": "Small", 
      "links": [
        {"href": "https://api.hostway.com/accounts/{accountId}/flexcloud/flavors/1/", "rel": "self"}, 
        {"href": "https://api.hostway.com/accounts/{accountId}/flexcloud/flavors/1/", "rel": "bookmark"}
      ], 
      "id": "1"
    },
    {
      "name": "Large", 
      "links": [
        {"href": "https://api.hostway.com/accounts/{accountId}/flexcloud/flavors/3/", "rel": "self"},
        {"href": "https://api.hostway.com/accounts/{accountId}/flexcloud/flavors/3/", "rel": "bookmark"}
      ],
      "id": "3"
    }
  ]
}

[edit] Failure while trying to make an unauthorized request

Request

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

Response

401 Unauthorized

[edit] Account not found

Request

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

Response

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

[edit] See also

[edit] Alternative URI /flavors

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


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox