Jump to: navigation, search

Difference between revisions of "MelangeAPIBase"

Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
= Melange Base API =
+
= General API Information =
This document constitutes a first attempt in defining an API for the Melange 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.
+
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 =
== List all versions ==
+
* The Melange API supports both the JSON and XML data serialization formats.
Method        : GET URL          : /
+
* 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.
  
Params        : None
+
== Versions ==
 +
* Lists all versions of the API
  
Description  : Lists all versions of the API(Currently, Only v0.1 will be listed)
+
        Method        : GET
 +
        URL          : /
 +
        Params        : None
 +
        Response Code : Success - 200 OK
  
Response Code : Success - 200 OK
+
== 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.
  
All the urls below are prefixed by "/v0.1".
+
* Lists all extensions of the API
  
----
+
        Method        : GET
== Public IP Blocks ==
+
        URL          : /extensions
Method        : GET URL          : /ipam/public_ip_blocks
+
        Params        : None
 +
        Response Code : Success - 200 OK
  
Params        : None
+
* Get details all extensions of the API
  
Description  : Lists all public ip blocks
+
        Method        : GET
 +
        URL          : /extensions/alias
 +
        Params        : None
 +
        Response Code : Success - 200 OK
  
Response Code : Success - 200 OK
+
=== NOTE: ===
 +
All the urls below are prefixed by "/v0.1".
  
Method        : POST URL          : /ipam/public_ip_blocks Params        : 'cidr':  [[IpV4]] or [[IpV6]] cidr [Mandatory]
+
== Global IP Blocks ==
 +
* Lists all ip blocks
  
* 'network_id' : Can be a uuid, any string accepted
+
        Method        : GET
 +
        URL          : /ipam/ip_blocks
 +
        Params        : type ('public' or 'private')
 +
        Response Code : Success - 200 OK
  
Description  : Create a public ip block
+
* List all subnets of an ip block
  
