Jump to: navigation, search

Difference between revisions of "MelangeAPIBase"

m (Text replace - "__NOTOC__" to "")
 
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__NOTOC__
+
 
This document constitutes a first attempt in defining an API for the Quantum service. The operation list cannot be deemed complete, and formats for request and response messages have not yet been defined. Moreover, authentication, authorization, and extension mechanisms, as well as the URL structure, are not defined in this document.
+
= Melange API Specification =
 +
 
 +
__TOC__
 +
 
 +
== General Information ==
 +
 
 +
The Melange API is implemented using a RESTful web service interface.
  
 
* All GET /resources accepts 'limit' and 'marker' params. If these params are not passed default limit is applied.
 
* All GET /resources accepts 'limit' and 'marker' params. If these params are not passed default limit is applied.
* Any request can specify format of data it can accept via 'Accept' HTTP header or add a suffix(.json or .xml) to url.
+
* If POST or PUT on a resource doesn't send mandatory params, API returns '400 Bad Request' response.
* The url suffix will override the format specified in 'Accept' header.
+
 
* If POST or PUT on a resource doesn't send mandatory params, API returns 400 Bad request response.
+
== Request/Response Types ==
 +
* The Melange API supports both the JSON and XML data serialization formats.
 +
* The request format is specified using the Content-Type header and is required for operations that have a request body.
 +
* The response format can be specified in requests using either the Accept header or adding an .xml or .json extension to the request URI.
 +
* If no response format is specified, JSON is the default.
 +
* If conflicting formats are specified using both an Accept header and a query extension, the query extension takes precedence.
 +
 
 +
== Versions ==
 +
 
 +
----
 +
=== List versions ===
 +
----
 +
 
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /
 +
|}
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">None </span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">Normal Response code: 200</span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''JSON Response:''</span></span>
 +
 
 +
 
 +
<pre><nowiki>
 +
{
 +
"versions":
 +
                [
 +
                  {"status": "CURRENT", "name": "v0.1", "links":  [ {"href": "http://localhost:9898/v0.1", "rel": "self"}]
 +
                  }
 +
                ]
 +
}
 +
</nowiki></pre>
 +
 
 +
 
 +
== Extensions ==
 +
The Melange API is extensible. The API Extensions allow introducing new features in the API without requiring a version change and allows vendor specific niche functionality. The API extensions work similar to nova extensions.
  
 
----
 
----
= List all versions =
+
=== List extensions ===
Method        : GET URL          : /
+
----
  
Params        : None
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /extensions
 +
|}
  
Description  : Lists all versions of the API(Currently, Only v0.1 will be listed)
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Response Code : Success - 200 OK
+
<span style="font-size: larger"><span style="font-size: smaller">None </span></span>
  
 +
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 +
 +
<span style="font-size: larger"><span style="font-size: smaller">Normal Response code: 200</span></span>
 +
 +
----
 +
=== List extension details ===
 +
----
 +
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /extensions/{alias}
 +
|}
 +
 +
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 +
 +
<span style="font-size: larger"><span style="font-size: smaller">None </span></span>
 +
 +
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 +
 +
<span style="font-size: larger"><span style="font-size: smaller">Normal Response code: 200</span></span>
 +
 +
==== NOTE: ====
 
All the urls below are prefixed by "/v0.1".
 
All the urls below are prefixed by "/v0.1".
 +
 +
== IP Blocks ==
  
 
----
 
----
= Public IP Blocks =
+
=== List Tenant's blocks ===
Method        : GET URL          : /ipam/public_ip_blocks
+
----
  
Params        : None
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/ip_blocks
 +
|}
  
Description  : Lists all public ip blocks
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Response Code : Success - 200 OK
+
<span style="font-size: larger"><span style="font-size: smaller">type ('public' or 'private')</span></span>
  
Method        : POST URL          : /ipam/public_ip_blocks Params        : 'cidr':  [[IpV4]] or [[IpV6]] cidr [Mandatory]
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
* 'network_id' : Can be a uuid, any string accepted
+
<span style="font-size: larger"><span style="font-size: smaller">Normal Response code: 200 </span></span>
  
Description  : Create a public ip block
+
----
 +
=== List Tenant's subnets ===
 +
----
  
Response Code : Success - 201 Created
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/subnets
 +
|}
  
Method        : DELETE URL          : /ipam/public_ip_blocks/:(id)
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Params        : None
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Description  : Delete a public ip block by given id
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Response Code : Success - 200 OK
+
~+~-Normal Response code: 200
 +
 
 +
