Zum Inhalt springen
Odinex Cloud
API-Referenz

Server

Diese Referenz wird aus der OpenAPI-Spezifikation erzeugt; die Beschreibungen der Endpunkte und Felder sind auf Englisch.

List servers

GET
/servers

Autorisierung

headerAutorisierungBearer <token>

Query-Parameter

page?integer
Bereich1 <= value
Standard1
per_page?integer
Bereich1 <= value <= 50
Standard25
label_selector?string

Filter by labels: env=prod, env!=prod, env (has key), !env; comma = AND

name?string
status?string
Wert in"initializing""starting""running""stopping""off""deleting""rebuilding""migrating""unknown"

Response-Body

Servers

application/json
  1. response
servers*array<>
meta*
curl -X GET "https://example.com/servers"
{  "servers": [    {      "id": 0,      "name": "string",      "status": "initializing",      "created": "2019-08-24T14:15:22Z",      "public_net": {        "ipv4": {          "id": 0,          "ip": "string",          "blocked": true,          "dns_ptr": "string"        },        "ipv6": {          "id": 0,          "ip": "string",          "blocked": true,          "dns_ptr": "string"        },        "elastic_ip": {          "id": 0,          "ip": "string"        }      },      "primary_network": 0,      "server_type": {        "id": 0,        "name": "t1",        "description": "Test 1",        "cpu_type": "shared",        "cores": 1,        "memory": 2,        "disk": 40,        "included_traffic": 0,        "deprecated": true,        "prices": [          {            "location": "fra1",            "price_hourly": {              "net": "0.0064000000",              "gross": "0.0064000000",              "currency": "EUR"            },            "price_monthly": {              "net": "0.0064000000",              "gross": "0.0064000000",              "currency": "EUR"            }          }        ]      },      "location": {        "id": 1,        "name": "fra1",        "description": "Frankfurt 1",        "country": "DE",        "city": "Frankfurt",        "network_zone": "eu-central",        "status": "active"      },      "image": {        "id": 0,        "type": "system",        "name": "string",        "description": "string",        "os_flavor": "ubuntu",        "os_version": "string",        "architecture": "x86",        "disk_size": 0,        "image_size": 0,        "status": "creating",        "deprecated": "2019-08-24T14:15:22Z",        "created_from": 0,        "protection": {          "delete": true        },        "locations": [          "string"        ],        "labels": {          "property1": "string",          "property2": "string"        },        "created": "2019-08-24T14:15:22Z"      },      "primary_disk_size": 0,      "private_net": [        {          "network": 0,          "ip": "string"        }      ],      "volumes": [        0      ],      "floating_ips": [        0      ],      "placement_group": 0,      "backup_window": "22-02",      "rescue_enabled": true,      "locked": true,      "network_blocked": true,      "protection": {        "delete": true      },      "labels": {        "property1": "string",        "property2": "string"      }    }  ],  "meta": {    "pagination": {      "page": 0,      "per_page": 0,      "previous_page": 0,      "next_page": 0,      "last_page": 0,      "total_entries": 0    }  }}

Create server

POST
/servers

Autorisierung

headerAutorisierungBearer <token>

Request-Body

application/json
  1. body
name*string

Hostname-safe: letters, digits, dots and dashes

Länge1 <= length <= 63
server_type*string

Server type name (e.g. t1) or ID

image*string

Image name (e.g. ubuntu-24.04) or ID

location*string

Region name, e.g. fra1

ssh_keys?array<string>

SSH key names or IDs

user_data?string

cloud-init user data

Längelength <= 32768
labels?

Up to 64 key/value pairs; keys and values up to 63 characters

start_after_create?boolean
Standardtrue
backups?boolean

Enable daily backups (+20 % of the server price), billed from when the server exists

Standardfalse
placement_group?string

Placement group name or ID

networks?array<string>

Private networks (names or IDs) to attach

firewalls?array<string>

Firewalls (names or IDs) applied to the server from the start

Elementeitems <= 5
public_net?

Set both to false for a server without public IPs (VPC): it must list at least one network, and the first one becomes its primary network. It reaches the internet through that network's NAT gateway and can be reached from outside through an Elastic IP or a load balancer.

Response-Body

Server is being created

application/json
  1. response
server*
action*
root_password?|

Set only when no SSH key was given. Shown once.