Response Code : Success - 201 Created
+
        Method        : GET
 +
        URL          : /ipam/ip_blocks/{ip_block_id}/subnets
 +
        Params        : None
 +
        Response Code : Success - 200 OK
 +
                        Error  - 404 Not Found [When IpBlock doesn't exist]
  
Method        : DELETE URL          : /ipam/public_ip_blocks/:(id)
+
* Get details of an ip block by given id
  
Params        : None
+
        Method        : GET
 +
        URL          : /ipam/ip_blocks/:(id)
 +
        Params        : None
 +
        Response Code : Success - 200 OK
 +
                        Error  - 404 Not Found [When IpBlock doesn't exist]
  
Description  : Delete a public ip block by given id
+
* Create an ip block
  
Response Code : Success - 200 OK
+
        Method        : POST
 +
        URL          : /ipam/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' : Can be a uuid, any string accepted
 +
        Response Code : Success - 201 Created
  
* Error  - 404 Not Found [When IpBlock doesn't exist]
+
* Create a subnet in an ip block
  
Method        : GET URL          : /ipam/public_ip_blocks/:(id)
+
        Method        : POST
 +
        URL          : /ipam/ip_blocks/{ip_block_id}/subnets
 +
        Params        : 'cidr':  [[IpV4]] or [[IpV6]] cidr [Mandatory]
 +
                        'network_id' : Can be a uuid, any string accepted
 +
                        'policy_id' : Can be a uuid, any string accepted
 +
        Response Code : Success - 201 Created
 +
                        Error  - 404 Not Found [When IpBlock doesn't exist]
  
Params        : None
+
* Update details of an ip block by given id
  
Description  : Get details of a public ip block by given id
+
        Method        : PUT
 +
        URL          : /ipam/ip_blocks/:(id)
 +
        Params        : 'network_id' : Can be a uuid, any string accepted
 +
                        'policy_id' : Can be a uuid, any string accepted
 +
        Response Code : Success - 200 OK
 +
                        Error  - 404 Not Found [When IpBlock doesn't exist]
  
Response Code : Success - 200 OK
+
* Delete an ip block by given id
  
* Error  - 404 Not Found [When IpBlock doesn't exist]
+
        Method        : DELETE
 +
        URL          : /ipam/ip_blocks/:(id)
 +
        Params        : None
 +
        Response Code : Success - 200 OK
 +
                        Error  - 404 Not Found [When IpBlock doesn't exist]
  
----
+
== Tenant's IP Blocks ==
== Private IP Blocks ==
+
* Lists all ip blocks of a tenant
Method        : GET URL          : /ipam/tenants/{tenant_id}/private_ip_blocks
 
  
Params        : None
+
        Method        : GET
 +
        URL          : /ipam/tenants/{tenant_id}/ip_blocks
 +
        Params        : type ('public' or 'private')
 +
        Response Code : Success - 200 OK
  
Description  : Lists all private ip blocks of a tenant
+
* List all subnets of a tenant's ip block
  
Response Code : Success - 200 OK
+
        Method        : GET
 +
        URL          : /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/subnets
 +
        Params        : None
 +
        Response Code : Success - 200 OK
 +
                        Error  - 404 Not Found [When IpBlock doesn't exist]
  
Method        : POST URL          : /ipam/tenants/{tenant_id}/private_ip_blocks
+
* Get details of an tenant's ip block
  
Params        : 'cidr': [[IpV4]] or [[IpV6]] cidr [Mandatory]
+
        Method        : GET
 +
        URL          : /ipam/tenants/{tenant_id}/ip_blocks/:(id)
 +
        Params        : None
 +
        Response Code : Success - 200 OK
 +
                        Error  - 404 Not Found [When IpBlock doesn't exist]
  
* 'network_id' : Can be a uuid, any string accepted
+
* Create a tenant's ip block
  
Description  : Create a private ip block for given tenant
+
        Method        : POST
 +
        URL          : /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' : Can be a uuid, any string accepted
 +
        Response Code : Success - 201 Created
  
Response Code : Success - 201 Created
+
* Create a subnet in a tenant's ip block
  
Method        : DELETE URL          : /ipam/tenants/{tenant_id}/private_ip_blocks/:(id)
+
        Method        : POST
 +
        URL          : /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' : Can be a uuid, any string accepted
 +
        Response Code : Success - 201 Created
 +
                        Error  - 404 Not Found [When IpBlock doesn't exist]
  
Params        : None
+
* Update details of a tenant's ip block by given id
  
Description  : Delete a tenant's private ip block by given id
+
        Method        : PUT
 +
        URL          : /ipam/tenants/{tenant_id}/ip_blocks/:(id)
 +
        Params        : 'network_id' : Can be a uuid, any string accepted
 +
                        'policy_id' : Can be a uuid, any string accepted
 +
        Response Code : Success - 200 OK
 +
                        Error  - 404 Not Found [When IpBlock doesn't exist]
  
Response Code : Success - 200 OK
+
* Delete a tenant's ip block by given id
  
* Error  - 404 Not Found [When IpBlock doesn't exist]
+
        Method        : DELETE
 +
        URL          : /ipam/tenants/{tenant_id}/ip_blocks/:(id)
 +
        Params        : None
 +
        Response Code : Success - 200 OK
 +
                        Error  - 404 Not Found [When IpBlock doesn't exist]
  
Method        : GET URL          : /ipam/tenants/{tenant_id}/private_ip_blocks/:(id)
+
== [[IpAddress]] from Global IP Blocks ==
 +
* List all ip addresses in the ip block.
  
Params        : None
+
        Method        : GET
 +
        URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses
 +
        Params        : None
 +
        Response Code : Success - 200 OK
 +
                        Error  - 404 Not Found (When [[IpBlock]] for given ip_block_id is not found)
  
Description  : Get details of a tenant's private ip block by given id
+
* Get details of an ip address.
  
Response Code : Success - 200 OK
+
        Method        : GET
 +
        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]
  
* Error  - 404 Not Found [When IpBlock doesn't exist]
+
* Allocate an [[IpAddress]] from a block.
  
----
+
        Method        : POST
== [[IpAddress]] for Public IP Blocks (Accessible to admins only) ==
+
        URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses
== Get [[IpAddress]] Details for  Public IP Block ==
+
        Params        : 'address' : This address is used for allocation. If this is not provided, next available address will be allocated.
Method        : GET URL          : /ipam/public_ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}
+
                        '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]
  
Params        : None
+
* Deallocate an [[IpAddress]]
  
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.
+
        Method        : DELETE
 +
        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]
  
Response Code : Success - 200 OK
+
* Restore a deallocated address.
  
* Error  - 404 Not Found ( When [[IpBlock]] for given ip_block_id is not found, or [[IpAddress]] for given address is not found)
+
        Method        : PUT
 +
        URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/restore
 +
        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]
  
== Get all [[IpAddresses]] for Public IP Block ==
+
== [[IpAddress]] from Tenant's IP Blocks ==
Method        : GET URL          : /ipam/public_ip_blocks/{ip_block_id}/ip_addresses
 
  
Params        : None
+
* Get details of an ip address in a tenant's ip block.
  
Description   : Finds and returns all the [[IpAddresses]] which belongs to the Ipblock with id="ip_block_id", type="public" and tenant_id=None
+
        Method        : GET
 +
        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]
  
Response Code : Success - 200 OK
+
* List all ip addresses in a tenant's ip block.
  
* Error  - 404 Not Found ( When [[IpBlock]] for given ip_block_id is not found)
+
        Method        : GET
 +
        URL          : /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses
 +
        Params        : None
 +
        Response Code : Success - 200 OK
 +
                        Error  - 404 Not Found [When IpBlock for given ip_block_id and tenant_id is not found]
  
== Allocate a new [[IpAddress]] from a Public IP Block ==
+
* Allocate an [[IpAddress]] from a tenant's block.
Method        : POST URL          : /ipam/public_ip_blocks/{ip_block_id}/ip_addresses Params        : [port_id, address](optional)
 
  
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.
+
        Method        : POST
 +
        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]
  
* If port_id is passed, that is set on allocated [[IpAddress]].
+
* Deallocate an [[IpAddress]] from a tenant's block.
  
Response Code : Success - 201 Created
+
        Method        : DELETE
 +
        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]
  
* Error  - 404 Not Found ( When [[IpBlock]] for given ip_block_id is not found)
+
* Restore a deallocated address from a tenant's block.
** 422 Unprocessable Entity ( If any new ip_address can not be allocated from [[IpBlock]] )
 
  
== Delete an [[IpAddress]] from a Public IP Block ==
+
        Method        : PUT
Method        : DELETE URL          : /ipam/public_ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}
+
        URL          : /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses/{address}/restore
 +
        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]
  
Params        : None
+
== IP allocations in a Network ==
 +
These API create an ipv4 and ipv6 address for given interface(port).
  
Description  : Deletes [[IpAddress]] with address="address" belonging to [[IpBlock]] with id="ip_block_id", type="public", tenant_id=None
+
* Allocate an [[IpAddress]] from a global network.
  
Response Code : Success - 200 OK
+
        Method        : POST
 +
        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]
  
* Error  - 404 Not Found ( When ip_block for given ip_block_id is not found)
+
* Allocate an [[IpAddress]] from a tenant's network.
  
== Restore a deallocated [[IpAddress]] from Public IP Block ==
+
        Method        : POST
Method        : PUT URL          : /ipam/public_ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}/restore
+
        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]
  
Params        : None
+
== Natting API ==
  
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.
+
* List all inside globals for a local ip_address
  
Response Code : Success - 200 OK
+
Method        : GET
 +
URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_globals
 +
Params        : None
 +
Description  : Return the inside 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 IpAddress by given address is not found]
  
* Error  - 404 Not Found (When [[IpBlock]] for given ip_block_id is not found or [[IpAddress]] for given address is not found)
+
* List all inside locals for a global ip_address
  
----
+
Method        : GET
== [[IpAddress]] For Tenant's Private IP Block ==
+
URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals
Get [[IpAddress]] Details for Tenant's Private IP Block
+
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 IpBlock for ip_block_id or IpAddress by given address is not found]
  
