Question

API indicates a size is available in a region, but the region itself is not listed as available

I’m new to the API, and I’m trying to understand the relationship between Regions and Sizes. I figured that they would have a concrete relationship: if the region is available, and has a certain size in the size array, then I expect to see that when I list the sizes, and search the regions array, it will map directly to the region data.

However, if I list the regions, it reports NYC1 and NYC3, but not NYC2. To me this indicates that NYC2 is not available for new droplets. However, if I list the available sizes, I see NYC1, NYC2, and NYC3 listed as available regions.

Is there a correct way to build a mapping starting with choosing a region, then for that reason list available sizes, and finally available images.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

jarland
DigitalOcean Employee
DigitalOcean Employee badge
March 27, 2019
Accepted Answer

Greetings!

The best way to tell what sizes are available for create is to use the /v2/regions part of the API. You can use /v2/sizes to draw the correlation on the slug for the details of a specific size that is available.

For example, as of the time of my comment the size s-16vcpu-64gb is not available in NYC2. Under /v2/sizes it does list nyc2 as an available region, but under /v2/regions it does not list the size as available under the nyc2 region.

I hope that makes sense :)

Jarland

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.