Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added "Calls Subject to Change" (potentially temp)

...

Get Host Utilization

URL/api/v1/api.php?target=ipam&action=getHostUtilization
DescriptionGets the host utilization statistics with support for filters.
Returns

Examples:

SUCCESSFUL
{

"success": 1,

"totalHosts": "256",

"hostsAssigned": 0,

"hostsAllocated": "256",

"hostsAvailable": "256",

"hostsInHolding": 0,

"availablePercentage": "100.00",

"assignedPercentage": "0.00",

"allocatedPercentage": "100.00",

"inHoldingPercentage": "0.00",

"resources": [{

"id": 351,

"name": "Customer 1",

"type": "entry",

"hosts": "256",

"blocks": "1",

"percentage": "100.00"

}]

}

ERROR{'success':0, 'message':'error message'}
Required Parameters
NameTypeExampleDescription
typeSTRING"ipv4" or "ipv6"IP type
Optional Parameters
NameTypeExampleMultiple ValuesDescription
codeSTRING"code-1"YesUser-defined block code as defined in Admin-IPAM settings: Generic Code Per Block Name
regionSTRING"SFO"YesRegion to assign from
rirSTRINGARIN

No

Acceptable values: ARIN, RIPE, APNIC, AfriNIC, LACNIC, 1918
tagsSTRING"Customer"YesComma separated string of tags
vlanINTEGER1000YesVLAN designated to a given block

NOTE: to filter using multiple values, pass the values as a JSON-encoded string representation of an array.

For example, to get utilization data for multiple tags, you could use the following URL:

/api/v1/api.php?target=ipam&action=getHostUtilization&type=ipv4&tags=["Customer","PTP"]

Example URL/api/v1/api.php?target=ipam&action=getHostUtilization&type=ipv4&tags=["Customer","PTP"]&region=SMF

 

 

Aggregate

Get Attribute List

URL/api/v1/api.php?target=ipam&action=getAttributeListsaggregate

DescriptionReturns a list of attributes

Aggregates a selected block to the mask specified. If no mask specified, re-aggregates blocks to next parent. IE. calling aggregate on a /25 will aggregate both children back to the parent /24. All child blocks must be Available for aggregation to succeed.

Returns

Examples:

SUCCESSFUL
 {"
asns
success":
[]
1,"
masks
message":
["24"],"rirs":["1918"],"lirs":[],"tags":["DHCP"],"codes":[],"vlans":[],"regions":["Quito"],"resources":[{"id":"1302","name":"Quito Lab 1","slug":"quito-lab-1","type":"dhcp_pool","parent_id":"1","category_id":null,"attr":{"_dhcp_type":"subnet","_dhcp_pool_attributes":"{\"mac\":\"\",\"rangeStart\":\"10.8.0.0\",\"rangeEnd\":\"10.8.0.255\",\"freeLines\":0}","_dhcp_ip_id":"125"}}]}
"10.2.0.128\/25 aggregated into 10.2.0.0\/24","id":16326}
                  
ERROR{'success':0, 'message':'error message'}
Required Parameters
NameTypeExampleDescription
id*INTEGER125ID of the IP block.
block*STRING213.37.29.0/24CIDR block.
*Either block or id can be used, but only one must be provided
Optional Parameters
NameTypeExampleDescription
autoAggregateToMaskINTEGER24

All blocks and IPs smaller than this netmask will be aggregated.

ignoreAssignments

BOOLTRUE

If the ignoreAssignment flag is not set the aggregation operation will fail if any children beneath the supplied autoAggregateToMask are assigned or otherwise unavailable.  If this option is set, it will unassign blocks prior to reaggregation.

Example URL/api/v1/api.php?target=ipam&action=aggregate&id=125&autoAggregateToMask=24
Optional Parameters/apiaggregate

Split

URL/api/v1/api.php?target=ipam&action=split
Description

Splits a selected block to the mask specified. If no mask specified, it split blocks to next child. IE. calling aggregate on a /24 will split both parent to the child /25s. All parent blocks must be Available, or have Allow Sub Assignments on for a split to succeed.

Returns

Examples:

SUCCESSFUL
                      {"success":1,"message":"10.1.0.0\/24 split into 10.1.0.0\/25 and 10.1.0.128\/25","data":{"child1":23441
                      ,"child2":23451}}
                    
ERROR{'success':0, 'message':'error message'}
Required Parameters
NameTypeExampleDescription
id*INTEGER125ID of the IP block.
block*
None
Example URL/api/v1/api.php?target=ipam&action=getAttributeLists&id=125
STRING213.37.29.0/24CIDR block.
*Either block or id can be used, but only one must be provided
Optional Parameters
NameTypeExampleDescription
autoSplitToMaskINTEGER24Auto aggregate the block back to this mask size. Note all blocks up this mask size must be Available or call will fail.
autoSplitLimitINTEGER4A number the power of 2 (^2).
Example URL/api

Aggregate

URL/v1/api.php?target=ipam&action=split&block=213.37.29.0/24&autoSplitLimit=4
Type

None

Scan Block

URL/api/v1/api.php?target=ipam&action=scanBlock
Description

Initiates an asynchronous ping (ICMP) scan of the target block specified. Results of the scan can be checked with get

Description

