import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.virtual_machines.create(data={
"type": latitudesh_python_sdk.VirtualMachinePayloadType.VIRTUAL_MACHINES,
"attributes": {
"name": "my-new-vm",
"project": "aerodynamic-granite-keyboard",
},
})
# Handle response
print(res)
{
"data": {
"id": "vm_mw49QDB5qagKb",
"type": "virtual_machines",
"attributes": {
"name": "my-new-vm",
"status": "Starting",
"created_at": "2025-07-16T18:37:13+00:00",
"operating_system": null,
"billing": "monthly",
"plan": {
"id": "plan_KN4ydzxvDVob3",
"name": "g3.l40s.medium-119"
},
"specs": {
"vcpu": 16,
"ram": "128 GB",
"storage": "100 GB",
"nic": "1 x 1 Gbps",
"gpu": "1 x NVIDIA H100 Tensor Core GPU"
},
"team": {
"id": "team_R38obnyYLkuAjexYE7ZEHMw2vB1",
"name": "627 Team",
"slug": "627-team",
"description": "627 Team",
"address": "64807 Hudson Curve, Port Anjanette, NH 53335",
"status": "verified",
"currency": {
"id": "cur_AW6Q2D9lqKLpr",
"code": "BRL",
"name": "Brazilian Real",
"currency_id": null
}
},
"project": {
"id": "proj_Qkm7dXMVq8nZV",
"name": "Enormous Wool Keyboard",
"slug": "enormous-wool-keyboard",
"description": "Durable Rubber Bench",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {
"subscription_id": null,
"type": "Normal",
"method": "Normal"
},
"stats": {
"databases": 0,
"ip_addresses": 0,
"prefixes": 0,
"servers": 0,
"storages": 0,
"virtual_machines": 1,
"vlans": 0
}
}
}
}
}
Creates a new Virtual Machine.
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.virtual_machines.create(data={
"type": latitudesh_python_sdk.VirtualMachinePayloadType.VIRTUAL_MACHINES,
"attributes": {
"name": "my-new-vm",
"project": "aerodynamic-granite-keyboard",
},
})
# Handle response
print(res)
{
"data": {
"id": "vm_mw49QDB5qagKb",
"type": "virtual_machines",
"attributes": {
"name": "my-new-vm",
"status": "Starting",
"created_at": "2025-07-16T18:37:13+00:00",
"operating_system": null,
"billing": "monthly",
"plan": {
"id": "plan_KN4ydzxvDVob3",
"name": "g3.l40s.medium-119"
},
"specs": {
"vcpu": 16,
"ram": "128 GB",
"storage": "100 GB",
"nic": "1 x 1 Gbps",
"gpu": "1 x NVIDIA H100 Tensor Core GPU"
},
"team": {
"id": "team_R38obnyYLkuAjexYE7ZEHMw2vB1",
"name": "627 Team",
"slug": "627-team",
"description": "627 Team",
"address": "64807 Hudson Curve, Port Anjanette, NH 53335",
"status": "verified",
"currency": {
"id": "cur_AW6Q2D9lqKLpr",
"code": "BRL",
"name": "Brazilian Real",
"currency_id": null
}
},
"project": {
"id": "proj_Qkm7dXMVq8nZV",
"name": "Enormous Wool Keyboard",
"slug": "enormous-wool-keyboard",
"description": "Durable Rubber Bench",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {
"subscription_id": null,
"type": "Normal",
"method": "Normal"
},
"stats": {
"databases": 0,
"ip_addresses": 0,
"prefixes": 0,
"servers": 0,
"storages": 0,
"virtual_machines": 1,
"vlans": 0
}
}
}
}
}
Show child attributes
Was this page helpful?