lsymds / hetznercloud-py

Python SDK for the new Hetzner cloud
MIT License
30 stars 12 forks source link

Support server locations. #12

Closed nh2 closed 6 years ago

nh2 commented 6 years ago

See https://docs.hetzner.cloud/#resources-servers-post:

If you want to create the server in a location, you must set location to the ID or name as listed in /locations. This is the recommended way. You can be even more specific by setting datacenter to the ID or name as listed in /datacenters. However directly specifying the datacenter is discouraged since supply availability in datacenters varies greatly and datacenters may be out of stock for extended periods of time or not serve certain server types at all.

ghost commented 6 years ago

Is there any need when you can specify the datacenter?

ghost commented 6 years ago

I'm happy to merge this in assuming the locationparameter is moved to the end of the parameter list (this will stop any breaking changes from occurring if someone is specifying ALL of the parameters in the default order).

Thanks!

nh2 commented 6 years ago

Is there any need when you can specify the datacenter?

@elsyms Yes, giving the location allows Hetzner to pick the datacenter within that location, e.g. for faster deployment and for a higher chance that the chosen server type is available.

I'm happy to merge this in assuming the locationparameter is moved to the end of the parameter list (this will stop any breaking changes from occurring if someone is specifying ALL of the parameters in the default order).

Done, #16.