Method        : GET URL          : /ipam/tenants/{tenant_id}/private_ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}
+
* Add Inside Global IPs to a local IP
  
Params        : None
+
Method        : POST
 +
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]
  
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".
+
* Add Inside Local IPs to a global IP
  
Response Code : Success - 200 OK
+
Method        : POST
 +
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]
  
* Error  - 404 Not Found ( When either [[IpBlock]] for given id and tenant_id is not found, or [[IpAddress]] for given address is not found)
+
* Delete a specific inside global for a local ip_address
  
Get all [[IpAddresses]] for Tenant's Private IP Block
+
Method        : DELETE
 +
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]
  
Method        : GET URL          : /ipam/tenants/{tenant_id}/private_ip_blocks/{ip_block_id}/ip_addresses
+
* Delete a specific inside local for a global ip_address
  
Params        : None
+
Method        : DELETE
 +
URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals/{address}
 +
Params        : None
 +
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
 +
                Error  - 404 Not Found [When IpBlock for ip_block_id or IpAddress by given address is not found]
  
Description  : Finds and returns all the [[IpAddresses]] which belongs to the Ipblock with id="ip_block_id", type="private" and tenant_id="tenant_id".
+
* Delete all inside globals for a local ip_address
  
Response Code : Success - 200 OK
+
Method        : DELETE
 +
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]
  
* Error  - 404 Not Found ( When [[IpBlock]] for given id and tenant_id is not found)
+
* Delete all inside locals for a global ip_address
  
Allocate a new [[IpAddress]] from Tenant's Private IP Block
+
Method        : DELETE
 +
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]
  
Method        : POST URL          : /ipam/tenants/{tenant_id}/private_ip_blocks/{ip_block_id}/ip_addresses
 
 
Params        : [port_id, address](optional)
 
 
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.
 
 
* If port_id is passed, that is set on allocated [[IpAddress]]
 
 
Response Code : Success - 201 Created
 
 
* Error  - 404 Not Found ( When [[IpBlock]] for given id and tenant_id is not found)
 