Aggregates a selected block to the mask specified. If no mask specified, re-aggregates blocks to next parent. IE. calling aggregate on a /25 will aggregate both children back to the parent /24. All child blocks must be Available for aggregation to succeed.

Returns

Examples:

SUCCESSFUL
{"success":1,"message":"
10.2
Ping scan started for 8.8.8.0
.128\/25 aggregated into 10.2.0.0\/24","id":16326}
\/27"}
ERROR{'success':0, 'message':'error message'}
Required Parameters
NameTypeExampleDescription
id*INTEGER125ID of the IP block.
block*STRING213.37.29.0/24CIDR block.
*Either block or id can be used, but only one must be provided
Optional ParametersName
ExampleDescription
autoAggregateToMaskINTEGER24

All blocks and IPs smaller than this netmask will be aggregated.

ignoreAssignments

BOOLTRUE

If the ignoreAssignment flag is not set the aggregation operation will fail if any children beneath the supplied autoAggregateToMask are assigned or otherwise unavailable.  If this option is set, it will unassign blocks prior to reaggregation.

/api/v1/api.php?target=ipam&action=scanBlock&block=213.37.29.0/24
/api/v1/apiaggregate&id=125&autoAggregateToMask=24

Get Scan Results

URL/api/v1/apiExample URL.php?target=ipam&action=

Split

URL/api/v1/api.php?target=ipam&action=split
getScanResults
Description

Initiates an asynchronous ping (ICMP) scan of the target block specified. Results of the scan can be checked with get

Description

Splits a selected block to the mask specified. If no mask specified, it split blocks to next child. IE. calling aggregate on a /24 will split both parent to the child /25s. All parent blocks must be Available, or have Allow Sub Assignments on for a split to succeed.

Returns

Examples:

SUCCESSFUL
{"success":1,"data":{"block":"8.8.8.0\/27","date":"07\/14\/2014 11:07:10",
"data":[{"address":"8.8.8.8","host":"google-public-dns-a.google.com","status":"Up"}],"status":"completed","hostsScanned":4,"activeHosts":4}}                      {"success":1,"message":"10.1.0.0\/24 split into 10.1.0.0\/25 and 10.1.0.128\/25","data":{"child1":23441
                      ,"child2":23451}}
                    
ERROR{'success':0, 'message':'error message'}
Required Parameters
NameTypeExampleDescription
id*INTEGER125ID of the IP block.
blockSTRINGblock*STRING213.37.29.0/24CIDR block.
*Either block or id can be used, but only one must be provided
Optional Parameters
NameTypeExampleDescription
autoSplitToMaskINTEGER24Auto aggregate the block back to this mask size. Note all blocks up this mask size must be Available or call will fail.
autoSplitLimitINTEGER4A number the power of 2 (^2).

None

ExampleExample URL/api/v1/api.php?target=ipam&action=splitgetScanResults&block=213.37.29.0/24&autoSplitLimit=4

IPAM API Calls Subject to Change:

Calls below this point are subject to change, and are not recommended for use in production code. 

 

blockCIDR block.

Get Attribute List

Scan Block

URL

/api/v1/api.php?target=ipam&action=

scanBlock

getAttributeLists

Description

Initiates an asynchronous ping (ICMP) scan of the target block specified. Results of the scan can be checked with get.Returns a list of attributes

Returns

Examples:

Get Scan Results

URL/api/v1/api.php?target=ipam&action=getScanResults
Description

Initiates an asynchronous ping (ICMP) scan of the target block specified. Results of the scan can be checked with get

Returns

Examples:

SUCCESSFUL

{"

success

asns":

1

[],"

message

masks":

"Ping scan started for 8.8.8.0\/27"}
ERROR{'success':0, 'message':'error message'}
Required Parameters
NameTypeExampleDescription
id*INTEGER125ID of the IP block.
block*STRING213.37.29.0/24CIDR block.
*Either block or id can be used, but only one must be provided
Optional Parameters

None

Example/api/v1/api.php?target=ipam&action=scanBlock&block=213.37.29.0/24
SUCCESSFUL
{"success":1,"data":{"block":"8.8.8.0\/27","date":"07\/14\/2014 11:07:10",
"data":[{"address":"8.8.8.8","host":"google-public-dns-a.google.com","status":"Up"}],"status":"completed","hostsScanned":4,"activeHosts":4}

["24"],"rirs":["1918"],"lirs":[],"tags":["DHCP"],"codes":[],"vlans":[],"regions":["Quito"],"resources":[{"id":"1302","name":"Quito Lab 1","slug":"quito-lab-1","type":"dhcp_pool","parent_id":"1","category_id":null,"attr":{"_dhcp_type":"subnet","_dhcp_pool_attributes":"{\"mac\":\"\",\"rangeStart\":\"10.8.0.0\",\"rangeEnd\":\"10.8.0.255\",\"freeLines\":0}","_dhcp_ip_id":"125"}}]}

ERROR{'success':0, 'message':'error message'}
Required Parameters
NameTypeExampleDescription
id
STRING213.37.29.0/24
INTEGER125ID of the IP block

Optional Parameters

None
Example URL/api/v1/api.php?target=ipam&action=getScanResultsgetAttributeLists&block=213.37.29.0/24id=125