Skip to content
Odinex Cloud
API reference

Volumes

List volumes

GET
/volumes

Authorization

headerAuthorizationBearer <token>

Query Parameters

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

Authorization

headerAuthorizationBearer <token>

Request Body

application/json
  1. body
name*string
Length1 <= length <= 64
size*integer

Size in GB

Range10 <= 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}

Authorization

headerAuthorizationBearer <token>

Path Parameters

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}

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Response Body

Deleted

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

Update volume

PUT
/volumes/{id}

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Request Body

application/json
  1. body
name?string
Length1 <= 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"  }}
POST
/volumes/{id}/actions/attach

Authorization

headerAuthorizationBearer <token>

Path Parameters

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

Authorization

headerAuthorizationBearer <token>

Path Parameters

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

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Request Body

application/json
  1. body
size*integer
Range10 <= 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"    }  }}