Error  - 404 Not Found [When IpBlock doesn't exist]-~+~
 +
 
 +
----
 +
=== Get details of tenant's IP block ===
 +
----
  
* Error  - 404 Not Found [When IpBlock doesn't exist]
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/ip_blocks/:(id)
 +
|}
  
Method        : GET URL          : /ipam/public_ip_blocks/:(id)
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Params        : None
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Description  : Get details of a public ip block by given id
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Response Code : Success - 200 OK
+
~+~-Normal Response code: 200  
  
* Error  - 404 Not Found [When IpBlock doesn't exist]
+
Error  - 404 Not Found [When IpBlock doesn't exist]-~+~
  
 
----
 
----
= Private IP Blocks =
+
=== Create tenant's IP block ===
Method        : GET URL          : /ipam/tenants/{tenant_id}/private_ip_blocks
+
----
  
Params        : None
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| POST
 +
| /ipam/tenants/{tenant_id}/ip_blocks
 +
|}
  
Description  : Lists all private ip blocks of a tenant
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Response Code : Success - 200 OK
+
~+~-'type': 'public' or 'private' [Mandatory]
  
Method        : POST URL          : /ipam/tenants/{tenant_id}/private_ip_blocks
+
'cidr': IPV4 or IPV6 cidr [Mandatory]
  
Params        : 'cidr': [[IpV4]] or [[IpV6]] cidr [Mandatory]
+
'network_id': Can be a uuid, any string accepted
  
* 'network_id' : Can be a uuid, any string accepted
+
'policy_id': Is a uuid, has to be an existing policy
  
Description  : Create a private ip block for given tenant
+
'dns1': Primary dns server ip address, defaults to dns configured in melange
  
Response Code : Success - 201 Created
+
'dns2': Secondary dns server ip address, defaults to dns configured in melange
  
Method        : DELETE URL          : /ipam/tenants/{tenant_id}/private_ip_blocks/:(id)
+
'gateway': any valid ip address, defaults to second ip address of the block-~+~
  
Params        : None
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Description  : Delete a tenant's private ip block by given id
+
~+~-Normal Response code: 201
  
Response Code : Success - 200 OK
+
Error - 400 Bad Request [When mandatory fields are not present or field validations fail]-~+~
  
* Error  - 404 Not Found [When IpBlock doesn't exist]
+
----
 +
=== Create tenant's subnet ===
 +
----
  
Method        : GET URL          : /ipam/tenants/{tenant_id}/private_ip_blocks/:(id)
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| POST
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/subnets
 +
|}
  
Params       : None
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Description  : Get details of a tenant's private ip block by given id
+
~+~-'cidr': [[IpV4]] or [[IpV6]] cidr [Mandatory]
  
Response Code : Success - 200 OK
+
'network_id' : Can be a uuid, any string accepted
  
* Error  - 404 Not Found [When IpBlock doesn't exist]
+
'policy_id' : Is a uuid, has to be an existing policy
  
 +
'tenant_id' : Can be a uuid, any string accepted, defaults to parent block's tenant_id-~+~
 +
 +
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 +
 +
~+~-Normal Response code: 201
 +
 +
Error  - 404 Not Found [When IpBlock for given ip_block_id and tenant_id doesn't exist]
 +
 +
Error  - 400 Bad Request [When mandatory fields are not present or field validations fails]-~+~
 +
 +
----
 +
=== Update tenant's IP block ===
 
----
 
----
= [[IpAddress]] for Public IP Blocks (Accessible to admins only) =
 
Get [[IpAddress]] Details for  Public IP Block
 
  
Method        : GET URL          : /ipam/public_ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| PUT
 +
| /ipam/tenants/{tenant_id}/ip_blocks/:(id)
 +
|}
  
Params       : None
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Description  : Finds and returns details of [[IpAddress]] for given 'address' which belongs to the Ipblock with id="ip_block_id", type="public" and tenant_id=None.
+
~+~-'network_id' : Can be a uuid, any string accepted
  
Response Code : Success - 200 OK
+
'policy_id' : Is a uuid, has to be an existing policy-~+~
  
* Error  - 404 Not Found ( When [[IpBlock]] for given ip_block_id is not found, or [[IpAddress]] for given address is not found)
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Get all [[IpAddresses]] for Public IP Block
+
~+~-Normal Response code: 200
  
Method        : GET URL          : /ipam/public_ip_blocks/{ip_block_id}/ip_addresses
+
Error  - 404 Not Found [When IpBlock for given id and tenant_id doesn't exist]
  
Params        : None
+
Error  - 400 Bad Request [When field validations fails]-~+~
  
Description  : Finds and returns all the [[IpAddresses]] which belongs to the Ipblock with id="ip_block_id", type="public" and tenant_id=None
+
----
 +
=== Delete tenant's IP block ===
 +
----
  
Response Code : Success - 200 OK
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /ipam/tenants/{tenant_id}/ip_blocks/:(id)
 +
|}
  
* Error  - 404 Not Found ( When [[IpBlock]] for given ip_block_id is not found)
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Allocate a new [[IpAddress]] from a Public IP Block
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Method        : POST URL          : /ipam/public_ip_blocks/{ip_block_id}/ip_addresses Params        : [port_id, address](optional)
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Description  : Allocates an [[IpAddress]] from Ipblock with id="ip_block_id", type="public" and tenant_id=None. If address is passed in params, [[IpAddress]] with that address is tried to be allocated.
+
~+~-Normal Response code: 200
  
* If port_id is passed, that is set on allocated [[IpAddress]].
+
Error  - 404 Not Found [When IpBlock for given id and tenant_id doesn't exist]-~+~
  
Response Code : Success - 201 Created
+
== IP Address from Tenant's IP Blocks ==
  
* Error  - 404 Not Found ( When [[IpBlock]] for given ip_block_id is not found)
+
----
** 422 Unprocessable Entity ( If any new ip_address can not be allocated from [[IpBlock]] )
+
=== List tenant's addresses ===
 +
----
  
Delete an [[IpAddress]] from a Public IP Block
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses
 +
|}
  
Method        : DELETE URL          : /ipam/public_ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Params        : None
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Description  : Deletes [[IpAddress]] with address="address" belonging to [[IpBlock]] with id="ip_block_id", type="public", tenant_id=None
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Response Code : Success - 200 OK
+
~+~-Normal Response code: 200
  
* Error  - 404 Not Found ( When ip_block for given ip_block_id is not found)
+
Error  - 404 Not Found (When [[IpBlock]] for given ip_block_id and tenant_id is not found)-~+~
  
Restore a deallocated [[IpAddress]] from Public IP Block Method        : PUT URL          : /ipam/public_ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}/restore
+
----
 +
=== List tenant's allocated addresses ===
 +
----
  
Params        : None
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/allocated_ip_addresses
 +
|}
  
Description  : Finds [[IpAddress]] with address="address" belonging to [[IpBlock]] with id="ip_block_id", type="public", tenant_id=None and restores it if was deallocated earlier.
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Response Code : Success - 200 OK
+
<span style="font-size: larger"><span style="font-size: smaller">'used_by_device': uuid of a device, can be any string. If given, IPs allocated to this device will be filtered and returned</span></span>
  
* Error  - 404 Not Found (When [[IpBlock]] for given ip_block_id is not found or [[IpAddress]] for given address is not found)
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">Normal Response code: 200</span></span>
  
 
----
 
----
= [[IpAddress]] For Tenant's Private IP Block =
+
=== List Cloud Providers allocated addresses ===
Get [[IpAddress]] Details for Tenant's Private IP Block
+
----
  
Method        : GET URL          : /ipam/tenants/{tenant_id}/private_ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET  
 +
| /ipam/allocated_ip_addresses
 +
|}
  
Params       : None
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Description  : Finds and returns details of [[IpAddress]] for given 'address' which belongs to the Ipblock with id="ip_block_id", type="private" and tenant_id="tenant_id".
+
<span style="font-size: larger"><span style="font-size: smaller">'used_by_device': uuid of a device, can be any string. If given, IPs allocated to this device will be filtered and returned</span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">Normal Response code: 200</span></span>
 +
 
 +
----
 +
=== Get address details ===
 +
----
  
Response Code : Success - 200 OK
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses/{address}
 +
|}
  
* Error  - 404 Not Found ( When either [[IpBlock]] for given id and tenant_id is not found, or [[IpAddress]] for given address is not found)
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Get all [[IpAddresses]] for Tenant's Private IP Block
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Method        : GET URL          : /ipam/tenants/{tenant_id}/private_ip_blocks/{ip_block_id}/ip_addresses
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Params        : None
+
~+~-Normal Response code: 200
  
