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 (regionName)
Enum: "eu-west-3" "us-east-1" "eu-central-1" "ap-southeast-1" "us-west-1" "eu-west-2" "ca-central-1"
Example: region=eu-west-3

region name

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
{
  • "instanceTypes": [
    ],
  • "_metadata": {
    }
}

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 (regionName)
Enum: "eu-west-3" "us-east-1" "eu-central-1" "ap-southeast-1" "us-west-1" "eu-west-2" "ca-central-1"

region name

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)

imageId can be either an Operating System or a UUID in case of a Custom Image

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 (storageType)
Enum: "LOCAL" "CENTRAL"

Storage type

sshKey
string

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

userData
string

User data to be installed into the instance. Please note that this setting cannot be used in combination with the 'sshKey' setting. Send the user data as plain text, not encoded as base64.

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",
  • "userData": "#cloud-config\n# vim: syntax=yaml\n#\n# This is the configuration syntax that the write_files module\n# will know how to understand. Encoding can be given b64 or gzip or (gz+b64).\n# The content will be decoded accordingly and then written to the path that is\n# provided. \n#\n# Note: Content strings here are truncated for example purposes.\nwrite_files:\n- encoding: b64\n content: TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3Rll1cyBtYXhpbXVzLg==\n owner: root:root\n path: /tmp/3.txt\n permissions: '0644'\n"
}

Response samples

Content type
application/json
{
  • "autoScalingGroup": null,
  • "contract": {
    },
  • "hasPrivateNetwork": false,
  • "hasPublicIpV4": true,
  • "hasUserData": 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 (imageId)
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 (regionName)
Enum: "eu-west-3" "us-east-1" "eu-central-1" "ap-southeast-1" "us-west-1" "eu-west-2" "ca-central-1"
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_22_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": null,
  • "contract": {
    },
  • "hasPrivateNetwork": false,
  • "hasPublicIpV4": true,
  • "hasUserData": false,
  • "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"
}

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,
  • "hasUserData": false,
  • "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
{
  • "instanceTypes": [
    ],
  • "_metadata": {
    }
}

List images 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

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.

custom
boolean

Filters the list to include only custom images.

standard
boolean
Example: standard=true

Filters the list to include only standard images.

Responses

Request samples

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

Response samples

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

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.

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.

Responses

Request samples

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&region=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Create Custom Image

Create a Custom Image

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

The name of the custom image to be created.

instanceId
required
string

The id of the instance from which the custom image will be created.

Responses

Request samples

Content type
application/json
{
  • "name": "New custom image",
  • "instanceId": "695ddd91-051f-4dd6-9120-938a927a47d0"
}

Response samples

Content type
application/json
{
  • "architecture": null,
  • "createdAt": "2024-07-05T10:54:27+00:00",
  • "custom": true,
  • "family": "linux",
  • "flavour": "ubuntu",
  • "id": "396a3299-1795-464b-aa10-e1f179db1926",
  • "marketApps": [ ],
  • "minDiskSize": null,
  • "name": "Custom image",
  • "region": "eu-west-3",
  • "state": "READY",
  • "stateReason": null,
  • "storageSize": {
    },
  • "storageTypes": [ ],
  • "updatedAt": "2024-07-17T13:14:01+00:00",
  • "version": null
}

Update Custom Image

Update a Custom Image

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

Image's ID

Request Body schema: application/json
required
name
required
string

The name of the custom image to be updated.

Responses

Request samples

Content type
application/json
{
  • "name": "Custom image"
}

Response samples

Content type
application/json
{
  • "architecture": null,
  • "createdAt": "2024-07-05T10:54:27+00:00",
  • "custom": true,
  • "family": "linux",
  • "flavour": "ubuntu",
  • "id": "396a3299-1795-464b-aa10-e1f179db1926",
  • "marketApps": [ ],
  • "minDiskSize": null,
  • "name": "Custom image",
  • "region": "eu-west-3",
  • "state": "READY",
  • "stateReason": null,
  • "storageSize": {
    },
  • "storageTypes": [ ],
  • "updatedAt": "2024-07-17T13:14:01+00:00",
  • "version": null
}

Target Groups

Get Target Group list

List and filter Target Groups

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.

id
string <uuid>
Example: id=a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
name
string
Example: name=Foo bar
protocol
string
Enum: "HTTP" "HTTPS" "TCP"
Example: protocol=HTTP
port
integer
Example: port=80
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"

region name

Responses

Request samples

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

Response samples

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

Create Target Group

Create a Target Group

Authorizations:
X-LSW-Auth
Request Body schema: application/json
required
id
required
string <uuid>
name
required
string

The name of the target group

protocol
required
string (protocol)
Enum: "HTTP" "HTTPS" "TCP"
port
required
integer

The port of the target group

region
required
string (regionName)
Enum: "eu-west-3" "us-east-1" "eu-central-1" "ap-southeast-1" "us-west-1" "eu-west-2" "ca-central-1"

region name

required
object or null (healthCheck)

Responses

Request samples

Content type
application/json
{
  • "id": "7e59b33d-05f3-4078-b251-c7831ae8fe14",
  • "name": "Target group name",
  • "protocol": "HTTP",
  • "port": 80,
  • "region": "eu-west-2",
  • "healthCheck": {
    }
}

Response samples

Content type
application/json
{
  • "id": "7e59b33d-05f3-4078-b251-c7831ae8fe14",
  • "name": "Target group name",
  • "protocol": "HTTP",
  • "port": 80,
  • "region": "eu-west-2",
  • "healthCheck": {
    }
}

Get Target Group details

Get Target Group details.

Authorizations:
X-LSW-Auth
path Parameters
targetGroupId
required
string <uuid>
Example: fb769dab-3daa-47e4-89ed-06a4b6499176

Target Group ID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/targetGroups/fb769dab-3daa-47e4-89ed-06a4b6499176 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "id": "7e59b33d-05f3-4078-b251-c7831ae8fe14",
  • "name": "Target group name",
  • "protocol": "HTTP",
  • "port": 80,
  • "region": "eu-west-2",
  • "healthCheck": {
    }
}

Update Target Group

Update a Target Group

Authorizations:
X-LSW-Auth
path Parameters
targetGroupId
required
string <uuid>
Example: fb769dab-3daa-47e4-89ed-06a4b6499176

Target Group ID

Request Body schema: application/json
required
id
required
string <uuid>
name
required
string

The name of the target group

protocol
required
string (protocol)
Enum: "HTTP" "HTTPS" "TCP"
port
required
integer

The port of the target group

region
required
string (regionName)
Enum: "eu-west-3" "us-east-1" "eu-central-1" "ap-southeast-1" "us-west-1" "eu-west-2" "ca-central-1"

region name

required
object or null (healthCheck)

Responses

Request samples

Content type
application/json
{
  • "id": "7e59b33d-05f3-4078-b251-c7831ae8fe14",
  • "name": "Target group name",
  • "protocol": "HTTP",
  • "port": 80,
  • "region": "eu-west-2",
  • "healthCheck": {
    }
}

Response samples

Content type
application/json
{
  • "id": "7e59b33d-05f3-4078-b251-c7831ae8fe14",
  • "name": "Target group name",
  • "protocol": "HTTP",
  • "port": 80,
  • "region": "eu-west-2",
  • "healthCheck": {
    }
}

Delete Target Group

Delete a Target Group.

Authorizations:
X-LSW-Auth
path Parameters
targetGroupId
required
string <uuid>
Example: fb769dab-3daa-47e4-89ed-06a4b6499176

Target Group ID

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/targetGroups/fb769dab-3daa-47e4-89ed-06a4b6499176 \
  --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 Targets

Get targets in a Target Group

Authorizations:
X-LSW-Auth
path Parameters
targetGroupId
required
string <uuid>
Example: fb769dab-3daa-47e4-89ed-06a4b6499176

Target Group 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/targetGroups/fb769dab-3daa-47e4-89ed-06a4b6499176/targets \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Register Targets

Register Targets in a Target Group

Authorizations:
X-LSW-Auth
path Parameters
targetGroupId
required
string <uuid>
Example: fb769dab-3daa-47e4-89ed-06a4b6499176

Target Group ID

Request Body schema: application/json
required
Array
string <uuid>

Responses

Request samples

Content type
application/json
[
  • "695ddd91-051f-4dd6-9120-938a927a47d0"
]

Response samples

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

Deregister Targets

