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,"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 | Name | Type | Example | Description |
---|
code | STRING | Code X | Arbitrary user-defined block code | mask | INTEGER | | The size of the block to be assigned | lirId | INTEGER | | The ID of an LIR resource | 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 |
|
Optional Parameters | Name | Type | Example | Description |
---|
tags | STRING | customer,vpn | Comma separated string of tags. Matches blocks which have at least the set of tag specified by this parameter | tagsMode | STRING | "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. | 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 | vlan | INTEGER | 1023 | VLAN 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 |