curl -X POST "https://example.com/servers" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "server_type": "string",    "image": "string",    "location": "string"  }'
{  "server": {    "id": 0,    "name": "string",    "status": "initializing",    "created": "2019-08-24T14:15:22Z",    "public_net": {      "ipv4": {        "id": 0,        "ip": "string",        "blocked": true,        "dns_ptr": "string"      },      "ipv6": {        "id": 0,        "ip": "string",        "blocked": true,        "dns_ptr": "string"      },      "elastic_ip": {        "id": 0,        "ip": "string"      }    },    "primary_network": 0,    "server_type": {      "id": 0,      "name": "t1",      "description": "Test 1",      "cpu_type": "shared",      "cores": 1,      "memory": 2,      "disk": 40,      "included_traffic": 0,      "deprecated": true,      "prices": [        {          "location": "fra1",          "price_hourly": {            "net": "0.0064000000",            "gross": "0.0064000000",            "currency": "EUR"          },          "price_monthly": {            "net": "0.0064000000",            "gross": "0.0064000000",            "currency": "EUR"          }        }      ]    },    "location": {      "id": 1,      "name": "fra1",      "description": "Frankfurt 1",      "country": "DE",      "city": "Frankfurt",      "network_zone": "eu-central",      "status": "active"    },    "image": {      "id": 0,      "type": "system",      "name": "string",      "description": "string",      "os_flavor": "ubuntu",      "os_version": "string",      "architecture": "x86",      "disk_size": 0,      "image_size": 0,      "status": "creating",      "deprecated": "2019-08-24T14:15:22Z",      "created_from": 0,      "protection": {        "delete": true      },      "locations": [        "string"      ],      "labels": {        "property1": "string",        "property2": "string"      },      "created": "2019-08-24T14:15:22Z"    },    "primary_disk_size": 0,    "private_net": [      {        "network": 0,        "ip": "string"      }    ],    "volumes": [      0    ],    "floating_ips": [      0    ],    "placement_group": 0,    "backup_window": "22-02",    "rescue_enabled": true,    "locked": true,    "network_blocked": true,    "protection": {      "delete": true    },    "labels": {      "property1": "string",      "property2": "string"    }  },  "action": {    "id": 0,    "command": "create_server",    "status": "running",    "progress": 0,    "started": "2019-08-24T14:15:22Z",    "finished": "2019-08-24T14:15:22Z",    "resources": [      {        "id": 0,        "type": "server"      }    ],    "error": {      "code": "string",      "message": "string"    }  },  "root_password": "string"}

Get server

GET
/servers/{id}

Autorisierung

headerAutorisierungBearer <token>

Pfadparameter

id*integer
Formatint64

Response-Body

Server

application/json
  1. response
server*
curl -X GET "https://example.com/servers/0"
{  "server": {    "id": 0,    "name": "string",    "status": "initializing",    "created": "2019-08-24T14:15:22Z",    "public_net": {      "ipv4": {        "id": 0,        "ip": "string",        "blocked": true,        "dns_ptr": "string"      },      "ipv6": {        "id": 0,        "ip": "string",        "blocked": true,        "dns_ptr": "string"      },      "elastic_ip": {        "id": 0,        "ip": "string"      }    },    "primary_network": 0,    "server_type": {      "id": 0,      "name": "t1",      "description": "Test 1",      "cpu_type": "shared",      "cores": 1,      "memory": 2,      "disk": 40,      "included_traffic": 0,      "deprecated": true,      "prices": [        {          "location": "fra1",          "price_hourly": {            "net": "0.0064000000",            "gross": "0.0064000000",            "currency": "EUR"          },          "price_monthly": {            "net": "0.0064000000",            "gross": "0.0064000000",            "currency": "EUR"          }        }      ]    },    "location": {      "id": 1,      "name": "fra1",      "description": "Frankfurt 1",      "country": "DE",      "city": "Frankfurt",      "network_zone": "eu-central",      "status": "active"    },    "image": {      "id": 0,      "type": "system",      "name": "string",      "description": "string",      "os_flavor": "ubuntu",      "os_version": "string",      "architecture": "x86",      "disk_size": 0,      "image_size": 0,      "status": "creating",      "deprecated": "2019-08-24T14:15:22Z",      "created_from": 0,      "protection": {        "delete": true      },      "locations": [        "string"      ],      "labels": {        "property1": "string",        "property2": "string"      },      "created": "2019-08-24T14:15:22Z"    },    "primary_disk_size": 0,    "private_net": [      {        "network": 0,        "ip": "string"      }    ],    "volumes": [      0    ],    "floating_ips": [      0    ],    "placement_group": 0,    "backup_window": "22-02",    "rescue_enabled": true,    "locked": true,    "network_blocked": true,    "protection": {      "delete": true    },    "labels": {      "property1": "string",      "property2": "string"    }  }}

Delete a server (its disk is destroyed)

DELETE
/servers/{id}

Backups are deleted with the server unless keep_backups is set; kept backups become snapshots, billed per GB. Snapshots of the server are kept unless delete_snapshots is set.

Autorisierung

headerAutorisierungBearer <token>

Pfadparameter

id*integer
Formatint64

