civo / client-python

Python package to interact with Civo's API
https://www.civo.com/
MIT License
10 stars 9 forks source link

Add Region Support with region flag #31

Closed martynbristow closed 3 years ago

martynbristow commented 3 years ago

Usage: civo(TOKEN, region='SVG1')

alejandrojnm commented 3 years ago

I haven't programmed in python for a while haha, I think it's great that I have done this update 👍 , but I think it would be better if we do it in the style of the Go library, that it is possible to pass the region to any of the classes, like:

# this is a global declaration
civo = Civo('token', region='NYC1')

# this is a service declaration
civo.kubernetes.create(name='my_cluster', num_nodes=2, region='SVG1')

in both case region is optional

martynbristow commented 3 years ago

Yeah I can update it to that, was keen to get something moving

martynbristow commented 3 years ago

Need to complete some tests and verify I've covered everything. Kubernetes is working ok

alejandrojnm commented 3 years ago

Look good to me. Also you add the test unit, the first time I didn't have time to do it