Zum Inhalt springen
Odinex Cloud
API-Referenz

Volumes

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

List volumes

GET
/volumes

Autorisierung

headerAutorisierungBearer <token>

Query-Parameter

label_selector?string

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

Response-Body

Volumes

application/json
  1. response
volumes*array<>
curl -X GET "https://example.com/volumes"
{  "volumes": [    {      "id": 0,      "name": "string",      "size": 0,      "status": "creating",      "location": "string",      "server": 0,      "linux_device": "string",      "protection": {        "delete": true      },      "labels": {        "property1": "string",        "property2": "string"      },      "created": "2019-08-24T14:15:22Z"    }  ]}

Create volume

POST
/volumes

Autorisierung

headerAutorisierungBearer <token>

Request-Body

application/json
  1. body
name*string
Länge1 <= length <= 64
size*integer

Size in GB

Bereich10 <= value <= 10240
location?string

Required unless server is given

server?integer

Attach to this server after creation

Formatint64
labels?

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

Response-Body

Created

application/json
  1. response
volume*
action?|null
curl -X POST "https://example.com/volumes" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "size": 10  }'
{  "volume": {    "id": 0,    "name": "string",    "size": 0,    "status": "creating",    "location": "string",    "server": 0,    "linux_device": "string",    "protection": {      "delete": true    },    "labels": {      "property1": "string",      "property2": "string"    },    "created": "2019-08-24T14:15:22Z"  },  "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"    }  }}

Get volume

GET
/volumes/{id}

Autorisierung

headerAutorisierungBearer <token>

Pfadparameter

id*integer
Formatint64

Response-Body

Volume

application/json
  1. response
volume*
curl -X GET "https://example.com/volumes/0"
{  "volume": {    "id": 0,    "name": "string",    "size": 0,    "status": "creating",    "location": "string",    "server": 0,    "linux_device": "string",    "protection": {      "delete": true    },    "labels": {      "property1": "string",      "property2": "string"    },    "created": "2019-08-24T14:15:22Z"  }}

Delete volume

DELETE
/volumes/{id}

Autorisierung

headerAutorisierungBearer <token>

Pfadparameter

id*integer
Formatint64

Response-Body

Deleted

curl -X DELETE "https://example.com/volumes/0"
Leer

Update volume

PUT
/volumes/{id}

Autorisierung

headerAutorisierungBearer <token>

Pfadparameter

id*integer
Formatint64

Request-Body

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

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

protection?

Response-Body

Updated

application/json
  1. response
volume*
curl -X PUT "https://example.com/volumes/0" \  -H "Content-Type: application/json" \  -d '{}'
{  "volume": {    "id": 0,    "name": "string",    "size": 0,    "status": "creating",    "location": "string",    "server": 0,    "linux_device": "string",    "protection": {      "delete": true    },    "labels": {      "property1": "string",      "property2": "string"    },    "created": "2019-08-24T14:15:22Z"  }}

Attach a volume to a server

POST
/volumes/{id}/actions/attach

Autorisierung

headerAutorisierungBearer <token>

Pfadparameter

id*integer
Formatint64

Request-Body

application/json
  1. body
server*integer
Formatint64

Response-Body

Action started

application/json
  1. response
action*
curl -X POST "https://example.com/volumes/0/actions/attach" \  -H "Content-Type: application/json" \  -d '{    "server": 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"    }  }}

Detach a volume

POST
/volumes/{id}/actions/detach

Autorisierung

headerAutorisierungBearer <token>

Pfadparameter

id*integer
Formatint64

Response-Body

Action started

application/json
  1. response
action*
curl -X POST "https://example.com/volumes/0/actions/detach"
{  "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"    }  }}

Grow a volume (online)

POST
/volumes/{id}/actions/resize

Autorisierung

headerAutorisierungBearer <token>

Pfadparameter

id*integer
Formatint64

Request-Body

application/json
  1. body
size*integer
Bereich10 <= value <= 10240

Response-Body

Action started

application/json
  1. response
action*
curl -X POST "https://example.com/volumes/0/actions/resize" \  -H "Content-Type: application/json" \  -d '{    "size": 10  }'
{  "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"    }  }}