Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: add deprecation notice to resourceHolderId

...

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'}
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
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"
lirIdINTEGER101The numeric ID of an LIR resource the block should be linked to
maskINTEGER24Integer bitmask
regionSTRINGSFOThe value from the list of name/value pairs which make up the list of available regions
resourceHolderIdSTRING6c-1234
cust-001

(Deprecated: Use resourceQuery instead)

A custom ID which can

The 20 character resource holder ID. This is an internal short identifier for the customer, and should

be used to link

resource holder details

resources 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.

resourceIdINTEGER1234The ID of the resource the block is assigned 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.
rirSTRINGARINAcceptable values: ARIN, RIPE, APNIC, AfriNIC
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
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.
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, 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
maskINTEGER24The size of the block to be assigned
rirSTRINGARINAcceptable values: ARIN, RIPE, APNIC, AfriNIC
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
resourceHolderIdSTRING6c-1234
cust-001

(Deprecated: Use resourceQuery instead)

A custom ID which can

The 20 character resource holder ID. This is an internal short identifier for the customer, and should

be used to link

resource holder details

resources 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.

typeSTRING"IPv4" or "IPv6"The type of block to assign
Optional Parameters*
NameTypeExampleDescription
assignedResourceIdINTEGER123The ID of the resource the block is assigned to
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" 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

*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&resourceHolderId=6con-003&resourceID=250&rir=ARIN

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
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
resourceHolderId**STRING6c-1234
cust-001

(Deprecated: Use resourceQuery instead)

A custom ID which can

The 20 character resource holder ID. This is an internal short identifier for the customer, and should

be used to link

resource holder details

resources 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**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, resourceQuery, or resourceHolderId can be used, but only one must be provided
Optional Parameters*
NameTypeExampleDescription
assignedResourceIdINTEGER123The ID of the resource the block is assigned to
codeSTRINGCode XArbitrary user-defined block code
lirIdINTEGER101The ID of an LIR resource
regionSTRINGAshburnRegion to assign from
rirSTRINGARIN

Acceptable values: ARIN, RIPE, APNIC, AfriNIC

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.

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=directAssign&block=213.37.29.0/24&resourceHolderIdresourceId=SJS-00311234

Unassign

URL/api/v1/api.php?target=ipam&action=unassign
DescriptionReclaims the specified block to be reassigned in the future
Returns

Examples:

SUCCESSFUL{ "success":1,"message":"192.168.0.0/24 unassigned", "id":12345,  "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
Example URL/api/v1/api.php?target=ipam&action=unassign&block=213.37.29.0/24

...