Jump to: navigation, search

Difference between revisions of "MelangeAPIBase"

m (Text replace - "__NOTOC__" to "")
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__
+
 
 
= Melange API Specification =
 
= Melange API Specification =
  
<<[[TableOfContents]]()>>
+
__TOC__
  
 
== General Information ==
 
== General Information ==
Line 39: Line 39:
  
 
<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">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 ==
 
== Extensions ==
Line 72: Line 86:
 
|-
 
|-
 
| GET  
 
| GET  
| /extensions/alias
+
| /extensions/{alias}
 
|}
 
|}
  
Line 86: Line 100:
 
All the urls below are prefixed by "/v0.1".
 
All the urls below are prefixed by "/v0.1".
  
== Global IP Blocks ==
+
== IP Blocks ==
  
 
----
 
----
=== List IP blocks ===
+
=== List Tenant's blocks ===
 
----
 
----
  
Line 97: Line 111:
 
|-
 
|-
 
| GET  
 
| GET  
| /ipam/ip_blocks
+
| /ipam/tenants/{tenant_id}/ip_blocks
 
|}
 
|}
  
 
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
<span style="font-size: larger"><span style="font-size: smaller">type ('public' or 'private') </span></span>
+
<span style="font-size: larger"><span style="font-size: smaller">type ('public' or 'private')</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">''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">Normal Response code: 200 </span></span>
  
 
----
 
----
=== List subnets ===
+
=== List Tenant's subnets ===
 
----
 
----
  
Line 117: Line 131:
 
|-
 
|-
 
| GET  
 
| GET  
| /ipam/ip_blocks/{ip_block_id}/subnets
+
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/subnets
 
|}
 
|}
  
 
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 
<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">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">''Response Codes:'' </span></span>
  
~+~-Normal Response code: 200
+
~+~-Normal Response code: 200  
  
Error response code(s):  #404-Not Found - when block does not exist -~+~
+
Error   - 404 Not Found [When IpBlock doesn't exist]-~+~
  
 
----
 
----
=== Get IP block details ===
+
=== Get details of tenant's IP block ===
 
----
 
----
  
Line 139: Line 153:
 
|-
 
|-
 
| GET  
 
| GET  
| /ipam/ip_blocks/:(id)
+
| /ipam/tenants/{tenant_id}/ip_blocks/:(id)
 
|}
 
|}
  
 
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 
<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">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">''Response Codes:'' </span></span>
  
~+~-Normal Response code: 200
+
~+~-Normal Response code: 200  
  
Error response code(s):  #404-Not Found - when block does not exist -~+~
+
Error   - 404 Not Found [When IpBlock doesn't exist]-~+~
  
 
----
 
----
=== Create IP block ===
+
=== Create tenant's IP block ===
 
----
 
----
  
Line 161: Line 175:
 
|-
 
|-
 
| POST  
 
| POST  
| /ipam/ip_blocks
+
| /ipam/tenants/{tenant_id}/ip_blocks
 
|}
 
|}
  
Line 168: Line 182:
 
~+~-'type': 'public' or 'private' [Mandatory]
 
~+~-'type': 'public' or 'private' [Mandatory]
  
'cidr':  [[IpV4]] or [[IpV6]] cidr [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
  
'network_id' : Can be a uuid, any string accepted
+
'dns1': Primary dns server ip address, defaults to dns configured in melange
 +
 
 +
'dns2': Secondary dns server ip address, defaults to dns configured in melange
  
'policy_id' : Can be a uuid, any string accepted -~+~
+
'gateway': any valid ip address, defaults to second ip address of the block-~+~
  
 
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </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: 201 </span></span>
+
~+~-Normal Response code: 201
 +
 
 +
Error - 400 Bad Request [When mandatory fields are not present or field validations fail]-~+~
  
 
----
 
----
=== Create subnet ===
+
=== Create tenant's subnet ===
 
----
 
----
  
Line 187: Line 209:
 
|-
 
|-
 
| POST  
 
| POST  
| /ipam/ip_blocks/{ip_block_id}/subnets
+
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/subnets
 
|}
 
|}
  
Line 196: Line 218:
 
