FlavorListDetails

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
(JSON)
m (1 revision: Release 86)
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Lists all flavors with size details optionally limited by the query parameters.
+
= GET /accounts/''{accountId}''/flexcloud/flavors/detail?minDisk=''{diskInGB}''&minRam=''{ramInMB}'' =
 +
This operation will list all available flavors with size details optionally limited by the query parameters.
 +
__TOC__
 +
== Request ==
 +
<code>GET /accounts/''{accountId}''/flexcloud/flavors/detail?minDisk=''{diskInGB}''&minRam=''{ramInMB}''</code>
  
'''GET''' /flavors/detail?''minDisk=diskInGB&minRam=ramInMB''
+
=== URI Parameters ===
 +
; accountId - ''string''
 +
: The selected account Id.
  
== Parameters ==
 
 
; minDisk - ''int''
 
; minDisk - ''int''
 
: ''Optional'' Only flavors only with a disk size greater than or equal to minDisk will be returned. Specified in GB.
 
: ''Optional'' Only flavors only 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 ===
+
 
<big><source lang="javascript">
+
=== 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 exist
 +
 
 +
=== Response Body ===
 +
<nowiki>
 
{
 
{
  "flavors":[
+
  "flavors":[
      {
+
    {
        "name":"Small",
+
      "name":"{display_flavor_name}",
        "links":[
+
      "links":[
            {
+
        {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", "rel":"self"}
              "href":"http://127.0.0.1:6543/flavors/1/",
+
      ],
              "rel":"self"
+
      "vcpu":1,
            }
+
      "ram":512,
        ],
+
      "disk":10,
        "vcpu":1,
+
      "id":"{flavor_id}"
        "ram":512,
+
    },
        "disk":10,
+
    {
        "id":"1"
+
      "name":"{display_flavor_name}",
      },
+
      "links":[
      {
+
        {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", "rel":"self"}
        "name":"Large",
+
      ],
        "links":[
+
      "vcpu":4,
            {
+
      "ram":16384,
              "href":"http://127.0.0.1:6543/flavors/2/",
+
      "disk":60,
              "rel":"self"
+
      "id":"{flavor_id}"
            }
+
    }
        ],
+
  ]
        "vcpu":4,
+
}</nowiki>
        "ram":16384,
+
        "disk":60,
+
        "id":"2"
+
      }
+
  ]
+
}
+
</source></big>
+
  
 +
==== Parameters ====
 
; id - ''string''
 
; id - ''string''
 
: Unique identifier for this flavor.
 
: Unique identifier for this flavor.
Line 54: Line 64:
  
 
; name - ''string''
 
; name - ''string''
: Descriptive name for this flavor.
+
: Display name for this flavor.
  
 
; ram - ''number''
 
; ram - ''number''
Line 65: Line 75:
 
: Number of CPUs allocated with this flavor.
 
: Number of CPUs allocated with this flavor.
  
<!--  THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING-->
+
== Examples ==
 +
 
 +
=== Successfully list flavors with details ===
 +
'''Request'''
 +
<nowiki>
 +
GET /accounts/{accountId}/flexcloud/flavors/detail
 +
Authorization: Basic {Base64-encoded username:password string}</nowiki>
 +
 
 +
'''Response'''
 +
<nowiki>
 +
200 OK
 +
 
 +
{
 +
  "flavors":[
 +
    {
 +
      "name":"Small",
 +
      "links":[
 +
        {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/1/", "rel":"self"}
 +
      ],
 +
      "vcpu":1,
 +
      "ram":512,
 +
      "disk":10,
 +
      "id":"1"
 +
    },
 +
    {
 +
      "name":"Large",
 +
      "links":[
 +
        {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/2/", "rel":"self"}
 +
      ],
 +
      "vcpu":4,
 +
      "ram":16384,
 +
      "disk":60,
 +
      "id":"2"
 +
    }
 +
  ]
 +
}</nowiki>
 +
 
 +
=== Failure while trying to make an unauthorized request ===
 +
'''Request'''
 +
<nowiki>
 +
GET /accounts/{accountId}/flexcloud/flavors/detail
 +
Authorization: Basic {invalid authorization}</nowiki>
 +
 
 +
'''Response'''
 +
<nowiki>
 +
401 Unauthorized</nowiki>
 +
 
 +
=== Account not found ===
 +
'''Request'''
 +
<nowiki>
 +
GET /accounts/{accountId}/flexcloud/flavors/detail
 +
Authorization: Basic {Base64-encoded username:password string}</nowiki>
 +
 
 +
'''Response'''
 +
  <nowiki>
 +
{
 +
    "itemNotFound": {
 +
        "guid": "23684df5-0532-4794-802d-fdc82e4e7e7c",
 +
        "message": "Resource not found",
 +
        "code": 404,
 +
        "details": ""
 +
    }
 +
}</nowiki>
 +
 
 +
== Alternative URI /flavors/detail ==
 +
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]].
 +
 
 +
<code>GET /flavors/detail</code>
  
{{#widget:DISQUS
+
== See also ==
|id=hostway
+
* [[FlexCloud Server|FlexCloud Server API]]
|uniqid={{PAGENAME}}
+
* [[Common Features]]
|url={{fullurl:{{PAGENAME}}}}
+
}}
+
  
<!--  ########################################################################### -->
+
{{disqus}}
 +
[[Category:Hostway API]]
 +
[[Category:FlexCloud Server API]]

Latest revision as of 12:00, 11 October 2013

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

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

Contents

[edit] Request

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

[edit] URI Parameters

accountId - string
The selected account Id.
minDisk - int
Optional Only flavors only 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 exist

[edit] Response Body

{
  "flavors":[
    {
      "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}"
    },
    {
      "name":"{display_flavor_name}",
      "links":[
        {"href":"https://api.hostway.com/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", "rel":"self"}
      ],
      "vcpu":4,
      "ram":16384,
      "disk":60,
      "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 list flavors with details

Request

GET /accounts/{accountId}/flexcloud/flavors/detail
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"}
      ],
      "vcpu":1,
      "ram":512,
      "disk":10,
      "id":"1"
    },
    {
      "name":"Large",
      "links":[
        {"href":"https://api.hostway.com/accounts/{accountId}/flexcloud/flavors/2/", "rel":"self"}
      ],
      "vcpu":4,
      "ram":16384,
      "disk":60,
      "id":"2"
    }
  ]
}

[edit] Failure while trying to make an unauthorized request

Request

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

Response

401 Unauthorized

[edit] Account not found

Request

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

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

[edit] See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox