Direct Assign |
---|
URL | /api/v1/api.php?target=ipam&action=directAssign |
Description | Assigns a block to an Resource Holder |
Returns | Examples: SUCCESSFUL | SINGLE BLOCK | { "success":1,"message":"Assigned 192.168.0.0/24 to Resource (1234)", "id":12345, "data":{ "id":12345, "cidr":192.168.0.0/24", ...} } | SUCCESSFUL | MULTIPLE 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 | 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 | code | STRING | "code-1" | User-defined block code as defined in Admin-IPAM settings: Generic Code Per Block Name | lirId | INTEGER | 105 | The numeric ID of an LIR resource the block should be linked to | region | STRING | "SFO" | Region to assign from | 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 | 1234 | 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.. 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* | Name | Type | Example | Description |
---|
assignedResourceId | INTEGER | 123 | The ID of the resource the block is assigned to | code | STRING | Code X | Arbitrary user-defined block code | lirId | INTEGER | 101 | The ID of an LIR resource | region | STRING | Ashburn | Region to assign from | rir | STRING | ARIN | Acceptable values: ARIN, RIPE, APNIC, AfriNIC | tags | STRING |
| "Customer"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. | vlan | INTEGER | 1023 | VLAN designated to a given block |
| Optional Parameters | None *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&resourceHolderId=SJS-0031 |