'network_id' : Can be a uuid, any string accepted
 
'network_id' : Can be a uuid, any string accepted
  
'policy_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-~+~
  
 
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
~+~-Normal Response code: 201  
+
~+~-Normal Response code: 201
  
Error  - 404 Not Found [When IpBlock doesn't exist]-~+~
+
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 block ===
+
=== Update tenant's IP block ===
 
----
 
----
  
Line 213: Line 239:
 
|-
 
|-
 
| PUT  
 
| PUT  
| /ipam/ip_blocks/:(id)
+
| /ipam/tenants/{tenant_id}/ip_blocks/:(id)
 
|}
 
|}
  
 
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
~+~-'type': 'network_id' : Can be a uuid, any string accepted
+
~+~-'network_id' : Can be a uuid, any string accepted
  
'policy_id' : Can be a uuid, any string accepted -~+~
+
'policy_id' : Is a uuid, has to be an existing policy-~+~
  
 
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
~+~-Normal Response code: 201
+
~+~-Normal Response code: 200
  
Error  - 404 Not Found [When IpBlock doesn't exist]-~+~
+
Error  - 404 Not Found [When IpBlock for given id and tenant_id doesn't exist]
 +
 
 +
Error  - 400 Bad Request [When field validations fails]-~+~
  
 
----
 
----
=== Delete block ===
+
=== Delete tenant's IP block ===
 
----
 
----
  
Line 237: Line 265:
 
|-
 
|-
 
| DELETE  
 
| DELETE  
| /ipam/ip_blocks/:(id)
+
| /ipam/tenants/{tenant_id}/ip_blocks/:(id)
 
|}
 
|}
  
Line 246: Line 274:
 
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
~+~-Normal Response code: 200  
+
~+~-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 ===
 +
----
 +
 
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses
 +
|}
 +
 
 +
<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 given ip_block_id and tenant_id is not found)-~+~
 +
 
 +
----
 +
=== List tenant's allocated addresses ===
 +
----
 +
 
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/allocated_ip_addresses
 +
|}
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 +
 
 +
<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 doesn't exist]-~+~
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
== Tenant's IP Blocks ==
+
<span style="font-size: larger"><span style="font-size: smaller">Normal Response code: 200</span></span>
  
 
----
 
----
=== List Tenant's blocks ===
+
=== List Cloud Providers allocated addresses ===
 
----
 
----
  
Line 261: Line 331:
 
|-
 
|-
 
| GET  
 
| GET  
| /ipam/tenants/{tenant_id}/ip_blocks
+
| /ipam/allocated_ip_addresses
 
|}
 
|}
  
 
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
<span style="font-size: larger"><span style="font-size: smaller">type ('public' or 'private')</span></span>
+
<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">''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">Normal Response code: 200</span></span>
  
 
----
 
----
=== List Tenant's subnets ===
+
=== Get address details ===
 
----
 
----
  
Line 281: Line 351:
 
|-
 
|-
 
| GET  
 
| GET  
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/subnets
+
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses/{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 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 ===
 +
----
 +
 
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| POST
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses
 +
|}
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 +
 
 +
~+~-'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.-~+~
 +
 
 +
<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 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 ===
 +
----
 +
 
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses/{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 ip_block for given id and tenant_id is not found)-~+~
 +
 
 +
----
 +
=== Restore tenant's address ===
 +
----
 +
 
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| PUT
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses/{address}/restore
 
|}
 
|}
  
Line 290: Line 440:
 
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
~+~-Normal Response code: 200  
+
~+~-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 IpBlock doesn't exist]-~+~
+
== Static Routes ==
  
 
----
 
----
=== Get details of tenant's IP block ===
+
==== 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
 +
|}
 +
 +
<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>
 +
 +
----
 +
==== Get details of a static route ====
 +
----
 
{| border="1" cellpadding="2" cellspacing="0"
 
{| border="1" cellpadding="2" cellspacing="0"
 
| Verb  
 
| Verb  
Line 303: Line 473:
 
|-
 
|-
 
| GET  
 
| GET  
| /ipam/tenants/{tenant_id}/ip_blocks/:(id)
+
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_routes/:(id)
 
|}
 
|}
  
