This commit is contained in:
Aleksandra Jonas 2023-01-29 23:54:19 +01:00
parent c135d8256b
commit 391cfb7d8c
3 changed files with 678 additions and 3 deletions

11
README.md Normal file
View File

@ -0,0 +1,11 @@
# Public cloud 4.1/4.3 HETZNER
Please, create remember to include the Hetzner token in the `main.py` file's code.
## Run
Go to the project directory and run the following in terminal:
```bash
python3 main.py
```

664
checkin.ipynb Normal file

File diff suppressed because one or more lines are too long

View File

@ -27,7 +27,7 @@ with open("token.txt", "r") as file:
hetzner_token = file.read().strip() hetzner_token = file.read().strip()
client = Client(token=hetzner_token) client = Client(token=hetzner_token)
"""
vnet = client.networks.create( vnet = client.networks.create(
name=vnet_name, name=vnet_name,
ip_range='10.10.10.0/24', ip_range='10.10.10.0/24',
@ -37,8 +37,8 @@ vnet = client.networks.create(
type='cloud') type='cloud')
] ]
) )
"""
vnet = client.networks.get_by_name(vnet_name) # vnet = client.networks.get_by_name(vnet_name)
print("Vnet: done") print("Vnet: done")
#ssh_key = client.ssh_keys.create(name=ssh_name, public_key=ssh_key_text) #ssh_key = client.ssh_keys.create(name=ssh_name, public_key=ssh_key_text)