Zone

(Difference between revisions)
Jump to: navigation, search
m (1 revision)
Line 1: Line 1:
This operation will return all zones per account
+
= GET /zones =
 +
Returns all available zones for the authorized user.
 +
__TOC__
 +
== Request ==
 +
<code>GET /zones</code>
  
'''GET''' /zones
+
== Response ==
  
== Result ==
+
=== Status Code ===
=== JSON ===
+
; 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":[
+
  "account_number":[
      {
+
    {
          "zone": "zone_textkey",
+
      "zone": "zone_id",
          "location": "location_zone"
+
      "location": "zone_location"
      },
+
    },
      {
+
    {
          "zone": "zone_textkey2",
+
      "zone": "zone_id",
          "location": "location_zone2"
+
      "location": "zone_location"
      }
+
    }
  ]
+
  ]
 
}
 
}
 
</nowiki>
 
</nowiki>
 +
 +
==== Parameters ====
 
; account_number - ''string''
 
; account_number - ''string''
: Account number for which are the zones. There can be several accounts per user.
+
: Account for which the zones are available. There can be several accounts per response.
  
 
; zone - ''string''
 
; zone - ''string''
: Zone textkey
+
: Zone Id.
  
 
; location - ''string''
 
; location - ''string''
: Location of the zone
+
: Location of the zone.
 
+
== Response Codes ==
+
; 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.
+
:''HTTP/1.1 403 Forbidden'' - The resource is forbidden for this user
+
  
 
== Examples ==
 
== Examples ==
'''Successfully get the zones'''
 
:'''GET''' <nowiki>http://{api_server}/zones</nowiki>
 
  
''Request Headers:''
+
=== Successfully get the zones ===
    Content-Type:application/json
+
'''Request'''
    Charset=UTF-8
+
<nowiki>
    Authorization:Base64-encoded username & password string
+
GET /zones
 
+
Authorization: Basic {Base64-encoded username:password string}
''Response Code:''
+
</nowiki>
<pre>HTTP/1.1 200 OK</pre>
+
  
''Response Body:''
+
'''Response'''
 
  <nowiki>
 
  <nowiki>
{
+
200 OK
  "smith1234":[
+
 
      {
+
{
          "zone": "USOTE-2012-TAMPA",
+
  "smith1234":[
          "location": "ote.2012.tampa"
+
    {
      }
+
      "zone": "USOTE-2012-TAMPA",
  ]
+
      "location": "ote.2012.tampa"
}
+
    }
 +
  ]
 +
}
 
</nowiki>
 
</nowiki>
  
'''Failure while trying to make an unauthorized request'''
+
=== Failure while trying to make an unauthorized request ===
:'''GET''' <nowiki>http://{api_server}/zones</nowiki>
+
'''Request'''
 +
<nowiki>
 +
GET /zones
 +
Authorization: Basic {invalid authorization}
 +
</nowiki>
  
''Request Headers:''
+
'''Response'''
    Content-Type:application/json
+
<nowiki>
    Charset=UTF-8
+
401 Unauthorized
    Authorization:Base64-encoded <span style="color:red">fake_authentication_string</span>
+
</nowiki>
  
''Response Code:''
+
=== Permission denied failure ===
<pre>HTTP/1.1 401 Unauthorized</pre>
+
'''Request'''
 +
<nowiki>
 +
GET /zones
 +
Authorization: Basic {Base64-encoded username:password string}
 +
</nowiki>
  
''Response Body:''
+
'''Response'''
    401 Unauthorized
+
  <nowiki>
    This server could not verify that you are authorized to
+
403 Forbidden
    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.
+
  
'''Permission denied failure'''
+
{
:'''GET''' http(s)://{api_server}/zones
+
  "forbidden": {
 
+
    "message": "forbidden",
''Request Headers:''
+
     "code": 403,
     Content-Type:application/json
+
     "details": "",
     Charset=UTF-8
+
     "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
     Authorization:Base64-encoded username & password string
+
  }
 
+
}
''Response Code:''
+
</nowiki>
<pre>HTTP/1.1 403 Forbidden</pre>
+
  
''Response Body:''
+
== See also ==
{
+
* [[FlexCloud Server|FlexCloud Server API]]
    "forbidden":
+
* [[Common Features]]
      {
+
          "message": "forbidden",
+
          "code": 403,
+
          "details": "",
+
          "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
+
      }
+
}
+
  
 +
{{disqus}}
 
[[Category:Hostway API]]
 
[[Category:Hostway API]]
 
[[Category:FlexCloud Server API]]
 
[[Category:FlexCloud Server API]]

Revision as of 14: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


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox