Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
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
codeSTRING User-defined block code as defined in Admin-IPAM settings: Generic Code Per Block Name
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"
maskINTEGER24Integer bitmask
regionSTRINGSFOThe value from the list of name/value pairs which make up the list of available regions
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.
resourceIdINTEGER The ID of the resource the block is assigned to
resourceQueryJSON
Code Block
{"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
topAggregateIdINTEGER1234The ID of the aggregate block to which the block belongs
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.
ReturnsExamples:
SUCCESSFUL: {'success':1, 'id':'12345'}
ERROR: {'success':0, 'message':'Unable to assign block'}
Required Parameters

24

NameTypeExampleDescription
codeSTRINGCode XArbitrary user-defined block code
maskINTEGER The size of the block to be assigned
rirSTRINGARINAcceptable values: ARIN, RIPE, APNIC, AfriNIC
resourceId*INTEGER Integer 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" typeSTRING"IPv4" or "IPv6"The type of block to assign
*Either resourceHolderId or resourceId can be used, but only one must be provided
Optional Parameters
NameTypeExampleDescription
tagsSTRINGcustomer,vpnComma separated string of tags
regionSTRINGAshburnRegion to assign from
assignedToResourceINTEGER1234Used to Smart Assign out of a block which is already assigned to another resource and allows sub assignment
Example URL/api/v1/api.php?target=ipam&action=smartAssign&mask=24&resourceHolderId=SJS-0031&rir=ARIN&tags=customer,vpn

Direct Assign

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

Examples:
SUCCESSFUL: {'success':1, 'message':'213.37.29.0/24 assigned to SJS-0031', 'id':'12345'}

SUCCESSFUL Multiple Assignments: {"success":1,"message":"Assigned 3 blocks to Worcester Telegram & Gazette","data":{"ids":[10001,10021 ,10031]}}

ERROR: {'success':0, 'message':'Unable to assign block'}

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*STRING The 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 Integer 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.
*Either resourceHolderId or resourceId can be used, but only one must be provided
Example URL/api/v1/api.php?target=ipam&action=directAssign&block=213.37.29.0/24&resourceHolderId=SJS-0031

...