Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Converted from version 6.0.2

...

Get

URL/api/v1/api.php?target=ipam&action=get
DescriptionReturns a list of IP blocks. Use optional parameters to filter the list.
If multiple parameters are specified, only blocks matching all parameters will be returned.
Returns

Examples:

SUCCESSFUL{ "success": 1, "message": "1 blocks found. ", "data": [ { "id": 5890, "type": "ipv4", "top_aggregate": null, "cidr": "192.168.0.0\/24", "formatted_ip": "192.168.0.0\/24", "address": "3232235520", "end_address": "3232235775", "mask": 24, "child1": null, "child2": null, "is_assigned": 0, "is_swipped": 0, "is_aggregate": 1, "custid": 81, "resource_id": 81, "resource_name": "Available", "last_updated_time": null, "description": null, "parent": null, "rir": "1918", "lir_id": null, "notes": null, "generic_code": null, "code": null, "region": "SFO", "vlan": 100, "arin_net_id": null, "arin_cust_id": null, "org_id": null, "arin_swip_time": null, "assigned_time": null, "asn": null, "allowSubAssignments": false, "permissions": { "permissionIPAMRead": "1", "permissionIPAMUpdate": "1", "permissionIPAMCreate": "1", "permissionSWIP": "1", "permissionAdmin": "1" }, "range": "192.168.0.0 - 192.168.0.255", "tags": [ "Customer", "PTP" ] } ] }
ERROR{'success':0, 'message':'error message'}
Required ParametersNone
Optional Parameters
NameTypeExampleDescription
addressINTEGER1125449728IP address of the block in decimal format
asnINTEGER1000Filters blocks based on their ASN
allowSubAssignmentsBOOLtrueFilters blocks based on wether they allow sub-assignments or not. Acceptable values: "true" or "false"
blockSTRING213.37.29.0/24CIDR block description
codeSTRINGCode XUser-defined block code as defined in Admin-IPAM settings: Generic Code Per Block Name
endAddressINTEGER1125453823End IP address of the block in decimal format
idINTEGER1234The ID of the block
includeAttributesBOOLtrueAllows loading and display of the attributes for all of the blocks in the collection.
isAggregateBOOLtrueIndicates if the block has been split into children or not. A value of 'true' will return blocks with no children.
isAssignedBOOLtrueAcceptable values: "true" or "false"
isSwippedBOOLtrueAcceptable values: "true" or "false"
lastUpdateTimeDATETIME=2015-8-19 21:08:54 SQL Datetime format, prefaced by an "=" for exact time updated, "=﹥" for blocks updated after the given time, or "=﹤" for blocks updated before the given time.
lirIdINTEGER101The numeric ID of an LIR resource the block should be linked to
maskINTEGER24Integer bitmask
notesSTRINGnote123Returns blocks with exact matches in the notes field against the provided "notes" string.
regionSTRINGSFOThe value from the list of name/value pairs which make up the list of available regions
resourceHolderIdSTRING
cust-001

(Deprecated: Use resourceQuery instead)

A custom ID which can be used to link resources in the 6Connect database back to your organization.

resourceIdINTEGER1234The ID of the resource the block is assigned to
resourceQueryJSON

 

{"parent_id":15}

 

A JSON object representing a valid resource query. Any parameters that can be used for a Resource GET API call can be used. Use of the resourceQuery parameter will return blocks assigned to any of the resources returned by that query.
rirSTRINGARINAcceptable values: ARIN, RIPE, APNIC, AfriNIC, LACNIC, 1918
searchSTRING192.168If a search term is provided, all IPAM fields including assigned Resource Holder name will be checked with a LIKE comparison to find matching blocks
selectCountINTEGER50# of blocks to get
selectOffsetINTEGER25Offset for results set; useful for paging (e.g. selectCount = 50, selectOffset = 100 would return the 3rd page of 50 results)
sortFieldSTRINGcidrAttribute to sort blocks by. Accepable values: cidr, mask, rir, vlan, code, updateTime
sortOrderINTEGERASCASC or DESC
tagsSTRINGcustomer,vpnComma-separated list of tags to filter by. If used in conjunction with 'search', performs the search operation and then filters results by the provided tag. Use with tagsMode to specify filter approach.
tagsModeSTRING"strict","exclude", "intersection", or "union".

Denotes how the "tags" parameter is handled:

"strict" - matches only blocks that have the exact set of tags of specified.

"exclude" - matches only blocks which are note tagged with any of the blocks specified.

"intersection" - matches any blocks which has all of the tags. 

"union" - matches all blocks which has any one of the tags. 

If not otherwise specified, tagsMode defaults to "intersection".

topAggregateIdINTEGER1234The ID of the aggregate block to which the block belongs
typeSTRING"ipv4" or "ipv6"IP type
vlanINTEGER123VLAN for the block
Example URL/api/v1/api.php?target=ipam&action=get&rir=ARIN&tags=customer,vpn

...

Smart Assign