Deregister Targets in a Target Group

Authorizations:
X-LSW-Auth
path Parameters
targetGroupId
required
string <uuid>
Example: fb769dab-3daa-47e4-89ed-06a4b6499176

Target Group ID

Request Body schema: application/json
required
Array
string <uuid>

Responses

Request samples

Content type
application/json
[
  • "695ddd91-051f-4dd6-9120-938a927a47d0"
]

Response samples

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

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 (metricsGranularity)
Enum: "5m" "10m" "30m" "60m" "DAY"

The interval for each metric

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": {
    }
}

Get load balancer requests metrics

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

Load balancer 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 (metricsGranularity)
Enum: "5m" "10m" "30m" "60m" "DAY"

The interval for each metric

Responses

Request samples

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

Response samples

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

Get load balancer requests per second metrics

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

Load balancer 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 (metricsGranularity)
Enum: "5m" "10m" "30m" "60m" "DAY"

The interval for each metric

Responses

Request samples

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

Response samples

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

Get load balancer data transferred metrics

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

Load balancer 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 (metricsGranularity)
Enum: "5m" "10m" "30m" "60m" "DAY"

The interval for each metric

Responses

Request samples

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

Response samples

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

Get load balancer data transferred per second metrics

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

Load balancer 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 (metricsGranularity)
Enum: "5m" "10m" "30m" "60m" "DAY"

The interval for each metric

Responses

Request samples

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

Response samples

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

Get connections metrics

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

Load balancer 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" "1h" "1d" "1w"

The interval for each metric

Responses

Request samples

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

Response samples

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

Get connections per second metrics

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

Load balancer 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" "1h" "1d" "1w"

The interval for each metric

Responses

Request samples

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

Response samples

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

Get response codes metrics

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

Load balancer 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" "1h" "1d" "1w"

The interval for each metric

Responses

Request samples

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

Response samples

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

Get response codes per second metrics

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

Load balancer 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" "1h" "1d" "1w"

The interval for each metric

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/metrics/responseCodesPerSecond \
  --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 (regionName)
Enum: "eu-west-3" "us-east-1" "eu-central-1" "ap-southeast-1" "us-west-1" "eu-west-2" "ca-central-1"

region name

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 (storageType)
Enum: "LOCAL" "CENTRAL"

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 (regionName)
Enum: "eu-west-3" "us-east-1" "eu-central-1" "ap-southeast-1" "us-west-1" "eu-west-2" "ca-central-1"
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

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": {
    }
}

Get listener list

List listeners

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

Load balancer 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/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/listeners?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

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

required
object (certificate)
required
object or null (listenerDefaultRule)

Responses

Request samples

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

Response samples

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

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",
  • "rules": [
    ],
  • "sslCertificates": [
    ]
}

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 or null
Enum: "HTTPS" "HTTP" "TCP"
port
required
integer or null

Port that the listener listens to

required
object or null (certificate)
required
object or null (listenerDefaultRule)

Responses

Request samples

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

Response samples

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

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."
}

Auto Scaling Groups

Create Auto Scaling Group

Create an Auto Scaling Group.

Authorizations:
X-LSW-Auth
Request Body schema: application/json
required
desiredAmount
integer >= 1

Required for "MANUAL" and "SCHEDULED" auto scaling group. Number of instances to be launched

minimumAmount
integer >= 1

Required for "CPU_BASED". The minimum number of instances that should be running

maximumAmount
integer >= 1

Required for "CPU_BASED" auto scaling group. The maximum number of instances that can be running

cpuThreshold
integer [ 1 .. 100 ]

Required for "CPU_BASED" auto scaling group. The target average CPU utilization for scaling

warmupTime
integer [ 60 .. 900 ]

Required for "CPU_BASED" auto scaling group. Warm-up time in seconds for new instances

cooldownTime
integer [ 300 .. 900 ]

Required for "CPU_BASED" auto scaling group. Cool-down time in seconds for new instances

instanceId
required
string <uuid>

The instance on which instances will be based on. This instance needs to be either Running or Stopped

reference
required
string <= 255 characters

The identifying name set to the auto scaling group

type
required
string
Enum: "MANUAL" "SCHEDULED" "CPU_BASED"
startsAt
string <date-time>