Description   : Finds and returns all the [[IpAddresses]] which belongs to the Ipblock with id="ip_block_id", type="private" and tenant_id="tenant_id".
+
Error   - 404 Not Found (When either [[IpBlock]] for given ip_block_id and tenant_id is not found, or [[IpAddress]] for given address is not found)-~+~
  
Response Code : Success - 200 OK
+
----
 +
=== Allocate tenant's address ===
 +
----
  
* Error  - 404 Not Found ( When [[IpBlock]] for given id and tenant_id is not found)
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| POST
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses
 +
|}
  
Allocate a new [[IpAddress]] from Tenant's Private IP Block
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Method        : POST URL          : /ipam/tenants/{tenant_id}/private_ip_blocks/{ip_block_id}/ip_addresses
+
~+~-'address' : This address is used for allocation. If this is not provided, next available address will be allocated.
  
Params        : [port_id, address](optional)
+
'interface_id' : Can be a uuid, any string accepted. Is an id pointing to the interface on which the ip will be configured
  
Description  : Allocates an [[IpAddress]] from Ipblock with id="ip_block_id", type="private" and tenant_id="tenant_id". If address is passed in params, [[IpAddress]] with that address is tried to be allocated.
+
'tenant_id' : The 'lessee' tenant (the tenant actually using the ip, as opposed to the tenant owning the block). Defaults to the tenant owning the block.
  
* If port_id is passed, that is set on allocated [[IpAddress]]
+
'used_by_device' : Can be a uuid, any string accepted. Is an id pointing to the instance(or any other device) on which the ip will be used.
  
Response Code : Success - 201 Created
+
'mac_address' : any valid mac_address, applicable only for generating ipv6 addresses, Mandatory for ipv6 blocks.-~+~
  
* Error  - 404 Not Found ( When [[IpBlock]] for given id and tenant_id is not found)
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
** 422 Unprocessable Entity ( If any new ip_address can not be allocated from [[IpBlock]] )
 
  
Delete an [[IpAddress]] from Tenant's Private IP Block
+
~+~-Normal Response code: 201
  
Method        : DELETE URL          : /ipam/tenants/{tenant_id}/private_ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}
+
Error  - 404 Not Found [When IpBlock for given ip_block_id is not found]
  
Params        : None
+
Error  - 422 Unprocessable Entity [If any new ip_address can not be allocated from IpBlock]
  
Description   : Deletes [[IpAddress]] with address="address" belonging to [[IpBlock]] with id="ip_block_id", type="private", tenant_id="tenant_id"
+
Error   - 409 Conflict [If the given address is already allocated]
  
Response Code : Success - 200 OK
+
Error  - 400 Bad Request [When mandatory fields are not present or fields fail validations]-~+~
  
* Error  - 404 Not Found ( When ip_block for given id and tenant_id is not found)
+
----
 +
=== Deallocate tenant's address ===
 +
----
  
Restore a deallocated [[IpAddress]] from Tenant's Private IP Block
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses/{address}
 +
|}
  
Method        : PUT URL          : /ipam/tenants/{tenant_id}/private_ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}/restore
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Params        : None
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Description  : Finds [[IpAddress]] with address="address" belonging to [[IpBlock]] with id="ip_block_id", type="private", tenant_id="tenant_id" and restores it if was deallocated earlier
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Response Code : Success - 200 OK
+
~+~-Normal Response code: 200
  
* Error  - 404 Not Found ( When [[IpBlock]] for given id and tenant_id is not found or [[IpAddress]] for given address is not found)
+
Error  - 404 Not Found (When ip_block for given id and tenant_id is not found)-~+~
  
 
----
 
----
= Natting =
+
=== Restore tenant's address ===
Add Inside Global IPs to a local IP
+
----
  
Method        : POST URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}/inside_globals
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| PUT
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses/{address}/restore
 +
|}
  
Params        : {'ip_addresses':'[ { "ip_block_id" : "some_global_ip_block_id", "ip_address" : "some_global_ip_address" } ... {} }
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Description  : Finds local [[IpAddress]] from given ip_block_id and address and adds [[IpAddresses]] passed in params as its inside global.
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Response Code : Success - 200 OK
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Add Inside Local IPs to a global IP
+
~+~-Normal Response code: 200
  
Method        : POST URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}/inside_locals
+
Error  - 404 Not Found (When [[IpBlock]] for given id and tenant_id is not found or [[IpAddress]] for given address is not found)-~+~
  
Params        : {'ip_addresses':'[ { "ip_block_id" : "some_local_ip_block_id", "ip_address" : "some_local_ip_address" } ... {} }
+
== Static Routes ==
  
Description  : Finds global [[IpAddress]] from given ip_block_id and address and adds [[IpAddresses]] passed in params as its inside local.
+
----
 +
==== List all Static Routes for an [[IpBlock]] ====
 +
----
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_routes
 +
|}
  
Response Code : Success - 200 OK
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
List all inside globals for a local ip_address
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Method        : GET URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}/inside_globals
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Params        : None
+
<span style="font-size: larger"><span style="font-size: smaller">Normal Response code: 200 </span></span>
  
Description  : Finds the local ip_address from given ip_block_id and address, and return all its inside global ip_addresses.
+
----
 +
==== Get details of a static route ====
 +
----
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_routes/:(id)
 +
|}
  
Response Code : Success - 200 OK
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
List all inside locals for a global ip_address
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Method        : GET URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}/inside_locals
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Params        : None
+
~+~-Normal Response code: 200
  
Description   : Finds the global ip_address from given ip_block_id and address, and return all its inside local ip_addresses.
+
Error   - 404 Not Found [When IpBlock for given ip_block_id and tenant_id does not exists or IpRoute for given id does not exists]-~+~
  
Response Code : Success - 200 OK
+
----
 +
=== Create a Static Route for an [[IpBlock]] ===
 +
----
  
Delete all inside locals for a global ip_address
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| POST
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_routes
 +
|}
  
Method        : DELETE URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}/inside_locals Params        : None
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Description  : Finds the global ip_address from given ip_block_id and address, and remove all its inside local ip_addresses.
+
~+~-'destination' : [Mandatory] [[IpAddress]] or Cidr of the destination host or network.
  
Response Code : Success - 200 OK
+
'netmask : netmask of the destination network, if applicable.
  
Delete a specific inside local for a global ip_address
+
'gateway' : [Mandatory] [[IpAddress]] of the gateway.-~+~
  
Method        : DELETE URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}/inside_locals/{inside_locals_address:.+?}
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Params        : None
+
~+~-Normal Response code: 201
  