** 422 Unprocessable Entity ( If any new ip_address can not be allocated from [[IpBlock]] )
 
 
Delete an [[IpAddress]] from Tenant's Private IP Block
 
 
Method        : DELETE URL          : /ipam/tenants/{tenant_id}/private_ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}
 
 
Params        : None
 
 
Description  : Deletes [[IpAddress]] with address="address" belonging to [[IpBlock]] with id="ip_block_id", type="private", tenant_id="tenant_id"
 
 
Response Code : Success - 200 OK
 
 
* Error  - 404 Not Found ( When ip_block for given id and tenant_id is not found)
 
 
Restore a deallocated [[IpAddress]] from Tenant's Private IP Block
 
 
Method        : PUT URL          : /ipam/tenants/{tenant_id}/private_ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}/restore
 
 
Params        : None
 
 
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
 
 
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)
 
 
----
 
== Natting ==
 
== Add Inside Global IPs to a local IP ==
 
Method        : POST 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 adds [[IpAddresses]] passed in params as its inside global.
 
 
Response Code : Success - 200 OK
 
 
== Add Inside Local IPs to a global IP ==
 
Method        : POST 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
 
 
== List all inside globals for a local ip_address ==
 
Method        : GET URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}/inside_globals
 
 
Params        : None
 
 
Description  : Finds the local ip_address from given ip_block_id and address, and return all its inside global ip_addresses.
 
 
Response Code : Success - 200 OK
 
 
== List all inside locals for a global ip_address ==
 
Method        : GET 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 return all its inside local ip_addresses.
 
 
Response Code : Success - 200 OK
 
 
== Delete all inside locals for a global ip_address ==
 
Method        : DELETE 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
 
 
== Delete a specific inside local for a global ip_address ==
 
Method        : DELETE URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}/inside_locals/{inside_locals_address:.+?}
 
 
Params        : None
 
 
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.
 
 
Response Code : Success - 200 OK
 
 
== Delete all inside globals for an inside ip_address ==
 
Method        : DELETE 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
 
 
== Delete a specific inside global for an inside ip_address ==
 