Required for "SCHEDULED" auto scaling group. Date and time (UTC) that the instances need to be launched

endsAt
string <date-time>

Required for "SCHEDULED" auto scaling group. Date and time (UTC) that the instances need to be terminated

Responses

Request samples

Content type
application/json
Example
{
  • "reference": "Manual scaling",
  • "type": "MANUAL",
  • "desiredAmount": 2,
  • "instanceId": "6762182e-7ae9-4d0b-b3b7-bea5a49b3f94"
}

Response samples

Content type
application/json
{
  • "cooldownTime": null,
  • "cpuThreshold": null,
  • "createdAt": "2024-05-28T11:03:31+00:00",
  • "desiredAmount": 2,
  • "endsAt": null,
  • "id": "4c3e9d29-9232-48af-93a7-7ec42b8c0f6d",
  • "maximumAmount": null,
  • "minimumAmount": null,
  • "reference": "Manual Auto Scaling Group",
  • "region": "eu-west-3",
  • "startsAt": null,
  • "state": "CREATING",
  • "targetGroups": [ ],
  • "type": "MANUAL",
  • "updatedAt": "2024-05-28T11:03:31+00:00",
  • "warmupTime": null
}

Get Auto Scaling Group list

List and filter Auto Scaling Groups

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.

id
string <uuid>
Example: id=a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
instanceId
string <uuid>
Example: instanceId=6762182e-7ae9-4d0b-b3b7-bea5a49b3f94
type
string
Enum: "MANUAL" "SCHEDULED" "CPU_BASED"

The Auto Scaling Group's 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"
Example: region=eu-west-3

The region in which the Auto Scaling Group was created

reference
string

The reference used to identify identifies the Auto Scaling Group

state
string
Enum: "ACTIVE" "CREATING" "CREATED" "DESTROYED" "DESTROYING" "SCALING" "UPDATING"

The Auto Scaling Group's current state

Responses

Request samples

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

Response samples

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

Delete Auto Scaling Group

Delete an Auto Scaling Group.

Authorizations:
X-LSW-Auth
path Parameters
autoScalingGroupId
required
string <uuid>
Example: fb769dab-3daa-47e4-89ed-06a4b6499176

Auto Scaling Group ID

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/autoScalingGroups/fb769dab-3daa-47e4-89ed-06a4b6499176 \
  --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 Auto Scaling Group

Update an Auto Scaling Group.

Authorizations:
X-LSW-Auth
path Parameters
autoScalingGroupId
required
string <uuid>
Example: fb769dab-3daa-47e4-89ed-06a4b6499176

Auto Scaling Group ID

Request Body schema: application/json
required
desiredAmount
integer >= 1

When "SCHEDULED", the number of instances that need to be running at the specified date and time.
When "MANUAL", the number of instances that to be launched immediately.

minimumAmount
integer >= 1

The minimum number of instances that should be running

maximumAmount
integer >= 1

Only for "CPU_BASED" auto scaling group. The maximum number of instances that can be running

cpuThreshold
integer [ 1 .. 100 ]

Only for "CPU_BASED" auto scaling group. The target average CPU utilization for scaling

warmupTime
integer [ 60 .. 900 ]

Only for "CPU_BASED" auto scaling group. Warm-up time in seconds for new instances

cooldownTime
integer [ 300 .. 900 ]

Only for "CPU_BASED" auto scaling group. Cool-down time in seconds for new instances

reference
string <= 255 characters

The identifying name set to the auto scaling group

startsAt
string <date-time>

Only for "SCHEDULED" auto scaling group. Date and time (UTC) that the instances need to be launched. Must be changed along with "endsAt"

endsAt
string <date-time>

Only for "SCHEDULED" auto scaling group. Date and time (UTC) that the instances need to be terminated. Must be changed along with "startsAt"

Responses

Request samples

Content type
application/json
Example
{
  • "reference": "Changed reference",
  • "desiredAmount": 4
}

Response samples

