22 lines
418 B
Python
Executable File
22 lines
418 B
Python
Executable File
#!/usr/bin/env python3
|
|
from hcloud import Client, APIException
|
|
import argparse
|
|
|
|
# Get Servername
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("apiKey")
|
|
|
|
args = parser.parse_args()
|
|
|
|
apiKey = args.apiKey
|
|
|
|
try:
|
|
client = Client(token=apiKey)
|
|
ssh_keys = client.ssh_keys.get_all()
|
|
|
|
for ssh_key in ssh_keys:
|
|
print("Key Name:", ssh_key.name)
|
|
|
|
except APIException as e:
|
|
print("API Error ", e)
|