Line 312: Line 482:
 
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
~+~-Normal Response code: 200  
+
~+~-Normal Response code: 200
  
Error  - 404 Not Found [When IpBlock doesn't exist]-~+~
+
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 tenant's IP block ===
+
=== Create a Static Route for an [[IpBlock]] ===
 
----
 
----
  
Line 325: Line 495:
 
|-
 
|-
 
| POST  
 
| POST  
| /ipam/tenants/{tenant_id}/ip_blocks
+
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_routes
 +
|}
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 +
 
 +
~+~-'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.-~+~
 +
 
 +
<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 does not exists]
 +
 
 +
Error  - 400 Bad Request [When required parameters are not present or field validation fails]-~+~
 +
 
 +
----
 +
=== Update a static route ===
 +
----
 +
 
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| PUT
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_routes/:(id)
 
|}
 
|}
  
 
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
 
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
~+~-'type': 'public' or 'private' [Mandatory]
+
~+~-'destination' : [[IpAddress]] or Cidr of the destination host or network.
 +
 
 +
'netmask : netmask of the destination network, if applicable.
 +
 
 +
'gateway' : [[IpAddress]] of the gateway.-~+~
 +
 
 +
<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 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 ===
 +
----
  
'cidr': [[IpV4]] or [[IpV6]] cidr [Mandatory]
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_routes/:(id)
 +
|}
  
'network_id' : Can be a uuid, any string accepted
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
'policy_id' : Can be a uuid, any string accepted-~+~
+
<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">''Response Codes:'' </span></span>
  
<span style="font-size: larger"><span style="font-size: smaller">Normal Response code: 201</span></span>
+
~+~-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 ==
  
 
----
 
----
=== Create tenant's subnet ===
+
=== Allocate address from tenant's network ===
 
----
 
----
  
Line 351: Line 575:
 
|-
 
|-
 
| POST  
 
| POST  
| /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/subnets
+
| /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>
 
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
~+~-'type': 'cidr':  [[IpV4]] or [[IpV6]] cidr [Mandatory]
+
~+~-'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.
  
'network_id' : Can be a uuid, any string accepted
+
'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.
  
'policy_id' : Can be a uuid, any string accepted-~+~
+
'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.-~+~
  
 
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
Line 366: Line 592:
 
~+~-Normal Response code: 201
 
~+~-Normal Response code: 201
  
Error  - 404 Not Found [When IpBlock doesn't exist]-~+~
+
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 ===
 +
----
 +
 
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /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>
 +
 
 +
<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 network for a given network_id and tenant_id is not found]-~+~
 +
 
 +
----
 +
===Deallocate all [[IpAddresses]] from a tenant's network ===
 +
----
 +
 
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /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>
 +
 
 +
<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 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 ===
 +
----
 +
 
 +
{| 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>
 +
 
 +
<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>
 +
 
 +
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 +
 
 +
~+~-Normal Response code: 200
 +
 
 +
Error  - 400 Bad Request [When the values of ip_block_id and ip_address are missing in the params]-~+~
  
 
----
 
----
=== Update tenant's IP block ===
+
=== Assign locals ===
 
----
 
----
  
Line 376: Line 721:
 
| URI  
 
| URI  
 
|-
 
|-
| PUT
+
| POST
| /ipam/tenants/{tenant_id}/ip_blocks/:(id)
+
| /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">''Params:'' </span></span>
  
~+~-'type': 'network_id' : Can be a uuid, any string accepted
+
<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>
  
'policy_id' : Can be a uuid, any string accepted-~+~
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
 +
 
 +
~+~-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 ===
 +
----
 +
 
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_globals/{inside_globals_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>
 
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
Line 390: Line 755:
 
~+~-Normal Response code: 200
 
~+~-Normal Response code: 200
  
Error  - 404 Not Found [When IpBlock doesn't exist]-~+~
+
Error  - 404 Not Found [When IpBlock for ip_block_id or IpAddress by given address is not found]-~+~
 +
 
 +
----
 +
=== 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]-~+~
  
 
----
 
----
=== Delete tenant's IP block ===
+
=== Remove all globals ===
 
----
 
----
  
Line 401: Line 788:
 
|-
 
|-
 
| DELETE  
 
| DELETE  
| /ipam/tenants/{tenant_id}/ip_blocks/:(id)
+
| /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals/{address}
 
|}
 
|}
  