Description   : Finds the global ip_address from given ip_block_id and address, and remove its inside local ip_address whose address is same as given inside_locals_address.
+
Error   - 404 Not Found [When IpBlock for given ip_block_id and tenant_id does not exists]
  
Response Code : Success - 200 OK
+
Error  - 400 Bad Request [When required parameters are not present or field validation fails]-~+~
  
Delete all inside globals for an inside ip_address Method        : DELETE URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}/inside_globals
+
----
 +
=== Update a static route ===
 +
----
  
Params        : None
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| PUT
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_routes/:(id)
 +
|}
  
Description  : Finds the inside ip_address from given ip_block_id and address, and remove all its inside global ip_addresses.
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Response Code : Success - 200 OK
+
~+~-'destination' : [[IpAddress]] or Cidr of the destination host or network.
  
Delete a specific inside global for an inside ip_address
+
'netmask : netmask of the destination network, if applicable.
  
Method        : DELETE URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}/inside_globals/{inside_globals_address:.+?}
+
'gateway' : [[IpAddress]] of the gateway.-~+~
  
Params        : None
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Description  : Finds the inside ip_address from given ip_block_id and address, and remove its inside global ip_address whose address is same as given inside_global_address.
+
~+~-Normal Response code: 200
  
Response Code : Success - 200 OK
+
Error  - 404 Not Found [When IpBlock for given ip_block_id and tenant_id does not exists or Static Route for given id does not exists]
 +
 
 +
Error  - 400 Bad Request [When field validation fails]-~+~
  
 
----
 
----
= Global Policies =
+
=== Delete a static route ===
Method        : GET URL          : /ipam/policies
+
----
  
Params        : None
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_routes/:(id)
 +
|}
  
Description  : Lists all global policies
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Response Code : Success - 200 OK
+
<span style="font-size: larger"><span style="font-size: smaller"> None </span></span>
  
Method        : POST URL          : /ipam/policies
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Params        : 'name': string  [Mandatory]
+
~+~-Normal Response code: 200
  
* 'description' : string
+
Error  - 404 Not Found [When IpBlock for given ip_block_id and tenant_id does not exists or Static Route for given id does not exists]-~+~
  
Description  : Create a global policy
+
== IP allocations in a Network ==
  
Response Code : Success - 201 Created
+
----
 +
=== Allocate address from tenant's network ===
 +
----
 +
 
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| POST
 +
| /ipam/tenants/{tenant_id}/networks/{network_id}/interfaces/{interface_id}/ip_allocations
 +
|}
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 +
 
 +
~+~-'addresses' : These addresses(can be array of ipv4 and/or ipv6 addresses) are used for allocation. If not provided, next available address will be allocated from one IPv4 and one IPv6 block.
  
Method        : DELETE URL          : /ipam/policies/:(id)
+
'mac_address' : This will used while allocation IPv6 address. Mandatory if network has IPv6 block.
  
Params        : None
+
'tenant_id' : The 'lessee' tenant (the tenant actually using the ip, as opposed to the tenant owning the block). Defaults to the tenant owning the block from which IPs are allocated.
  
Description  : Delete a global policy by given id
+
'used_by_device' : Can be a uuid, any string accepted. Is an id pointing to the instance(or any other device) on which the ip will be used.-~+~
  
Response Code : Success - 200 OK
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
* Error  - 404 Not Found [When Policy doesn't exist]
+
~+~-Normal Response code: 201
  
Method        : GET URL          : /ipam/policies/:(id)
+
Error  - 422 Unprocessable Entity [If ip address can not be allocated from Network]
  
Params        : None
+
Error - 404 Not Found [When network for a given network_id and tenant_id is not found]
  
Description   : Get details of a global policy by given id
+
Error   - 409 Conflict [If the given address is already allocated]-~+~
  
Response Code : Success - 200 OK
+
Error  - 400 Bad Request [When required parameters are not present or field validation fails]-~+~
  
* Error  - 404 Not Found [When Policy doesn't exist]
+
----
 +
=== List allocated [[IpAddresses]] from a tenant's network ===
 +
----
  
Method        : PUT URL          : /ipam/policies/:(id)
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/networks/{network_id}/interfaces/{interface_id}/ip_allocations
 +
|}
  
Params        : 'name', 'description' Description  : Update details of a global policy by given id
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Response Code : Success - 200 OK
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
* Error   - 404 Not Found [When Policy doesn't exist]
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 +
 
 +
~+~-Normal Response code: 200
 +
 
 +
Error - 404 Not Found [When network for a given network_id and tenant_id is not found]-~+~
  
 
----
 
----
= Global Policy Unusable Ip Ranges =
+
===Deallocate all [[IpAddresses]] from a tenant's network ===
Method        : GET URL          : /ipam/policies/{policy_id}/unusable_ip_ranges
+
----
  
Params        : None
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /ipam/tenants/{tenant_id}/networks/{network_id}/interfaces/{interface_id}/ip_allocations
 +
|}
  
Description  : Lists all unusable ip ranges of a global policy
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Response Code : Success - 200 OK
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Method        : POST URL          : /ipam/policies/{policy_id}/unusable_ip_ranges
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Params        : 'offset': integer  [Mandatory, Can be +ve or -ve integer]
+
~+~-Normal Response code: 200
  
* 'length' : integer [Mandatory, Should be +ve integer]
+
Error - 404 Not Found [When network for a given network_id and tenant_id is not found]-~+~
  
Description  : Create a unusable ip range in global policy
+
== NAT'ing ==
 +
Tracking NAT information is designed to assist in the implementation and tracking of floating IPs.
  
Response Code : Success - 201 Created
+
----
 +
=== List globals ===
 +
----
 +
 
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_globals
 +
|}
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 +
 
 +
~+~-Normal Response code: 200
 +
 
 +
Error  - 404 Not Found [When IpBlock for ip block ID or IP Address by given address is not found]-~+~
 +
 
 +
----
 +
=== List locals ===
 +
----
 +
 
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals
 +
|}
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 +
 
 +
~+~-Normal Response code: 200
 +
 
 +
Error  - 404 Not Found [When IP Block for ip_block_id or IpAddress by given address is not found]-~+~
 +
 
 +
----
 +
=== Assign globals ===
 +
----
 +
 
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| POST
 +
| /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_globals
 +
