Versions Compared

Key

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

...

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.
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
NameTypeExampleDescription
codeSTRINGCode XArbitrary user-defined block code
maskINTEGER The size of the block to be assigned
lirIdINTEGER The ID of an LIR resource
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" or "IPv6"The type of block to assign
Optional Parameters
NameTypeExampleDescription
tagsSTRINGcustomer,vpnComma separated string of tags. Matches blocks which have at least the set of tag specified by this parameter
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.

regionSTRINGAshburnRegion to assign from
assignedToResourceINTEGER1234Used to Smart Assign out of a block which is already assigned to another resource and allows sub assignment
vlanINTEGER1023VLAN 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

...