Line 412: Line 799:
 
~+~-Normal Response code: 200
 
~+~-Normal Response code: 200
  
Error  - 404 Not Found [When IpBlock doesn't exist]-~+~
+
Error  - 404 Not Found [When IpBlock for ip_block_id or IpAddress by given address is not found]-~+~
  
== IP Address from Global IP Blocks ==
+
----
* List all ip addresses in the ip block.
+
=== Remove all locals ===
 +
----
  
        Method        : GET
+
{| border="1" cellpadding="2" cellspacing="0"
        URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses
+
| Verb
        Params        : None
+
| URI
        Response Code : Success - 200 OK
+
|-
                        Error  - 404 Not Found (When [[IpBlock]] for given ip_block_id is not found)
+
| DELETE
 +
| /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals
 +
|}
  
* Get details of an ip address.
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
        Method        : GET
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
        URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}
 
        Params        : None
 
        Response Code : Success - 200 OK
 
                        Error  - 404 Not Found [When IpBlock for given ip_block_id is not found, or IpAddress for given address is not found]
 
  
* Allocate an [[IpAddress]] from a block.
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
        Method        : POST
+
~+~-Normal Response code: 200
        URL          : /ipam/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.
 
                        'port_id' : Can be a uuid, any string accepted
 
        Response Code : Success - 201 Created
 
                        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]
 
                                  409 Conflict [If the given address is already allocated]
 
  
* Deallocate an [[IpAddress]]
+
Error  - 404 Not Found [When IpBlock for ip_block_id or IpAddress by given address is not found]-~+~
  
        Method        : DELETE
+
== IP Policy ==
        URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}
 
        Params        : None
 
        Response Code : Success - 200 OK
 
                        Error  - 404 Not Found [When IpBlock for given ip_block_id is not found, or IpAddress for given address is not found]
 
  
* Restore a deallocated address.
+
=== Policy ===
  
        Method        : PUT
+
----
        URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/restore
+
==== List all Tenant's IP Policies  ====
        Params        : None
+
----
        Response Code : Success - 200 OK
+
{| border="1" cellpadding="2" cellspacing="0"
                        Error  - 404 Not Found [When IpBlock for given ip_block_id is not found or IpAddress for given address is not found]
+
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/policies
 +
|}
  
== IP Address from Tenant's IP Blocks ==
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
* Get details of an ip address in a tenant's ip block.
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
        Method        : GET
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
        URL          : /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses/{address}
 
        Params        : None
 
        Response Code : Success - 200 OK
 
                        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]
 
  
* List all ip addresses in a tenant's ip block.
+
<span style="font-size: larger"><span style="font-size: smaller">Normal Response code: 200 </span></span>
  
        Method        : GET
+
----
        URL          : /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses
+
==== Get details of a Tenant's IP Policy  ====
        Params        : None
+
----
        Response Code : Success - 200 OK
+
{| border="1" cellpadding="2" cellspacing="0"
                        Error  - 404 Not Found [When IpBlock for given ip_block_id and tenant_id is not found]
+
| Verb
 +
| URI
 +
|-
 +
| GET  
 +
| /ipam/tenants/{tenant_id}/policies/:(id)
 +
|}
  
* Allocate an [[IpAddress]] from a tenant's block.
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
        Method        : POST
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
        URL          : /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.
 
                        'port_id' : Can be a uuid, any string accepted
 
        Response Code : Success - 201 Created
 
                        Error  - 404 Not Found [When IpBlock for given ip_block_id and tenant_id is not found]
 
                                  422 Unprocessable Entity [If any new ip_address can not be allocated from IpBlock]
 
                                  409 Conflict [If the given address is already allocated]
 
  
* Deallocate an [[IpAddress]] from a tenant's block.
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
        Method        : DELETE
