Menu
August 17th, 2018

Improved Batch Deployments with Advanced Location Selection

To meet more advanced inventory demands you will now have an easier time specifying these when deploying on demand in bulk. Thanks to the new options, the API will also have more flexibility to fulfill the request which will result in less failed requests aka more seamless deploys.

Any location

If you pass e.g. “‘facility’: [‘any’]” or “‘facility’: ‘any’” , the API selects which facility/facilities to deploy in based on the most available capacity for the requested type. We then fill the requests across facilities by default. For instance, when deploying 10 servers, EWR1 could receive 7 and SJC1 could receive 3.

The immediate use case for this option is those who generally care only about finding available equipment regardless of the location.

Prioritized location selection

This option allows you to specify the order of priority of locations in which the API should deploy. In this example: “facility: ['sjc1', 'ewr1', 'any']”, we would prioritize fulfilling the request in sjc1, then ewr1, then any facility.

Option to diversify

In addition to prioritized location selection, you can also indicate how many facilities you are willing to be spread across. For this purpose, we have added a new parameter: facility_diversity_level = N.

Example:

“facility: ['sjc1', 'ewr1', 'any']”
“facility_diversity_level = 1”
“quantity = 10”

Would result in this behavior:

SJC1: 7 available
EWR1: 24 available
DFW1: 50 available
=> 10 deployed to EWR1

or 

"facility_diversity_level = 2" with "quantity = 25":
SJC1: 7 available
EWR1: 24 available
DFW1: 50 available
=> 7 deployed to SJC1, 18 deployed to EWR1

If this parameter is not specified, we don't enforce any limit and device provisioning could be spread across 1 or 2 or all facilities:

SJC1: 7 available
EWR1: 24 available
DFW1: 50 available
=> 25 deployed to DFW1

For individual device creation: 

curl \
-s \
-H "Content-Type: application/json" \
-d '
{
  "plan": "t1.small",
  "facility": ["iad1","any"],
  "operating_system": "ubuntu_18_04"
}' \
-H "X-Auth-Token: <token>" \
https://api.packet.net/projects/<project-id>/devices

For batch device creation:

curl \
-s \
-H "Content-Type: application/json" \
-d '
{
  "batches":
  [
    {
      "quantity": 1,
      "plan": "t1.small",
      "facility": ["iad1","any"],
      "operating_system": "ubuntu_18_04"
    }
  ]
}' \
-H "X-Auth-Token: <token>" \
https://api.packet.net/projects/<project-id>/devices/batch

Replace <token> and <project-id> with the appropriate API key and project ID values as necessary.

If you need more information regarding this feature, please see our updated help documentation. As always, feel free to reach out to help@packet.net if you have any questions.

Don't see what you need? Need a platform demo? Contact us so we can chat about options, and help you get the most out of our platform.