Zone
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision) |
Mike.robski (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | + | = GET /zones = | |
+ | Returns all available zones for the authorized user. | ||
+ | __TOC__ | ||
+ | == Request == | ||
+ | <code>GET /zones</code> | ||
− | + | == 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 | ||
+ | |||
+ | === Response Body === | ||
<nowiki> | <nowiki> | ||
{ | { | ||
− | + | "account_number":[ | |
− | + | { | |
− | + | "zone": "zone_id", | |
− | + | "location": "zone_location" | |
− | + | }, | |
− | + | { | |
− | + | "zone": "zone_id", | |
− | + | "location": "zone_location" | |
− | + | } | |
− | + | ] | |
} | } | ||
</nowiki> | </nowiki> | ||
+ | |||
+ | ==== Parameters ==== | ||
; account_number - ''string'' | ; account_number - ''string'' | ||
− | : Account | + | : Account for which the zones are available. There can be several accounts per response. |
; zone - ''string'' | ; zone - ''string'' | ||
− | : Zone | + | : Zone Id. |
; location - ''string'' | ; location - ''string'' | ||
− | : Location of the zone | + | : Location of the zone. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
== Examples == | == Examples == | ||
− | |||
− | |||
− | ''Request | + | === Successfully get the zones === |
− | + | '''Request''' | |
− | + | <nowiki> | |
− | + | GET /zones | |
− | + | Authorization: Basic {Base64-encoded username:password string} | |
− | + | </nowiki> | |
− | + | ||
− | ''Response | + | '''Response''' |
<nowiki> | <nowiki> | ||
− | + | 200 OK | |
− | + | ||
− | + | { | |
− | + | "smith1234":[ | |
− | + | { | |
− | + | "zone": "USOTE-2012-TAMPA", | |
− | + | "location": "ote.2012.tampa" | |
− | + | } | |
+ | ] | ||
+ | } | ||
</nowiki> | </nowiki> | ||
− | + | === Failure while trying to make an unauthorized request === | |
− | + | '''Request''' | |
+ | <nowiki> | ||
+ | GET /zones | ||
+ | Authorization: Basic {invalid authorization} | ||
+ | </nowiki> | ||
− | '' | + | '''Response''' |
− | + | <nowiki> | |
− | + | 401 Unauthorized | |
− | + | </nowiki> | |
− | '' | + | === Permission denied failure === |
− | < | + | '''Request''' |
+ | <nowiki> | ||
+ | GET /zones | ||
+ | Authorization: Basic {Base64-encoded username:password string} | ||
+ | </nowiki> | ||
− | ''Response | + | '''Response''' |
− | + | <nowiki> | |
− | + | 403 Forbidden | |
− | + | ||
− | + | ||
− | + | ||
− | + | { | |
− | : | + | "forbidden": { |
− | + | "message": "forbidden", | |
− | + | "code": 403, | |
− | + | "details": "", | |
− | + | "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" | |
− | + | } | |
− | + | } | |
− | + | </nowiki> | |
− | + | ||
− | + | == See also == | |
− | + | * [[FlexCloud Server|FlexCloud Server API]] | |
− | + | * [[Common Features]] | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | {{disqus}} | ||
[[Category:Hostway API]] | [[Category:Hostway API]] | ||
[[Category:FlexCloud Server API]] | [[Category:FlexCloud Server API]] |
Revision as of 13:45, 24 May 2013
GET /zones
Returns all available zones for the authorized user.
Contents |
Request
GET /zones
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
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 /zones 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 /zones Authorization: Basic {invalid authorization}
Response
401 Unauthorized
Permission denied failure
Request
GET /zones Authorization: Basic {Base64-encoded username:password string}
Response
403 Forbidden { "forbidden": { "message": "forbidden", "code": 403, "details": "", "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" } }
See also