The base URL for this API is: https://api.leaseweb.com/publicCloud/v1/
This API provides ways to launch and manage VPS.
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": "https://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.
The VPS must be stopped before the execution
vpsId required | string Example: 999999999 VPS ID |
curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/start \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}
The VPS must be running before the execution
vpsId required | string Example: 999999999 VPS ID |
curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/stop \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}
The VPS must be running before the execution
vpsId required | string Example: 999999999 VPS ID |
curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/reboot \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}
vpsId required | string Example: 999999999 VPS ID |
curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/credentials \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "totalCount": 1,
- "limit": 20,
- "offset": 0
}, - "credentials": [
- {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
]
}
vpsId required | string Example: 999999999 VPS ID |
type required | string (credentialType) Enum: "OPERATING_SYSTEM" "CONTROL_PANEL" |
username required | string Can contain only alphanumeric values and characters |
password required | string The password you'd like to store |
{- "password": "12341234",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
{- "password": "12341234",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
Delete all credentials stored for a given VPS.
vpsId required | string Example: 999999999 VPS ID |
curl --request DELETE \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/credentials \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "401",
- "errorMessage": "You are not authorized to view this resource."
}
vpsId required | string Example: 999999999 VPS ID |
type required | string (credentialType) Enum: "OPERATING_SYSTEM" "CONTROL_PANEL" Type of credential |
curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/credentials/%7Btype%7D \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "totalCount": 1,
- "limit": 20,
- "offset": 0
}, - "credentials": [
- {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
]
}
vpsId required | string Example: 999999999 VPS ID |
type required | string (credentialType) Enum: "OPERATING_SYSTEM" "CONTROL_PANEL" Type of credential |
username required | string Example: root Username |
curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/credentials/%7Btype%7D/root \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "password": "12341234",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
vpsId required | string Example: 999999999 VPS ID |
type required | string (credentialType) Enum: "OPERATING_SYSTEM" "CONTROL_PANEL" Type of credential |
username required | string Example: root Username |
password required | string The new password |
{- "password": "12341234"
}
{- "password": "12341234",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
vpsId required | string Example: 999999999 VPS ID |
type required | string (credentialType) Enum: "OPERATING_SYSTEM" "CONTROL_PANEL" Type of credential |
username required | string Example: root Username |
curl --request DELETE \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/credentials/%7Btype%7D/root \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "401",
- "errorMessage": "You are not authorized to view this resource."
}
The operation may take a few moments to complete.
You can obtain the new credential using the credentials endpoints
vpsId required | string Example: 999999999 VPS ID |
curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/resetPassword \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}
VPS must not have ISO attached, otherwise, it will return a validation error.
Available ISOs can be obtained using /v1/isos
.
vpsId required | string Example: 999999999 VPS ID |
isoId required | string The ISO ID, obtained using the ISO endpoints |
{- "isoId": "GRML"
}
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}
VPS must have ISO attached, otherwise, it will return a validation error
vpsId required | string Example: 999999999 VPS ID |
curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/detachIso \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}
List all available ISO images
limit | integer Example: limit=20 Limit the number of results returned. |
offset | integer Example: offset=10 Return results starting from the given offset. |
curl --request GET \ --url 'https://api.leaseweb.com/publicCloud/v1/isos?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "totalCount": 2,
- "limit": 20,
- "offset": 0
}, - "isos": [
- {
- "id": "GRML",
- "name": "GRML 2022.11"
}, - {
- "id": "ACRONIS_BOOT_MEDIA",
- "name": "Acronis Boot Media"
}
]
}
limit | integer Example: limit=20 Limit the number of results returned. |
offset | integer Example: offset=10 Return results starting from the given offset. |
custom | boolean Filters the list to include only custom images. |
standard | boolean Example: standard=true Filters the list to include only standard images. |
state | string (imageState) Enum: "CREATING" "READY" "DESTROYED" "DESTROYING" "FAILED" Filters the list by the state of custom images. |
marketAppId | string (marketAppId) Enum: "CPANEL_30" "CPANEL_100" "PLESK_WEB_PRO" "PLESK_WEB_ADMIN" Filters the list by the market app of standard images. |
storageType | string Enum: "LOCAL" "CENTRAL" Filters the list by the market app of standard images. |
name | string Example: name=Ubuntu 20.04 LTS (x86_64) Filters the list by the name of images. |
flavour | string (flavour) Enum: "ubuntu" "debian" "freebsd" "centos" "almalinux" "rockylinux" "archlinux" "windows" Filters the list by the flavour of standard images. |
region | string Example: region=eu-west-3 Available regions can be found using the List Regions endpoint. |
curl --request GET \ --url 'https://api.leaseweb.com/publicCloud/v1/images?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&custom=SOME_BOOLEAN_VALUE&standard=SOME_BOOLEAN_VALUE&state=SOME_STRING_VALUE&marketAppId=SOME_STRING_VALUE&storageType=SOME_STRING_VALUE&name=SOME_STRING_VALUE&flavour=SOME_STRING_VALUE®ion=SOME_STRING_VALUE' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "images": [
- {
- "id": "UBUNTU_24_04_64BIT",
- "name": "Ubuntu 24.04 LTS (x86_64)",
- "version": "24.04",
- "family": "linux",
- "flavour": "ubuntu",
- "architecture": "x86_64",
- "marketApps": [ ],
- "storageTypes": [
- "LOCAL",
- "CENTRAL"
], - "storageSize": null,
- "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": null,
- "updatedAt": null,
- "custom": false,
- "minDiskSize": null
}, - {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (x86_64)",
- "version": "22.04",
- "family": "linux",
- "flavour": "ubuntu",
- "architecture": "x86_64",
- "marketApps": [
- "PLESK_WEB_ADMIN"
], - "storageTypes": [
- "LOCAL",
- "CENTRAL"
], - "storageSize": null,
- "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": null,
- "updatedAt": null,
- "custom": false,
- "minDiskSize": null
}, - {
- "id": "UBUNTU_20_04_64BIT",
- "name": "Ubuntu 20.04 LTS (x86_64)",
- "version": "20.04",
- "family": "linux",
- "flavour": "ubuntu",
- "architecture": "x86_64",
- "marketApps": [ ],
- "storageTypes": [
- "LOCAL",
- "CENTRAL"
], - "storageSize": null,
- "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": null,
- "updatedAt": null,
- "custom": false,
- "minDiskSize": null
}, - {
- "id": "abcc1630-362f-48ba-832f-c496aff24121",
- "name": "Custom image - 01",
- "flavour": "ubuntu",
- "family": "linux",
- "version": null,
- "architecture": null,
- "marketApps": [ ],
- "storageTypes": [ ],
- "storageSize": {
- "size": 2.03,
- "unit": "GB"
}, - "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": "2024-07-05T10:44:08+00:00",
- "updatedAt": "2024-07-18T08:52:08+00:00",
- "custom": true,
- "minDiskSize": null
}, - {
- "id": "8600b94b-45b4-4887-86e1-2792b06dbb32",
- "name": "Custom image - 02",
- "flavour": "ubuntu",
- "family": "linux",
- "version": null,
- "architecture": null,
- "marketApps": [ ],
- "storageTypes": [ ],
- "storageSize": {
- "size": 2.03,
- "unit": "GB"
}, - "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": "2024-07-05T10:47:01+00:00",
- "updatedAt": "2024-07-17T13:14:01+00:00",
- "custom": true,
- "minDiskSize": null
}, - {
- "id": "ace712e9-a166-47f1-9065-4af0f7e7fce1",
- "name": "Custom image - 03",
- "flavour": "ubuntu",
- "family": "linux",
- "version": null,
- "architecture": null,
- "marketApps": [ ],
- "storageTypes": [ ],
- "storageSize": {
- "size": 2.03,
- "unit": "GB"
}, - "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": "2024-07-05T10:54:27+00:00",
- "updatedAt": "2024-07-17T13:14:01+00:00",
- "custom": true,
- "minDiskSize": null
}
], - "_metadata": {
- "totalCount": 6,
- "limit": 6,
- "offset": 0
}
}
vpsId required | string Example: 999999999 VPS ID |
from | string <date> Example: from=2025-01-28 The start of the interval to get the metric |
to | string <date> Example: to=2025-01-28 The end of the interval to get the metric. Must be greater than the date provided in |
granularity | string Value: "DAY" How the metrics are grouped by |
aggregation | string Value: "SUM" How the metrics are aggregated |
curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/metrics/datatraffic \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "from": "2023-10-01T00:00:00+00:00",
- "to": "2023-10-31T00:00:00+00:00",
- "granularity": "DAY",
- "aggregation": "SUM",
- "unit": "B",
- "summary": {
- "downPublic": {
- "average": 340733979,
- "expected": 10222019370,
- "total": 1022201937,
- "peak": {
- "value": 896116855,
- "timestamp": "2023-10-28T00:00:00+00:00"
}
}, - "upPublic": {
- "average": 59920023.67,
- "expected": 1797600710.1,
- "total": 179760071,
- "peak": {
- "value": 85089279,
- "timestamp": "2023-10-28T00:00:00+00:00"
}
}
}
}, - "metrics": {
- "downPublic": {
- "values": [
- {
- "value": 461323,
- "timestamp": "2023-10-27T00:00:00+00:00"
}, - {
- "value": 1249243,
- "timestamp": "2023-10-28T00:00:00+00:00"
}
], - "unit": "B"
}, - "upPublic": {
- "values": [
- {
- "value": 437565,
- "timestamp": "2023-10-27T00:00:00+00:00"
}, - {
- "value": 6938590,
- "timestamp": "2023-10-28T00:00:00+00:00"
}
], - "unit": "B"
}
}
}
List VPS snapshots
vpsId required | string Example: 999999999 VPS ID |
limit | integer Example: limit=20 Limit the number of results returned. |
offset | integer Example: offset=10 Return results starting from the given offset. |
curl --request GET \ --url 'https://api.leaseweb.com/publicCloud/v1/vps/999999999/snapshots?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "totalCount": 1,
- "limit": 20,
- "offset": 0
}, - "snapshots": [
- {
- "id": "624c53c3-48e9-41d1-833f-90a9abf5fd95",
- "displayName": "snapshot 1",
- "state": "READY",
- "created": "2023-11-02T07:31:28+0000"
}
]
}
The VPS must be running before the execution.
The time taken to create the snapshot depends on several factors, including memory size and usage.
Allowed only one snapshot per VPS.
vpsId required | string Example: 999999999 VPS ID |
name required | string A name to identify your snapshot |
{- "name": "my snapshot"
}
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}
vpsId required | string Example: 999999999 VPS ID |
snapshotId required | string <uuid> |
curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/snapshots/%7BsnapshotId%7D \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "created": "2023-11-02T07:31:28+0000",
- "displayName": "snapshot 1",
- "id": "ef73e9e2-95cd-49ef-940f-a24e6ad6c4a0",
- "state": "READY"
}
vpsId required | string Example: 999999999 VPS ID |
snapshotId required | string <uuid> |
curl --request PUT \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/snapshots/%7BsnapshotId%7D \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}
vpsId required | string Example: 999999999 VPS ID |
snapshotId required | string <uuid> |
curl --request DELETE \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/snapshots/%7BsnapshotId%7D \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}
List the VPS's IPs
vpsId required | string Example: 999999999 VPS ID |
version | integer (ipVersion) Enum: 4 6 Ip version |
nullRouted | boolean |
ips | string A list of IPs separated by |
curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/ips \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "totalCount": 1,
- "limit": 20,
- "offset": 0
}, - "ips": [
- {
- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": null,
- "mainIp": false,
- "nullRouted": false,
- "networkType": "INTERNAL",
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
]
}
vpsId required | string Example: 999999999 VPS ID |
ip required | string <ip> Example: 10.0.0.1 |
curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/ips/%7Bip%7D \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
Allows you to set the reverse lookup for the IP
vpsId required | string Example: 999999999 VPS ID |
ip required | string <ip> Example: 10.0.0.1 |
reverseLookup required | string |
{- "reverseLookup": "a-valid-domain.xpto"
}
{- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
Null route an IP. It may take a few minutes before the change is propagated across the network.
Only works for IPv4.
vpsId required | string Example: 999999999 VPS ID |
ip required | string <ip> Example: 10.0.0.1 |
comment | string The reason why the IP is being null-routed |
automatedUnnulingAt | integer [ 1 .. 17520 ] If provided, reverts the operation automatically in the specified value, in hours |
{- "automatedUnnulingAt": 2,
- "comment": "Getting DDoS"
}
{- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
Remove an IP null route. It may take a few minutes before the change is propagated across the network
vpsId required | string Example: 999999999 VPS ID |
ip required | string <ip> Example: 10.0.0.1 |
curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/ips/%7Bip%7D/unnull \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
vpsId required | string Example: 999999999 VPS ID |
limit | integer Example: limit=20 Limit the number of results returned. |
offset | integer Example: offset=10 Return results starting from the given offset. |
standard | boolean Example: standard=true Filters the list to include only standard images. |
curl --request GET \ --url 'https://api.leaseweb.com/publicCloud/v1/vps/999999999/reinstall/images?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&standard=SOME_BOOLEAN_VALUE' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "images": [
- {
- "id": "UBUNTU_24_04_64BIT",
- "name": "Ubuntu 24.04 LTS (x86_64)",
- "version": "24.04",
- "family": "linux",
- "flavour": "ubuntu",
- "architecture": "x86_64",
- "marketApps": [ ],
- "storageTypes": [
- "LOCAL",
- "CENTRAL"
], - "storageSize": null,
- "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": null,
- "updatedAt": null,
- "custom": false,
- "minDiskSize": null
}, - {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (x86_64)",
- "version": "22.04",
- "family": "linux",
- "flavour": "ubuntu",
- "architecture": "x86_64",
- "marketApps": [
- "PLESK_WEB_ADMIN"
], - "storageTypes": [
- "LOCAL",
- "CENTRAL"
], - "storageSize": null,
- "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": null,
- "updatedAt": null,
- "custom": false,
- "minDiskSize": null
}, - {
- "id": "UBUNTU_20_04_64BIT",
- "name": "Ubuntu 20.04 LTS (x86_64)",
- "version": "20.04",
- "family": "linux",
- "flavour": "ubuntu",
- "architecture": "x86_64",
- "marketApps": [ ],
- "storageTypes": [
- "LOCAL",
- "CENTRAL"
], - "storageSize": null,
- "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": null,
- "updatedAt": null,
- "custom": false,
- "minDiskSize": null
}, - {
- "id": "abcc1630-362f-48ba-832f-c496aff24121",
- "name": "Custom image - 01",
- "flavour": "ubuntu",
- "family": "linux",
- "version": null,
- "architecture": null,
- "marketApps": [ ],
- "storageTypes": [ ],
- "storageSize": {
- "size": 2.03,
- "unit": "GB"
}, - "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": "2024-07-05T10:44:08+00:00",
- "updatedAt": "2024-07-18T08:52:08+00:00",
- "custom": true,
- "minDiskSize": null
}, - {
- "id": "8600b94b-45b4-4887-86e1-2792b06dbb32",
- "name": "Custom image - 02",
- "flavour": "ubuntu",
- "family": "linux",
- "version": null,
- "architecture": null,
- "marketApps": [ ],
- "storageTypes": [ ],
- "storageSize": {
- "size": 2.03,
- "unit": "GB"
}, - "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": "2024-07-05T10:47:01+00:00",
- "updatedAt": "2024-07-17T13:14:01+00:00",
- "custom": true,
- "minDiskSize": null
}, - {
- "id": "ace712e9-a166-47f1-9065-4af0f7e7fce1",
- "name": "Custom image - 03",
- "flavour": "ubuntu",
- "family": "linux",
- "version": null,
- "architecture": null,
- "marketApps": [ ],
- "storageTypes": [ ],
- "storageSize": {
- "size": 2.03,
- "unit": "GB"
}, - "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": "2024-07-05T10:54:27+00:00",
- "updatedAt": "2024-07-17T13:14:01+00:00",
- "custom": true,
- "minDiskSize": null
}
], - "_metadata": {
- "totalCount": 6,
- "limit": 6,
- "offset": 0
}
}
Recreates the VPS, with optionally different Image and Marketplace App.
Cannot be performed when the VPS has snapshots.
Available Images can be obtained using /v1/{resource}/{instanceId}/reinstall/images
.
Available Marketplace Apps can be obtained using /v1/images/{imageId}/marketApps
.
vpsId required | string Example: 999999999 VPS ID |
imageId required | string The Image ID |
marketAppId | string The Market App to be installed |
{- "imageId": "UBUNTU_22_04_64BIT"
}
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}
Get console access to the VPS
vpsId required | string Example: 999999999 VPS ID |
curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/console \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
List and filter VPS
limit | integer Example: limit=20 Limit the number of results returned. |
offset | integer Example: offset=10 Return results starting from the given offset. |
id | string Example: id=999999999 VPS Equipment Id |
reference | string Example: reference=Foo bar |
ip | string <ip> Example: ip=10.0.0.1 |
state | string Enum: "RUNNING" "STARTING" "STOPPED" "STOPPING" The current state |
pack | string Enum: "Leaseweb VPS 1" "Leaseweb VPS 2" "Leaseweb VPS 3" "Leaseweb VPS 4" "Leaseweb VPS 5" "Leaseweb VPS 6" Vps package type |
region | string (regionName) Enum: "eu-west-3" "us-east-1" "eu-central-1" "ap-southeast-1" "us-west-1" "eu-west-2" "ca-central-1" "ap-northeast-1" region name |
curl --request GET \ --url 'https://api.leaseweb.com/publicCloud/v1/vps?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&id=SOME_STRING_VALUE&reference=SOME_STRING_VALUE&ip=10.0.0.1&state=SOME_STRING_VALUE&pack=SOME_STRING_VALUE®ion=SOME_STRING_VALUE' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "totalCount": 1,
- "limit": 10,
- "offset": 0
}, - "vps": [
- {
- "id": "123581321",
- "pack": "Leaseweb VPS 2",
- "region": "eu-central-1",
- "datacenter": "FRA-01",
- "reference": "testing",
- "image": {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (x86_64)",
- "family": "linux",
- "flavour": "ubuntu",
- "custom": false
}, - "marketAppId": null,
- "state": "RUNNING",
- "hasPublicIpV4": true,
- "rootDiskSize": 50,
- "ips": [
- {
- "ip": "88.17.128.0",
- "prefixLength": "16",
- "version": 4,
- "nullRouted": false,
- "reverseLookup": "",
- "mainIp": true,
- "networkType": "PUBLIC"
}
], - "startedAt": "2024-10-24T21:13:25+00:00"
}
]
}
Get VPS details.
vpsId required | string Example: 999999999 VPS ID |
curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "contract": {
- "id": "41228459000100",
- "billingFrequency": 1,
- "term": 12,
- "type": "MONTHLY",
- "state": "ACTIVE",
- "endsAt": "2024-10-24T21:13:25+00:00",
- "createdAt": "2024-10-24T21:13:25+00:00",
- "sla": "Basic",
- "controlPanel": "cPanel Admin 5",
- "inModification": false,
- "dataTraffic": {
- "value": 30,
- "unit": "TB"
}
}, - "datacenter": "FRA-01",
- "hasPublicIpV4": true,
- "id": "123581321",
- "image": {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (x86_64)",
- "family": "linux",
- "flavour": "ubuntu",
- "custom": false
}, - "ips": [
- {
- "ip": "88.17.128.0",
- "prefixLength": "16",
- "version": 4,
- "nullRouted": false,
- "reverseLookup": "",
- "mainIp": true,
- "networkType": "PUBLIC",
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
], - "iso": null,
- "marketAppId": null,
- "pack": "Leaseweb VPS 2",
- "reference": "testing",
- "region": "eu-central-1",
- "resources": {
- "cpu": {
- "value": 4,
- "unit": "vCPU"
}, - "memory": {
- "value": 6,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 10000,
- "unit": "Mbps"
}
}, - "rootDiskSize": 50,
- "startedAt": "2024-10-24T21:13:25+00:00",
- "state": "RUNNING"
}
vpsId required | string Example: 999999999 VPS ID |
reference | string An identifying name you can refer to the VPS |
{- "reference": "updated reference"
}
{- "contract": {
- "id": "41228459000100",
- "billingFrequency": 1,
- "term": 12,
- "type": "MONTHLY",
- "state": "ACTIVE",
- "endsAt": "2024-10-24T21:13:25+00:00",
- "createdAt": "2024-10-24T21:13:25+00:00",
- "sla": "Basic",
- "controlPanel": "cPanel Admin 5",
- "inModification": false,
- "dataTraffic": {
- "value": 30,
- "unit": "TB"
}
}, - "datacenter": "FRA-01",
- "hasPublicIpV4": true,
- "id": "123581321",
- "image": {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (x86_64)",
- "family": "linux",
- "flavour": "ubuntu",
- "custom": false
}, - "ips": [
- {
- "ip": "88.17.128.0",
- "prefixLength": "16",
- "version": 4,
- "nullRouted": false,
- "reverseLookup": "",
- "mainIp": true,
- "networkType": "PUBLIC",
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
], - "iso": null,
- "marketAppId": null,
- "pack": "Leaseweb VPS 2",
- "reference": "testing",
- "region": "eu-central-1",
- "resources": {
- "cpu": {
- "value": 4,
- "unit": "vCPU"
}, - "memory": {
- "value": 6,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 10000,
- "unit": "Mbps"
}
}, - "rootDiskSize": 50,
- "startedAt": "2024-10-24T21:13:25+00:00",
- "state": "RUNNING"
}