Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Revised: Add, Update, Smart Assign, Direct Assign

...

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
codeSTRING User-defined block code as defined in Admin-IPAM settings: Generic Code Per Block Name
notesSTRING Notes or description for the block
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&rir=ARIN
Delete

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
idINTEGER125YesID of the IP block. Multiple block IDs can be specified in a comma-separated list.
blockSTRING192.0.0.0/24YesCIDR or the block. Multiple CIDRs can be specified in a comma-separated list.
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
codeSTRING Arbitrary user-defined block code
lirIdINTEGER The numeric ID of an LIR resource the block should be linked to
notesSTRINGWordsMisc. Notes
regionSTRINGChicago, ILThe region this IP block is assigned to.
rirSTRINGARINThe RIR
vlanNUMERIC123 
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

Delete

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

Examples

SUCCESSFUL{"success":
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.

...

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
maskINTEGER 24The size of the block to be assigned
lirIdINTEGER 101The ID of an LIR resource
rirSTRINGARINAcceptable values: ARIN, RIPE, APNIC, AfriNIC
resourceId*INTEGER 1234Integer 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 fromassignedToResourceINTEGER1234Used to Smart Assign out of a block which is already assigned to another resource and allows sub assignment
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
Region to assign from

Direct Assign

URL/api/v1/api.php?target=ipam&action=directAssign
DescriptionAssigns a block to an Resource Holder
Returns

Examples:

 

SUCCESSFULSINGLE BLOCK{ "success":1,"message":"Assigned 192.168.0.0/24 to Resource (1234)", "id":12345, "data":{ "id":12345, "cidr":192.168.0.0/24", ...} }
SUCCESSFULMULTIPLE BLOCKS{ "success":1,"message":"Assigned 5 blocks to Resource (1234) via Direct Assign", "data":{ "ids":[12345, 12346, 12347, ...] } }
ERROR  { "success":0, "message":"error message" }


Required Parameters
*Either block or id can be used, but only one must be provided
NameTypeExampleDescription
block*STRING213.37.29.0/24CIDR block description
id*INTEGER125ID of the IP block, comma separated list of ids, or json encoded array of ids
*Either block or id can be used, but only one must be provided
codeSTRING"code-1"

User-defined block code as defined in Admin-IPAM settings: Generic Code Per Block Name

lirId

INTEGER105

The numeric ID of an LIR resource the block should be linked to

regionSTRING"SFO"Region to assign from
resourceHolderId*STRING 6c-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.
resourceId*INTEGER 1234Integer ID of the resource to assign the block to
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.
Optional Parameters
NameTypeExampleDescription
codeSTRING"code-1"Arbitrary user-defined block code
regionSTRING"SFO"
rirSTRINGARIN

Acceptable values: ARIN, RIPE, APNIC, AfriNIC

tagsSTRING"Customer"Comma separated string of tags
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.

vlanINTEGER1023VLAN designated to a given block
Example URL/api/v1/api.php?target=ipam&action=directAssign&block=213.37.29.0/24&resourceHolderId=SJS-0031

...