Zone
From Hostway API Documentation
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision) |
Mike.robski (Talk | contribs) m (1 revision: Release 86) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | = GET / | + | = GET /accounts/''{accountId}''/flexcloud/zone = |
− | Returns all available zones for the | + | Returns all available zones for the specified account. |
__TOC__ | __TOC__ | ||
== Request == | == Request == | ||
− | <code>GET / | + | <code>GET /accounts/''{accountId}''/flexcloud/zone</code> |
+ | |||
+ | ==== Request Parameters ==== | ||
+ | ; accountId - ''string'' | ||
+ | : The selected account Id. | ||
== Response == | == Response == | ||
Line 16: | Line 20: | ||
; 403 Forbidden | ; 403 Forbidden | ||
: Failure - The resource is forbidden for this user | : Failure - The resource is forbidden for this user | ||
+ | |||
+ | ; 404 itemNotFound | ||
+ | : Failure - When trying to get the zones with invalid account number | ||
=== Response Body === | === Response Body === | ||
Line 30: | Line 37: | ||
} | } | ||
] | ] | ||
− | } | + | }</nowiki> |
− | </nowiki> | + | |
==== Parameters ==== | ==== Parameters ==== | ||
Line 48: | Line 54: | ||
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
− | GET / | + | GET /accounts/smith1234/flexcloud/zone |
− | Authorization: Basic {Base64-encoded username:password string} | + | Authorization: Basic {Base64-encoded username:password string}</nowiki> |
− | + | ||
'''Response''' | '''Response''' | ||
Line 63: | Line 68: | ||
} | } | ||
] | ] | ||
− | } | + | }</nowiki> |
− | </nowiki> | + | |
=== Failure while trying to make an unauthorized request === | === Failure while trying to make an unauthorized request === | ||
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
− | GET / | + | GET /accounts/smith1234/flexcloud/zone |
− | Authorization: Basic {invalid authorization} | + | Authorization: Basic {invalid authorization}</nowiki> |
− | + | ||
'''Response''' | '''Response''' | ||
<nowiki> | <nowiki> | ||
− | 401 Unauthorized | + | 401 Unauthorized</nowiki> |
− | + | ||
=== Permission denied failure === | === Permission denied failure === | ||
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
− | GET / | + | GET /accounts/smith1234/flexcloud/zone |
− | Authorization: Basic {Base64-encoded username:password string} | + | Authorization: Basic {Base64-encoded username:password string}</nowiki> |
− | + | ||
'''Response''' | '''Response''' | ||
Line 96: | Line 97: | ||
"errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" | "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" | ||
} | } | ||
− | } | + | }</nowiki> |
− | </nowiki> | + | |
+ | === Account Number not found === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | GET /accounts/fake/flexcloud/zone | ||
+ | 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 /zones == | ||
+ | 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 /zones</code> | ||
== See also == | == See also == |
Latest revision as of 11:00, 11 October 2013
GET /accounts/{accountId}/flexcloud/zone
Returns all available zones for the specified account.
Contents |
Request
GET /accounts/{accountId}/flexcloud/zone
Request Parameters
- accountId - string
- The selected account Id.
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.
- 403 Forbidden
- Failure - The resource is forbidden for this user
- 404 itemNotFound
- Failure - When trying to get the zones with invalid account number
Response Body
{ "account_number":[ { "zone": "zone_id", "location": "zone_location" }, { "zone": "zone_id", "location": "zone_location" } ] }
Parameters
- account_number - string
- Account for which the zones are available. There can be several accounts per response.
- zone - string
- Zone Id.
- location - string
- Location of the zone.
Examples
Successfully get the zones
Request
GET /accounts/smith1234/flexcloud/zone Authorization: Basic {Base64-encoded username:password string}
Response
200 OK { "smith1234":[ { "zone": "USOTE-2012-TAMPA", "location": "ote.2012.tampa" } ] }
Failure while trying to make an unauthorized request
Request
GET /accounts/smith1234/flexcloud/zone Authorization: Basic {invalid authorization}
Response
401 Unauthorized
Permission denied failure
Request
GET /accounts/smith1234/flexcloud/zone Authorization: Basic {Base64-encoded username:password string}
Response
403 Forbidden { "forbidden": { "message": "forbidden", "code": 403, "details": "", "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" } }
Account Number not found
Request
GET /accounts/fake/flexcloud/zone Authorization: Basic {Base64-encoded username:password string}
Response
{ "itemNotFound": { "guid": "23684df5-0532-4794-802d-fdc82e4e7e7c", "message": "Resource not found", "code": 404, "details": "" } }
Alternative URI /zones
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 /zones
See also