Skip to main content
POST
/
servers
Python (SDK)
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_W6Q2D93GdKLpr",
            "plan": latitudesh_python_sdk.CreateServerServersPlan.C2_SMALL_X86,
            "site": latitudesh_python_sdk.CreateServerServersSite.SAO,
            "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": {}
}

Authorizations

Authorization
string
header
required

Body

data
object

Response

201 - application/vnd.api+json

Created

data
object
meta
object
I