|}
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Method        : DELETE URL          : /ipam/policies/{policy_id}/unusable_ip_ranges/:(id)
+
<span style="font-size: larger"><span style="font-size: smaller">{'ip_addresses':'[ { "ip_block_id" : "some_global_ip_block_id", "ip_address" : "some_global_ip_address" }, ..., {....} }</span></span>
  
Params        : None
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Description  : Delete a global policy's unusable ip range by given id
+
~+~-Normal Response code: 200
  
Response Code : Success - 200 OK
+
Error  - 400 Bad Request [When the values of ip_block_id and ip_address are missing in the params]-~+~
 +
 
 +
----
 +
=== Assign locals ===
 +
----
  
* Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| POST
 +
| /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_globals
 +
|}
  
Method        : GET URL          : /ipam/policies/{policy_id}/unusable_ip_ranges/:(id)
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Params        : None
+
<span style="font-size: larger"><span style="font-size: smaller">{'ip_addresses':'[ { "ip_block_id" : "some_local_ip_block_id", "ip_address" : "some_local_ip_address" } ... {} }</span></span>
  
Description  : Get details of a global policy's unusable ip range by given id
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Response Code : Success - 200 OK
+
~+~-Normal Response code: 200
  
* Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
+
Error  - 400 Bad Request [When the values of ip_block_id and ip_address are missing in the params]-~+~
  
Method        : PUT URL          : /ipam/policies/{policy_id}/unusable_ip_ranges/:(id)
+
----
 +
=== Remove global ===
 +
----
  
Params        : 'offset', 'length'
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_globals/{inside_globals_address}
 +
|}
  
Description  : Update details of a global policy's unusable ip range by given id
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Response Code : Success - 200 OK
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
* Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 +
 
 +
~+~-Normal Response code: 200
 +
 
 +
Error  - 404 Not Found [When IpBlock for ip_block_id or IpAddress by given address is not found]-~+~
  
 
----
 
----
Global Policy Unusable Ip Octets
+
=== Remove local ===
 +
----
 +
 
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals/{inside_locals_address}
 +
|}
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 +
 
 +
~+~-Normal Response code: 200
 +
 
 +
Error  - 404 Not Found [When IpBlock for ip_block_id or IpAddress by given address is not found]-~+~
 +
 
 +
----
 +
=== Remove all globals ===
 +
----
 +
 
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals/{address}
 +
|}
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Method        : GET URL          : /ipam/policies/{policy_id}/unusable_ip_octets
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Params        : None
+
~+~-Normal Response code: 200
  
Description   : Lists all unusable ip octets of a global policy
+
Error   - 404 Not Found [When IpBlock for ip_block_id or IpAddress by given address is not found]-~+~
  
Response Code : Success - 200 OK
+
----
 +
=== Remove all locals ===
 +
----
  
Method        : POST URL          : /ipam/policies/{policy_id}/unusable_ip_octets
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals
 +
|}
  
Params       : 'octet': integer  [Mandatory, Should be 0-255]
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Description  : Create a unusable ip octet in global policy
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Response Code : Success - 201 Created
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Method        : DELETE URL          : /ipam/policies/{policy_id}/unusable_ip_octets/:(id)
+
~+~-Normal Response code: 200
  
Params        : None
+
Error  - 404 Not Found [When IpBlock for ip_block_id or IpAddress by given address is not found]-~+~
  
Description  : Delete a global policy's unusable ip octet by given id
+
== IP Policy ==
  
Response Code : Success - 200 OK
+
=== Policy ===
  
* Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
+
----
 +
==== List all Tenant's IP Policies  ====
 +
----
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/policies
 +
|}
  
Method        : GET URL          : /ipam/policies/{policy_id}/unusable_ip_octets/:(id)
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Params        : None
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Description  : Get details of a global policy's unusable ip octet by given id
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Response Code : Success - 200 OK
+
<span style="font-size: larger"><span style="font-size: smaller">Normal Response code: 200 </span></span>
  
* Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
+
----
 +
==== Get details of a Tenant's IP Policy ====
 +
----
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/policies/:(id)
 +
|}
  
Method        : PUT URL          : /ipam/policies/{policy_id}/unusable_ip_octets/:(id)
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Params        : 'octet'
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Description  : Update details of a global policy's unusable ip octet by given id
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Response Code : Success - 200 OK
+
~+~-Normal Response code: 200
  
* Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
+
Error  - 404 Not Found [When Policy for given id and tenant_id does not exists]-~+~
  
 
----
 
----
= Tenant Policies =
+
=== Create an IP Policy for a tenant ===
Method        : GET URL          : /ipam/tenants/{tenant_id}/policies
+
----
  
Params        : None
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| POST
 +
| /ipam/tenants/{tenant_id}/policies
 +
|}
  
Description  : Lists all tenant's policies
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Response Code : Success - 200 OK
+
~+~-'name' : [Mandatory] Name of the policy.
  
Method        : POST URL          : /ipam/tenants/{tenant_id}/policies
+
'description' : Small description about the policy.-~+~
  
Params        : 'name': string  [Mandatory]
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
* 'description' : string
+
~+~-Normal Response code: 201
  
Description   : Create a tenant's policy
+
Error   - 400 Bad Request [When required parameters are not present or field validation fails]-~+~
  
Response Code : Success - 201 Created
+
----
 +
=== Update an IP Policy for a tenant ===
 +
----
  
Method        : DELETE URL          : /ipam/tenants/{tenant_id}/policies/:(id)
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| PUT
 +
| /ipam/tenants/{tenant_id}/policies/:(id)  
 +
|}
  
Params       : None
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Description  : Delete a tenant's policy by given id
+
~+~-'name' : Name of the policy.
  
Response Code : Success - 200 OK
+
'description' : Small description about the policy.-~+~
  
