Volume Actions

Attach Volume to a Server

Attaches a Volume to a Server. Works only if the Server is in the same Location as the Volume.

post/volumes/{id}/actions/attach

Request

  • Base URL: https://api.hetzner.cloud/v1
  • URL: https://api.hetzner.cloud/v1/volumes/{id}/actions/attach
  • Auth: HTTP bearer

Path parameters

idinteger required

ID of the Volume.

Example:42

ID of the Volume.

Request body

serverinteger required

ID of the Server the Volume will be attached to.

automountboolean

Auto-mount the Volume after attaching it.

Example request

{
  "server": 43
}

Response

Request succeeded.

Example response

{
  "action": {
    "id": 42,
    "command": "start_resource",
    "started": "2016-01-30T23:55:00Z",
    "finished": "2016-01-30T23:55:00Z",
    "progress": 100,
    "resources": [
      {
        "id": 42,
        "type": "server"
      }
    ],
    "error": {
      "code": "action_failed",
      "message": "Action failed"
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.