sharingio/pair

ServerSpec type usage availability and priority

Closed this issue · 2 comments

It would be useful to be able to provide a list of ServerSpec types and have the next type that is available in the given region be chosen

Links:

Related #84

These api endpoints maybe of use

curl -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN>" \
"https://api.equinix.com/metal/v1/capacity/metros" \
-d '{
    "servers": [
        {
            "metro": "<metro_code>",
            "plan": "<server_type>",
            "quantity": <integer>
        }
    ]
}'

A sample response from SJC1 facility

{
  "servers": [
    {
      "facility": "sjc1",
      "plan": "c3.medium.x86",
      "quantity": 5,
      "available": false
    }
  ]
}
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: &lt;API_TOKEN&gt;" \
"https://api.equinix.com/metal/v1/capacity" \
-d '{
    "servers": [
        {
            "facility": "<facility_code>",
            "plan": "<server_type>",
            "quantity": <number_of_servers>
        }
    ]
}'