* Error  - 404 Not Found [When Policy doesn't exist]
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Method        : GET URL          : /ipam/tenants/{tenant_id}/policies/:(id) Params        : None
+
~+~-Normal Response code: 200
  
Description   : Get details of a tenant's policy by given id
+
Error   - 404 Not Found [When Policy for given id and tenant_id does not exists]
  
Response Code : Success - 200 OK
+
Error  - 400 Bad Request [When required parameters are not present or field validation fails]-~+~
  
* Error  - 404 Not Found [When Policy doesn't exist]
+
----
 +
=== Delete an IP Policy for a tenant ===
 +
----
  
Method        : PUT URL          : /ipam/tenants/{tenant_id}/policies/:(id)
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /ipam/tenants/{tenant_id}/policies/:(id)  
 +
|}
  
Params        : 'name', 'description'
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Description  : Update details of a tenant's policy by given id
+
<span style="font-size: larger"><span style="font-size: smaller"> None </span></span>
  
Response Code : Success - 200 OK
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
* Error  - 404 Not Found [When Policy doesn't exist]
+
~+~-Normal Response code: 200
 +
 
 +
Error  - 404 Not Found [When Policy for given id and tenant_id does not exists]-~+~
 +
 
 +
=== Unusable IP Ranges ===
  
 
----
 
----
Tenant Policy Unusable Ip Ranges
+
==== List all unusable ip ranges of a tenant's policy ====
 +
----
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges
 +
|}
  
Method        : GET URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Params        : None
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Description  : Lists all unusable ip ranges of a tenant's policy
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Response Code : Success - 200 OK
+
~+~-Normal Response code: 200
  
Method        : POST URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges
+
Error  - 404 Not Found [When policy doesn't exist]-~+~
 +
 
 +
----
 +
==== Get details of a tenant's policy's unusable ip range ====
 +
----
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges
 +
|}
  
Params       : 'offset': integer  [Mandatory, Can be +ve or -ve integer]
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
* 'length' : integer [Mandatory, Should be +ve integer]
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Description  : Create a unusable ip range in tenant's policy
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Response Code : Success - 201 Created
+
~+~-Normal Response code: 200
  
Method        : DELETE URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges/:(id)
+
Error  - 404 Not Found [When Policy or IP Range doesn't exist]-~+~
  
Params        : None
+
----
 +
==== Create a unusable ip range in tenant's policy ====
 +
----
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| POST
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges
 +
|}
  
Description  : Delete a tenant's policy's unusable ip range by given id
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Response Code : Success - 200 OK
+
~+~-'offset': integer  [Mandatory, Can be +ve or -ve integer]
  
* Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
+
'length' : integer [Mandatory, Should be +ve integer]-~+~
  
Method        : GET URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges/:(id)
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Params        : None
+
~+~-Normal Response code: 201
  
Description   : Get details of a tenant's policy's unusable ip range by given id
+
Error   - 404 Not Found [When Policy  doesn't exist]-~+~
  
Response Code : Success - 200 OK
+
----
 +
==== Update details of a tenant's policy's unusable ip range ====
 +
----
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| PUT
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges/:(id)
 +
|}
  
* Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Method        : PUT URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges/:(id)
+
~+~-'offset': integer  [Can be +ve or -ve integer]
  
Params        : 'offset', 'length'
+
'length' : integer [Should be +ve integer]-~+~
  
Description  : Update details of a tenant's policy's unusable ip range by given id
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Response Code : Success - 200 OK
+
~+~-Normal Response code: 200
  
* Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
+
Error  - 404 Not Found [When Policy or IP range doesn't exist]-~+~
  
 
----
 
----
Tenant Policy Unusable Ip Octets
+
==== Delete a tenant's policy's unusable ip range ====
 +
----
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges/:(id)
 +
|}
  
Method        : GET URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Params        : None
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Description  : Lists all unusable ip octets of a tenant's policy
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Response Code : Success - 200 OK
+
~+~-Normal Response code: 200
  
Method        : POST URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets
+
Error  - 404 Not Found [When Policy or IP range doesn't exist]-~+~
  
Params        : 'octet': integer  [Mandatory, Should be 0-255]
+
=== Tenant Policy Unusable Ip Octets ===
 +
----
 +
====  List all unusable ip octets of a tenant's policy ====
 +
----
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets
 +
|}
  
Description  : Create a unusable ip octet in tenant's policy
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Response Code : Success - 201 Created
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Method        : DELETE URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Params        : None
+
~+~-Normal Response code: 200
  
Description   : Delete a tenant's policy's unusable ip octet by given id
+
Error   - 404 Not Found [When Policy doesn't exist]-~+~
  
Response Code : Success - 200 OK
+
----
 +
==== Get details of a tenant's policy's unusable ip octet ====
 +
----
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)
 +
|}
  
* Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Method        : GET URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Params        : None
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Description  : Get details of a tenant's policy's unusable ip octet by given id
+
~+~-Normal Response code: 200
  
Response Code : Success - 200 OK
+
Error  - 404 Not Found [When Policy or IP octet doesn't exist]-~+~
  
* Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
+
----
 +
==== Create a unusable ip octet in tenant's policy ====
 +
----
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| POST
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets
 +
|}
  
Method        : PUT URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Params        : 'octet'
+
<span style="font-size: larger"><span style="font-size: smaller">'octet': integer  [Mandatory, Should be 0-255]</span></span>
  
Description  : Update details of a tenant's policy's unusable ip octet by given id
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Response Code : Success - 200 OK
+
~+~-Normal Response code: 201
  
* Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
+
Error  - 404 Not Found [When Policy doesn't exist]-~+~
  
 
----
 
----
= Extensions =
+
==== Update details of a tenant's policy's unusable ip octet. ====
The API works similar to Nova extensions.
+
----
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| PUT
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)
 +
|}
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">'octet': integer  [Should be 0-255]</span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 +
 
 +
~+~-Normal Response code: 200
 +
 
 +
Error  - 404 Not Found [When Policy or IP octet doesn't exist]-~+~
  
 
----
 
----
= To Be Done: =
+
==== Delete a tenant's policy's unusable ip octet ====
* Add 'previous' and 'next' links in list all resources (#56) * Add network info like gateway, dns etc. during block creation (#63) * Add API to allocate ip address in a given network (#64)
+
----
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)
 +
|}
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 +
 
 +
~+~-Normal Response code: 200
 +
 
 +
