LeaseWeb API for launching and managing Public Cloud instances (v1)

License: Apache 2.0

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

This API provides ways to launch and manage Public Cloud instances.

BETA
This API is in BETA. Documentation might be incorrect or incomplete. Functionality might change with the final release.>

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": "https://developer.leaseweb.com/errors/APP00800"
}

API Key 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.

Regions

List regions

Authorizations:
X-LSW-Auth
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/regions \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Instance Types

List instance types

Get instance types

Authorizations:
X-LSW-Auth
query Parameters
region
required
string
Example: region=eu-west-3
limit
integer >= 0
Default: 50
offset
integer >= 0
Default: 0

Responses

Request samples

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

Response samples

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

Instances

Launch instance

Launch a Public Cloud instance.

Available regions can be obtained using /v1/regions.

Available Images can be obtained using /v1/images.

Available instance types for your region can be obtained using /v1/instanceTypes.

Authorizations:
X-LSW-Auth
Request Body schema: application/json
required
region
required
string

Region to launch the instance into

type
required
string (typeName)
Enum: "lsw.m3.large" "lsw.m3.xlarge" "lsw.m3.2xlarge" "lsw.m4.large" "lsw.m4.xlarge" "lsw.m4.2xlarge" "lsw.m4.4xlarge" "lsw.m5.large" "lsw.m5.xlarge" "lsw.m5.2xlarge" "lsw.m5.4xlarge" "lsw.m5a.large" "lsw.m5a.xlarge" "lsw.m5a.2xlarge" "lsw.m5a.4xlarge" "lsw.m5a.8xlarge" "lsw.m5a.12xlarge" "lsw.m6a.large" "lsw.m6a.xlarge" "lsw.m6a.2xlarge" "lsw.m6a.4xlarge" "lsw.m6a.8xlarge" "lsw.m6a.12xlarge" "lsw.m6a.16xlarge" "lsw.m6a.24xlarge" "lsw.c3.large" "lsw.c3.xlarge" "lsw.c3.2xlarge" "lsw.c3.4xlarge" "lsw.c4.large" "lsw.c4.xlarge" "lsw.c4.2xlarge" "lsw.c4.4xlarge" "lsw.c5.large" "lsw.c5.xlarge" "lsw.c5.2xlarge" "lsw.c5.4xlarge" "lsw.c5a.large" "lsw.c5a.xlarge" "lsw.c5a.2xlarge" "lsw.c5a.4xlarge" "lsw.c5a.9xlarge" "lsw.c5a.12xlarge" "lsw.c6a.large" "lsw.c6a.xlarge" "lsw.c6a.2xlarge" "lsw.c6a.4xlarge" "lsw.c6a.8xlarge" "lsw.c6a.12xlarge" "lsw.c6a.16xlarge" "lsw.c6a.24xlarge" "lsw.r3.large" "lsw.r3.xlarge" "lsw.r3.2xlarge" "lsw.r4.large" "lsw.r4.xlarge" "lsw.r4.2xlarge" "lsw.r5.large" "lsw.r5.xlarge" "lsw.r5.2xlarge" "lsw.r5a.large" "lsw.r5a.xlarge" "lsw.r5a.2xlarge" "lsw.r5a.4xlarge" "lsw.r5a.8xlarge" "lsw.r5a.12xlarge" "lsw.r6a.large" "lsw.r6a.xlarge" "lsw.r6a.2xlarge" "lsw.r6a.4xlarge" "lsw.r6a.8xlarge" "lsw.r6a.12xlarge" "lsw.r6a.16xlarge" "lsw.r6a.24xlarge"

Instance/Load balancer type

imageId
required
string (imageId)
Enum: "ALMALINUX_8_64BIT" "ALMALINUX_9_64BIT" "ARCH_LINUX_64BIT" "CENTOS_7_64BIT" "DEBIAN_10_64BIT" "DEBIAN_11_64BIT" "DEBIAN_12_64BIT" "FREEBSD_13_64BIT" "FREEBSD_14_64BIT" "ROCKY_LINUX_8_64BIT" "ROCKY_LINUX_9_64BIT" "UBUNTU_20_04_64BIT" "UBUNTU_22_04_64BIT" "UBUNTU_24_04_64BIT" "WINDOWS_SERVER_2016_STANDARD_64BIT" "WINDOWS_SERVER_2019_STANDARD_64BIT" "WINDOWS_SERVER_2022_STANDARD_64BIT"

Image ID

marketAppId
string