Content type
application/json
{
  • "cooldownTime": null,
  • "cpuThreshold": null,
  • "createdAt": "2024-04-26T09:22:25+00:00",
  • "desiredAmount": 2,
  • "endsAt": null,
  • "id": "fb769dab-3daa-47e4-89ed-06a4b6499176",
  • "maximumAmount": null,
  • "minimumAmount": null,
  • "reference": "Manual Auto Scaling Group",
  • "region": "eu-west-3",
  • "startsAt": null,
  • "state": "ACTIVE",
  • "targetGroups": [
    ],
  • "type": "MANUAL",
  • "updatedAt": "2024-04-26T09:22:25+00:00",
  • "warmupTime": null
}

Get Auto Scaling Group details

Get details about Auto Scaling Group.

Authorizations:
X-LSW-Auth
path Parameters
autoScalingGroupId
required
string <uuid>
Example: fb769dab-3daa-47e4-89ed-06a4b6499176

Auto Scaling Group ID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/autoScalingGroups/fb769dab-3daa-47e4-89ed-06a4b6499176 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "cooldownTime": null,
  • "cpuThreshold": null,
  • "createdAt": "2024-04-26T09:22:25+00:00",
  • "desiredAmount": 2,
  • "endsAt": null,
  • "id": "fb769dab-3daa-47e4-89ed-06a4b6499176",
  • "maximumAmount": null,
  • "minimumAmount": null,
  • "reference": "Manual Auto Scaling Group",
  • "region": "eu-west-3",
  • "startsAt": null,
  • "state": "ACTIVE",
  • "targetGroups": [
    ],
  • "type": "MANUAL",
  • "updatedAt": "2024-04-26T09:22:25+00:00",
  • "warmupTime": null
}

Get list of instances belonging to an Auto Scaling Group

List instances belonging to an Auto Scaling Group

Authorizations:
X-LSW-Auth
path Parameters
autoScalingGroupId
required
string <uuid>
Example: fb769dab-3daa-47e4-89ed-06a4b6499176

Auto Scaling Group 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/autoScalingGroups/fb769dab-3daa-47e4-89ed-06a4b6499176/instances?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Register Target Group

Associates an auto scaling group with a target group.

Authorizations:
X-LSW-Auth
path Parameters
autoScalingGroupId
required
string <uuid>
Example: fb769dab-3daa-47e4-89ed-06a4b6499176

Auto Scaling Group ID

Request Body schema: application/json
required
targetGroupId
required
string <uuid>

The target group unique identifier

Responses

Request samples

Content type
application/json
{
  • "targetGroupId": "b05917e1-96a4-442a-900c-c41f273d95c9"
}

Response samples

Content type
application/json
{
  • "cooldownTime": null,
  • "cpuThreshold": null,
  • "createdAt": "2024-04-26T09:22:25+00:00",
  • "desiredAmount": 2,
  • "endsAt": null,
  • "id": "fb769dab-3daa-47e4-89ed-06a4b6499176",
  • "maximumAmount": null,
  • "minimumAmount": null,
  • "reference": "Manual Auto Scaling Group",
  • "region": "eu-west-3",
  • "startsAt": null,
  • "state": "ACTIVE",
  • "targetGroups": [
    ],
  • "type": "MANUAL",
  • "updatedAt": "2024-04-26T09:22:25+00:00",
  • "warmupTime": null
}

Deregister Target Group

Disassociate a target group from an Auto Scaling Group

Authorizations:
X-LSW-Auth
path Parameters
autoScalingGroupId
required
string <uuid>
Example: fb769dab-3daa-47e4-89ed-06a4b6499176

Auto Scaling Group ID

Request Body schema: application/json
required
targetGroupId
required
string <uuid>

The target group unique identifier

Responses

Request samples

Content type
application/json
{
  • "targetGroupId": "b05917e1-96a4-442a-900c-c41f273d95c9"
}

Response samples

Content type
application/json
{
  • "cooldownTime": null,
  • "cpuThreshold": null,
  • "createdAt": "2024-04-26T09:22:25+00:00",
  • "desiredAmount": 2,
  • "endsAt": null,
  • "id": "fb769dab-3daa-47e4-89ed-06a4b6499176",
  • "maximumAmount": null,
  • "minimumAmount": null,
  • "reference": "Manual Auto Scaling Group",
  • "region": "eu-west-3",
  • "startsAt": null,
  • "state": "ACTIVE",
  • "targetGroups": [
    ],
  • "type": "MANUAL",
  • "updatedAt": "2024-04-26T09:22:25+00:00",
  • "warmupTime": null
}