Method        : DELETE URL          : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address:.+?}/inside_globals/{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 inside_global_address.
 
 
Response Code : Success - 200 OK
 
 
----
 
 
== Global Policies ==
 
== Global Policies ==
Method        : GET URL          : /ipam/policies
 
 
Params        : None
 
 
Description  : Lists all global policies
 
 
Response Code : Success - 200 OK
 
 
Method        : POST URL          : /ipam/policies
 
 
Params        : 'name': string  [Mandatory]
 
 
* 'description' : string
 
 
Description  : Create a global policy
 
 
Response Code : Success - 201 Created
 
 
Method        : DELETE URL          : /ipam/policies/:(id)
 
 
Params        : None
 
 
Description  : Delete a global policy by given id
 
 
Response Code : Success - 200 OK
 
 
* Error  - 404 Not Found [When Policy doesn't exist]
 
  
Method        : GET URL          : /ipam/policies/:(id)
+
* Lists all global policies
  
Params        : None
+
Method        : GET
 +
URL          : /ipam/policies
 +
Params        : None
 +
Response Code : Success - 200 OK
  
Description  : Get details of a global policy by given id
+
* Get details of a global policy
  
Response Code : Success - 200 OK
+
Method        : GET
 +
URL          : /ipam/policies/:(id)
 +
Params        : None
 +
Response Code : Success - 200 OK
 +
                Error  - 404 Not Found [When Policy doesn't exist]
  
* Error  - 404 Not Found [When Policy doesn't exist]
+
* Create a global policy
  
Method        : PUT URL          : /ipam/policies/:(id)
+
Method        : POST
 +
URL          : /ipam/policies
 +
Params        : 'name': string  [Mandatory]
 +
                'description' : string
 +
Response Code : Success - 201 Created
 +
                Error  - 422 [[UnProcessable]] Entity [When name is None]
  
Params        : 'name', 'description'
+
* Update details of a global policy
  
Description  : Update details of a global policy by given id
+
Method        : PUT
 +
URL          : /ipam/policies/:(id)
 +
Params        : 'name', 'description'
 +
Response Code : Success - 200 OK
 +
                Error  - 404 Not Found [When Policy doesn't exist]
  
Response Code : Success - 200 OK
+
* Delete a global policy
  
* Error  - 404 Not Found [When Policy doesn't exist]
+
Method        : DELETE
 +
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 ==
 
== Global Policy Unusable Ip Ranges ==
Method        : GET URL          : /ipam/policies/{policy_id}/unusable_ip_ranges
 
 
Params        : None
 
  
Description  : Lists all unusable ip ranges of a global policy
+
* List all unusable ip ranges of a global policy
  
Response Code : Success - 200 OK
+
Method        : GET
 +
URL          : /ipam/policies/{policy_id}/unusable_ip_ranges
 +
Params        : None
 +
Response Code : Success - 200 OK
 +
                Error  - 404 Not Found [When Policy doesn't exist]
  
Method        : POST URL          : /ipam/policies/{policy_id}/unusable_ip_ranges
+
* Get details of a global policy's unusable ip range
  
Params        : 'offset': integer  [Mandatory, Can be +ve or -ve integer]
+
Method        : GET
 +
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]
  
* 'length' : integer [Mandatory, Should be +ve integer]
+
* Create a unusable ip range in global policy
  
Description   : Create a unusable ip range in global policy
+
Method        : POST
 +
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]
  
Response Code : Success - 201 Created
+
* Update details of a global policy's unusable ip range
  
Method        : DELETE URL          : /ipam/policies/{policy_id}/unusable_ip_ranges/:(id)
+
Method        : PUT
 +
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]
  
Params        : None
+
* Delete a global policy's unusable ip range
  
Description   : Delete a global policy's unusable ip range by given id
+
Method        : DELETE
 +
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]
  
Response Code : Success - 200 OK
 
 
* Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
 
 
Method        : GET URL          : /ipam/policies/{policy_id}/unusable_ip_ranges/:(id)
 
 
Params        : None
 
 
Description  : Get details of a global policy's unusable ip range by given id
 
 
Response Code : Success - 200 OK
 
 
* Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
 
 
Method        : PUT URL          : /ipam/policies/{policy_id}/unusable_ip_ranges/:(id)
 
 
Params        : 'offset', 'length'
 
 
Description  : Update details of a global policy's unusable ip range by given id
 
 
Response Code : Success - 200 OK
 
 
* Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
 
 
----
 
 
== Global Policy Unusable Ip Octets ==
 
== Global Policy Unusable Ip Octets ==
Method        : GET URL          : /ipam/policies/{policy_id}/unusable_ip_octets
 
 
Params        : None
 
 
Description  : Lists all unusable ip octets of a global policy
 
 
Response Code : Success - 200 OK
 
  
Method        : POST URL          : /ipam/policies/{policy_id}/unusable_ip_octets
+
* List all unusable ip octets of a global policy
  
Params        : 'octet': integer  [Mandatory, Should be 0-255]
+
Method        : GET
 +
URL          : /ipam/policies/{policy_id}/unusable_ip_octets
 +
Params        : None
 +
Response Code : Success - 200 OK
 +
                Error  - 404 Not Found [When Policy doesn't exist]
  
Description  : Create a unusable ip octet in global policy
+
* Get details of a global policy's unusable ip octet
  
Response Code : Success - 201 Created
+
Method        : GET
 +
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]
  
Method        : DELETE URL          : /ipam/policies/{policy_id}/unusable_ip_octets/:(id)
+
* Create a unusable ip octet in global policy
  
Params        : None
+
Method        : POST
 +
URL          : /ipam/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]
  
Description  : Delete a global policy's unusable ip octet by given id
+
* Delete a global policy's unusable ip octet
  
Response Code : Success - 200 OK
+
Method        : DELETE
 +
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]
  
* Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
+
* Update details of a global policy's unusable ip octet
  
Method        : GET URL          : /ipam/policies/{policy_id}/unusable_ip_octets/:(id)
+
Method        : PUT
 +
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]
  
Params        : None
 
 
Description  : Get details of a global policy's unusable ip octet by given id
 
 
Response Code : Success - 200 OK
 
 
* Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
 
 
Method        : PUT URL          : /ipam/policies/{policy_id}/unusable_ip_octets/:(id)
 
 
Params        : 'octet'
 
 
Description  : Update details of a global policy's unusable ip octet by given id
 
 
Response Code : Success - 200 OK
 
 
* Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
 
 
----
 
 
== Tenant Policies ==
 
== Tenant Policies ==
Method        : GET URL          : /ipam/tenants/{tenant_id}/policies
 
 
Params        : None
 
 
Description  : Lists all tenant's policies
 
 
Response Code : Success - 200 OK
 
 
Method        : POST URL          : /ipam/tenants/{tenant_id}/policies
 
 
Params        : 'name': string  [Mandatory]
 
 
* 'description' : string
 
 
Description  : Create a tenant's policy
 
  
Response Code : Success - 201 Created
+
* List all tenant's policies
  
Method        : DELETE URL          : /ipam/tenants/{tenant_id}/policies/:(id)
+
Method        : GET
 +
URL          : /ipam/tenants/{tenant_id}/policies
 +
Params        : None
 +