Market App ID that must be installed into the instance

reference
string

An identifying name you can refer to the instance

contractType
required
string (contractType)
Enum: "HOURLY" "MONTHLY"

Select HOURLY for billing based on hourly usage, else MONTHLY for billing per month usage

contractTerm
required
integer (contractTerm)
Enum: 0 1 3 6 12

Contract commitment. Used only when contract type is MONTHLY

billingFrequency
required
integer (billingFrequency)
Enum: 1 3 6 12

The billing frequency (in months) of the instance.

rootDiskSize
integer (rootDiskSize) [ 5 .. 1000 ]

The root disk's size in GB. Must be at least 5 GB for Linux and FreeBSD instances and 50 GB for Windows instances

rootDiskStorageType
required
string (rootDiskStorageType)
Enum: "LOCAL" "CENTRAL"

The root disk's storage type

sshKey
string

Public SSH key to be installed into the instance. Must be used only on Linux/FreeBSD instances

Responses

Request samples

Content type
application/json
{
  • "billingFrequency": 1,
  • "contractTerm": 0,
  • "contractType": "HOURLY",
  • "imageId": "UBUNTU_20_04_64BIT",
  • "reference": "my-webserver",
  • "region": "eu-west-3",
  • "rootDiskSize": 50,
  • "rootDiskStorageType": "CENTRAL",
  • "type": "lsw.m3.large"
}

Response samples

Content type
application/json
{
  • "autoScalingGroup": null,
  • "contract": {
    },
  • "hasPrivateNetwork": false,
  • "hasPublicIpV4": true,
  • "id": "ace712e9-a166-47f1-9065-4af0f7e7fce1",
  • "image": {
    },
  • "ips": [
    ],
  • "marketAppId": null,
  • "productType": "INSTANCE",
  • "reference": "my webserver",
  • "region": "eu-west-3",
  • "resources": {
    },
  • "rootDiskSize": 5,
  • "rootDiskStorageType": "CENTRAL",
  • "startedAt": null,
  • "state": "STOPPED",
  • "type": "lsw.m3.large"
}

Get instance list

List and filter instances

Authorizations:
X-LSW-Auth
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

ip
string <ip>
Example: ip=10.0.0.1
reference
string
Example: reference=my-webserver
id
string <uuid>
Example: id=a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
contractType
string
Enum: "HOURLY" "MONTHLY"

Select HOURLY for billing based on hourly usage, else MONTHLY for billing per month usage

contractState
string
Enum: "ACTIVE" "DELETE_SCHEDULED"
imageId
string
Enum: "ALMALINUX_8_64BIT" "ALMALINUX_9_64BIT" "ARCH_LINUX_64BIT" "CENTOS_7_64BIT" "DEBIAN_10_64BIT" "DEBIAN_11_64BIT" "DEBIAN_12_64BIT" "FREEBSD_13_64BIT" "FREEBSD_14_64BIT" "ROCKY_LINUX_8_64BIT" "ROCKY_LINUX_9_64BIT" "UBUNTU_20_04_64BIT" "UBUNTU_22_04_64BIT" "UBUNTU_24_04_64BIT" "WINDOWS_SERVER_2016_STANDARD_64BIT" "WINDOWS_SERVER_2019_STANDARD_64BIT" "WINDOWS_SERVER_2022_STANDARD_64BIT"
Example: imageId=UBUNTU_22_04_64BIT

Available Images can be obtained using /v1/images.

state
string
Enum: "CREATING" "DESTROYED" "DESTROYING" "FAILED" "RUNNING" "STARTING" "STOPPED" "STOPPING" "UNKNOWN"

The instance's current state(s), separated by commas.

region
string
Example: region=eu-west-3

Available regions can be obtained using /v1/regions

object (instanceType)
Example: type=lsw.c3.xlarge

Available instance types for your region can be obtained using /v1/instanceTypes.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/instances?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&ip=SOME_STRING_VALUE&reference=SOME_STRING_VALUE&id=SOME_STRING_VALUE&contractType=SOME_STRING_VALUE&contractState=SOME_STRING_VALUE&imageId=UBUNTU_24_04_64BIT&state=SOME_STRING_VALUE&region=SOME_STRING_VALUE&type=SOME_OBJECT_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get instance details