Query-Parameter

keep_backups?boolean
Standardfalse
delete_snapshots?boolean
Standardfalse

Response-Body

Deletion started

application/json
  1. response
action*
curl -X DELETE "https://example.com/servers/0"
{  "action": {    "id": 0,    "command": "create_server",    "status": "running",    "progress": 0,    "started": "2019-08-24T14:15:22Z",    "finished": "2019-08-24T14:15:22Z",    "resources": [      {        "id": 0,        "type": "server"      }    ],    "error": {      "code": "string",      "message": "string"    }  }}
PUT
/servers/{id}

Autorisierung

headerAutorisierungBearer <token>

Pfadparameter

id*integer
Formatint64

Request-Body

application/json
  1. body
name?string
Länge1 <= length <= 63
labels?

Up to 64 key/value pairs; keys and values up to 63 characters

protection?

Response-Body

Updated

application/json
  1. response
server*
curl -X PUT "https://example.com/servers/0" \  -H "Content-Type: application/json" \  -d '{}'
{  "server": {    "id": 0,    "name": "string",    "status": "initializing",    "created": "2019-08-24T14:15:22Z",    "public_net": {      "ipv4": {        "id": 0,        "ip": "string",        "blocked": true,        "dns_ptr": "string"      },      "ipv6": {        "id": 0,        "ip": "string",        "blocked": true,        "dns_ptr": "string"      },      "elastic_ip": {        "id": 0,        "ip": "string"      }    },    "primary_network": 0,    "server_type": {      "id": 0,      "name": "t1",      "description": "Test 1",      "cpu_type": "shared",      "cores": 1,      "memory": 2,      "disk": 40,      "included_traffic": 0,      "deprecated": true,      "prices": [        {          "location": "fra1",          "price_hourly": {            "net": "0.0064000000",            "gross": "0.0064000000",            "currency": "EUR"          },          "price_monthly": {            "net": "0.0064000000",            "gross": "0.0064000000",            "currency": "EUR"          }        }      ]    },    "location": {      "id": 1,      "name": "fra1",      "description": "Frankfurt 1",      "country": "DE",      "city": "Frankfurt",      "network_zone": "eu-central",      "status": "active"    },    "image": {      "id": 0,      "type": "system",      "name": "string",      "description": "string",      "os_flavor": "ubuntu",      "os_version": "string",      "architecture": "x86",      "disk_size": 0,      "image_size": 0,      "status": "creating",      "deprecated": "2019-08-24T14:15:22Z",      "created_from": 0,      "protection": {        "delete": true      },      "locations": [        "string"      ],      "labels": {        "property1": "string",        "property2": "string"      },      "created": "2019-08-24T14:15:22Z"    },    "primary_disk_size": 0,    "private_net": [      {        "network": 0,        "ip": "string"      }    ],    "volumes": [      0    ],    "floating_ips": [      0    ],    "placement_group": 0,    "backup_window": "22-02",    "rescue_enabled": true,    "locked": true,    "network_blocked": true,    "protection": {      "delete": true    },    "labels": {      "property1": "string",      "property2": "string"    }  }}

What the server has cost this month

GET
/servers/{id}/costs

Usage of the current month (live) for the server, its backups and its primary IPs.

Autorisierung

headerAutorisierungBearer <token>

Pfadparameter

id*integer
Formatint64

Response-Body

Costs

application/json
  1. response
costs*
curl -X GET "https://example.com/servers/0/costs"
{  "costs": {    "month": "2026-10",    "total": "string",    "lines": [      {        "description": "string",        "resource_type": "string",        "resource_id": 0,        "project_id": 0,        "sku": "string",        "hours": 0,        "hourly": "string",        "monthly_cap": "string",        "capped": true,        "amount": "string",        "from": "2019-08-24T14:15:22Z",        "to": "2019-08-24T14:15:22Z"      }    ]  }}

CPU, disk and network time series

GET
/servers/{id}/metrics

Autorisierung

headerAutorisierungBearer <token>

Pfadparameter

id*integer
Formatint64

Query-Parameter

type*string
Wert in"cpu""disk""network"
start*string
Formatdate-time
end*string
Formatdate-time
step?integer

Seconds between points

Bereich10 <= value

Response-Body

Metrics

application/json
  1. response
metrics*
curl -X GET "https://example.com/servers/0/metrics?type=cpu&start=2019-08-24T14%3A15%3A22Z&end=2019-08-24T14%3A15%3A22Z"
{  "metrics": {    "start": "2019-08-24T14:15:22Z",    "end": "2019-08-24T14:15:22Z",    "step": 0,    "time_series": {      "property1": {        "values": [          [            null          ]        ]      },      "property2": {        "values": [          [            null          ]        ]      }    }  }}