File tree Expand file tree Collapse file tree 6 files changed +30
-6
lines changed
Expand file tree Collapse file tree 6 files changed +30
-6
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,11 @@ from hcloud import Client
3434from hcloud.images import Image
3535from hcloud.server_types import ServerType
3636
37- client = Client(token = " {YOUR_API_TOKEN} " ) # Please paste your API token here
37+ client = Client(
38+ token = " {YOUR_API_TOKEN} " , # Please paste your API token here
39+ application_name = " my-app" ,
40+ application_version = " v1.0.0" ,
41+ )
3842
3943# Create a server named my-server
4044response = client.servers.create(
Original file line number Diff line number Diff line change 1111), "Please export your API token in the HCLOUD_TOKEN environment variable"
1212token = environ ["HCLOUD_TOKEN" ]
1313
14- client = Client (token = token )
14+ client = Client (
15+ token = token ,
16+ application_name = "examples" ,
17+ application_version = "unknown" ,
18+ )
1519
1620response = client .servers .create (
1721 name = "my-server" ,
Original file line number Diff line number Diff line change 1212), "Please export your API token in the HCLOUD_TOKEN environment variable"
1313token = environ ["HCLOUD_TOKEN" ]
1414
15- client = Client (token = token )
15+ client = Client (
16+ token = token ,
17+ application_name = "examples" ,
18+ application_version = "unknown" ,
19+ )
1620
1721server = client .servers .get_by_name ("my-server" )
1822if server is None :
Original file line number Diff line number Diff line change 99), "Please export your API token in the HCLOUD_TOKEN environment variable"
1010token = environ ["HCLOUD_TOKEN" ]
1111
12- client = Client (token = token )
12+ client = Client (
13+ token = token ,
14+ application_name = "examples" ,
15+ application_version = "unknown" ,
16+ )
1317servers = client .servers .get_all ()
1418print (servers )
Original file line number Diff line number Diff line change 1212token = environ ["HCLOUD_TOKEN" ]
1313
1414# Create a client
15- client = Client (token = token )
15+ client = Client (
16+ token = token ,
17+ application_name = "examples" ,
18+ application_version = "unknown" ,
19+ )
1620
1721# Create 2 servers
1822# Create 2 servers
Original file line number Diff line number Diff line change 1313), "Please export your API token in the HCLOUD_TOKEN environment variable"
1414token = environ ["HCLOUD_TOKEN" ]
1515
16- client = Client (token = token )
16+ client = Client (
17+ token = token ,
18+ application_name = "examples" ,
19+ application_version = "unknown" ,
20+ )
1721
1822# Create 2 servers
1923response1 = client .servers .create (
You can’t perform that action at this time.
0 commit comments