+
~+~-Normal Response code: 200
        URL          : /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses/{address}
 
        Params        : None
 
        Response Code : Success - 200 OK
 
                        Error  - 404 Not Found [When ip_block for given id and tenant_id is not found]
 
  
* Restore a deallocated address from a tenant's block.
+
Error  - 404 Not Found [When Policy for given id and tenant_id does not exists]-~+~
  
        Method        : PUT
+
----
        URL          : /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses/{address}/restore
+
=== Create an IP Policy for a tenant ===
        Params        : None
+
----
        Response Code : Success - 200 OK
 
                        Error  - 404 Not Found [When IpBlock for given id and tenant_id is not found or IpAddress for given address is not found]
 
  
== IP allocations in a Network ==
+
{| border="1" cellpadding="2" cellspacing="0"
These API create an ipv4 and ipv6 address for given interface(port).
+
| Verb
 +
| URI
 +
|-
 +
| POST
 +
| /ipam/tenants/{tenant_id}/policies
 +
|}
  
* Allocate an [[IpAddress]] from a global network.
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
        Method        : POST
+
~+~-'name' : [Mandatory] Name of the policy.
        URL          : /ipam/networks/{network_id}/ports/{port_id}/ip_allocations
 
        Params        : 'address' : This address is used for allocation. If this is not provided, next available address will be allocated.
 
        Response Code : Success - 201 Created
 
                        Error  - 422 Unprocessable Entity [If ip address can not be allocated from Network]
 
                                  409 Conflict [If the given address is already allocated]
 
  
* Allocate an [[IpAddress]] from a tenant's network.
+
'description' : Small description about the policy.-~+~
  
        Method        : POST
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
        URL          : /ipam/tenants/{tenant_id}/networks/{network_id}/ports/{port_id}/ip_allocations
 
        Params        : 'address' : This address is used for allocation. If this is not provided, next available address will be allocated.
 
        Response Code : Success - 201 Created
 
                        Error  - 422 Unprocessable Entity [If ip address can not be allocated from tenant's Network]
 
                                  409 Conflict [If the given address is already allocated]
 
  
== NAT'ing ==
+
~+~-Normal Response code: 201
  
* List all outside globals for a local ip_address
+
Error  - 400 Bad Request [When required parameters are not present or field validation fails]-~+~
  
Method        : GET
+
----
URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_globals
+
=== Update an IP Policy for a tenant ===
Params        : None
+
----
Description  : Return the outside global ip addresses for the local ip address of the ip_block.
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When IpBlock for ip block ID or IP Address by given address is not found]
 
  
* List all inside locals for a global ip_address
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| PUT
 +
| /ipam/tenants/{tenant_id}/policies/:(id)
 +
|}
  
Method        : GET
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals
 
Params        : None
 
Description  : Return the inside local IP addresses for the global IP address of the IP block.
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When IP Block for ip_block_id or IpAddress by given address is not found]
 
  
* Add Inside Global IPs to a local IP
+
~+~-'name' : Name of the policy.
  
Method        : POST
+
'description' : Small description about the policy.-~+~
URL          : /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" } ... {} }
 
Description  : Finds local [[IpAddress]] from given ip_block_id and address and creates [[IpAddresses]] passed in params as its inside global.
 
Response Code : Success - 200 OK
 
                Error  - 400 Bad Request [When the values of ip_block_id and ip_address are missing in the params]
 
  
* Add Inside Local IPs to a global IP
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Method        : POST
+
~+~-Normal Response code: 200
URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals
 
Params        : {'ip_addresses':'[ { "ip_block_id" : "some_local_ip_block_id", "ip_address" : "some_local_ip_address" } ... {} }
 
Description  : Finds global [[IpAddress]] from given ip_block_id and address and adds [[IpAddresses]] passed in params as its inside local.
 
Response Code : Success - 200 OK
 
                Error  - 400 Bad Request [When the values of ip_block_id and ip_address are missing in the params]
 
  
* Delete a specific inside global for a local ip_address
+
Error  - 404 Not Found [When Policy for given id and tenant_id does not exists]
  
Method        : DELETE
+
Error  - 400 Bad Request [When required parameters are not present or field validation fails]-~+~
URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_globals/{address}
 
Params        : None
 
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 address.
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When IpBlock for ip_block_id or IpAddress by given address is not found]
 
  
* Delete a specific inside local for a global ip_address
+
----
 +
