import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.servers.create(data={
"type": latitudesh_python_sdk.CreateServerServersType.SERVERS,
"attributes": {
"project": "proj_A05EdQ50dvKYQ",
"plan": latitudesh_python_sdk.CreateServerServersPlan.C2_SMALL_X86,
"site": latitudesh_python_sdk.CreateServerServersSite.ASH,
"operating_system": latitudesh_python_sdk.CreateServerServersOperatingSystem.UBUNTU_22_04_X64_LTS,
"hostname": "BRC1",
},
})
# Handle response
print(res){
"data": {
"type": "servers",
"id": "sv_KXgRdRyoOv9k5",
"attributes": {
"hostname": "BRC1",
"label": "868155NODEVO",
"role": "Bare Metal",
"status": "off",
"primary_ipv4": "29.227.250.123",
"primary_ipv6": "f5:1442:770b:d762:7b55:1583:8420:630b",
"specs": {
"cpu": "Xeon E-2186G CPU @ 3.80GHz (6 cores)",
"disk": "500 GB SSD",
"ram": "32 GB",
"nic": ""
},
"plan": {
"id": "plan_VE1Wd3aXDXnZJ",
"name": "c2.small.x86",
"slug": "c2-small-x86",
"billing": "hourly"
},
"interfaces": [
{
"role": "ipmi",
"name": "IPMI",
"mac_address": "00:11:22:33:44:55",
"description": "IPMI Interface"
},
{
"role": "internal",
"name": "PXE",
"mac_address": "66:77:88:99:aa:bb",
"description": "PXE Interface"
}
]
}
},
"meta": {}
}import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.servers.create(data={
"type": latitudesh_python_sdk.CreateServerServersType.SERVERS,
"attributes": {
"project": "proj_A05EdQ50dvKYQ",
"plan": latitudesh_python_sdk.CreateServerServersPlan.C2_SMALL_X86,
"site": latitudesh_python_sdk.CreateServerServersSite.ASH,
"operating_system": latitudesh_python_sdk.CreateServerServersOperatingSystem.UBUNTU_22_04_X64_LTS,
"hostname": "BRC1",
},
})
# Handle response
print(res){
"data": {
"type": "servers",
"id": "sv_KXgRdRyoOv9k5",
"attributes": {
"hostname": "BRC1",
"label": "868155NODEVO",
"role": "Bare Metal",
"status": "off",
"primary_ipv4": "29.227.250.123",
"primary_ipv6": "f5:1442:770b:d762:7b55:1583:8420:630b",
"specs": {
"cpu": "Xeon E-2186G CPU @ 3.80GHz (6 cores)",
"disk": "500 GB SSD",
"ram": "32 GB",
"nic": ""
},
"plan": {
"id": "plan_VE1Wd3aXDXnZJ",
"name": "c2.small.x86",
"slug": "c2-small-x86",
"billing": "hourly"
},
"interfaces": [
{
"role": "ipmi",
"name": "IPMI",
"mac_address": "00:11:22:33:44:55",
"description": "IPMI Interface"
},
{
"role": "internal",
"name": "PXE",
"mac_address": "66:77:88:99:aa:bb",
"description": "PXE Interface"
}
]
}
},
"meta": {}
}Show child attributes
servers Show child attributes
The project (ID or Slug) to deploy the server
The plan slug to choose server from, defining the specs the server will have
c2-large-x86, c2-medium-x86, c2-small-x86, c3-large-x86, c3-medium-x86, c3-small-x86, c3-xlarge-x86, g3-large-x86, g3-medium-x86, g3-small-x86, g3-xlarge-x86, m3-large-x86, s2-small-x86, s3-large-x86 The site slug to deploy the server
ASH, BGT, BUE, CHI, DAL, FRA, LAX, LON, MEX, MEX2, MIA, MIA2, NYC, SAN, SAO, SAO2, SYD, TYO, TYO2 The operating system slug for the new server
ipxe, windows_server_2019_std_v1, ubuntu_22_04_x64_lts, debian_11, debian_10, rhel8, windows_server_2012_r2_std_v28, windows_server_2012_r2_dc_v5, esxi_6_7, debian_9_4_x64, centos_7_4_x64, centos_8_x64, ubuntu_16_04_x64_lts, ubuntu_20_04_x64_lts, windows_server_2016_std_v1, windows_server_2016_dc_v1, windows_server_2019_dc_v1, debian_12, ubuntu22_ml_in_a_box, ubuntu_18_04_x64_lts, windows_server_2019_std_uefi, windows_2022_std_uefi, windows_2022_std, ubuntu_24_04_x64_lts, rockylinux_8 The server hostname
SSH Keys to set on the server
User data ID to set on the server. This is a custom script that will run after the deploy
RAID mode for the server
raid-0, raid-1 URL where iPXE script is stored on, OR the iPXE script encoded in base64. This attribute is required when iPXE is selected as operating system.
The server billing type. Accepts hourly and monthly for on demand projects and yearly for reserved projects.
hourly, monthly, yearly Created
Show child attributes
Show child attributes
The server label
on - The server is powered ON
off - The server is powered OFF
unknown - The server power status is unknown
ready - The server is in reinstalling state ready and should start disk_erasing shortly
disk_erasing - The server is in reinstalling state disk_erasing
failed_disk_erasing - The server has failed disk erasing in reinstall
deploying - The server is in the last reinstalling stage and is deploying
failed_deployment - The server has failed deployment in reinstall
on, off, unknown, ready, disk_erasing, failed_disk_erasing, deploying, failed_deployment Unavailable, Intermittent, Normal The server role (e.g. Bare Metal)
Show child attributes
The OS name
The OS slug
The OS description
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?