Get details about the instance

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "autoScalingGroup": {
    },
  • "contract": {
    },
  • "hasPrivateNetwork": false,
  • "hasPublicIpV4": true,
  • "id": "ace712e9-a166-47f1-9065-4af0f7e7fce1",
  • "image": {
    },
  • "ips": [
    ],
  • "iso": null,
  • "marketAppId": null,
  • "privateNetwork": null,
  • "productType": "INSTANCE",
  • "reference": "my webserver",
  • "region": "eu-west-3",
  • "resources": {
    },
  • "rootDiskSize": 5,
  • "rootDiskStorageType": "CENTRAL",
  • "startedAt": "2024-04-11T12:59:34+00:00",
  • "state": "STOPPED",
  • "type": "lsw.m3.large"
}

Terminate instance

Terminate Public Cloud instance

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Update instance

Update the instance's reference, type, storage or contract type.

Eligible instance types for update can be obtained using /v1/instances/{instanceId}/instanceTypesUpdate.

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Request Body schema: application/json
required
type
string (typeName)
Enum: "lsw.m3.large" "lsw.m3.xlarge" "lsw.m3.2xlarge" "lsw.m4.large" "lsw.m4.xlarge" "lsw.m4.2xlarge" "lsw.m4.4xlarge" "lsw.m5.large" "lsw.m5.xlarge" "lsw.m5.2xlarge" "lsw.m5.4xlarge" "lsw.m5a.large" "lsw.m5a.xlarge" "lsw.m5a.2xlarge" "lsw.m5a.4xlarge" "lsw.m5a.8xlarge" "lsw.m5a.12xlarge" "lsw.m6a.large" "lsw.m6a.xlarge" "lsw.m6a.2xlarge" "lsw.m6a.4xlarge" "lsw.m6a.8xlarge" "lsw.m6a.12xlarge" "lsw.m6a.16xlarge" "lsw.m6a.24xlarge" "lsw.c3.large" "lsw.c3.xlarge" "lsw.c3.2xlarge" "lsw.c3.4xlarge" "lsw.c4.large" "lsw.c4.xlarge" "lsw.c4.2xlarge" "lsw.c4.4xlarge" "lsw.c5.large" "lsw.c5.xlarge" "lsw.c5.2xlarge" "lsw.c5.4xlarge" "lsw.c5a.large" "lsw.c5a.xlarge" "lsw.c5a.2xlarge" "lsw.c5a.4xlarge" "lsw.c5a.9xlarge" "lsw.c5a.12xlarge" "lsw.c6a.large" "lsw.c6a.xlarge" "lsw.c6a.2xlarge" "lsw.c6a.4xlarge" "lsw.c6a.8xlarge" "lsw.c6a.12xlarge" "lsw.c6a.16xlarge" "lsw.c6a.24xlarge" "lsw.r3.large" "lsw.r3.xlarge" "lsw.r3.2xlarge" "lsw.r4.large" "lsw.r4.xlarge" "lsw.r4.2xlarge" "lsw.r5.large" "lsw.r5.xlarge" "lsw.r5.2xlarge" "lsw.r5a.large" "lsw.r5a.xlarge" "lsw.r5a.2xlarge" "lsw.r5a.4xlarge" "lsw.r5a.8xlarge" "lsw.r5a.12xlarge" "lsw.r6a.large" "lsw.r6a.xlarge" "lsw.r6a.2xlarge" "lsw.r6a.4xlarge" "lsw.r6a.8xlarge" "lsw.r6a.12xlarge" "lsw.r6a.16xlarge" "lsw.r6a.24xlarge"

Instance/Load balancer type

reference
string

An identifying name you can refer to the instance

contractType
string (contractType)
Enum: "HOURLY" "MONTHLY"

Select HOURLY for billing based on hourly usage, else MONTHLY for billing per month usage

contractTerm
integer (contractTerm)
Enum: 0 1 3 6 12

Contract commitment. Used only when contract type is MONTHLY

billingFrequency
integer (billingFrequency)
Enum: 1 3 6 12

The billing frequency (in months) of the instance.

rootDiskSize
integer (rootDiskSize) [ 5 .. 1000 ]

The root disk's size in GB. Must be at least 5 GB for Linux and FreeBSD instances and 50 GB for Windows instances

Responses

Request samples

Content type
application/json
Example
{
  • "reference": "new-reference"
}

Response samples

