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, mask size, etc.) and assigns it to a 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
maskINTEGER24The size of the block to be assigned
rirSTRINGARINAcceptable values: ARIN, RIPE, APNIC, AfriNIC, LACNIC, 1918
resourceId*INTEGER1234Integer 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 resourceId or resourceQuery can be used, but only one must be provided
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.

typeSTRING"IPv4" or "IPv6"The type of block to assign
Optional Parameters*
NameTypeExampleDescription
assignedResourceIdINTEGER123The ID of the resource the block is assigned to
codeSTRINGCode XArbitrary user-defined block code
lirIdINTEGER101The ID of an LIR resource
regionSTRINGAshburnRegion to assign from
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.

vlanINTEGER1023VLAN designated to a given block

*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=smartAssign&mask=24&type=IPv4&resourceIDresourceId=250&rir=ARIN

Direct Assign

URL/api/v1/api.php?target=ipam&action=directAssign
DescriptionAssigns a block to an Resource Holder
Returns

Examples:

 

SUCCESSFULSINGLE BLOCK{ "success":1,"message":"Assigned 192.168.0.0/24 to Resource (1234)", "id":12345, "data":{ "id":12345, "cidr":192.168.0.0/24", ...} }
SUCCESSFULMULTIPLE 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
NameTypeExampleDescription
block*STRING213.37.29.0/24CIDR block description
id*INTEGER125ID 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
cust-001

(Deprecated: Use resourceQuery instead)

A custom ID which can be used to link resources in the 6Connect database back to your organization.

resourceId**INTEGER1234Integer 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 resourceId, resourceQuery, or resourceHolderId can be used, but only one must be provided
Optional Parameters*
NameTypeExampleDescription
codeSTRINGCode XArbitrary user-defined block code
lirIdINTEGER101The ID of an LIR resource
regionSTRINGAshburnRegion to assign from
rirSTRINGARIN

Acceptable values: ARIN, RIPE, APNIC, AfriNIC, LACNIC, 1918

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.

vlanINTEGER1023VLAN designated to a given block

*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&resourceId=1234

...