Error  - 404 Not Found [When Policy or IP octet doesn't exist]-~+~
 +
 
 +
== To Be Done: ==
 +
 
 +
* Add 'self' and 'bookmark' links in resource details.
 +
* Versions atom feed
 +
* API to list all IPs by an instance_id

Latest revision as of 23:30, 17 February 2013

Melange API Specification

Contents

General Information

The Melange API is implemented using a RESTful web service interface.

  • All GET /resources accepts 'limit' and 'marker' params. If these params are not passed default limit is applied.
  • If POST or PUT on a resource doesn't send mandatory params, API returns '400 Bad Request' response.

Request/Response Types

  • The Melange API supports both the JSON and XML data serialization formats.
  • The request format is specified using the Content-Type header and is required for operations that have a request body.
  • The response format can be specified in requests using either the Accept header or adding an .xml or .json extension to the request URI.
  • If no response format is specified, JSON is the default.
  • If conflicting formats are specified using both an Accept header and a query extension, the query extension takes precedence.

Versions


List versions


Verb URI
GET /

Params:

None

Response Codes:

Normal Response code: 200

JSON Response:


{
 "versions": 
                 [
                   {"status": "CURRENT", "name": "v0.1", "links":  [ {"href": "http://localhost:9898/v0.1", "rel": "self"}]
                   }
                 ]
}


Extensions

The Melange API is extensible. The API Extensions allow introducing new features in the API without requiring a version change and allows vendor specific niche functionality. The API extensions work similar to nova extensions.


List extensions


Verb URI
GET /extensions

Params:

None

Response Codes:

Normal Response code: 200


List extension details


Verb URI
GET /extensions/{alias}

Params:

None

Response Codes:

Normal Response code: 200

NOTE:

All the urls below are prefixed by "/v0.1".

IP Blocks


List Tenant's blocks


Verb URI
GET /ipam/tenants/{tenant_id}/ip_blocks

Params:

type ('public' or 'private')

Response Codes:

Normal Response code: 200


List Tenant's subnets


Verb URI
GET /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/subnets

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When IpBlock doesn't exist]-~+~


Get details of tenant's IP block


Verb URI
GET /ipam/tenants/{tenant_id}/ip_blocks/:(id)

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When IpBlock doesn't exist]-~+~


Create tenant's IP block


Verb URI
POST /ipam/tenants/{tenant_id}/ip_blocks

Params:

~+~-'type': 'public' or 'private' [Mandatory]

'cidr': IPV4 or IPV6 cidr [Mandatory]

'network_id': Can be a uuid, any string accepted

'policy_id': Is a uuid, has to be an existing policy

'dns1': Primary dns server ip address, defaults to dns configured in melange

'dns2': Secondary dns server ip address, defaults to dns configured in melange

'gateway': any valid ip address, defaults to second ip address of the block-~+~

Response Codes:

~+~-Normal Response code: 201

Error - 400 Bad Request [When mandatory fields are not present or field validations fail]-~+~


Create tenant's subnet


Verb URI
POST /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/subnets

Params:

~+~-'cidr': IpV4 or IpV6 cidr [Mandatory]

'network_id' : Can be a uuid, any string accepted

'policy_id' : Is a uuid, has to be an existing policy

'tenant_id' : Can be a uuid, any string accepted, defaults to parent block's tenant_id-~+~

Response Codes:

~+~-Normal Response code: 201

Error - 404 Not Found [When IpBlock for given ip_block_id and tenant_id doesn't exist]

Error - 400 Bad Request [When mandatory fields are not present or field validations fails]-~+~


Update tenant's IP block


Verb URI
PUT /ipam/tenants/{tenant_id}/ip_blocks/:(id)

Params:

~+~-'network_id' : Can be a uuid, any string accepted

'policy_id' : Is a uuid, has to be an existing policy-~+~

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When IpBlock for given id and tenant_id doesn't exist]

Error - 400 Bad Request [When field validations fails]-~+~


Delete tenant's IP block


Verb URI
DELETE /ipam/tenants/{tenant_id}/ip_blocks/:(id)

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When IpBlock for given id and tenant_id doesn't exist]-~+~

IP Address from Tenant's IP Blocks


List tenant's addresses


Verb URI
GET /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found (When IpBlock for given ip_block_id and tenant_id is not found)-~+~


List tenant's allocated addresses


Verb URI
GET /ipam/tenants/{tenant_id}/allocated_ip_addresses

Params:

'used_by_device': uuid of a device, can be any string. If given, IPs allocated to this device will be filtered and returned

Response Codes:

Normal Response code: 200


List Cloud Providers allocated addresses


Verb URI
GET /ipam/allocated_ip_addresses

Params:

'used_by_device': uuid of a device, can be any string. If given, IPs allocated to this device will be filtered and returned

Response Codes:

Normal Response code: 200


Get address details


Verb URI
GET /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses/{address}

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found (When either IpBlock for given ip_block_id and tenant_id is not found, or IpAddress for given address is not found)-~+~


Allocate tenant's address


Verb URI
POST /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses

Params:

~+~-'address' : This address is used for allocation. If this is not provided, next available address will be allocated.

'interface_id' : Can be a uuid, any string accepted. Is an id pointing to the interface on which the ip will be configured

'tenant_id' : The 'lessee' tenant (the tenant actually using the ip, as opposed to the tenant owning the block). Defaults to the tenant owning the block.

'used_by_device' : Can be a uuid, any string accepted. Is an id pointing to the instance(or any other device) on which the ip will be used.

'mac_address' : any valid mac_address, applicable only for generating ipv6 addresses, Mandatory for ipv6 blocks.-~+~

Response Codes:

~+~-Normal Response code: 201

Error - 404 Not Found [When IpBlock for given ip_block_id is not found]

Error - 422 Unprocessable Entity [If any new ip_address can not be allocated from IpBlock]

Error - 409 Conflict [If the given address is already allocated]

Error - 400 Bad Request [When mandatory fields are not present or fields fail validations]-~+~


Deallocate tenant's address


Verb URI
DELETE /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses/{address}

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found (When ip_block for given id and tenant_id is not found)-~+~


Restore tenant's address


Verb URI
PUT /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses/{address}/restore

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found (When IpBlock for given id and tenant_id is not found or IpAddress for given address is not found)-~+~

Static Routes


List all Static Routes for an IpBlock


Verb URI
GET /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_routes

Params:

None

Response Codes:

Normal Response code: 200


Get details of a static route


Verb URI
GET /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_routes/:(id)

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When IpBlock for given ip_block_id and tenant_id does not exists or IpRoute for given id does not exists]-~+~


Create a Static Route for an IpBlock


Verb URI
POST /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_routes

Params:

~+~-'destination' : [Mandatory] IpAddress or Cidr of the destination host or network.

'netmask : netmask of the destination network, if applicable.

'gateway' : [Mandatory] IpAddress of the gateway.-~+~

Response Codes:

~+~-Normal Response code: 201

Error - 404 Not Found [When IpBlock for given ip_block_id and tenant_id does not exists]

Error - 400 Bad Request [When required parameters are not present or field validation fails]-~+~


Update a static route


Verb URI
PUT /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_routes/:(id)

Params:

~+~-'destination' : IpAddress or Cidr of the destination host or network.

'netmask : netmask of the destination network, if applicable.

'gateway' : IpAddress of the gateway.-~+~

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When IpBlock for given ip_block_id and tenant_id does not exists or Static Route for given id does not exists]

Error - 400 Bad Request [When field validation fails]-~+~


Delete a static route


Verb URI
DELETE /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_routes/:(id)

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When IpBlock for given ip_block_id and tenant_id does not exists or Static Route for given id does not exists]-~+~

IP allocations in a Network


