You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 20
Next »
IP Address Management (IPv4 and IPv6)
Get |
---|
URL | /api/v1/api.php?target=ipam&action=get |
Description | Returns 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 | Name | Type | Example | Description |
---|
asn | INTEGER | 1000 | Filters blocks based on their ASN | allowSubAssignments | BOOL | true | Filters blocks based on wether they allow sub-assignments or not. Acceptable values: "true" or "false" | block | STRING | 213.37.29.0/24 | CIDR block description | code | STRING | | User-defined block code as defined in Admin-IPAM settings: Generic Code Per Block Name | id | INTEGER | 1234 | The ID of the block | isAggregate | BOOL | true | Indicates if the block has been split into children or not. A value of 'true' will return blocks with no children. | isAssigned | BOOL | true | Acceptable values: "true" or "false" | isSwipped | BOOL | true | Acceptable values: "true" or "false" | mask | INTEGER | 24 | Integer bitmask | region | STRING | SFO | The value from the list of name/value pairs which make up the list of available regions | resourceHolderId | STRING | 6c-1234 | 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 | | The ID of the resource the block is assigned 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. | rir | STRING | ARIN | Acceptable values: ARIN, RIPE, APNIC, AfriNIC | search | STRING | 192.168 | If a search term is provided, all IPAM fields including assigned Resource Holder name will be checked with a LIKE comparison to find matching blocks | selectCount | INTEGER | 50 | # of blocks to get | selectOffset | INTEGER | 25 | Offset for results set; useful for paging (e.g. selectCount = 50, selectOffset = 100 would return the 3rd page of 50 results) | sortField | STRING | cidr | Attribute to sort blocks by. Accepable values: cidr, mask, rir, vlan, code, updateTime | sortOrder | INTEGER | ASC | ASC or DESC | tags | STRING | customer,vpn | Comma-separated list of tags | topAggregateId | INTEGER | 1234 | The ID of the aggregate block to which the block belongs | vlan | INTEGER | 123 | VLAN for the block |
|
Example URL | /api/v1/api.php?target=ipam&action=get&rir=ARIN&tags=customer,vpn |
Add |
---|
URL | /api/v1/api.php?target=ipam&action=add |
Description | Adds an IPv4 or IPv6 block |
Returns | Examples: SUCCESSFUL: {'success':1, 'id':'12345'} ERROR: {'success':0, 'message':'unable to add block'}> |
Required Parameters | Name | Type | Example | Description |
---|
block | STRING | 213.37.29.0/24 | CIDR block description | rir | STRING | ARIN | Acceptable values: ARIN, RIPE, APNIC, AfriNIC |
|
Optional Parameters | Name | Type | Example | Description |
---|
allowSubAssignments | BOOL | true | Does 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" | asn | INTEGER | 1000 | ASN for the block | code | STRING | | User-defined block code as defined in Admin-IPAM settings: Generic Code Per Block Name | notes | STRING | | Notes or description for the block | region | STRING | SFO | The value from the list of name/value pairs which make up the list of available regions | tags | STRING | customer,vpn | Comma-separated list of tags | vlan | INTEGER | 123 | VLAN for the block |
|
Example URL | /api/v1/api.php?target=ipam&action=add&rir=ARIN |
Update |
---|
URL | /api/v1/api.php?target=ipam&action=update&type=IP&ipid=13420&rir=RIPE |
Description | Updates detail data about an IP block. |
Returns | Examples: SUCCESSFUL | {"success":1,"message":"Update Successful."} | ERROR | {'success':0, 'message':'error message'} |
|
Required Parameters | Name | Type | Example | Allow Multiple | Description |
---|
id | INTEGER | 125 | Yes | ID of the IP block. Multiple block IDs can be specified in a comma-separated list. | block | STRING | 192.0.0.0/24 | Yes | CIDR or the block. Multiple CIDRs can be specified in a comma-separated list. |
|
Optional Parameters | Name | Type | Example | Description |
---|
allowSubAssignments | BOOL | true | Does 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" | asn | INTEGER | 1000 | ASN for the block | code | STRING | | Arbitrary user-defined block code | lirId | INTEGER | | The numeric ID of an LIR resource the block should be linked to | notes | STRING | Words | Misc. Notes | region | STRING | Chicago, IL | The region this IP block is assigned to. | rir | STRING | ARIN | The RIR | vlan | NUMERIC | 50000 | |
|
Add Tag |
---|
URL | /api/v1/api.php?target=ipam&action=addTag&id=13420&tag=Infra |
Description | Adds a tag to an IP block. |
Returns | Examples: SUCCESSFUL | {"success":1,"message":"Tag Added."} | ERROR | {'success':0, 'message':'error message'} |
|
Required Parameters | Name | Type | Example | Description |
---|
id | INTEGER | 125 | ID of the block | tag | STRING | Customer | The tag to add |
|
Delete Tag |
---|
URL | /api/v1/api.php?target=ipam&action=deleteTag&id=13420&tag=Prod |
Description | Removes a tag from an IP block. |
Returns | Examples: SUCCESSFUL | {"success":1,"message":"Tag Removed."} | ERROR | {'success':0, 'message':'error message'} |
|
Required Parameters | Name | Type | Example | Description |
---|
id | INTEGER | 125 | ID of the block | tag | STRING | Customer | The tag to delete |
|
Smart Assign |
---|
URL | /api/v1/api.php?target=ipam&action=smartAssign |
Description | Selects a block based on supplied parameters (rir, tags, etc.) and assigns to an Resource Holder. |
Returns | Examples: SUCCESSFUL: {'success':1, 'id':'12345'} ERROR: {'success':0, 'message':'Unable to assign block'} |
Required Parameters | 24 Name | Type | Example | Description |
---|
code | STRING | Code X | Arbitrary user-defined block code | mask | INTEGER | | The size of the block to be assigned | rir | STRING | ARIN | Acceptable values: ARIN, RIPE, APNIC, AfriNIC | resourceId* | INTEGER | | Integer ID of the resource to assign the block to | resourceHolderId | STRING | 6c-1234 | 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. | 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. | type | STRING | "IPv4" or "IPv6" | The type of block to assign | *Either resourceHolderId or resourceId can be used, but only one must be provided |
|
Optional Parameters | Name | Type | Example | Description |
---|
tags | STRING | customer,vpn | Comma separated string of tags | region | STRING | Ashburn | Region to assign from | assignedToResource | INTEGER | 1234 | Used 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 |
Description | Assigns 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 | Name | Type | Example | Description |
---|
block* | STRING | 213.37.29.0/24 | CIDR block description | id* | INTEGER | 125 | ID 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 | 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 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 |
Unassign |
---|
URL | /api/v1/api.php?target=ipam&action=unassign |
Description | Reclaims the specified block to be reassigned in the future |
Returns | Examples: SUCCESSFUL: {'success':1, 'message':'213.37.29.0/24 unassigned', 'id':'12345'} ERROR: {'success':0, 'message':'213.37.29.0/24 was not found'} |
Required Parameters | Name | Type | Example | Description |
---|
block* | STRING | 213.37.29.0/24 | CIDR block description | id* | INTEGER | 125 | ID 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 |
|
---|
URL | /api/v1/api.php?target=ipam&action=getTagList |
Description | Returns a list of all valid IP Tags in the database. |
Returns | Examples: SUCCESSFUL | {"success":1,"message":"Tags Retrieved.","data":[{"value":"IT","name":"IT"},{"value":"LTE","name":"LTE Mobile"},{"value":"PTP","name":"Point to Point"},{"value":"Prod","name":"Production"},{"value":"VM","name":"Virtual Machines"},{"value":"VOIP","name":"VOIP"},{"value":"ANY","name":"ANY"}]} | ERROR | {'success':0, 'message':'error message'} |
|
Get RIRs List |
---|
URL | /api/v1/api.php?target=ipam&action=getRIRList |
Description | Returns a list of all valid RIRs in the database. |
Returns | Examples: SUCCESSFUL | {"success":1,"message":"RIRs Retrieved.","data":[{"value":"ARIN","name":"ARIN"},{"value":"1918","name":"1918"},{"value":"AfriNIC","name":"AfriNIC"},{"value":"APNIC","name":"APNIC"},{"value":"LACNIC","name":"LACNIC"},{"value":"RIPE","name":"RIPE"},{"value":"1918-SJC","name":"1918-SJC"}]} | ERROR | {'success':0, 'message':'error message'} |
|
Get Regions List |
---|
URL | /api/v1/api.php?target=ipam&action=getRegionList |
Description | Returns a list of all valid Regions in the database. |
Returns | Examples: SUCCESSFUL | {"success":1,"message":"Regions Retrieved.","data":[{"value":"ANY","name":"Any Region"},{"value":"ASH1","name":"Ashburn, VA"},{"value":"BOS","name":"Boston, MA"},{"value":"CHI","name":"Chicago, IL"},{"value":"DAL","name":"Dallas, TX"},{"value":"DEN","name":"Denver, CO"},{"value":"FRKT","name":"Frankfurt, DE"},{"value":"LON1","name":"London, UK"},{"value":"MIA","name":"Miami, FL"},{"value":"PAR","name":"Paris, FR"},{"value":"SFO","name":"San Francisco, CA"},{"value":"SEA","name":"Seattle, WA"},{"value":"Tokyo","name":"Tokyo"},{"value":"Singapore","name":"Singapore"},{"value":"Jakarta","name":"Jakarta"}]} | ERROR | {'success':0, 'message':'error message'} |
|
Get Utilization |
---|
URL | /api/v1/api.php?target=ipam&action=utilization |
Description | Gets the utilization percentages for a specific ip block or ip block and mask combination. |
Example URLs | https://ops.6connect.com/qa-4.1/api/v1/api.php?target=ipam&action=utilization&id=23131 |
Returns | Examples: SUCCESSFUL | { "success":1, "message":"", "totalHosts":"256", "hostsAssigned":"144", "hostsAvailable":"112", "availablePercentage":"43.7", "assignedPercentage":"56.2", "allocatedPercentage":"56.2" } | ERROR | {'success':0, 'message':'error message'} |
|
Required Parameters | Name | Type | Example | Description |
---|
id | int | 125 | ID of the IP block. |
|
Optional Parameters | Name | Type | Example | Description |
---|
mask | int | 24 | The specific mask size to retrieve utilization for. If using this parameter, the id parameter should be the id of the aggregate. |
|
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 | Name | Type | Example | Description |
---|
id | int | 125 | ID of the IP block. |
|
Optional Parameters | Name | Type | Example | Description |
---|
mask | int | 24 | Auto aggregate the block back to this mask size. Note all blocks up this mask size must be Available or call will fail. | block* | STRING | 213.37.29.0/24 | CIDR block. Only the block id OR the block CIDR can be specified. Not both. |
|
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 | Name | Type | Example | Description |
---|
id | int | 125 | ID of the IP block. |
|
Optional Parameters | Name | Type | Example | Description |
---|
mask | int | 24 | Auto aggregate the block back to this mask size. Note all blocks up this mask size must be Available or call will fail. | block* | STRING | 213.37.29.0/24 | CIDR block. Only the block id OR the block CIDR can be specified. Not both. | autoSplitLimit | int | 4 | A number the power of 2 (^2). |
|
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 | Name | Type | Example | Description |
---|
id | int | 125 | ID of the IP block. |
|
Optional Parameters | Name | Type | Example | Description |
---|
block* | STRING | 213.37.29.0/24 | CIDR 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 |
Get Scan Results |
---|
URL | /api/v1/api.php?target=ipam&action=getScanResults |
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,"data":{"block":"8.8.8.0\/27","date":"07\/14\/2014 11:07:10", "data":[{"address":"8.8.8.8","host":"google-public-dns-a.google.com","status":"Up"}],"status":"completed","hostsScanned":4,"activeHosts":4}} | ERROR | {'success':0, 'message':'error message'} |
|
Required Parameters | Name | Type | Example | Description |
---|
block* | STRING | 213.37.29.0/24 | CIDR block. Only the block id OR the block CIDR can be specified. Not both. |
|
Optional Parameters | None |
Example | /api/v1/api.php?target=ipam&action=getScanResults&block=8.8.8.0/27 |