Storage API (v1)

The base URL for this API is: https://api.leaseweb.com/storage/v1

BETA
LIMITED ACCESS
To use this API, please request access via your account manager.

Errors

The API uses standard HTTP status codes to indicate the success or failure of the API call. The response will be JSON. Most APIs use the following format:

{
"errorCode" : "APP00800",
"errorMessage" : "The connection with the DB cannot be established.",
"correlationId" : "550e8400-e29b-41d4-a716-446655440000",
"userMessage" : "Cannot handle your request at the moment. Please try again later.",
"reference" : "http://developer.leaseweb.com/errors/APP00800"
}

Authentication

Authentication for the APIs is required. To authenticate your call, you will need to sent your API key as X-LSW-Auth header.

You can generate API keys in the Customer Portal.

List storages

Show all storages for the given customer.

Authorizations:
X-LSW-Auth
query Parameters
limit
integer
Default: 10

Limit the number of results returned.

offset
integer
Default: 0

Return results starting from the given offset.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/storage/v1/storages?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "storages": [
    ],
  • "_metadata": {
    }
}

List StorageVMs

Show all StorageVMs for the given customer.

Authorizations:
X-LSW-Auth
query Parameters
limit
integer
Default: 10

Limit the number of results returned.

offset
integer
Default: 0

Return results starting from the given offset.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/storage/v1/storageVMs?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "storageVMs": [
    ],
  • "_metadata": {
    }
}

List volumes

Show all the volumes in a StorageVM.

Authorizations:
X-LSW-Auth
path Parameters
storageVMId
required
string
Example: 1575dd1c-dddf-11ed-af62-000c299d72cd

UUID of the Storage VM.

query Parameters
limit
integer
Default: 10

Limit the number of results returned.

offset
integer
Default: 0

Return results starting from the given offset.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/storage/v1/storageVMs/1575dd1c-dddf-11ed-af62-000c299d72cd/volumes?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "volumes": [
    ],
  • "_metadata": {
    }
}

Grow volume

Grow the size of a volume in StorageVM.

Authorizations:
X-LSW-Auth
path Parameters
storageVMId
required
string
Example: 1575dd1c-dddf-11ed-af62-000c299d72cd

UUID of the Storage VM.

volumeId
required
string
Example: 1575dd1c-dddf-11ed-af62-000c299d72cd

UUID of a storage volume.

Request Body schema: application/json
growSize
required
integer

The amount by which the volume will be grown in GB.

Responses

Request samples

Content type
application/json
{
  • "growSize": 5
}

Response samples

Content type
application/json
{
  • "id": "d385ae54-3763-11ee-af62-000c299d72cd",
  • "status": "PENDING"
}

Show a job

Gets status details about a job running in the specified storage VM.

Authorizations:
X-LSW-Auth
path Parameters
storageVMId
required
string
Example: 1575dd1c-dddf-11ed-af62-000c299d72cd

UUID of the Storage VM.

jobId
required
string
Example: d385ae54-3763-11ee-af62-000c299d72cd

UUID of a queue job.

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/storage/v1/storageVMs/1575dd1c-dddf-11ed-af62-000c299d72cd/jobs/d385ae54-3763-11ee-af62-000c299d72cd \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "id": "d385ae54-3763-11ee-af62-000c299d72cd",
  • "status": "COMPLETED",
  • "startedAt": "2023-07-31T12:39:23+00:00",
  • "completedAt": "2023-07-31T12:39:24+00:00"
}