Response Code : Success - 200 OK
  
Params        : None
+
* Get details of a tenant's policy
  
Description   : Delete a tenant's policy by given id
+
Method        : GET
 +
URL          : /ipam/tenants/{tenant_id}/policies/:(id)
 +
Params        : None
 +
Response Code : Success - 200 OK
 +
                Error   - 404 Not Found [When Policy doesn't exist]
  
Response Code : Success - 200 OK
+
* Create a tenant's policy
  
* Error  - 404 Not Found [When Policy doesn't exist]
+
Method        : POST
 +
URL          : /ipam/tenants/{tenant_id}/policies
 +
Params        : 'name': string  [Mandatory]
 +
                'description' : string
 +
Response Code : Success - 201 Created
  
Method        : GET URL          : /ipam/tenants/{tenant_id}/policies/:(id) Params        : None
+
* Update details of a tenant's policy
  
Description   : Get details of a tenant's policy by given id
+
Method        : PUT
 +
URL          : /ipam/tenants/{tenant_id}/policies/:(id)
 +
Params        : 'name', 'description'
 +
Response Code : Success - 200 OK
 +
                Error   - 404 Not Found [When Policy doesn't exist]
  
Response Code : Success - 200 OK
+
* Delete a tenant's policy
  
* Error  - 404 Not Found [When Policy doesn't exist]
+
  Method        : DELETE
 +
  URL          : /ipam/tenants/{tenant_id}/policies/:(id)
 +
  Params        : None
 +
  Response Code : Success - 200 OK
 +
                  Error  - 404 Not Found [When Policy doesn't exist]
  
Method        : PUT URL          : /ipam/tenants/{tenant_id}/policies/:(id)
 
 
Params        : 'name', 'description'
 
 
Description  : Update details of a tenant's policy by given id
 
 
Response Code : Success - 200 OK
 
 
* Error  - 404 Not Found [When Policy doesn't exist]
 
 
----
 
 
== Tenant Policy Unusable Ip Ranges ==
 
== Tenant Policy Unusable Ip Ranges ==
Method        : GET URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges
 
 
Params        : None
 
 
Description  : Lists all unusable ip ranges of a tenant's policy
 
 
Response Code : Success - 200 OK
 
 
Method        : POST 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]
 
 
Description  : Create a unusable ip range in tenant's policy
 
 
Response Code : Success - 201 Created
 
 
Method        : DELETE URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges/:(id)
 
 
Params        : None
 
 
Description  : Delete a tenant's policy's unusable ip range by given id
 
 
Response Code : Success - 200 OK
 
 
* Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
 
  
Method        : GET URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges/:(id)
+
* List all unusable ip ranges of a tenant's policy
  
Params        : None
+
Method        : GET
 +
URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges
 +
Params        : None
 +
Response Code : Success - 200 OK
 +
        Error  - 404 Not Found [When Policy doesn't exist]
  
Description  : Get details of a tenant's policy's unusable ip range by given id
+
* Get details of a tenant's policy's unusable ip range
  
Response Code : Success - 200 OK
+
Method        : GET
 +
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]
  
* Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
+
* Create a unusable ip range in tenant's policy
  
Method        : PUT URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_ranges/:(id)
+
Method        : POST
 +
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]
  
Params        : 'offset', 'length'
+
* Update details of a tenant's policy's unusable ip range
  
Description  : Update details of a tenant's policy's unusable ip range by given id
+
Method        : PUT
 +
URL          : /ipam/tenants/{tenant_id}/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]
  
Response Code : Success - 200 OK
+
* Delete a tenant's policy's unusable ip range
  
* Error  - 404 Not Found [When Policy or Ip Range doesn't exist]
+
Method        : DELETE
 +
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 ==
 
== Tenant Policy Unusable Ip Octets ==
Method        : GET URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets
+
* List all unusable ip octets of a tenant's policy
 
 
Params        : None
 
 
 
Description  : Lists all unusable ip octets of a tenant's policy
 
 
 
Response Code : Success - 200 OK
 
 
 
Method        : POST URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets
 
 
 
Params        : 'octet': integer  [Mandatory, Should be 0-255]
 
 
 
Description  : Create a unusable ip octet in tenant's policy
 
 
 
Response Code : Success - 201 Created
 
 
 
Method        : DELETE URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)
 
 
 
Params        : None
 
 
 
Description  : Delete a tenant's policy's unusable ip octet by given id
 
 
 
Response Code : Success - 200 OK
 
 
 
* 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)
 
 
 
Params        : None
 
  
Description   : Get details of a tenant's policy's unusable ip octet by given id
+
Method        : GET
 +
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]
  
Response Code : Success - 200 OK
+
* 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)
 +
