FlavorList

From Hostway API Documentation
Jump to: navigation, search

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

Lists all available flavors optionally limited by the query parameters.

Contents

Request

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

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

Response

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

{
  "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}"
    }
  ]
}

Parameters

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

Examples

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"
    }
  ]
}

Failure while trying to make an unauthorized request

Request

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

Response

401 Unauthorized

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": ""
    }
}

See also

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