Allocate Flexible IP
From Hostway API Documentation
Revision as of 19:30, 12 April 2013 by Administrator (Talk | contribs)
A Flexible IP address is a static IP address that can be bound to any single Server. When you associate a flexible IP with a Server the IP is bound to that Server's network interface. You will use your flexible IP to connect to your Server. You can allocate IPs and release IPs from your account as needed.
Contents |
POST /os-floating-ips
This operation will allocate a new flexible IP.
Response
JSON
{ "floating_ip" : { "instance_id" : "{instance_id}", "ip" : "{ip_address}", "fixed_ip" : null, "links" : [ { "href" : "http://{api_server}/os-floating-ips/{ip_address}/", "rel" : "self" } ], "pool" : "default" } }
floating_ip
- 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.
Response Codes
- Success
- HTTP/1.1 202 Accepted
- Failure
- HTTP/1.1 401 Unauthorized : This server could not verify that you are authorized to access the document you requested. Either you supplied incorrect credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.
Examples
Successfully allocate a flexible IP
- POST http(s)://{api_server}/os-floating-ips
Request Headers:
Content-Type:application/json Charset=UTF-8 Authorization:Base64-encoded username & password string
Response Code:
HTTP/1.1 202 Accepted
Response Body:
{ "floating_ip" : { "instance_id" : null, "ip" : "{ip_address}", "fixed_ip" : null, "links" : [ { "href" : "http://{api_server}/os-floating-ips/{ip_address}/", "rel" : "self" } ], "pool" : "default" } }
Unauthorized access
- POST http://{api_server}/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.