]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blame - python/list_servers.py
Add wireguard profile
[perso/Immae/Projets/Puppet.git] / python / list_servers.py
CommitLineData
85abd2fd
IB
1try:
2 from ovh import ovh
3except ImportError:
4 # In case it's installed globally
5 import ovh
6
7client = ovh.Client()
8
69da835d
IB
9print("OVH cloud instances:")
10projects_list = client.get('/cloud/project/')
11for 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
18vps_list = client.get('/vps/')
19
69da835d 20print("OVH VPS SSD servers:")
85abd2fd 21for vps in vps_list:
69da835d
IB
22 print("\t{}".format(vps))
23