]>
git.immae.eu Git - perso/Immae/Projets/Puppet.git/blob - python/list_servers.py
4 # In case it's installed globally
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"]))
18 vps_list
= client
.get('/vps/')
20 print("OVH VPS SSD servers:")
22 print("\t{}".format(vps
))