Allocate address from tenant's network


Verb URI
POST /ipam/tenants/{tenant_id}/networks/{network_id}/interfaces/{interface_id}/ip_allocations

Params:

~+~-'addresses' : These addresses(can be array of ipv4 and/or ipv6 addresses) are used for allocation. If not provided, next available address will be allocated from one IPv4 and one IPv6 block.

'mac_address' : This will used while allocation IPv6 address. Mandatory if network has IPv6 block.

'tenant_id' : The 'lessee' tenant (the tenant actually using the ip, as opposed to the tenant owning the block). Defaults to the tenant owning the block from which IPs are allocated.

'used_by_device' : Can be a uuid, any string accepted. Is an id pointing to the instance(or any other device) on which the ip will be used.-~+~

Response Codes:

~+~-Normal Response code: 201

Error - 422 Unprocessable Entity [If ip address can not be allocated from Network]

Error - 404 Not Found [When network for a given network_id and tenant_id is not found]

Error - 409 Conflict [If the given address is already allocated]-~+~

Error - 400 Bad Request [When required parameters are not present or field validation fails]-~+~


List allocated IpAddresses from a tenant's network


Verb URI
GET /ipam/tenants/{tenant_id}/networks/{network_id}/interfaces/{interface_id}/ip_allocations

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When network for a given network_id and tenant_id is not found]-~+~


Deallocate all IpAddresses from a tenant's network


Verb URI
DELETE /ipam/tenants/{tenant_id}/networks/{network_id}/interfaces/{interface_id}/ip_allocations

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When network for a given network_id and tenant_id is not found]-~+~

NAT'ing

Tracking NAT information is designed to assist in the implementation and tracking of floating IPs.


List globals


Verb URI
GET /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_globals

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When IpBlock for ip block ID or IP Address by given address is not found]-~+~


List locals


Verb URI
GET /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When IP Block for ip_block_id or IpAddress by given address is not found]-~+~


Assign globals


Verb URI
POST /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_globals

Params:

{'ip_addresses':'[ { "ip_block_id" : "some_global_ip_block_id", "ip_address" : "some_global_ip_address" }, ..., {....} }

Response Codes:

~+~-Normal Response code: 200

Error - 400 Bad Request [When the values of ip_block_id and ip_address are missing in the params]-~+~


Assign locals


Verb URI
POST /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_globals

Params:

{'ip_addresses':'[ { "ip_block_id" : "some_local_ip_block_id", "ip_address" : "some_local_ip_address" } ... {} }

Response Codes:

~+~-Normal Response code: 200

Error - 400 Bad Request [When the values of ip_block_id and ip_address are missing in the params]-~+~


Remove global


Verb URI
DELETE /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_globals/{inside_globals_address}

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When IpBlock for ip_block_id or IpAddress by given address is not found]-~+~


Remove local


Verb URI
DELETE /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals/{inside_locals_address}

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When IpBlock for ip_block_id or IpAddress by given address is not found]-~+~


Remove all globals


Verb URI
DELETE /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals/{address}

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When IpBlock for ip_block_id or IpAddress by given address is not found]-~+~


Remove all locals


Verb URI
DELETE /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When IpBlock for ip_block_id or IpAddress by given address is not found]-~+~

IP Policy

Policy


List all Tenant's IP Policies


Verb URI
GET /ipam/tenants/{tenant_id}/policies

Params:

None

Response Codes:

Normal Response code: 200


Get details of a Tenant's IP Policy


Verb URI
GET /ipam/tenants/{tenant_id}/policies/:(id)

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When Policy for given id and tenant_id does not exists]-~+~


Create an IP Policy for a tenant


Verb URI
POST /ipam/tenants/{tenant_id}/policies

Params:

~+~-'name' : [Mandatory] Name of the policy.

'description' : Small description about the policy.-~+~

Response Codes:

~+~-Normal Response code: 201

Error - 400 Bad Request [When required parameters are not present or field validation fails]-~+~


Update an IP Policy for a tenant


Verb URI
PUT /ipam/tenants/{tenant_id}/policies/:(id)

Params:

~+~-'name' : Name of the policy.

'description' : Small description about the policy.-~+~

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When Policy for given id and tenant_id does not exists]

Error - 400 Bad Request [When required parameters are not present or field validation fails]-~+~


Delete an IP Policy for a tenant


Verb URI
DELETE /ipam/tenants/{tenant_id}/policies/:(id)

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When Policy for given id and tenant_id does not exists]-~+~

Unusable IP Ranges


List all unusable ip ranges of a tenant's policy


Verb URI
GET /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When policy doesn't exist]-~+~


Get details of a tenant's policy's unusable ip range


Verb URI
GET /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When Policy or IP Range doesn't exist]-~+~


Create a unusable ip range in tenant's policy


Verb URI
POST /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges

Params:

~+~-'offset': integer [Mandatory, Can be +ve or -ve integer]

'length' : integer [Mandatory, Should be +ve integer]-~+~

Response Codes:

~+~-Normal Response code: 201

Error - 404 Not Found [When Policy doesn't exist]-~+~


Update details of a tenant's policy's unusable ip range


Verb URI
PUT /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges/:(id)

Params:

~+~-'offset': integer [Can be +ve or -ve integer]

'length' : integer [Should be +ve integer]-~+~

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When Policy or IP range doesn't exist]-~+~


Delete a tenant's policy's unusable ip range


Verb URI
DELETE /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges/:(id)

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When Policy or IP range doesn't exist]-~+~

Tenant Policy Unusable Ip Octets


List all unusable ip octets of a tenant's policy


Verb URI
GET /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When Policy doesn't exist]-~+~


Get details of a tenant's policy's unusable ip octet


Verb URI
GET /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When Policy or IP octet doesn't exist]-~+~


Create a unusable ip octet in tenant's policy


Verb URI
POST /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets

Params:

'octet': integer [Mandatory, Should be 0-255]

Response Codes:

~+~-Normal Response code: 201

Error - 404 Not Found [When Policy doesn't exist]-~+~


Update details of a tenant's policy's unusable ip octet.


Verb URI
PUT /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)

Params:

'octet': integer [Should be 0-255]

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When Policy or IP octet doesn't exist]-~+~


Delete a tenant's policy's unusable ip octet


Verb URI
DELETE /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)

Params:

None

Response Codes:

~+~-Normal Response code: 200

Error - 404 Not Found [When Policy or IP octet doesn't exist]-~+~

To Be Done:

  • Add 'self' and 'bookmark' links in resource details.
  • Versions atom feed
  • API to list all IPs by an instance_id