Content type
application/json
{
  • "autoScalingGroup": null,
  • "contract": {
    },
  • "hasPrivateNetwork": false,
  • "hasPublicIpV4": true,
  • "id": "ace712e9-a166-47f1-9065-4af0f7e7fce1",
  • "image": {
    },
  • "ips": [
    ],
  • "iso": null,
  • "marketAppId": null,
  • "privateNetwork": null,
  • "productType": "INSTANCE",
  • "reference": "my webserver",
  • "region": "eu-west-3",
  • "resources": {
    },
  • "rootDiskSize": 5,
  • "rootDiskStorageType": "CENTRAL",
  • "startedAt": "2024-04-09T15:11:37+00:00",
  • "state": "RUNNING",
  • "type": "lsw.m3.large"
}

Cancel instance termination

Cancel the termination process of monthly instances. Must be executed prior to the instance's contractEndsAt.

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/cancelTermination \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Get console access

Get console access to the instance

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Responses

List available instance types for update

Get available instance types for update

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

query Parameters
limit
integer >= 0
Default: 50
offset
integer >= 0
Default: 0

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/instanceTypesUpdate?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

List OSes available for reinstall

List Images available for reinstall

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/reinstall/images \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    }
]

Reinstall instance

Recreates the instance, with optionally different Image and Marketplace App.

Cannot be performed when the instance has snapshots.

Available Images can be obtained using /v1/instances/{instanceId}/reinstall/images.

Available Marketplace Apps can be obtained using /v1/images/{imageId}/marketApps.

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Request Body schema: application/json
required
imageId
required
string

The Image ID

marketAppId
string

The Market App to be installed

Responses

Request samples

Content type
application/json
{
  • "imageId": "UBUNTU_22_04_64BIT"
}

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Power

Start instance

The instance must be stopped before the execution

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/start \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Stop instance

The instance must be running before the execution

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/stop \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Reboot instance

The instance must be running before the execution

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/reboot \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Credentials

List credentials stored for instance

Get all credentials stored for the instance

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/credentials \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Store credentials

Store credential used for the instance

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Request Body schema: application/json
required
type
required
string (credentialType)
Enum: "OPERATING_SYSTEM" "CONTROL_PANEL"
username
required
string

Can contain only alphanumeric values and characters @, ., - and _

password
required
string

The password you'd like to store

Responses

Request samples

Content type
application/json
{
  • "password": "a$Ndes-3fad2-rfas@-",
  • "type": "OPERATING_SYSTEM",
  • "username": "another-user"
}

Response samples

Content type
application/json
{
  • "password": "a$Ndes-3fad2-rfas@-",
  • "type": "OPERATING_SYSTEM",
  • "username": "another-user"
}

Delete all instance credentials

Delete all credentials stored for a given instance

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/credentials \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "401",
  • "errorMessage": "You are not authorized to view this resource."
}

Get credentials by type

Get credentials stored for the instance by their types

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

type
required
string
Example: OPERATING_SYSTEM

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/credentials/OPERATING_SYSTEM \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get credentials by type and username

Get credentials by type and username

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

type
required
string
Example: OPERATING_SYSTEM

Credential type

username
required
string
Example: root

Username

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/credentials/OPERATING_SYSTEM/root \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "password": "12341234",
  • "type": "OPERATING_SYSTEM",
  • "username": "root"
}

Update credentials

Update credentials for a given type and username

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

type
required
string
Example: OPERATING_SYSTEM

Credential type

username
required
string
Example: root

Username

Request Body schema: application/json
required
password
required
string

The new password

Responses

Request samples

Content type
application/json
{
  • "password": "@-n3w-Pa$$w0rD"
}

Response samples

Content type
application/json
{
  • "password": "@-n3w-Pa$$w0rD",
  • "type": "OPERATING_SYSTEM",
  • "username": "another-user"
}

Delete credentials

Delete credential for a given type and username

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

type
required
string
Example: OPERATING_SYSTEM

Credential type

username
required
string
Example: root

Username

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/credentials/OPERATING_SYSTEM/root \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "401",
  • "errorMessage": "You are not authorized to view this resource."
}

Reset instance password

The operation may take a few moments to complete.

You can obtain the new credential using the credentials endpoints

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/resetPassword \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Expenses

Get costs for a given month.

Authorizations:
X-LSW-Auth
path Parameters
equipmentId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Equipment's UUID

query Parameters
from
required
string <date>
Example: from=2023-11-01

Start date of the period to get costs for. It must be the first day of the month

to
string <date>
Example: to=2023-12-01

End date of the period to get costs for. This date needs to be exactly one month after the 'from' date. If this value is not passed, it will be calculated based on 'from' parameter

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/equipments/695ddd91-051f-4dd6-9120-938a927a47d0/expenses?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "billing": {
    }
}

ISOs

