11 lines
399 B
Python
11 lines
399 B
Python
from hcloud import Client
|
|
client = Client(
|
|
token="KccUEiddxtzGoLWSNC3V8tylq7MYHCjdnShtgasQ8jSbHqCjGoaa6Rq7yoz4uS23"
|
|
)
|
|
PREFIX = "478815"
|
|
|
|
servers = client.servers.get_all()
|
|
for s in servers:
|
|
if s.data_model.name.startswith(PREFIX):
|
|
action = client.servers.delete(s)
|
|
print(f"Usuwanie serwera {s.data_model.name} ({s.data_model.public_net.ipv4.ip}): {action.data_model.status}") |