]>
Commit | Line | Data |
---|---|---|
85abd2fd IB |
1 | try: |
2 | from ovh import ovh | |
3 | except ImportError: | |
4 | # In case it's installed globally | |
5 | import ovh | |
6 | ||
7 | client = ovh.Client() | |
8 | ||
69da835d IB |
9 | print("OVH cloud instances:") |
10 | projects_list = client.get('/cloud/project/') | |
11 | for project_id in projects_list: | |
12 | project = client.get('/cloud/project/{}'.format(project_id)) | |
13 | print("\t{}:".format(project["description"])) | |
14 | instances_list = client.get('/cloud/project/{}/instance'.format(project_id)) | |
15 | for instance in instances_list: | |
16 | print("\t\t{}: {}".format(instance["name"], instance["id"])) | |
17 | ||
85abd2fd IB |
18 | vps_list = client.get('/vps/') |
19 | ||
69da835d | 20 | print("OVH VPS SSD servers:") |
85abd2fd | 21 | for vps in vps_list: |
69da835d IB |
22 | print("\t{}".format(vps)) |
23 |