=== Delete an IP Policy for a tenant ===
 +
----
  
Method        : DELETE
+
{| border="1" cellpadding="2" cellspacing="0"
URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals/{address}
+
| Verb
Params        : None
+
| URI
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 address.
+
|-
Response Code : Success - 200 OK
+
| DELETE  
                Error  - 404 Not Found [When IpBlock for ip_block_id or IpAddress by given address is not found]
+
| /ipam/tenants/{tenant_id}/policies/:(id)
 +
|}
  
* Delete all inside globals for a local ip_address
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Method        : DELETE
+
<span style="font-size: larger"><span style="font-size: smaller"> None </span></span>
URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_globals
 
Params        : None
 
Description  : Finds the inside ip_address from given ip_block_id and address, and remove all its inside global ip_addresses.
 
Response Code : Success - 200 OK
 
        Error  - 404 Not Found [When IpBlock for ip_block_id or IpAddress by given address is not found]
 
  
* Delete all inside locals for a global ip_address
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Method        : DELETE
+
~+~-Normal Response code: 200
URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals
 
Params        : None
 
Description  : Finds the global ip_address from given ip_block_id and address, and remove all its inside local ip_addresses.
 
Response Code : Success - 200 OK
 
        Error  - 404 Not Found [When IpBlock for ip_block_id or IpAddress for global ip_address are not found]
 
  
== Global Policies ==
+
Error  - 404 Not Found [When Policy for given id and tenant_id does not exists]-~+~
  
* Lists all global policies
+
=== Unusable IP Ranges ===
  
Method        : GET
+
----
URL          : /ipam/policies
+
==== List all unusable ip ranges of a tenant's policy ====
Params        : None
+
----
Response Code : Success - 200 OK
+
{| border="1" cellpadding="2" cellspacing="0"
 +
| Verb
 +
| URI
 +
|-
 +
| GET  
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges
 +
|}
  
* Get details of a global policy
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Method        : GET
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
URL          : /ipam/policies/:(id)
 
Params        : None
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When Policy doesn't exist]
 
  
* Create a global policy
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Method        : POST
+
~+~-Normal Response code: 200
URL          : /ipam/policies
 
Params        : 'name': string  [Mandatory]
 
                'description' : string
 
Response Code : Success - 201 Created
 
                Error  - 422 [[UnProcessable]] Entity [When name is None]
 
  
