The base URL for this API is: https://api.leaseweb.com/storage/v1
BETALIMITED ACCESSTo use this API, please request access via your account manager.
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 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.
Show all storages for the given customer.
limit | integer Default: 10 Limit the number of results returned. |
offset | integer Default: 0 Return results starting from the given offset. |
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'
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 3
}, - "storages": [
- {
- "id": "10812374",
- "quantity": {
- "value": 70000,
- "unit": "GB"
}, - "type": "SANS"
}, - {
- "id": "10812375",
- "quantity": {
- "value": 350000,
- "unit": "GB"
}, - "type": "SANS"
}, - {
- "id": "10938904",
- "quantity": {
- "value": 65000,
- "unit": "GB"
}, - "type": "SANS"
}
]
}
Show all StorageVMs for the given customer.
limit | integer Default: 10 Limit the number of results returned. |
offset | integer Default: 0 Return results starting from the given offset. |
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'
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 1
}, - "storageVMs": [
- {
- "id": "1575dd1c-dddf-11ed-af62-000c299d72cd"
}
]
}
Show all the volumes in a StorageVM.
storageVMId required | string Example: 1575dd1c-dddf-11ed-af62-000c299d72cd UUID of the Storage VM. |
limit | integer Default: 10 Limit the number of results returned. |
offset | integer Default: 0 Return results starting from the given offset. |
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'
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 2
}, - "volumes": [
- {
- "id": "15ca9bf3-dddf-11ed-af62-000c299d72cd",
- "name": "volume1",
- "space": {
- "size": {
- "value": 0.021,
- "unit": "GB"
}, - "available": {
- "value": 0.018,
- "unit": "GB"
}, - "used": {
- "value": 0.002,
- "unit": "GB"
}
}
}, - {
- "id": "75a7e5ed-dde1-11ed-af62-000c299d72cd",
- "name": "volume2",
- "space": {
- "size": {
- "value": 5.369,
- "unit": "GB"
}, - "available": {
- "value": 5.368,
- "unit": "GB"
}, - "used": {
- "value": 0,
- "unit": "GB"
}
}
}
]
}
Grow the size of a volume in StorageVM.
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. |
growSize required | integer The amount by which the volume will be grown in GB. |
{- "growSize": 5
}
{- "id": "d385ae54-3763-11ee-af62-000c299d72cd",
- "status": "PENDING"
}
Gets status details about a job running in the specified storage VM.
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. |
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'
{- "id": "d385ae54-3763-11ee-af62-000c299d72cd",
- "status": "COMPLETED",
- "startedAt": "2023-07-31T12:39:23+00:00",
- "completedAt": "2023-07-31T12:39:24+00:00"
}