Volumes

Create volume

This method creates a volume according to the specified parameters. To create a volume, follow these steps:

  1. Select a data center using the /v1/data-centers endpoint. The data center determines the provider and location of the volume.
  2. Select an available configuration for the volume using the /v1/volumes-configs endpoint.
  3. (optional) Specify the attachedToId field with existing virtual machine id to attach new volume to this virtual machine
post/v1/volumes

Request

  • Base URL
    https://api.emma.ms/external
  • Auth
    HTTP bearer

Request body

dataCenterIdstring required

ID of the data center

volumeGbinteger required

Capacity of the volume in gigabytes

volumeType'hdd' | 'ssd' | 'ssd-plus' required

Volume type

attachedToIdinteger

Target virtual machine for attaching the volume

Example request

{
  "dataCenterId": "aws-us-west-1",
  "volumeGb": 500,
  "volumeType": "ssd",
  "attachedToId": 51080
}

Response

Volume created

idinteger

Volume ID

namestring

Volume name

attachedToIdinteger

Compute instance ID that the volume is currently attached to

projectIdinteger

Project ID

sizeGbinteger

Volume size in gigabytes

type'hdd' | 'ssd' | 'ssd-plus'

Volume type

isSystemboolean

Indicates whether the volume contains OS or not

status'DRAFT' | 'BUSY' | 'AVAILABLE' | 'ACTIVE' | 'FAILED' | 'DELETED'

Status of the volume

createdAtstring

Date and time when the volume was created

createdByNamestring

Name of the user who created the volume

createdByIdinteger

ID of the user who created the volume

modifiedAtstring

Date and time when the volume was last edited

modifiedByNamestring

Name of the user who last edited the volume

modifiedByIdinteger

ID of the user who last edited the volume

deviceIdentifierstring nullable

Device identifier of the volume as seen by the operating system

Example response

{
  "id": 5819,
  "name": "volume-1ay48j",
  "attachedToId": 5806,
  "projectId": 933,
  "sizeGb": 250,
  "type": "ssd",
  "isSystem": true,
  "status": "ACTIVE",
  "provider": {
    "id": 12,
    "name": "AWS"
  },
  "location": {
    "id": 6,
    "name": "London",
    "country": "United Kingdom",
    "continent": "Europe",
    "region": "EMEA",
    "latitude": 51.50735,
    "longitude": -0.1277583
  },
  "dataCenter": {
    "id": "aws-eu-west-2",
    "name": "eu-west-2",
    "providerId": 12,
    "providerName": "AWS",
    "locationId": 6,
    "locationName": "London"
  },
  "createdAt": "2021-11-26T14:54:11",
  "createdByName": "Automation User",
  "createdById": 123,
  "modifiedAt": "2021-11-26T14:54:11",
  "modifiedByName": "Automation User",
  "modifiedById": 123,
  "cost": {
    "unit": "MONTHS",
    "currency": "EUR",
    "price": 5.479952
  },
  "deviceIdentifier": "/dev/sda"
}

Changes

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