hcloud-python
hcloud-python copied to clipboard
Is there any way to link server_types with locations?
Bug Report
Current Behavior
We have an API wrapper, which create instance from the client.servers.create()
. And it takes:
-
location
(random selected fromclient.locations.get_all()
) and -
server_types
(fixed value and get fromclient.server_types.get_by_name(server_type_name)
)
We were using cx21
to test but then we noticed the API will throw error if cx21
isn unavailable in certain locations, like "Hillsboro US"
Input Code
instance = client.servers.create(
name="test-server"
server_type=client.server_types.get_by_name('cx21')
location=random.choice(client.locations.get_all())
)
Expected behavior/code
It works for some location like fsn1
because in this location, cx21
type exist. But for something in US, only cpx21
available.
I read through the doc i didn't see anywhere I can link (or get) the available server_types based on location.
Environment
Not Related
Possible Solution
add another function like client.sever_type.get_by_location()
?
Additional context/Screenshots N/A