Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Checked / Update example URLS for Get-> Deletetag

...

Add

URL/api/v1/api.php?target=ipam&action=add
DescriptionAdds an IPv4 or IPv6 block
Returns

Examples:

SUCCESSFUL{"success":1,"message":"Block 192.168.0.0/24 (12345) added", "id":12345, "data":{ "id":12345, "cidr":192.168.0.0/24", ...} }
ERROR{ "success":0, "message":"error message" }


Required Parameters
NameTypeExampleDescription
blockSTRING213.37.29.0/24CIDR block description
rirSTRINGARINAcceptable values: ARIN, RIPE, APNIC, AfriNIC
Optional Parameters
NameTypeExampleDescription
allowDuplicateBOOLtrueAllow the creation of duplicate blocks. The default behavior is to reject duplicates.
allowSubAssignmentsBOOLtrueDoes the block allow sub-assignments? If the block is assigned and allowSubAssignments is "true", children split from this block will be able to be assigned to different resources.
Acceptable values: "true" or "false"
asnINTEGER1000ASN for the block
codeSTRINGCode XUser-defined block code as defined in Admin-IPAM settings: Generic Code Per Block Name
regionSTRINGSFOThe value from the list of name/value pairs which make up the list of available regions
tagsSTRINGcustomer,vpnComma-separated list of tags
vlanINTEGER123VLAN for the block
Example URL/api/v1/api.php?target=ipam&action=add&block=213.37.29.0/24&rir=ARIN

Update

URL/api/v1/api.php?target=ipam&action=update&type=IP&ipid=13420&rir=RIPE
DescriptionUpdates detail data about an IP block.
Returns

Examples:

SUCCESSFULSINGLE BLOCK{"success":1,"message":"Block 192.168.0.0/24 (12345) updated", "data":{ "id":12345, "cidr":192.168.0.0/24", ...} }
SUCCESSFULMULTIPLE BLOCKS{"success":1,"message":"3 blocks updated", "data":[ { "id":12345, "cidr":192.168.0.0/24", ...}, {"id":12346, "cidr", "192.168.0.1/32", ...} ] }
ERROR { "success":0, "message":"error message" }
  
Required Parameters
NameTypeExampleAllow MultipleDescription
id*INTEGER125YesID of the IP block. Multiple block IDs can be specified in a comma-separated list.
block*STRING192.0.0.0/24YesCIDR or the block. Multiple CIDRs can be specified in a comma-separated list.
*Either block or id can be used, but only one must be provided
Optional Parameters
NameTypeExampleDescription
allowSubAssignmentsBOOLtrueDoes the block allow sub-assignments? If the block is assigned and allowSubAssignments is "true", children split from this block will be able to be assigned to different resources.
Acceptable values: "true" or "false"
asnINTEGER1000ASN for the block
codeSTRINGCode XArbitrary user-defined block code
lirIdINTEGER101The numeric ID of an LIR resource the block should be linked to
notesSTRINGWordsMisc. Notes
regionSTRINGChicago, ILThe region this IP block is assigned to.
propagateBOOLtruePropagates all attribute values to any smaller child blocks of the block being updated. Available in version 5.1.0
rirSTRINGARINThe RIR
tagsSTRING

Customer, vpn

Comma-separated list of tags

tags_actionSTRINGreplaceWhat action to take on the supplied tags.  This action must be taken in conjunction with the tags parameter.  Valid settings for tags_action are:  replace, add, delete.  When tags_action is set to 'replace', all tags on an IP block are replaced with those
vlanNUMERIC123VLAN for the block
Example URL/api/v1/api.php?target=ipam&action=update&block=192.0.0.0/24&notes=Notes_here

Delete

URL/api/v1/api.php?target=ipam&action=delete&id=12345
DescriptionDeletes an aggregate block
Returns

Examples

SUCCESSFUL{"success":1,"message":"Aggregate deleted: 192.168.0.0/24", "data":{ "id":12345, "cidr":192.168.0.0/24", ...} }
ERROR{ "success":0, "message":"error message" }
Required Parameters
NameTypeExampleDescription
block*STRING213.37.29.0/24CIDR block description
id*INTEGER125ID of the IP block
*Either block or id can be used, but only one must be provided
Optional Parameters
NameTypeExampleDescription
forceBOOLtrueForces the aggregate block to be deleted even if the block is split or contains sub blocks which are assigned. The default behavior is to reject attempts to delete blocks which have been split or are assigned.

Add Tag

Example URL/api/v1/api.php?target=ipam&action=delete&block=213.37.29.0/24
deleteTag

Add Tag

URL/api/v1/api.php?target=ipam&action=addaddTag&id=13420&tag=Infra
DescriptionAdds a tag to an IP block.
Returns

Examples:

SUCCESSFUL{ "success":1,"message":"Tag Added.", "data":{ "id":12345, "cidr":192.168.0.0/24", ...} }
ERROR { "success":0, "message":"error message" }
Required Parameters
NameTypeExampleDescription
id*INTEGER125ID of the block
block*STRING192.0.0.0/24CIDR of the block
*Either block or id can be used, but only one must be provided
tagSTRINGCustomerThe tag to add

Delete Tag

Example URL/api/v1/api.php?target=ipam&action=addTag&id=125&tag=Customer

Delete Tag

URL/api/v1/api.php?target=ipam&action=deleteTag=13420&tag=Prod
DescriptionRemoves a tag from an IP block.
Returns

Examples:

SUCCESSFUL{ "success":1,"message":"Tag Removed.", "data":{ "id":12345, "cidr":192.168.0.0/24", ...} }
ERROR { "success":0, "message":"error message" }
Required Parameters
NameTypeExampleDescription
idINTEGER125ID of the block
blockSTRING192.0.0.0/24CIDR of the block
*Either block or id can be used, but only one must be provided
tagSTRINGCustomerThe tag to delete
Example URL/api/v1/api.php?target=ipam&action=deleteTag&id=125&tag=Customer

Smart Assign

URL/api/v1/api.php?target=ipam&action=smartAssign
DescriptionSelects a block based on supplied parameters (rir, tags, etc.) and assigns to an 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
codeSTRINGCode XArbitrary user-defined block code
maskINTEGER24The size of the block to be assigned
lirIdINTEGER101The ID of an LIR resource
rirSTRINGARINAcceptable values: ARIN, RIPE, APNIC, AfriNIC
resourceId*INTEGER1234Integer ID of the resource to assign the block to
resourceHolderIdSTRING6c-1234The 20 character resource holder ID. This is an internal short identifier for the customer, and should be used to link resource holder details in the 6Connect database back to your organization. Consider using internal customer numbers or department numbers for this field depending on your use case. Example: Customer-001 or 000213.
resourceQueryJSON

 

{"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.
typeSTRING"IPv4" or "IPv6"The type of block to assign
Optional Parameters
NameTypeExampleDescription
assignedResourceIdINTEGER123The ID of the resource the block is assigned to
tagsSTRINGcustomer,vpnComma separated string of tags. Matches blocks which have at least the set of tag specified by this parameter
tagsModeSTRING"strict" or "exclude"

"strict" - matches ONLY blocks that have the EXACT set of tags of specified.

"exclude" - matches ONLY blocks which are NOT tagged with any of the blocks specified.

regionSTRINGAshburnRegion to assign from
vlanINTEGER1023VLAN designated to a given block
Example URL/api/v1/api.php?target=ipam&action=smartAssign&mask=24&resourceHolderId=SJS-0031&rir=ARIN&tags=customer,vpn

...

Get Utilization

URL/api/v1/api.php?target=ipam&action=utilization
DescriptionGets the utilization percentages for a specific ip block or ip block and mask combination.
Example URLs/api/v1/api.php?target=ipam&action=utilization&id=23131
Returns

Examples:

SUCCESSFUL
{

"success": 1,

"totalBlocks": 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"

}],

 

"blocksAssigned":0,

"blocksAllocated": 1,

"blocksAvailable": "1",

"blocksInHolding": null,

"blocksAssignedPercentage": "0.00",

"blocksAllocatedPercentage": "100.00",

"blocksAvailablePercentage": "100.00",

"blocksInHoldingPercentage": "0.00"

}
ERROR{'success':0, 'message':'error message'}
Required Parameters
NameTypeExampleDescription
block*STRING213.37.29.0/24CIDR block description
id*INTEGER125ID of the IP block
*Either block or id can be used, but only one must be provided
Optional Parameters
NameTypeExampleDescription
maskINTEGER24The specific mask size to retrieve utilization for. If using this parameter, the id parameter should be the id of the aggregate.
Example URL 

Get Host Utilization

URL/api/v1/api.php?target=ipam&action=getHostUtilization
DescriptionGets the host utilization statistics with support for filters.
Example URLs/api/v1/api.php?target=ipam&action=getHostUtilization&tags=["Customer","PTP"]&region=SMF
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
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"]

Aggregate

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

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.0.128\/25 aggregated into 10.2.0.0\/24","id":16326}
                  
ERROR{'success':0, 'message':'error message'}
Required Parameters
NameTypeExampleDescription
idINTEGER125ID of the IP block.
Optional Parameters
NameTypeExampleDescription
autoAggregateToMaskINTEGER24

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

block*STRING213.37.29.0/24CIDR block. Only the block id OR the block CIDR can be specified. Not both.

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 

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
idINTEGER125ID of the IP block.
Optional Parameters
NameTypeExampleDescription
block*STRING213.37.29.0/24CIDR block. Only the block id OR the block CIDR can be specified. Not both.
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 

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

Returns

Examples:

SUCCESSFUL
{"success":1,"message":"Ping scan started for 8.8.8.0\/27"}
ERROR{'success':0, 'message':'error message'}
Required Parameters
NameTypeExampleDescription
idINTEGER125ID of the IP block.
Optional Parameters
NameTypeExampleDescription
block*STRING213.37.29.0/24CIDR block. Only the block id OR the block CIDR can be specified. Not both.
Example/api/v1/api.php?target=ipam&action=scanBlock&block=8.8.8.0/27

...