Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from this space and version 5.3.0

...

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

...