dpzc_3_2/remove.py

24 lines
516 B
Python
Raw Normal View History

2021-11-27 13:51:14 +01:00
from constants import *
from hcloud import Client
def main():
with open(API_KEY_FNAME) as f:
api_key = f.read()
client = Client(api_key)
ssh_key = client.ssh_keys.get_by_name(SSH_KEY_NAME)
vnet = client.networks.get_by_name(VNET_NAME)
db_server = client.servers.get_by_name(DB_SERVER_NAME)
gitea_server = client.servers.get_by_name(GITEA_SERVER_NAME)
ssh_key.delete()
vnet.delete()
db_server.delete()
gitea_server.delete()
if __name__ == "__main__":
main()