By jjk2sfu
when I create a droplet, it doesn’t return the ip_address.
I look at my dashboard and it seems that ip address becomes initially available early on during the progress.
On average how long does it take until ip address is returned by a droplet still being provisioned?
I also noticed that event_id is not available as well.
So my hope is that if I can get ip_address as soon as possible, I can immediately start creating dns records for it to point my subdomains to, instead of waiting until the whole provision is complete.
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!
The ip_address should be assigned quickly, but as you’ve noticed it is not instantaneous. The same goes for the event_id. Unfortunately, you just need to workaround this. Here’s some (pseudo) Python code: <br> <br><pre> <br> info = droplet.get_info() <br> loading = True <br> while loading: <br> info.load() <br> try: <br> ip_address = info[“ip_address”] <br> loading = False <br> except TypeError: # Not yet reporting an ip yet <br> pass <br> # Now do something <br></pre> <br> <br>This is similar to something I really use in a project. It generally will get the IP the second time through the loop, but you might want to add a small sleep in case you’re worried about the number of network requests.
thank you. I guess do the same thing to check for event_id, and get progress data as well?
Right. Again, it should be available quickly. It’s just not there if you hit the endpoint immediately after creation.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
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
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.