List available ISOs

List all available ISO images

Authorizations:
X-LSW-Auth
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/isos \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Attach ISO to instance

Instance must not have ISO attached, otherwise, it will return a validation error.

Available ISOs can be obtained using /v1/isos.

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Request Body schema: application/json
required
isoId
required
string

The ISO ID, obtained using the ISO endpoints

Responses

Request samples

Content type
application/json
{
  • "isoId": "GRML"
}

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Detach ISO from instance

Instance must have ISO attached, otherwise, it will return a validation error

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/detachIso \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Images

List all available Images

Authorizations:
X-LSW-Auth
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/images \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Marketplace Apps

Get marketplace apps

Get all available marketplace apps.

Authorizations:
X-LSW-Auth

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/marketApps \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Metrics

Get instance data traffic metrics

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

query Parameters
from
string <date>

The start of the interval to get the metric

to
string <date>

The end of the interval to get the metric. Must be greater than the date provided in from

granularity
string
Value: "DAY"

How the metrics are grouped by

aggregation
string
Value: "SUM"

How the metrics are aggregated

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/metrics/datatraffic \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "_metadata": {
    },
  • "metrics": {
    }
}

Get instance CPU metrics

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

query Parameters
from
string <date>

The start of the interval to get the metric

to
string <date>

The end of the interval to get the metric. Must be greater than the date provided in from

granularity
string
Enum: "5m" "10m" "30m" "60m"

How the metrics are grouped by

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/metrics/cpu \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "_metadata": {
    },
  • "metrics": {
    }
}

Snapshots

List snapshots

List instance snapshots

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/snapshots?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Create instance snapshot

The instance 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 instance.

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/snapshots \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Get snapshot detail

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

snapshotId
required
string <uuid>

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/snapshots/%7BsnapshotId%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "created": "2023-11-02T07:31:28+0000",
  • "displayName": "snapshot 1",
  • "id": "ef73e9e2-95cd-49ef-940f-a24e6ad6c4a0",
  • "state": "READY"
}

Restore instance snapshot

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

snapshotId
required
string <uuid>

Responses

Request samples

curl --request PUT \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/snapshots/%7BsnapshotId%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Delete instance snapshot

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

snapshotId
required
string <uuid>

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/snapshots/%7BsnapshotId%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

IPs

List instance's IPs

List the instance's IPs

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

query Parameters
version
integer
Example: version=4
nullRouted
boolean
ips
string

A list of IPs separated by |

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/ips \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get details about an instance's IP

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

ip
required
string <ip>
Example: 10.0.0.1

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/ips/%7Bip%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "ip": "10.0.0.1",
  • "prefixLength": "28",
  • "version": 4,
  • "reverseLookup": "a-valid-domain.xpto",
  • "mainIp": false,
  • "networkType": "INTERNAL",
  • "nullRouted": true,
  • "ddos": {
    }
}

Update IP

Allows you to set the reverse lookup for the IP

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

ip
required
string <ip>
Example: 10.0.0.1
Request Body schema: application/json
required
reverseLookup
required
string

Responses

Request samples

Content type
application/json
{
  • "reverseLookup": "a-valid-domain.xpto"
}

Response samples

Content type
application/json
{
  • "ip": "10.0.0.1",
  • "prefixLength": "28",
  • "version": 4,
  • "reverseLookup": "a-valid-domain.xpto",
  • "mainIp": false,
  • "networkType": "INTERNAL",
  • "nullRouted": true,
  • "ddos": {
    }
}

Null route IP

Null route an IP. It may take a few minutes before the change is propagated across the network.

Only works for IPv4.

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

ip
required
string <ip>
Example: 10.0.0.1
Request Body schema: application/json
optional
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

Responses

Request samples

Content type
application/json
{
  • "automatedUnnulingAt": 2,
  • "comment": "Getting DDoS"
}

Response samples

Content type
application/json
{
  • "ip": "10.0.0.1",
  • "prefixLength": "28",
  • "version": 4,
  • "reverseLookup": "a-valid-domain.xpto",
  • "mainIp": false,
  • "networkType": "INTERNAL",
  • "nullRouted": true,
  • "ddos": {
    }
}

Remove an IP null route

Remove an IP null route. It may take a few minutes before the change is propagated across the network

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

ip
required
string <ip>
Example: 10.0.0.1

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/ips/%7Bip%7D/unnull \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "ip": "10.0.0.1",
  • "prefixLength": "28",
  • "version": 4,
  • "reverseLookup": "a-valid-domain.xpto",
  • "mainIp": false,
  • "networkType": "INTERNAL",
  • "nullRouted": true,
  • "ddos": {
    }
}