Params        : None
 +
Response Code : Success - 200 OK
 +
                Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
  
Method        : PUT URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)
+
* Create a unusable ip octet in tenant's policy
  
Params        : 'octet'
+
Method        : POST
 +
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]
  
Description  : Update details of a tenant's policy's unusable ip octet by given id
+
* Update details of a tenant's policy's unusable ip octet.
  
Response Code : Success - 200 OK
+
Method        : PUT
 +
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]
  
* Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
+
* Delete a tenant's policy's unusable ip octet
  
----
+
Method        : DELETE
== Extensions ==
+
URL          : /ipam/tenants/{tenant_id}/policies/{policy_id}/unusable_ip_octets/:(id)
The API works similar to Nova extensions.
+
Params        : None
 +
Response Code : Success - 200 OK
 +
                Error  - 404 Not Found [When Policy or Ip Octet doesn't exist]
  
----
+
= To Be Done: =
== To Be Done: ==
+
* Authentication and Authorization using keystone identity service.
* 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)
+
* Add 'next' links in paginated list resources.
 +
* Add 'self' and 'bookmark' links in resource details.
 +
* Versions atom feed
 +
* Versioning by mime type

Revision as of 17:40, 27 July 2011

General API 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

  • Lists all versions of the API
       Method        : GET
       URL           : /
       Params        : None
       Response Code : Success - 200 OK

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.

  • Lists all extensions of the API
       Method        : GET
       URL           : /extensions
       Params        : None
       Response Code : Success - 200 OK
  • Get details all extensions of the API
       Method        : GET
       URL           : /extensions/alias
       Params        : None
       Response Code : Success - 200 OK

NOTE:

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

