Skip to content

Commit d7c9ff7

Browse files
authored
docs: update deprecated server types (#577)
The CX Gen 2 and CPX Gen 1 types are deprecated and will be removed from the API at the end of the year. This replaces all usages in our docs so users do not have to figure it out themselves. I kept the existing unit tests.
1 parent 56997a1 commit d7c9ff7

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ client = Client(token="{YOUR_API_TOKEN}") # Please paste your API token here
3939
# Create a server named my-server
4040
response = client.servers.create(
4141
name="my-server",
42-
server_type=ServerType(name="cx22"),
42+
server_type=ServerType(name="cx23"),
4343
image=Image(name="ubuntu-22.04"),
4444
)
4545
server = response.server

examples/create_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
response = client.servers.create(
1717
name="my-server",
18-
server_type=ServerType(name="cx22"),
18+
server_type=ServerType(name="cx23"),
1919
image=Image(name="ubuntu-24.04"),
2020
)
2121
server = response.server

examples/get_server_metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
if server is None:
1919
response = client.servers.create(
2020
name="my-server",
21-
server_type=ServerType(name="cx22"),
21+
server_type=ServerType(name="cx23"),
2222
image=Image(name="ubuntu-24.04"),
2323
)
2424
server = response.server

examples/usage_oop.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
# Create 2 servers
1818
# Create 2 servers
1919
response1 = client.servers.create(
20-
"Server1", server_type=ServerType(name="cx22"), image=Image(id=4711)
20+
"Server1", server_type=ServerType(name="cx23"), image=Image(id=4711)
2121
)
2222

2323
response2 = client.servers.create(
24-
"Server2", server_type=ServerType(name="cx22"), image=Image(id=4711)
24+
"Server2", server_type=ServerType(name="cx23"), image=Image(id=4711)
2525
)
2626
# Get all servers
2727
server1 = response1.server

examples/usage_procedurale.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717

1818
# Create 2 servers
1919
response1 = client.servers.create(
20-
name="Server1", server_type=ServerType(name="cx22"), image=Image(id=4711)
20+
name="Server1", server_type=ServerType(name="cx23"), image=Image(id=4711)
2121
)
2222

2323
response2 = client.servers.create(
24-
"Server2", server_type=ServerType(name="cx22"), image=Image(id=4711)
24+
"Server2", server_type=ServerType(name="cx23"), image=Image(id=4711)
2525
)
2626

2727
server1 = response1.server
@@ -64,7 +64,7 @@
6464
# Create one more server and attach 2 volumes to it
6565
client.servers.create(
6666
"Server3",
67-
server_type=ServerType(name="cx22"),
67+
server_type=ServerType(name="cx23"),
6868
image=Image(id=4711),
6969
volumes=[Volume(id=221), Volume(id=222)],
7070
)

0 commit comments

Comments
 (0)