Private Networks

Add instance to Private Network

Add instance to Private Network.

Cannot be performed when the instance has snapshots.

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Responses

Request samples

curl --request PUT \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/addToPrivateNetwork \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Remove instance from Private Network

Remove instance from Private Network.

Cannot be performed when the instance has snapshots.

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Instance's ID

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/instances/695ddd91-051f-4dd6-9120-938a927a47d0/removeFromPrivateNetwork \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Load Balancer

Launch Load balancer

Launch a Load balancer.

Available regions can be obtained using /v1/regions.

Available load balancer types for your region can be obtained using /v1/loadBalancerTypes.

Authorizations:
X-LSW-Auth
Request Body schema: application/json
required
region
required
string

Region to launch the load balancer into

type
required
string (typeName)
Enum: "lsw.m3.large" "lsw.m3.xlarge" "lsw.m3.2xlarge" "lsw.m4.large" "lsw.m4.xlarge" "lsw.m4.2xlarge" "lsw.m4.4xlarge" "lsw.m5.large" "lsw.m5.xlarge" "lsw.m5.2xlarge" "lsw.m5.4xlarge" "lsw.m5a.large" "lsw.m5a.xlarge" "lsw.m5a.2xlarge" "lsw.m5a.4xlarge" "lsw.m5a.8xlarge" "lsw.m5a.12xlarge" "lsw.m6a.large" "lsw.m6a.xlarge" "lsw.m6a.2xlarge" "lsw.m6a.4xlarge" "lsw.m6a.8xlarge" "lsw.m6a.12xlarge" "lsw.m6a.16xlarge" "lsw.m6a.24xlarge" "lsw.c3.large" "lsw.c3.xlarge" "lsw.c3.2xlarge" "lsw.c3.4xlarge" "lsw.c4.large" "lsw.c4.xlarge" "lsw.c4.2xlarge" "lsw.c4.4xlarge" "lsw.c5.large" "lsw.c5.xlarge" "lsw.c5.2xlarge" "lsw.c5.4xlarge" "lsw.c5a.large" "lsw.c5a.xlarge" "lsw.c5a.2xlarge" "lsw.c5a.4xlarge" "lsw.c5a.9xlarge" "lsw.c5a.12xlarge" "lsw.c6a.large" "lsw.c6a.xlarge" "lsw.c6a.2xlarge" "lsw.c6a.4xlarge" "lsw.c6a.8xlarge" "lsw.c6a.12xlarge" "lsw.c6a.16xlarge" "lsw.c6a.24xlarge" "lsw.r3.large" "lsw.r3.xlarge" "lsw.r3.2xlarge" "lsw.r4.large" "lsw.r4.xlarge" "lsw.r4.2xlarge" "lsw.r5.large" "lsw.r5.xlarge" "lsw.r5.2xlarge" "lsw.r5a.large" "lsw.r5a.xlarge" "lsw.r5a.2xlarge" "lsw.r5a.4xlarge" "lsw.r5a.8xlarge" "lsw.r5a.12xlarge" "lsw.r6a.large" "lsw.r6a.xlarge" "lsw.r6a.2xlarge" "lsw.r6a.4xlarge" "lsw.r6a.8xlarge" "lsw.r6a.12xlarge" "lsw.r6a.16xlarge" "lsw.r6a.24xlarge"

Instance/Load balancer type

reference
string

An identifying name you can refer to the load balancer

contractType
required
string
Enum: "HOURLY" "MONTHLY"

The contract applicable for the load balancer

billingFrequency
required
integer
Enum: 1 3 6 12

How often you wish to be charged. Used only when contract type is MONTHLY. '1' means every month, '3' every three months and so on.

rootDiskStorageType
required
string (rootDiskStorageType)
Enum: "LOCAL" "CENTRAL"

The root disk's storage type

targetPort
required
integer

The port that the registered instances listen to

Responses

Request samples

Content type
application/json
{
  • "billingFrequency": 1,
  • "contractType": "HOURLY",
  • "reference": "my-loadbalancer-1",
  • "region": "eu-west-3",
  • "rootDiskStorageType": "CENTRAL",
  • "targetPort": 443,
  • "type": "lsw.m3.large"
}

Response samples