URL/api/v1/api.php?target=ipam&action=smartAssign
DescriptionSelects a block based on supplied parameters (rir, tags, mask size, etc.) and assigns it to a Resource Holder.
Returns

Examples:

SUCCESSFUL{ "success":1,"message":"Assigned 192.168.0.0/24 to Resource (1234) via Smart Assign", "id":12345, "data":{ "id":12345, "cidr":192.168.0.0/24", ...} }
ERROR { "success":0, "message":"error message" }


Required Parameters
NameTypeExampleDescription
maskINTEGER24The size of the block to be assigned
rirSTRINGARINAcceptable values: ARIN, RIPE, APNIC, AfriNIC, LACNIC, 1918
resourceId*INTEGER1234Integer ID of the resource to assign the block to
resourceQuery*JSON

 

{"custom_id":"cust-001"}

 

A JSON object representing a valid resource query. Any parameters that can be used for a Resource GET API call can be used. Use of the resourceQuery parameter will return blocks assigned to any of the resources returned by that query.
*Either resourceId or resourceQuery can be used, but only one must be provided
resourceHolderIdSTRING
cust-001

(Deprecated: Use resourceQuery instead)

A custom ID which can be used to link resources in the 6Connect database back to your organization.

typeSTRING"IPv4" or "IPv6"The type of block to assign
Optional Parameters*
NameTypeExampleDescription
assignedResourceIdSTRING"123" or "ignore"The ID of the resource the block is assigned to, or the string "ignore". If assignedResourceId is set to "ignore", then a matching IP block is selected from the Available pool or any sub-assignable block on any resource.
codeSTRINGCode XArbitrary user-defined block code
lirIdINTEGER101The ID of an LIR resource
regionSTRINGAshburnRegion to assign from
tagsSTRINGcustomer,vpnComma separated string of tags. Matches blocks which have at least the set of tag specified by this parameter
tagsModeSTRING"strict","exclude", "intersection", or "union".

Denotes how the "tags" parameter is handled:

"strict" - matches only blocks that have the exact set of tags of specified.

"exclude" - matches only blocks which are note tagged with any of the blocks specified.

"intersection" - matches any blocks which has all of the tags. 

"union" - matches all blocks which has any one of the tags. 

If not otherwise specified, tagsMode defaults to "intersection".

vlanINTEGER1023VLAN designated to a given block

*Additional or fewer "optional" parameters may be required in order to result in a successful assignment, depending on the attributes of available blocks.

Example URL/api/v1/api.php?target=ipam&action=smartAssign&mask=24&type=IPv4&resourceId=250&rir=ARIN

...

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

...

Process Holding Tank

URL

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

Description

Processes the Holding Tank, returning held blocks to available status

Returns

Examples:

SUCCESSFUL{"success":1,"message":"1 IPv4 and 0 IPv6 blocks would be moved to the available pool. ","data":[{"id":77712,"type":"ipv4","top_aggregate":77552,"cidr":"23.92.0.64\/26","formatted_ip":"23.92.0.64\/26","address":"391905344","end_address":"391905407","mask":26,"netmask":"255.255.255.192","child1":null,"child2":null,"is_assigned":0,"is_swipped":0,"is_aggregate":1,"custid":188,"resource_id":188,"resource_name":"6connect holding","last_updated_time":"2014-10-29 11:25:41","description":null,"parent":77682,"rir":"ARIN","lir_id":"451","notes":null,"generic_code":null,"code":null,"region":"PHX","region_name":"Phoenix, AZ","vlan":null,"arin_net_id":null,"arin_cust_id":null,"org_id":null,"arin_swip_time":null,"assigned_time":"2014-10-29 11:20:34","asn":null,"allowSubAssignments":false,"permissions":{"permissionIPAMRead":"1","permissionIPAMUpdate":"1","permissionIPAMCreate":"1","permissionIPAMDelete":"1","permissionSWIP":"1","permissionAdmin":"1"},"range":"23.92.0.64 - 23.92.0.127","tags":["Customer","DSL"]}]}
ERROR{'success':0, 'message':'error message'}
Required ParametersNone
Optional Parameters
NameTypeExampleDescription

preview

BOOLtrue

Acceptable values: "true" or "false"

If set to "true", returns a list of blocks that would be removed from the holding tank, but does not complete the process holding tank action.

If set to "false", processes the holding tank and returns a list of blocks returned to available status.

Example URL/api/v1/api.php?target=ipam&action=processHoldingTank&preview=true

...

Mask Report

URL/api/v1/api.php?target=ipam&action=maskReport
DescriptionReturns a JSON report breakdown of by-mask use statistics
Returns

Examples:

SUCCESSFUL{"success":1,"data":{"IPv4":{"total":576,"available":21,"assigned":555,"holding":0,"allocated":446,"prefixes":{"32":{"assigned_percentage":91.666666,"holding_percentage":0,"available_percentage":8.333333,"allocated_percentage":0,"total":12,"available":1,"assigned":11,"holding":0,"allocated":0},"31":{"assigned_percentage":100,"holding_percentage":0,"available_percentage":0,"allocated_percentage":30,"total":20,"available":0,"assigned":20,"holding":0,"allocated":6},"30":{"assigned_percentage":50,"holding_percentage":0,"available_percentage":50,"allocated_percentage":0,"total":8,"available":4,"assigned":4,"holding":0,"allocated":0},"29":{"assigned_percentage":100,"holding_percentage":0,"available_percentage":0,"allocated_percentage":20,"total":40,"available":0,"assigned":40,"holding":0,"allocated":8},"28":{"assigned_percentage":66.666666,"holding_percentage":0,"available_percentage":33.333333,"allocated_percentage":33.333333,"total":48,"available":16,"assigned":32,"holding":0,"allocated":16},"27":{"assigned_percentage":100,"holding_percentage":0,"available_percentage":0,"allocated_percentage":50,"total":64,"available":0,"assigned":64,"holding":0,"allocated":32},"26":{"assigned_percentage":100,"holding_percentage":0,"available_percentage":0,"allocated_percentage":100,"total":128,"available":0,"assigned":128,"holding":0,"allocated":128},"25":{"assigned_percentage":100,"holding_percentage":0,"available_percentage":0,"allocated_percentage":100,"total":256,"available":0,"assigned":256,"holding":0,"allocated":256}},"assigned_percentage":96.354166,"holding_percentage":0,"available_percentage":3.645833,"allocated_percentage":77.430555},"IPv6":{"total":16777216,"available":0,"assigned":16777216,"holding":0,"allocated":0,"prefixes":{"41":{"assigned_percentage":100,"holding_percentage":0,"available_percentage":0,"allocated_percentage":0,"total":16777216,"available":0,"assigned":16777216,"holding":0,"allocated":0}},"assigned_percentage":100,"holding_percentage":0,"available_percentage":0,"allocated_percentage":0}}}
ERROR { "success":0, "message":"error message" }


Required Parameters

None

Optional Parameters
NameTypeExampleDescription
resource_idINTEGER1234Integer value of a Resource ID. If provided, the system will display an IPAM Mask Usage report limited to blocks associated with a single resource.
tagsSTRING"Customer"Comma separated list of tags. If provided, limits the IPAM Mask Usage report to certain tags (standard tag mode).
regionsSTRING"DEN"Comma separated list of regions. If provided, limits the IPAM Mask Usage Report to blocks associated with the provided region(s).
Example URL/api/v1/api.php?target=ipam&action=maskReport&regions=DEN

...

Deassign

URL/api/v1/api.php?target=ipam&action=deassign
DescriptionPerforms a SWIP deassignment for the indicated IPAM block. 
Returns

Examples:

SUCCESSFUL{ "success":1,"message":"success message" }
ERROR { "success":0, "message":"error message" }


Required Parameters
NameTypeExampleDescription
blockIdINTEGER1234ID of the block to deassign
blockSTRING67.221.241.0/24the CIDR of the block being de-assigned
resourceIdINTEGER1234ID of resource representing the customer to deassign
lirIdINTEGER1234The ProVision id of the LIR which is performing the de-assignment
entityHandleSTRINGCONNE-81The Org ID for the LIR.
Optional Parameters
NameTypeExampleDescription
netNameSTRING6CONN-67-221-241-0-24Optional name for the network to override the default. The default net name will be created using the Net Name Prefix and IP address for the block.
Example URL/api/v1/api.php?target=ipam&action=deassign&resourceId=1234&blockId=1234&lirId=1234&entityHandle=CONNE-81&block=67.221.241.0/24&netName=6CONN-67-221-241-0-24

...

Simple Reassign

URL/api/v1/api.php?target=ipam&action=simpleReassign
DescriptionARIN SWIP - simple reassign. Creates an ARIN customer record for the assigned resource and reassigns the block to the ARIN customer record.
Returns

Examples:

SUCCESSFUL{ "success":1,"message":"Sent ARIN SWIP with action simpleReassign for 67.221.244.0/28 for Acme, Message: Success" }
ERROR { "success":0, "message":"error message" }


Required Parameters
NameTypeExampleDescription
blockIdINTEGER1234ID of the block to reassign
resourceIdINTEGER1234ID of resource representing the customer to reassign to
lirIdINTEGER1234The ProVision id of the LIR to use for reassignment
entityHandleSTRINGCONNE-81The Org ID for the LIR.
Optional Parameters
NameTypeExampleDescription
netNameSTRINGNET-ACME-67-221-244-0-28Optional name for the network to override the default. The default net name will be created using the Net Name Prefix and IP address for the block.
Example URL/api/v1/api.php?target=ipam&action=simpleReassign&resourceId=121&blockId=31559&lirId=95&entityHandle=CONNE-81&&netName=NET-ACME-67-221-244-0-28


IPAM API Calls Subject to Change:

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

...