Global IP Blocks

  • Lists all ip blocks
       Method        : GET
       URL           : /ipam/ip_blocks
       Params        : type ('public' or 'private')
       Response Code : Success - 200 OK
  • List all subnets of an ip block
       Method        : GET
       URL           : /ipam/ip_blocks/{ip_block_id}/subnets
       Params        : None
       Response Code : Success - 200 OK
                       Error   - 404 Not Found [When IpBlock doesn't exist]
  • Get details of an ip block by given id
       Method        : GET
       URL           : /ipam/ip_blocks/:(id)
       Params        : None
       Response Code : Success - 200 OK
                       Error   - 404 Not Found [When IpBlock doesn't exist]
  • Create an ip block
       Method        : POST
       URL           : /ipam/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' : Can be a uuid, any string accepted
       Response Code : Success - 201 Created
  • Create a subnet in an ip block
       Method        : POST
       URL           : /ipam/ip_blocks/{ip_block_id}/subnets
       Params        : 'cidr':  IpV4 or IpV6 cidr [Mandatory]
                       'network_id' : Can be a uuid, any string accepted
                       'policy_id' : Can be a uuid, any string accepted
       Response Code : Success - 201 Created
                       Error   - 404 Not Found [When IpBlock doesn't exist]
  • Update details of an ip block by given id
       Method        : PUT
       URL           : /ipam/ip_blocks/:(id)
       Params        : 'network_id' : Can be a uuid, any string accepted
                       'policy_id' : Can be a uuid, any string accepted
       Response Code : Success - 200 OK
                       Error   - 404 Not Found [When IpBlock doesn't exist]
  • Delete an ip block by given id
       Method        : DELETE
       URL           : /ipam/ip_blocks/:(id)
       Params        : None
       Response Code : Success - 200 OK
                       Error   - 404 Not Found [When IpBlock doesn't exist]

Tenant's IP Blocks

  • Lists all ip blocks of a tenant
       Method        : GET
       URL           : /ipam/tenants/{tenant_id}/ip_blocks
       Params        : type ('public' or 'private')
       Response Code : Success - 200 OK
  • List all subnets of a tenant's ip block
       Method        : GET
       URL           : /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/subnets
       Params        : None
       Response Code : Success - 200 OK
                       Error   - 404 Not Found [When IpBlock doesn't exist]
  • Get details of an tenant's ip block
       Method        : GET
       URL           : /ipam/tenants/{tenant_id}/ip_blocks/:(id)
       Params        : None
       Response Code : Success - 200 OK
                       Error   - 404 Not Found [When IpBlock doesn't exist]
  • Create a tenant's ip block
       Method        : POST
       URL           : /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' : Can be a uuid, any string accepted
       Response Code : Success - 201 Created
  • Create a subnet in a tenant's ip block
       Method        : POST
       URL           : /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' : Can be a uuid, any string accepted
       Response Code : Success - 201 Created
                       Error   - 404 Not Found [When IpBlock doesn't exist]
  • Update details of a tenant's ip block by given id
       Method        : PUT
       URL           : /ipam/tenants/{tenant_id}/ip_blocks/:(id)
       Params        : 'network_id' : Can be a uuid, any string accepted
                       'policy_id' : Can be a uuid, any string accepted
       Response Code : Success - 200 OK
                       Error   - 404 Not Found [When IpBlock doesn't exist]
  • Delete a tenant's ip block by given id
       Method        : DELETE
       URL           : /ipam/tenants/{tenant_id}/ip_blocks/:(id)
       Params        : None
       Response Code : Success - 200 OK
                       Error   - 404 Not Found [When IpBlock doesn't exist]

IpAddress from Global IP Blocks

  • List all ip addresses in the ip block.
       Method        : GET
       URL           : /ipam/ip_blocks/{ip_block_id}/ip_addresses
       Params        : None
       Response Code : Success - 200 OK
                       Error   - 404 Not Found (When IpBlock for given ip_block_id is not found)
  • Get details of an ip address.
       Method        : GET
       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]
       Method        : POST
       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]
       Method        : DELETE
       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.
       Method        : PUT
       URL           : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/restore
       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]

IpAddress from Tenant's IP Blocks

  • Get details of an ip address in a tenant's ip block.
       Method        : GET
       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.
       Method        : GET
       URL           : /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses
       Params        : None
       Response Code : Success - 200 OK
                       Error   - 404 Not Found [When IpBlock for given ip_block_id and tenant_id is not found]
  • Allocate an IpAddress from a tenant's block.
       Method        : POST
       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.
       Method        : DELETE
       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.
       Method        : PUT
       URL           : /ipam/tenants/{tenant_id}/ip_blocks/{ip_block_id}/ip_addresses/{address}/restore
       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

These API create an ipv4 and ipv6 address for given interface(port).

  • Allocate an IpAddress from a global network.
       Method        : POST
       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.
       Method        : POST
       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]

Natting API

  • List all inside globals for a local ip_address

Method  : GET URL  : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_globals Params  : None Description  : Return the inside 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 IpAddress by given address is not found]

  • List all inside locals for a global ip_address

Method  : GET 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 IpBlock for ip_block_id or IpAddress by given address is not found]

  • Add Inside Global IPs to a local IP

Method  : POST 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

Method  : POST 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

Method  : DELETE 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

Method  : DELETE URL  : /ipam/ip_blocks/{ip_block_id}/ip_addresses/{address}/inside_locals/{address} Params  : None 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 Error - 404 Not Found [When IpBlock for ip_block_id or IpAddress by given address is not found]

  • Delete all inside globals for a local ip_address

Method  : DELETE 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

Method  : DELETE 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

  • Lists all global policies

Method  : GET URL  : /ipam/policies Params  : None Response Code : Success - 200 OK

  • Get details of a global policy

Method  : GET URL  : /ipam/policies/:(id) Params  : None Response Code : Success - 200 OK Error - 404 Not Found [When Policy doesn't exist]

  • Create a global policy

Method  : POST 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

Method  : PUT URL  : /ipam/policies/:(id) Params  : 'name', 'description' Response Code : Success - 200 OK Error - 404 Not Found [When Policy doesn't exist]

  • Delete a global policy

Method  : DELETE 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

  • List all unusable ip ranges of a global policy

Method  : GET 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

Method  : GET 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

Method  : POST 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

Method  : PUT 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

Method  : DELETE 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]

Global Policy Unusable Ip Octets

  • List all unusable ip octets of a global policy

Method  : GET 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

Method  : GET 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

Method  : POST URL  : /ipam/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]

  • Delete a global policy's unusable ip octet

Method  : DELETE 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

Method  : PUT 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

  • List all tenant's policies

Method  : GET URL  : /ipam/tenants/{tenant_id}/policies Params  : None Response Code : Success - 200 OK

  • Get details of a tenant's policy

Method  : GET 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

Method  : POST URL  : /ipam/tenants/{tenant_id}/policies Params  : 'name': string [Mandatory] 'description' : string Response Code : Success - 201 Created

  • Update details of a tenant's policy

Method  : PUT 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
 			Method        : DELETE
 			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

  • List all unusable ip ranges of a tenant's policy

Method  : GET URL  : /ipam/tenants/{tenant_id}/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 tenant's policy's unusable ip range

Method  : GET 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

Method  : POST 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

Method  : PUT URL  : /ipam/tenants/{tenant_id}/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 tenant's policy's unusable ip range

Method  : DELETE 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

  • List all unusable ip octets of a tenant's policy

Method  : GET 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

Method  : GET 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]

  • Create a unusable ip octet in tenant's policy

Method  : POST 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.

Method  : PUT 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

Method  : DELETE 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.
  • Versions atom feed
  • Versioning by mime type