Content type
application/json
{
  • "privateNetwork": null,
  • "id": "32082a93-d1e2-4bc0-8f5e-8fe4312b0844",
  • "type": "lsw.m3.large",
  • "resources": {
    },
  • "autoScalingGroup": null,
  • "region": "eu-west-3",
  • "reference": "my-loadbalancer1",
  • "state": "RUNNING",
  • "ips": [
    ],
  • "startedAt": "2024-04-09T15:11:37+00:00",
  • "contract": {
    },
  • "configuration": {
    }
}

Get load balancer list

List and filter load balancers

Authorizations:
X-LSW-Auth
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

ip
string <ip>
Example: ip=10.0.0.1
reference
string
Example: reference=my-lb
id
string <uuid>
Example: id=a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
contractState
string
Enum: "ACTIVE" "DELETE_SCHEDULED"
contractType
string
Enum: "HOURLY" "MONTHLY"
Example: contractType=HOURLY
state
string
Enum: "RUNNING" "STARTING" "STOPPED" "STOPPING" "CREATING" "DESTROYED" "DESTROYING"
Example: state=RUNNING
region
string
Example: region=eu-west-3

Available regions can be found using the List Regions endpoint.

type
string
Example: type=lsw.c3.xlarge

Available load balancer types can be found using the List Load Balancer Types endpoint.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/loadBalancers?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&ip=SOME_STRING_VALUE&reference=SOME_STRING_VALUE&id=SOME_STRING_VALUE&contractState=SOME_STRING_VALUE&contractType=SOME_STRING_VALUE&state=SOME_STRING_VALUE&region=SOME_STRING_VALUE&type=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get load balancer details

Get details about the load balancer

Authorizations:
X-LSW-Auth
path Parameters
loadBalancerId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Load balancer ID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "privateNetwork": null,
  • "id": "32082a93-d1e2-4bc0-8f5e-8fe4312b0844",
  • "type": "lsw.m3.large",
  • "resources": {
    },
  • "autoScalingGroup": null,
  • "region": "eu-west-3",
  • "reference": "my-loadbalancer1",
  • "state": "RUNNING",
  • "ips": [
    ],
  • "startedAt": "2024-04-09T15:11:37+00:00",
  • "contract": {
    },
  • "configuration": {
    }
}

Delete load balancer

Terminate a Load balancer

Authorizations:
X-LSW-Auth
path Parameters
loadBalancerId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Load balancer ID

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

Update load balancer

Update load balancer configurations

Authorizations:
X-LSW-Auth
path Parameters
loadBalancerId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Load balancer ID

Request Body schema: application/json
required
type
string (typeName)
Enum: "lsw.m3.large" "lsw.m3.xlarge" "lsw.m3.2xlarge" "lsw.m4.large" "lsw.m4.xlarge" "lsw.m4.2xlarge" "lsw.m4.4xlarge" "lsw.m5.large" "lsw.m5.xlarge" "lsw.m5.2xlarge" "lsw.m5.4xlarge" "lsw.m5a.large" "lsw.m5a.xlarge" "lsw.m5a.2xlarge" "lsw.m5a.4xlarge" "lsw.m5a.8xlarge" "lsw.m5a.12xlarge" "lsw.m6a.large" "lsw.m6a.xlarge" "lsw.m6a.2xlarge" "lsw.m6a.4xlarge" "lsw.m6a.8xlarge" "lsw.m6a.12xlarge" "lsw.m6a.16xlarge" "lsw.m6a.24xlarge" "lsw.c3.large" "lsw.c3.xlarge" "lsw.c3.2xlarge" "lsw.c3.4xlarge" "lsw.c4.large" "lsw.c4.xlarge" "lsw.c4.2xlarge" "lsw.c4.4xlarge" "lsw.c5.large" "lsw.c5.xlarge" "lsw.c5.2xlarge" "lsw.c5.4xlarge" "lsw.c5a.large" "lsw.c5a.xlarge" "lsw.c5a.2xlarge" "lsw.c5a.4xlarge" "lsw.c5a.9xlarge" "lsw.c5a.12xlarge" "lsw.c6a.large" "lsw.c6a.xlarge" "lsw.c6a.2xlarge" "lsw.c6a.4xlarge" "lsw.c6a.8xlarge" "lsw.c6a.12xlarge" "lsw.c6a.16xlarge" "lsw.c6a.24xlarge" "lsw.r3.large" "lsw.r3.xlarge" "lsw.r3.2xlarge" "lsw.r4.large" "lsw.r4.xlarge" "lsw.r4.2xlarge" "lsw.r5.large" "lsw.r5.xlarge" "lsw.r5.2xlarge" "lsw.r5a.large" "lsw.r5a.xlarge" "lsw.r5a.2xlarge" "lsw.r5a.4xlarge" "lsw.r5a.8xlarge" "lsw.r5a.12xlarge" "lsw.r6a.large" "lsw.r6a.xlarge" "lsw.r6a.2xlarge" "lsw.r6a.4xlarge" "lsw.r6a.8xlarge" "lsw.r6a.12xlarge" "lsw.r6a.16xlarge" "lsw.r6a.24xlarge"

Instance/Load balancer type

reference
string

An identifying name you can refer to the load balancer

contractType
string (contractType)
Enum: "HOURLY" "MONTHLY"

Select HOURLY for billing based on hourly usage, else MONTHLY for billing per month usage

object or null (stickySession)
balance
string (balance)
Enum: "roundrobin" "leastconn" "source"

Algorithm to be used for load balancer

object or null (healthCheck)
xForwardedFor
boolean

Is xForwardedFor enabled or not

idleTimeOut
integer

Time to close the connection if load balancer is idle

targetPort
integer

Port on which the backend (target) servers are listening to handle incoming requests

Responses

Request samples

Content type
application/json
{
  • "balance": "roundrobin",
  • "contractType": "HOURLY",
  • "idleTimeOut": 60,
  • "reference": "foo",
  • "targetPort": 9000,
  • "type": "lsw.m3.xlarge",
  • "xForwardedFor": false
}

Response samples

Content type
application/json
{
  • "privateNetwork": null,
  • "id": "32082a93-d1e2-4bc0-8f5e-8fe4312b0844",
  • "type": "lsw.m3.large",
  • "resources": {
    },
  • "autoScalingGroup": null,
  • "region": "eu-west-3",
  • "reference": "my-loadbalancer1",
  • "state": "RUNNING",
  • "ips": [
    ],
  • "startedAt": "2024-04-09T15:11:37+00:00",
  • "contract": {
    },
  • "configuration": {
    }
}

Create listener

Create listener

Authorizations:
X-LSW-Auth
path Parameters
loadBalancerId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Load balancer ID

Request Body schema: application/json
required
protocol
required
string
Enum: "HTTPS" "HTTP" "TCP"
port
required
integer

Port that the listener listens to

object (certificate)

Responses

Request samples

Content type
application/json
{
  • "protocol": "HTTPS",
  • "port": 443,
  • "certificate": {
    }
}

Response samples

Content type
application/json
{
  • "protocol": "HTTPS",
  • "port": 443,
  • "id": "fac06878-6655-4956-8ea7-124a97f133ab"
}

Get listener details

Get details about a listener

Authorizations:
X-LSW-Auth
path Parameters
loadBalancerId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Load balancer ID

listenerId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Listener ID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/listeners/695ddd91-051f-4dd6-9120-938a927a47d0 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "protocol": "HTTPS",
  • "port": 443,
  • "id": "fac06878-6655-4956-8ea7-124a97f133ab"
}

Update a listener

Authorizations:
X-LSW-Auth
path Parameters
loadBalancerId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Load balancer ID

listenerId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Listener ID

Request Body schema: application/json
required
protocol
required
string
Enum: "HTTPS" "HTTP" "TCP"
port
required
integer

Port that the listener listens to

object (certificate)

Responses

Request samples

Content type
application/json
{
  • "protocol": "HTTPS",
  • "port": 443,
  • "certificate": {
    }
}

Response samples

Content type
application/json
{
  • "protocol": "HTTPS",
  • "port": 443,
  • "id": "fac06878-6655-4956-8ea7-124a97f133ab"
}

Delete load balancer listener

Delete a listener

Authorizations:
X-LSW-Auth
path Parameters
loadBalancerId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Load balancer ID

listenerId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Listener ID

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/listeners/695ddd91-051f-4dd6-9120-938a927a47d0 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "The API could not interpret your request correctly."
}

List registered targets

List targets registered in a load balancer.

Authorizations:
X-LSW-Auth
path Parameters
loadBalancerId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Load balancer ID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/targets \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Register targets

Register targets in a load balancer. Instances must be running and have private network enabled so they can be registered.

Authorizations:
X-LSW-Auth
path Parameters
loadBalancerId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Load balancer ID

Request Body schema: application/json
required
Array of objects (loadBalancerTargetOpt)

Responses

Request samples

Content type
application/json
{
  • "targets": [
    ]
}

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",