* Update details of a global policy
+
Error  - 404 Not Found [When policy doesn't exist]-~+~
  
Method        : PUT
+
----
URL          : /ipam/policies/:(id)
+
==== Get details of a tenant's policy's unusable ip range ====
Params        : 'name', 'description'
+
----
Response Code : Success - 200 OK
+
{| border="1" cellpadding="2" cellspacing="0"
                Error  - 404 Not Found [When Policy doesn't exist]
+
| Verb
 +
| URI
 +
|-
 +
| GET
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges
 +
|}
  
* Delete a global policy
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Method        : DELETE
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
URL          : /ipam/policies/:(id)
 
Params        : None
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When Policy doesn't exist]
 
  
== Global Policy Unusable Ip Ranges ==
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
* List all unusable ip ranges of a global policy
+
~+~-Normal Response code: 200
  
Method        : GET
+
Error  - 404 Not Found [When Policy or IP Range doesn't exist]-~+~
URL          : /ipam/policies/{policy_id}/unusable_ip_ranges
 
Params        : None
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When Policy doesn't exist]
 
  
* Get details of a global policy's unusable ip range
+
----
 +
==== 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
 +
|}
  
Method        : GET
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
URL          : /ipam/policies/{policy_id}/unusable_ip_ranges/:(id)
 
Params       : None
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
 
  
* Create a unusable ip range in global policy
+
~+~-'offset': integer  [Mandatory, Can be +ve or -ve integer]
  
Method        : POST
+
'length' : integer [Mandatory, Should be +ve integer]-~+~
URL          : /ipam/policies/{policy_id}/unusable_ip_ranges
 
Params        : 'offset': integer  [Mandatory, Can be +ve or -ve integer]
 
                'length' : integer [Mandatory, Should be +ve integer]
 
Response Code : Success - 201 Created
 
                Error  - 404 Not Found [When Policy doesn't exist]
 
  
* Update details of a global policy's unusable ip range
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Method        : PUT
+
~+~-Normal Response code: 201
URL          : /ipam/policies/{policy_id}/unusable_ip_ranges/:(id)
 
Params        : 'offset', 'length'
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
 
  
* Delete a global policy's unusable ip range
+
Error  - 404 Not Found [When Policy  doesn't exist]-~+~
  
Method        : DELETE
+
----
URL          : /ipam/policies/{policy_id}/unusable_ip_ranges/:(id)
+
==== Update details of a tenant's policy's unusable ip range ====
Params        : None
+
----
Response Code : Success - 200 OK
+
{| border="1" cellpadding="2" cellspacing="0"
                Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
+
| Verb
 +
| URI
 +
|-
 +
| PUT
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges/:(id)
 +
|}
  
== Global Policy Unusable Ip Octets ==
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
* List all unusable ip octets of a global policy
+
~+~-'offset': integer  [Can be +ve or -ve integer]
  
Method        : GET
+
'length' : integer [Should be +ve integer]-~+~
URL          : /ipam/policies/{policy_id}/unusable_ip_octets
 
Params        : None
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When Policy doesn't exist]
 
  
* Get details of a global policy's unusable ip octet
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Method        : GET
+
~+~-Normal Response code: 200
URL          : /ipam/policies/{policy_id}/unusable_ip_octets/:(id)
 
Params        : None
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
 
  
* Create a unusable ip octet in global policy
+
Error  - 404 Not Found [When Policy or IP range doesn't exist]-~+~
  
Method        : POST
+
----
URL          : /ipam/policies/{policy_id}/unusable_ip_octets
+
==== Delete a tenant's policy's unusable ip range ====
Params        : 'octet': integer  [Mandatory, Should be 0-255]
+
----
Response Code : Success - 201 Created
+
{| border="1" cellpadding="2" cellspacing="0"
                Error  - 404 Not Found [When Policy doesn't exist]
+
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges/:(id)
 +
|}
  
* Delete a global policy's unusable ip octet
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Method        : DELETE
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
URL          : /ipam/policies/{policy_id}/unusable_ip_octets/:(id)
 
Params        : None
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
 
  
* Update details of a global policy's unusable ip octet
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Method        : PUT
+
~+~-Normal Response code: 200
URL          : /ipam/policies/{policy_id}/unusable_ip_octets/:(id)
 
Params        : 'octet'
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
 
  
== Tenant Policies ==
+
Error  - 404 Not Found [When Policy or IP range doesn't exist]-~+~
  
* List all tenant's policies
+
=== 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
 +
|}
  
Method        : GET
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
URL          : /ipam/tenants/{tenant_id}/policies
 
Params        : None
 
Response Code : Success - 200 OK
 
  
* Get details of a tenant's policy
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
Method        : GET
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
URL          : /ipam/tenants/{tenant_id}/policies/:(id)
 
Params        : None
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When Policy doesn't exist]
 
  
* Create a tenant's policy
+
~+~-Normal Response code: 200
  
Method        : POST
+
Error  - 404 Not Found [When Policy doesn't exist]-~+~
URL          : /ipam/tenants/{tenant_id}/policies
 
Params        : 'name': string  [Mandatory]
 
                'description' : string
 
Response Code : Success - 201 Created
 
  
* Update details of a tenant's policy
+
----
 +
==== 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)
 +
|}
  
Method        : PUT
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
URL          : /ipam/tenants/{tenant_id}/policies/:(id)
 
Params       : 'name', 'description'
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When Policy doesn't exist]
 
  
* Delete a tenant's policy
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
  
  Method        : DELETE
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  URL          : /ipam/tenants/{tenant_id}/policies/:(id)
 
  Params        : None
 
  Response Code : Success - 200 OK
 
                  Error  - 404 Not Found [When Policy doesn't exist]
 
  
== Tenant Policy Unusable Ip Ranges ==
+
~+~-Normal Response code: 200
  
* List all unusable ip ranges of a tenant's policy
+
Error  - 404 Not Found [When Policy or IP octet doesn't exist]-~+~
  
Method        : GET
+
----
URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges
+
==== Create a unusable ip octet in tenant's policy ====
Params        : None
+
----
Response Code : Success - 200 OK
+
{| border="1" cellpadding="2" cellspacing="0"
        Error  - 404 Not Found [When Policy doesn't exist]
+
| Verb
 +
| URI
 +
|-
 +
| POST
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets
 +
|}
  
* Get details of a tenant's policy's unusable ip range
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Method        : GET
+
<span style="font-size: larger"><span style="font-size: smaller">'octet': integer  [Mandatory, Should be 0-255]</span></span>
URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges/:(id)
 
Params        : None
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
 
  
* Create a unusable ip range in tenant's policy
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Method        : POST
+
~+~-Normal Response code: 201
URL          : /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 Code : Success - 201 Created
 
                Error  - 404 Not Found [When Policy doesn't exist]
 
  
* Update details of a tenant's policy's unusable ip range
+
Error  - 404 Not Found [When Policy  doesn't exist]-~+~
  
Method        : PUT
+
----
URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges/:(id)
+
==== Update details of a tenant's policy's unusable ip octet. ====
Params        : 'offset', 'length'
+
----
Response Code : Success - 200 OK
+
{| border="1" cellpadding="2" cellspacing="0"
                Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
+
| Verb
 +
| URI
 +
|-
 +
| PUT  
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)
 +
|}
  
* Delete a tenant's policy's unusable ip range
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Method        : DELETE
+
<span style="font-size: larger"><span style="font-size: smaller">'octet': integer  [Should be 0-255]</span></span>
URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges/:(id)
 
Params        : None
 
Response Code : Success - 200 OK
 
              Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
 
  
== Tenant Policy Unusable Ip Octets ==
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
* List all unusable ip octets of a tenant's policy
 
  
Method        : GET
+
~+~-Normal Response code: 200
URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets
 
Params        : None
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When Policy doesn't exist]
 
  
* Get details of a tenant's policy's unusable ip octet
+
Error  - 404 Not Found [When Policy or IP octet doesn't exist]-~+~
  
Method        : GET
+
----
URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)
+
==== Delete a tenant's policy's unusable ip octet ====
Params        : None
+
----
Response Code : Success - 200 OK
+
{| border="1" cellpadding="2" cellspacing="0"
                Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
+
| Verb
 +
| URI
 +
|-
 +
| DELETE
 +
| /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)
 +
|}
  
* Create a unusable ip octet in tenant's policy
+
<span style="font-size: larger"><span style="font-size: smaller">''Params:'' </span></span>
  
Method        : POST
+
<span style="font-size: larger"><span style="font-size: smaller">None</span></span>
URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets
 
Params        : 'octet': integer  [Mandatory, Should be 0-255]
 
Response Code : Success - 201 Created
 
                Error  - 404 Not Found [When Policy doesn't exist]
 
  
* Update details of a tenant's policy's unusable ip octet.
+
<span style="font-size: larger"><span style="font-size: smaller">''Response Codes:'' </span></span>
  
Method        : PUT
+
~+~-Normal Response code: 200
URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)
 
Params        : 'octet'
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
 
  
* Delete a tenant's policy's unusable ip octet
+
Error  - 404 Not Found [When Policy or IP octet doesn't exist]-~+~
  
Method        : DELETE
+
== To Be Done: ==
URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)
 
Params        : None
 
Response Code : Success - 200 OK
 
                Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
 
  
= To Be Done: =
 
* Authentication and Authorization using keystone identity service.
 
* Add 'next' links in paginated list resources.
 
 
* Add 'self' and 'bookmark' links in resource details.
 
* Add 'self' and 'bookmark' links in resource details.
 
* Versions atom feed
 
* Versions atom feed
* Versioning by mime type
+
* 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