List Flexible IPs

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
(Created page with "='''GET''' /os-floating-ips= This operation will list all the allocated flexible IP addresses in your account. == Response == === JSON === <nowiki> { "floating_ips" : [ ...")
 
m (1 revision: Release 86)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
='''GET''' /os-floating-ips=
+
='''GET''' /accounts/''{accountId}''/flexcloud/os-floating-ips=
 
This operation will list all the allocated flexible IP addresses in your account.
 
This operation will list all the allocated flexible IP addresses in your account.
 +
__TOC__
  
 +
== Request ==
 +
<code>GET /accounts/{accountId}/flexcloud/os-floating-ips</code>
 +
 +
==== Request Parameters ====
 +
; accountId - ''string''
 +
: The selected account Id.
  
 
== Response ==
 
== Response ==
Line 14: Line 21:
 
         "links": [
 
         "links": [
 
             {
 
             {
               "href": "http://{api_server}/os-floating-ips/{ip_address}/",  
+
               "href": "http://{api_server}/accounts/{accountId}/flexcloud/os-floating-ips/{ip_address}/",  
 
               "rel": "self"
 
               "rel": "self"
 
             }
 
             }
Line 26: Line 33:
 
         "links": [
 
         "links": [
 
             {
 
             {
               "href": "http://{api_server}/os-floating-ips/{ip_address}/",  
+
               "href": "http://{api_server}/accounts/{accountId}/flexcloud/os-floating-ips/{ip_address}/",  
 
               "rel": "self"
 
               "rel": "self"
 
             }
 
             }
Line 59: Line 66:
  
 
'''List servers'''
 
'''List servers'''
:'''GET''' http(s)://{api_server}/os-floating-ips
+
:'''GET''' http(s)://{api_server}/accounts/{accountId}/flexcloud/os-floating-ips
  
  
Line 80: Line 87:
 
         "links": [
 
         "links": [
 
             {
 
             {
               "href": "http://{api_server}/os-floating-ips/{ip_address}/",  
+
               "href": "http://{api_server}/accounts/{accountId}/flexcloud/os-floating-ips/{ip_address}/",  
 
               "rel": "self"
 
               "rel": "self"
 
             }
 
             }
Line 92: Line 99:
 
         "links": [
 
         "links": [
 
             {
 
             {
               "href": "http://{api_server}/os-floating-ips/{ip_address}/",  
+
               "href": "http://{api_server}/accounts/{accountId}/flexcloud/os-floating-ips/{ip_address}/",  
 
               "rel": "self"
 
               "rel": "self"
 
             }
 
             }
Line 103: Line 110:
  
 
'''Unauthorized access'''
 
'''Unauthorized access'''
:'''GET''' <nowiki>http://{api_server}/os-floating-ips</nowiki>
+
:'''GET''' <nowiki>http://{api_server}/accounts/{accountId}/flexcloud/os-floating-ips</nowiki>
  
  
Line 121: Line 128:
 
     does not understand how to supply the credentials required.
 
     does not understand how to supply the credentials required.
  
 +
'''Failure while trying to pass invalid account number'''
 +
:'''GET''' <nowiki>http://{api_server}/accounts/fake/flexcloud/os-floating-ips</nowiki>
 +
 +
''Response Code:''
 +
<pre>HTTP/1.1 404 Not Found</pre>
 +
 +
''Response Body:''
 +
<nowiki>
 +
{
 +
    "itemNotFound" : {
 +
      "message": "Resource not found",
 +
      "code": 404,
 +
      "details": "",
 +
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 +
    }
 +
}</nowiki>
  
<!-- THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING-->
+
== Alternative URI /os-floating-ips ==
 +
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]].
  
{{#widget:DISQUS
+
<code>GET /os-floating-ips</code>
|id=hostway
+
|uniqid={{PAGENAME}}
+
|url={{fullurl:{{PAGENAME}}}}
+
}}
+
  
<!--  ########################################################################### -->
+
[[Category:Hostway API]]
 +
[[Category:FlexCloud Server API]]

Latest revision as of 12:00, 11 October 2013

[edit] GET /accounts/{accountId}/flexcloud/os-floating-ips

This operation will list all the allocated flexible IP addresses in your account.

Contents


[edit] Request

GET /accounts/{accountId}/flexcloud/os-floating-ips

[edit] Request Parameters

accountId - string
The selected account Id.

[edit] Response

[edit] JSON

{
   "floating_ips" : [
      {
         "instance_id" : {instance_id}, 
         "ip": "{ip_address}", 
         "fixed_ip": null, 
         "links": [
            {
               "href": "http://{api_server}/accounts/{accountId}/flexcloud/os-floating-ips/{ip_address}/", 
               "rel": "self"
            }
         ], 
         "pool": "default"
      }, 
      {
         "instance_id": "{instance_id}", 
         "ip": "{ip_address}", 
         "fixed_ip": null, 
         "links": [
            {
               "href": "http://{api_server}/accounts/{accountId}/flexcloud/os-floating-ips/{ip_address}/", 
               "rel": "self"
            }
         ],  
         "pool": "default"
       }
   ]
}

[edit] floating_ips

instance_id - string
Unique instance identifier floating IP is assigned to.
ip - string
IP address allocated.
fixed_ip - string
Fixed IP address.
links - list
Hypermedia for this resource.
pool - string
Name of the pool IP address belongs to.

[edit] Response Codes

Success
HTTP/1.1 200 OK

[edit] Examples

List servers

GET http(s)://{api_server}/accounts/{accountId}/flexcloud/os-floating-ips


Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 200 OK

Response Body:

 {
   "floating_ips" : [
      {
         "instance_id" : null, 
         "ip": "{ip_address}", 
         "fixed_ip": null, 
         "links": [
            {
               "href": "http://{api_server}/accounts/{accountId}/flexcloud/os-floating-ips/{ip_address}/", 
               "rel": "self"
            }
         ], 
         "pool": "default"
      }, 
      {
         "instance_id": "test_server_0013", 
         "ip": "{ip_address}", 
         "fixed_ip": null, 
         "links": [
            {
               "href": "http://{api_server}/accounts/{accountId}/flexcloud/os-floating-ips/{ip_address}/", 
               "rel": "self"
            }
         ],  
         "pool": "default"
       }
   ]
 }

Unauthorized access

GET http://{api_server}/accounts/{accountId}/flexcloud/os-floating-ips


Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded fake_authentication_string

Response Code:

HTTP/1.1 401 Unauthorized

Response Body:

    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.

Failure while trying to pass invalid account number

GET http://{api_server}/accounts/fake/flexcloud/os-floating-ips

Response Code:

HTTP/1.1 404 Not Found

Response Body:

 {
    "itemNotFound" : {
       "message": "Resource not found", 
       "code": 404, 
       "details": "",
       "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
    }
 }

[edit] Alternative URI /os-floating-ips

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 /os-floating-ips

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox