DPZC_3/3_2/del.py

17 lines
347 B
Python
Raw Normal View History

2023-01-02 00:10:51 +01:00
from hcloud import Client
api_token = ""
with open("token.txt", "r") as file:
api_token = file.read().strip()
client = Client(
token=api_token
)
2023-01-03 09:28:06 +01:00
INDEKS = "s444455"
2023-01-02 00:10:51 +01:00
servers = client.servers.get_all()
2023-01-03 09:28:06 +01:00
for i in servers:
if i.data_model.name.startswith(INDEKS):
action = client.servers.delete(i)
print("Cleaning servers: done")