leaseweb
API Documentation
Developer API

Developer API

This API provides ways to manage the Leaseweb infrastructure.

The Leaseweb API offers comprehensive tools to effectively manage and interact with the Leaseweb infrastructure. It enables users to automate infrastructure-related tasks, such as provisioning, monitoring, and scaling resources. With its robust functionality, this API simplifies infrastructure management, enhances operational efficiency, and supports seamless integration into your existing workflows.

Error

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

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

Authentication

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.

Public Clouds

BETA

Leaseweb Public Cloud is a cloud computing service that provides virtualized infrastructure, allowing businesses and developers to deploy and manage cloud-based resources efficiently. It is designed to offer scalability, flexibility, and high performance at a competitive price.

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?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

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" "ap-northeast-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=eu-west-3&limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

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" "ap-northeast-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": "RUNNING",
  • "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" "ap-northeast-1"
Example: region=eu-west-3

Available regions can be obtained using /v1/regions

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"
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=20&offset=10&ip=10.0.0.1&reference=my-webserver&id=a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11&contractType=SOME_STRING_VALUE&contractState=SOME_STRING_VALUE&imageId=UBUNTU_22_04_64BIT&state=SOME_STRING_VALUE&region=eu-west-3&type=lsw.c3.xlarge' \
  --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: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1 \
  --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": {
    },
  • "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: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1 \
  --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: ace712e9-a166-47f1-9065-4af0f7e7fce1

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": {
    },
  • "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: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/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."
}

Start a specific resource Instance

The Instance must be stopped before the execution

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/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."
}

Start a specific resource Load Balancer

The Load Balancer must be stopped before the execution

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

Load balancer ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/loadBalancers/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 a specific Instance

The Instance must be running before the execution

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/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."
}

Stop a specific Load Balancer

The Load Balancer must be running before the execution

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

Load balancer ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/loadBalancers/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 a specific Instance

The Instance must be running before the execution

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/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."
}

Reboot a specific Load Balancer

The Load Balancer must be running before the execution

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

Load balancer ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/loadBalancers/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."
}

Get console access

Get console access to the instance

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/console \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

List available instance types for update

Get available instance types for update

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

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/ace712e9-a166-47f1-9065-4af0f7e7fce1/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 credentials stored for a specific Instance

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/credentials \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Store credentials for a specific Instance

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

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": "12341234",
  • "type": "OPERATING_SYSTEM",
  • "username": "root"
}

Response samples

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

Delete all credentials associated with a specific Instance

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/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 for a specific Instance

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

type
required
string (credentialType)
Enum: "OPERATING_SYSTEM" "CONTROL_PANEL"

Type of credential

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/credentials/%7Btype%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get Instance credentials by type and username.

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

type
required
string (credentialType)
Enum: "OPERATING_SYSTEM" "CONTROL_PANEL"

Type of credential

username
required
string
Example: root

Username

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/credentials/%7Btype%7D/root \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Update credentials for a given type and username

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

type
required
string (credentialType)
Enum: "OPERATING_SYSTEM" "CONTROL_PANEL"

Type of credential

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

Response samples

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

Delete Instance credential for a given type and username

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

type
required
string (credentialType)
Enum: "OPERATING_SYSTEM" "CONTROL_PANEL"

Type of credential

username
required
string
Example: root

Username

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/credentials/%7Btype%7D/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 the password for a specific Instance

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: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/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."
}

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=2023-11-01&to=2023-12-01' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

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?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

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=20&offset=10&custom=SOME_BOOLEAN_VALUE&standard=true&state=SOME_STRING_VALUE&marketAppId=SOME_STRING_VALUE&storageType=SOME_STRING_VALUE&name=Ubuntu%2020.04%20LTS%20(x86_64)&flavour=SOME_STRING_VALUE&region=eu-west-3' \
  --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": "ace712e9-a166-47f1-9065-4af0f7e7fce1",
  • "marketApps": [ ],
  • "minDiskSize": null,
  • "name": "Custom image - 03",
  • "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": "ace712e9-a166-47f1-9065-4af0f7e7fce1",
  • "marketApps": [ ],
  • "minDiskSize": null,
  • "name": "Custom image - 03",
  • "region": "eu-west-3",
  • "state": "READY",
  • "stateReason": null,
  • "storageSize": {
    },
  • "storageTypes": [ ],
  • "updatedAt": "2024-07-17T13:14:01+00:00",
  • "version": null
}

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": [
    ]
}

Attach ISO to a specific 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: ace712e9-a166-47f1-9065-4af0f7e7fce1

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 a specific Instance

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

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/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."
}

List images available for reinstall

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

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/ace712e9-a166-47f1-9065-4af0f7e7fce1/reinstall/images?limit=20&offset=10&custom=SOME_BOOLEAN_VALUE&standard=true' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Reinstall an 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/{resource}/{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: ace712e9-a166-47f1-9065-4af0f7e7fce1

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

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" "ap-northeast-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 (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.

Responses

Request samples

Content type
application/json
{
  • "billingFrequency": 1,
  • "contractTerm": 0,
  • "contractType": "HOURLY",
  • "reference": "my-loadbalancer-1",
  • "region": "eu-west-3",
  • "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" "ap-northeast-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=20&offset=10&ip=10.0.0.1&reference=my-lb&id=a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11&contractState=SOME_STRING_VALUE&contractType=HOURLY&state=RUNNING&region=eu-west-3&type=lsw.c3.xlarge' \
  --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

Responses

Request samples

Content type
application/json
{
  • "balance": "roundrobin",
  • "contractType": "HOURLY",
  • "idleTimeOut": 60,
  • "reference": "foo",
  • "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=20&offset=10' \
  --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 (protocol)
Enum: "HTTP" "HTTPS" "TCP"
port
required
integer

Port that the listener listens to

object (sslCertificate)
required
object (loadBalancerListenerDefaultRule)

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
string (protocol)
Enum: "HTTP" "HTTPS" "TCP"
port
integer

Port that the listener listens to

object (sslCertificate)
object (loadBalancerListenerDefaultRule)

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

List IP addresses associated with a specific Instance

List the Instance's IPs

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

query Parameters
version
integer
Enum: 4 6

Ip version

nullRouted
boolean
ips
string

A list of IPs separated by |

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/ips?version=SOME_INTEGER_VALUE&nullRouted=SOME_BOOLEAN_VALUE&ips=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

List IP addresses associated with a specific Load Balancer

List the Load Balancers IPs

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

Load balancer ID

query Parameters
version
integer
Enum: 4 6

Ip version

nullRouted
boolean
ips
string

A list of IPs separated by |

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/ips?version=SOME_INTEGER_VALUE&nullRouted=SOME_BOOLEAN_VALUE&ips=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get IP details for a specific Instance

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

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/ace712e9-a166-47f1-9065-4af0f7e7fce1/ips/10.0.0.1 \
  --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 the IP address for a specific Instance

Allows you to set the reverse lookup for the IP

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

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

Get IP details for a specific Load Balancer

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

Load balancer ID

ip
required
string <ip>
Example: 10.0.0.1

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/ips/10.0.0.1 \
  --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 the IP address for a specific Load Balancer

Allows you to set the reverse lookup for the IP

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

Load balancer 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 address for a specific resource Instance

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: ace712e9-a166-47f1-9065-4af0f7e7fce1

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

Null route IP address for a specific resource Load Balancer

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
loadBalancerId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Load balancer 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 for a specific Instance

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: ace712e9-a166-47f1-9065-4af0f7e7fce1

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/ace712e9-a166-47f1-9065-4af0f7e7fce1/ips/10.0.0.1/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": {
    }
}

Remove an IP null route for a specific Load Balancer

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
loadBalancerId
required
string <uuid>
Example: 695ddd91-051f-4dd6-9120-938a927a47d0

Load balancer ID

ip
required
string <ip>
Example: 10.0.0.1

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/ips/10.0.0.1/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": {
    }
}

Get data traffic metrics for a specific Instance

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

query Parameters
from
string <date>
Example: from=2025-01-28

The start of the interval to get the metric

to
string <date>
Example: to=2025-01-28

The end of the interval to get the metric. Must be greater than the date provided in 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/ace712e9-a166-47f1-9065-4af0f7e7fce1/metrics/datatraffic?from=2025-01-28&to=2025-01-28&granularity=SOME_STRING_VALUE&aggregation=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get data traffic metrics for a specific Load Balancer

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

Load balancer ID

query Parameters
from
string <date>
Example: from=2025-01-28

The start of the interval to get the metric

to
string <date>
Example: to=2025-01-28

The end of the interval to get the metric. Must be greater than the date provided in 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/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/metrics/datatraffic?from=2025-01-28&to=2025-01-28&granularity=SOME_STRING_VALUE&aggregation=SOME_STRING_VALUE' \
  --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: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

query Parameters
from
string <date>
Example: from=2025-01-28

The start of the interval to get the metric

to
string <date>
Example: to=2025-01-28

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

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

The interval for each metric

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/metrics/cpu?from=2025-01-28&to=2025-01-28&granularity=SOME_STRING_VALUE' \
  --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 <datetime>
Example: from=2025-01-28T10:34:01+00:00

The start of the interval to get the metric, in ISO 8601 format

to
string <datetime>
Example: to=2025-01-28T11:44:01+00:00

The end of the interval to get the metric in format ISO 8601. 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/requests?from=2025-01-28T10%3A34%3A01%2B00%3A00&to=2025-01-28T11%3A44%3A01%2B00%3A00&granularity=SOME_STRING_VALUE' \
  --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 <datetime>
Example: from=2025-01-28T10:34:01+00:00

The start of the interval to get the metric, in ISO 8601 format

to
string <datetime>
Example: to=2025-01-28T11:44:01+00:00

The end of the interval to get the metric in format ISO 8601. 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/requestsPerSecond?from=2025-01-28T10%3A34%3A01%2B00%3A00&to=2025-01-28T11%3A44%3A01%2B00%3A00&granularity=SOME_STRING_VALUE' \
  --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 <datetime>
Example: from=2025-01-28T10:34:01+00:00

The start of the interval to get the metric, in ISO 8601 format

to
string <datetime>
Example: to=2025-01-28T11:44:01+00:00

The end of the interval to get the metric in format ISO 8601. 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/dataTransferred?from=2025-01-28T10%3A34%3A01%2B00%3A00&to=2025-01-28T11%3A44%3A01%2B00%3A00&granularity=SOME_STRING_VALUE' \
  --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 <datetime>
Example: from=2025-01-28T10:34:01+00:00

The start of the interval to get the metric, in ISO 8601 format

to
string <datetime>
Example: to=2025-01-28T11:44:01+00:00

The end of the interval to get the metric in format ISO 8601. 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/dataTransferredPerSecond?from=2025-01-28T10%3A34%3A01%2B00%3A00&to=2025-01-28T11%3A44%3A01%2B00%3A00&granularity=SOME_STRING_VALUE' \
  --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 <datetime>
Example: from=2025-01-28T10:34:01+00:00

The start of the interval to get the metric, in ISO 8601 format

to
string <datetime>
Example: to=2025-01-28T11:44:01+00:00

The end of the interval to get the metric in format ISO 8601. 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?from=2025-01-28T10%3A34%3A01%2B00%3A00&to=2025-01-28T11%3A44%3A01%2B00%3A00&granularity=SOME_STRING_VALUE' \
  --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 <datetime>
Example: from=2025-01-28T10:34:01+00:00

The start of the interval to get the metric, in ISO 8601 format

to
string <datetime>
Example: to=2025-01-28T11:44:01+00:00

The end of the interval to get the metric in format ISO 8601. 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?from=2025-01-28T10%3A34%3A01%2B00%3A00&to=2025-01-28T11%3A44%3A01%2B00%3A00&granularity=SOME_STRING_VALUE' \
  --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 <datetime>
Example: from=2025-01-28T10:34:01+00:00

The start of the interval to get the metric, in ISO 8601 format

to
string <datetime>
Example: to=2025-01-28T11:44:01+00:00

The end of the interval to get the metric in format ISO 8601. 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?from=2025-01-28T10%3A34%3A01%2B00%3A00&to=2025-01-28T11%3A44%3A01%2B00%3A00&granularity=SOME_STRING_VALUE' \
  --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 <datetime>
Example: from=2025-01-28T10:34:01+00:00

The start of the interval to get the metric, in ISO 8601 format

to
string <datetime>
Example: to=2025-01-28T11:44:01+00:00

The end of the interval to get the metric in format ISO 8601. 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?from=2025-01-28T10%3A34%3A01%2B00%3A00&to=2025-01-28T11%3A44%3A01%2B00%3A00&granularity=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

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: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

Responses

Request samples

curl --request PUT \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/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: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/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."
}

List snapshots

List instance snapshots

Authorizations:
X-LSW-Auth
path Parameters
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

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/ace712e9-a166-47f1-9065-4af0f7e7fce1/snapshots?limit=20&offset=10' \
  --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: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

Request Body schema: application/json
required
name
required
string

A name to identify your snapshot

Responses

Request samples

Content type
application/json
{
  • "name": "my snapshot"
}

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: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

snapshotId
required
string <uuid>

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/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: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

snapshotId
required
string <uuid>

Responses

Request samples

curl --request PUT \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/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: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's ID

snapshotId
required
string <uuid>

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/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."
}

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" "ap-northeast-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=20&offset=10&id=a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11&instanceId=6762182e-7ae9-4d0b-b3b7-bea5a49b3f94&type=SOME_STRING_VALUE&region=eu-west-3&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=20&offset=10' \
  --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
}

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" "ap-northeast-1"

region name

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/targetGroups?limit=20&offset=10&id=a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11&name=Foo%20bar&protocol=HTTP&port=80&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
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" "ap-northeast-1"

region name

object (healthCheckOpts)

Responses

Request samples

Content type
application/json
{
  • "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
name
string

The name of the target group

port
integer

The port of the target group

object (healthCheckOpts)

Responses

Request samples

Content type
application/json
{
  • "name": "Target group name",
  • "port": 80,
  • "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?limit=20&offset=10' \
  --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."
}

VPS

BETA

Leaseweb VPS (Virtual Private Server) is a hosting solution that provides dedicated virtualized resources within a physical server. It offers a balance between shared hosting and dedicated servers, making it a cost-effective option for businesses, developers, and enterprises that need more control, scalability, and performance.

Start a specific VPS

The VPS must be stopped before the execution

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/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 a specific VPS

The VPS must be running before the execution

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/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 a specific VPS

The VPS must be running before the execution

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/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."
}

Get console access

Get console access to the VPS

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

Responses

List credentials stored for a specific VPS

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

Responses

Request samples

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

Response samples

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

Store credentials for a specific VPS

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS 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": "12341234",
  • "type": "OPERATING_SYSTEM",
  • "username": "root"
}

Response samples

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

Delete all credentials associated with a specific VPS

Delete all credentials stored for a given VPS.

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/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 for a specific VPS

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

type
required
string (credentialType)
Enum: "OPERATING_SYSTEM" "CONTROL_PANEL"

Type of credential

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/credentials/%7Btype%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get VPS credential by type and username.

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

type
required
string (credentialType)
Enum: "OPERATING_SYSTEM" "CONTROL_PANEL"

Type of credential

username
required
string
Example: root

Username

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/credentials/%7Btype%7D/root \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Update credentials for a given type and username

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

type
required
string (credentialType)
Enum: "OPERATING_SYSTEM" "CONTROL_PANEL"

Type of credential

username
required
string
Example: root

Username

Request Body schema: application/json
required
password
required
string

The new password

Responses

Request samples

Content type
application/json
{
  • "password": "12341234"
}

Response samples

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

Delete VPS credential

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

type
required
string (credentialType)
Enum: "OPERATING_SYSTEM" "CONTROL_PANEL"

Type of credential

username
required
string
Example: root

Username

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/credentials/%7Btype%7D/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 the password for a specific VPS

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
vpsId
required
string
Example: 999999999

VPS ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/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."
}

Attach ISO to a specific VPS

VPS 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
vpsId
required
string
Example: 999999999

VPS 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 a specific VPS

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

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/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."
}

List images available for reinstall

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS 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.

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/vps/999999999/reinstall/images?limit=20&offset=10&standard=true' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Reinstall a VPS

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

Cannot be performed when the VPS has snapshots.

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

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

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

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

List IP addresses associated with a specific VPS

List the VPS's IPs

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

query Parameters
version
integer
Enum: 4 6

Ip version

nullRouted
boolean
ips
string

A list of IPs separated by |

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/vps/999999999/ips?version=SOME_INTEGER_VALUE&nullRouted=SOME_BOOLEAN_VALUE&ips=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get IP details for a specific VPS

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

ip
required
string <ip>
Example: 10.0.0.1

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/ips/10.0.0.1 \
  --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 the IP address for a specific VPS

Allows you to set the reverse lookup for the IP

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS 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 address for a specific resource VPS

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
vpsId
required
string
Example: 999999999

VPS 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 for a specific VPS

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
vpsId
required
string
Example: 999999999

VPS ID

ip
required
string <ip>
Example: 10.0.0.1

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/ips/10.0.0.1/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": {
    }
}

Get data traffic metrics for a specific VPS

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

query Parameters
from
string <date>
Example: from=2025-01-28

The start of the interval to get the metric

to
string <date>
Example: to=2025-01-28

The end of the interval to get the metric. Must be greater than the date provided in 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/vps/999999999/metrics/datatraffic?from=2025-01-28&to=2025-01-28&granularity=SOME_STRING_VALUE&aggregation=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

List snapshots

List VPS snapshots

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS 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/vps/999999999/snapshots?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Create VPS snapshot

The VPS must be running before the execution.

The time taken to create the snapshot depends on several factors, including memory size and usage.

Allowed only one snapshot per VPS.

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

Request Body schema: application/json
required
name
required
string

A name to identify your snapshot

Responses

Request samples

Content type
application/json
{
  • "name": "my snapshot"
}

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
vpsId
required
string
Example: 999999999

VPS ID

snapshotId
required
string <uuid>

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/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 VPS snapshot

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

snapshotId
required
string <uuid>

Responses

Request samples

curl --request PUT \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/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 VPS snapshot

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

snapshotId
required
string <uuid>

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/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."
}

Get VPS list

List and filter VPS

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
Example: id=999999999

VPS Equipment Id

reference
string
Example: reference=Foo bar
ip
string <ip>
Example: ip=10.0.0.1
state
string
Enum: "RUNNING" "STARTING" "STOPPED" "STOPPING"

The current state

pack
string
Enum: "Leaseweb VPS 1" "Leaseweb VPS 2" "Leaseweb VPS 3" "Leaseweb VPS 4" "Leaseweb VPS 5" "Leaseweb VPS 6"

Vps package type

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

region name

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/vps/?limit=20&offset=10&id=999999999&reference=Foo%20bar&ip=10.0.0.1&state=SOME_STRING_VALUE&pack=SOME_STRING_VALUE&region=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get VPS details

Get VPS details.

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "contract": {
    },
  • "datacenter": "FRA-01",
  • "hasPublicIpV4": true,
  • "id": "123581321",
  • "image": {
    },
  • "ips": [
    ],
  • "iso": null,
  • "marketAppId": null,
  • "pack": "Leaseweb VPS 2",
  • "reference": "testing",
  • "region": "eu-central-1",
  • "resources": {
    },
  • "rootDiskSize": 50,
  • "startedAt": "2024-10-24T21:13:25+00:00",
  • "state": "RUNNING"
}

Update VPS details

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

Request Body schema: application/json
required
reference
string

An identifying name you can refer to the VPS

Responses

Request samples

Content type
application/json
{
  • "reference": "updated reference"
}

Response samples

Content type
application/json
{
  • "contract": {
    },
  • "datacenter": "FRA-01",
  • "hasPublicIpV4": true,
  • "id": "123581321",
  • "image": {
    },
  • "ips": [
    ],
  • "iso": null,
  • "marketAppId": null,
  • "pack": "Leaseweb VPS 2",
  • "reference": "testing",
  • "region": "eu-central-1",
  • "resources": {
    },
  • "rootDiskSize": 50,
  • "startedAt": "2024-10-24T21:13:25+00:00",
  • "state": "RUNNING"
}

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/vps/images?limit=20&offset=10&custom=SOME_BOOLEAN_VALUE&standard=true&state=SOME_STRING_VALUE&marketAppId=SOME_STRING_VALUE&storageType=SOME_STRING_VALUE&name=Ubuntu%2020.04%20LTS%20(x86_64)&flavour=SOME_STRING_VALUE&region=eu-west-3' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

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/vps/isos?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

List the notification settings of a customer

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS 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/vps/vps/999999999/notificationSettings/dataTraffic?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get details of a notification Setting

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

notificationSettingId
required
string <uuid>
Example: 3a042956-0689-45dc-8322-8b8325464182

Notification Setting ID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "action": "POWER_OFF",
  • "channels": [
    ],
  • "id": "ff6bbd04-c24c-4ecf-b09d-e6c415a65d63",
  • "threshold": {
    },
  • "timePeriod": "DAY",
  • "type": "DATA_TRAFFIC"
}

Create a notification setting

Create a notification setting

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

notificationSettingId
required
string <uuid>
Example: 3a042956-0689-45dc-8322-8b8325464182

Notification Setting ID

Request Body schema: application/json
required
required
object
timePeriod
required
string (timePeriod)
Enum: "DAY" "WEEK" "MONTH"

Frequency of the notification setting

action
required
string or null (action)
Enum: "POWER_OFF" null

The action for when the threshold is exceeded

required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "action": "POWER_OFF",
  • "channels": [
    ],
  • "threshold": {
    },
  • "timePeriod": "DAY"
}

Response samples

Content type
application/json
{
  • "action": "POWER_OFF",
  • "channels": [
    ],
  • "id": "ff6bbd04-c24c-4ecf-b09d-e6c415a65d63",
  • "threshold": {
    },
  • "timePeriod": "DAY",
  • "type": "DATA_TRAFFIC"
}

Update Notification Setting details

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

notificationSettingId
required
string <uuid>
Example: 3a042956-0689-45dc-8322-8b8325464182

Notification Setting ID

Request Body schema: application/json
required
object
timePeriod
string (timePeriod)
Enum: "DAY" "WEEK" "MONTH"

Frequency of the notification setting

action
string or null (action)
Enum: "POWER_OFF" null

The action for when the threshold is exceeded

Array of objects

Responses

Request samples

Content type
application/json
{
  • "action": "POWER_OFF",
  • "channels": [
    ],
  • "threshold": {
    },
  • "timePeriod": "DAY"
}

Response samples

Content type
application/json
{
  • "action": "POWER_OFF",
  • "channels": [
    ],
  • "id": "ff6bbd04-c24c-4ecf-b09d-e6c415a65d63",
  • "threshold": {
    },
  • "timePeriod": "DAY",
  • "type": "DATA_TRAFFIC"
}

Delete a notification setting setting

Authorizations:
X-LSW-Auth
path Parameters
vpsId
required
string
Example: 999999999

VPS ID

notificationSettingId
required
string <uuid>
Example: 3a042956-0689-45dc-8322-8b8325464182

Notification Setting ID

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182 \
  --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."
}

Private Clouds

Leaseweb Private Cloud is a dedicated cloud solution that provides a secure, high-performance, and customizable cloud environment for businesses. Unlike public cloud services, a private cloud ensures that all resources are dedicated to a single organization, enhancing security, performance, and compliance.

List private clouds

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

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/cloud/v2/privateClouds?limit=10&offset=0' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect a private cloud

Authorizations:
X-LSW-Auth
path Parameters
privateCloudId
required
string
Example: 123242

Id of the private cloud

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/cloud/v2/privateClouds/123242 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "id": "218030",
  • "customerId": "1301178860",
  • "dataCenter": "AMS-01",
  • "serviceOffering": "FLAT_FEE",
  • "sla": "Bronze",
  • "contract": {
    },
  • "hardware": {
    },
  • "ips": [
    ],
  • "networkTraffic": {
    }
}

List credentials

Please note that this feature is only available for CloudStack Private Clouds.

Also note that you will only be able to retrieve the last password that we configured in your remote management tool. If you changed it, the information retrieved by this API call will not work.

NameTypeDescription
typestringType of credential pair. Possible values are REMOTE_MANAGEMENT.
usernamestringName of the user in the remote management tool.
domainstringDomain name to log in to the remote management tool.
Please note that the password is not returned in this call, you must use the endpoint to get a credential by the username to retrieve it.

The _metadata object contains the following attributes:

NameTypeDescription
totalCountintegerTotal amount of credentials that were found.
limitintegerMaximum amount of credentials that will be included in the credentials array.
offsetintegerOffset of the request.
Authorizations:
X-LSW-Auth
path Parameters
credentialType
required
string
Value: "REMOTE_MANAGEMENT"

Type of credential pair

privateCloudId
required
string
Example: 123242

Id of the private cloud

query Parameters
limit
integer
Default: 10
Example: limit=10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/cloud/v2/privateClouds/123242/credentials/%7BcredentialType%7D?limit=10&offset=0' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect user credentials

Please note that this feature is only available for CloudStack Private Clouds.

Also note that you will only be able to retrieve the last password that we configured in your server or control panel. If you changed it, the information retrieved by this API call will not work.

Authorizations:
X-LSW-Auth
path Parameters
credentialType
required
string
Value: "REMOTE_MANAGEMENT"

Type of credential pair

username
required
string

Name of the user in the remote management tool

privateCloudId
required
string
Example: 123242

Id of the private cloud

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/cloud/v2/privateClouds/123242/credentials/%7BcredentialType%7D/%7Busername%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "type": "REMOTE_MANAGEMENT",
  • "username": "root",
  • "password": "password123",
  • "domain": "123456"
}

Inspect datatraffic metrics

Authorizations:
X-LSW-Auth
path Parameters
privateCloudId
required
string
Example: 123242

Id of the private cloud

query Parameters
granularity
string
Enum: "NONE" "5MIN" "HOUR" "DAY" "MONTH" "YEAR"

Specify the preferred interval for each metric. If granularity is omitted from the request, only one metric is returned.

aggregation
string
Value: "SUM"

Aggregate each metric using the given aggregation function.

from
date

Start of date interval in RFC3339 format.

The returned data will include everything up from - and including - the specified date time.

to
date

End of date interval in RFC3339 format.

The returned data will include everything up until - but not including - the specified date time.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/cloud/v2/privateClouds/%7B[privateCloudId%7D/metrics/datatraffic?granularity=SOME_STRING_VALUE&aggregation=SOME_STRING_VALUE&from=SOME_DATE_VALUE&to=SOME_DATE_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect bandwidth metrics

Authorizations:
X-LSW-Auth
path Parameters
privateCloudId
required
string
Example: 123242

Id of the private cloud

query Parameters
granularity
string
Enum: "NONE" "5MIN" "HOUR" "DAY" "MONTH" "YEAR"

Specify the preferred interval for each metric. If granularity is omitted from the request, only one metric is returned.

aggregation
string
Value: "AVG"

Aggregate each metric using the given aggregation function.

from
date

Start of date interval in RFC3339 format.

The returned data will include everything up from - and including - the specified date time.

to
date

End of date interval in RFC3339 format.

The returned data will include everything up until - but not including - the specified date time.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/cloud/v2/privateClouds/123242/metrics/bandwidth?granularity=SOME_STRING_VALUE&aggregation=SOME_STRING_VALUE&from=SOME_DATE_VALUE&to=SOME_DATE_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect CPU metrics

Authorizations:
X-LSW-Auth
path Parameters
privateCloudId
required
string
query Parameters
granularity
string
Enum: "NONE" "5MIN" "HOUR" "DAY" "MONTH" "YEAR"

Specify the preferred interval for each metric. If granularity is omitted from the request, only one metric is returned.

aggregation
string
Value: "AVG"

Aggregate each metric using the given aggregation function.

from
date

Start of date interval in RFC3339 format.

The returned data will include everything up from - and including - the specified date time.

to
date

End of date interval in RFC3339 format.

The returned data will include everything up until - but not including - the specified date time.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/cloud/v2/privateClouds/%7BprivateCloudId%7D/metrics/cpu?granularity=SOME_STRING_VALUE&aggregation=SOME_STRING_VALUE&from=SOME_DATE_VALUE&to=SOME_DATE_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect memory metrics

Authorizations:
X-LSW-Auth
path Parameters
privateCloudId
required
string
Example: 123242

Id of the private cloud

query Parameters
granularity
string
Enum: "NONE" "5MIN" "HOUR" "DAY" "MONTH" "YEAR"

Specify the preferred interval for each metric. If granularity is omitted from the request, only one metric is returned.

aggregation
string
Value: "AVG"

Aggregate each metric using the given aggregation function.

from
date

Start of date interval in RFC3339 format.

The returned data will include everything up from - and including - the specified date time.

to
date

End of date interval in RFC3339 format.

The returned data will include everything up until - but not including - the specified date time.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/cloud/v2/privateClouds/123242/metrics/memory?granularity=SOME_STRING_VALUE&aggregation=SOME_STRING_VALUE&from=SOME_DATE_VALUE&to=SOME_DATE_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect storage metrics

Authorizations:
X-LSW-Auth
path Parameters
privateCloudId
required
string
Example: 123242

Id of the private cloud

query Parameters
granularity
string
Enum: "NONE" "5MIN" "HOUR" "DAY" "MONTH" "YEAR"

Specify the preferred interval for each metric. If granularity is omitted from the request, only one metric is returned.

aggregation
string
Value: "MAX"

Aggregate each metric using the given aggregation function.

from
date

Start of date interval in RFC3339 format.

The returned data will include everything up from - and including - the specified date time.

to
date

End of date interval in RFC3339 format.

The returned data will include everything up until - but not including - the specified date time.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/cloud/v2/privateClouds/123242/metrics/storage?granularity=SOME_STRING_VALUE&aggregation=SOME_STRING_VALUE&from=SOME_DATE_VALUE&to=SOME_DATE_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Storage

BETA LIMITED ACCESS

Leaseweb Storage is a storage solution that provides scalable and reliable storage for businesses. It offers a range of storage options, including block storage, object storage, and file storage, to meet different storage needs and requirements.

List storages

Show all storages for the given customer.

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

Limit the number of results returned.

offset
integer
Default: 0

Return results starting from the given offset.

Responses

Request samples

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

Response samples

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

List StorageVMs

Show all StorageVMs for the given customer.

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

Limit the number of results returned.

offset
integer
Default: 0

Return results starting from the given offset.

Responses

Request samples

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

Response samples

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

List volumes

Show all the volumes in a StorageVM.

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

UUID of the Storage VM.

query Parameters
limit
integer
Default: 10

Limit the number of results returned.

offset
integer
Default: 0

Return results starting from the given offset.

Responses

Request samples

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

Response samples

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

Grow volume

Grow the size of a volume in StorageVM.

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

UUID of the Storage VM.

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

UUID of a storage volume.

Request Body schema: application/json
growSize
required
integer

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

Responses

Request samples

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

Response samples

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

Show a job

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

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

UUID of the Storage VM.

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

UUID of a queue job.

Responses

Request samples

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

Response samples

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

Dedicated Servers

Leaseweb Dedicated Servers are physical servers that are dedicated to a single customer, providing high performance, scalability, and security. They are ideal for businesses that require a dedicated environment for their critical applications.

List servers

List your Dedicated Servers. This api call supports pagination. Use the limit and offset query string parameters to paginate through all your dedicated servers.

Every server object in the json response lists a few properties of a server. Use the single resource api call to get more details for a single server.

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.

reference
string
Example: reference=my-db

Filter the list of servers by reference.

ip
string <ipv4>
Example: ip=127.0.0.4

Filter the list of servers by ip address.

macAddress
string([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})|([0-9...
Example: macAddress=aa:bb:cc:dd:ee:ff

Filter the list of servers by mac address.

site
string
Example: site=FRA-10

Filter the list of servers by site (location).

privateRackId
string
Example: privateRackId=123

Filter the list of servers by dedicated rack id.

privateNetworkCapable
string
Enum: "true" "false"

Filter the list for private network capable servers

privateNetworkEnabled
string
Enum: "true" "false"

Filter the list for private network enabled servers

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/servers?limit=20&offset=10&reference=my-db&ip=127.0.0.4&macAddress=aa%3Abb%3Acc%3Add%3Aee%3Aff&site=FRA-10&privateRackId=123&privateNetworkCapable=SOME_STRING_VALUE&privateNetworkEnabled=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get server

Use this API to get information about a single server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "assetId": "1234561882",
  • "contract": {
    },
  • "featureAvailability": {
    },
  • "id": "123456",
  • "isPrivateNetworkCapable": true,
  • "isPrivateNetworkEnabled": true,
  • "isRedundantPrivateNetworkCapable": false,
  • "location": {
    },
  • "networkInterfaces": {
    },
  • "powerPorts": [
    ],
  • "privateNetworks": [
    ],
  • "rack": {
    },
  • "serialNumber": "HN2XGHSD02H04",
  • "specs": {
    }
}

Update server

Update the reference for a server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Request Body schema: application/json
required
reference
required
string

The reference for this server

Responses

Request samples

Content type
application/json
{
  • "reference": "database-server"
}

Response samples

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

List IPs

List all IP Addresses associated with this server. Optionally filtered.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

query Parameters
networkType
string
Enum: "INTERNAL" "PUBLIC" "REMOTE_MANAGEMENT"
Example: networkType=INTERNAL

Filter the collection of ip addresses by network type

version
string

Filter the collection by ip version

nullRouted
string

Filter Ips by Nulled-Status

ips
string

Filter the collection of Ips for the comma separated list of Ips

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/bareMetals/v2/servers/12345/ips?networkType=INTERNAL&version=SOME_STRING_VALUE&nullRouted=SOME_STRING_VALUE&ips=SOME_STRING_VALUE&limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Show a server IP

Get a single IP address associated with this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

ip
required
string
Example: 127.0.0.6

The IP Address

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/ips/127.0.0.6 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "ddos": {
    },
  • "floatingIp": false,
  • "gateway": "12.123.123.254",
  • "ip": "12.123.123.1/24",
  • "mainIp": true,
  • "networkType": "PUBLIC",
  • "nullRouted": false,
  • "reverseLookup": "domain.example.com",
  • "version": 4
}

Update an IP

Update the reverse lookup or DDoS detection profile for the ip address.

DDoS detection profiles can only be changed if the IP address is protected using Advanced DDoS protection.

For more information about DDoS detection profiles click here for our KB related article.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

ip
required
string
Example: 127.0.0.6

The IP Address

Request Body schema: application/json
detectionProfile
string
Enum: "ADVANCED_DEFAULT" "ADVANCED_LOW_UDP" "ADVANCED_MED_UDP"

The detection profile value

reverseLookup
string

The reverse lookup value

Responses

Request samples

Content type
application/json
{
  • "detectionProfile": "ADVANCED_LOW_UDP",
  • "reverseLookup": "domain.example.com"
}

Response samples

Content type
application/json
{
  • "ddos": {
    },
  • "floatingIp": false,
  • "gateway": "12.123.123.254",
  • "ip": "12.123.123.1/24",
  • "mainIp": true,
  • "networkType": "PUBLIC",
  • "nullRouted": false,
  • "reverseLookup": "domain.example.com",
  • "version": 4
}

Null route an IP

Null the given IP address. It might take a few minutes before the change is propagated across the network.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

ip
required
string
Example: 127.0.0.6

The IP Address

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/ips/127.0.0.6/null \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "ddos": {
    },
  • "floatingIp": false,
  • "gateway": "12.123.123.254",
  • "ip": "12.123.123.1/24",
  • "mainIp": true,
  • "networkType": "PUBLIC",
  • "nullRouted": false,
  • "reverseLookup": "domain.example.com",
  • "version": 4
}

Remove a null route

Remove an existing null route for the given IP address. It might take a few minutes before the change is propagated across the network.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

ip
required
string
Example: 127.0.0.6

The IP Address

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/ips/127.0.0.6/unnull \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "ddos": {
    },
  • "floatingIp": false,
  • "gateway": "12.123.123.254",
  • "ip": "12.123.123.1/24",
  • "mainIp": true,
  • "networkType": "PUBLIC",
  • "nullRouted": false,
  • "reverseLookup": "domain.example.com",
  • "version": 4
}

Show null route history

Show all null route history for any ips associated with this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

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/bareMetals/v2/servers/12345/nullRouteHistory?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Delete a server from a private network

This API call will remove the dedicated server from the private network.

It takes a few minutes before the server has been removed from the private network.

To get the current status of the server you can call /bareMetals/v2/servers/{serverId}.

While the server is being removed the status changes to REMOVING.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

privateNetworkId
required
string
Example: 892

The ID of a Private Network

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/privateNetworks/892 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "f8d84555-9822-49fb-919a-d4945b201fe3",
  • "errorCode": "400",
  • "errorMessage": "Equipment 27072 is not part of private network 3943"
}

Add a server to private network

It takes a few minutes before the server has access to the private network.

To get the current status of the server you can call /bareMetals/v2/servers/{serverId}.

Once the server is added to the private network the status changes from CONFIGURING to CONFIGURED.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

privateNetworkId
required
string
Example: 892

The ID of a Private Network

Request Body schema: application/json
linkSpeed
required
integer (linkSpeed)
Enum: 100 1000 10000 25000 40000 100000

The port speed in Mbps

Responses

Request samples

Content type
application/json
{
  • "linkSpeed": 100
}

Response samples

Content type
application/json
{
  • "correlationId": "f8d84555-9822-49fb-919a-d4945b201fe3",
  • "errorCode": "400",
  • "errorMessage": "Equipment 27072 is not part of private network 3943"
}

List network interfaces

List all network interfaces for this server, including their current status.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/networkInterfaces \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Close all network interfaces

Close all network interfaces for this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/networkInterfaces/close \
  --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."
}

Open all network interfaces

Open all network interfaces of this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/networkInterfaces/open \
  --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."
}

Show a network interface

Show the network interface of the given type of this server, including its status.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

networkTypeURL
required
string
Enum: "internal" "public" "remoteManagement"
Example: internal

Type of network

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/networkInterfaces/internal \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "linkSpeed": "100Mbps",
  • "operStatus": "OPEN",
  • "status": "OPEN",
  • "switchInterface": "33",
  • "switchName": "EVO-JV12-1",
  • "type": "PUBLIC"
}

Close network interface

Close the network interface of this type of this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

networkTypeURL
required
string
Enum: "internal" "public" "remoteManagement"
Example: internal

Type of network

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/networkInterfaces/internal/close \
  --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."
}

Open network interface

Open all network interfaces of the given type for this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

networkTypeURL
required
string
Enum: "internal" "public" "remoteManagement"
Example: internal

Type of network

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/networkInterfaces/internal/open \
  --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."
}

Inspect DDoS notification settings

Show all DDoS Protection related notification settings for this server. These settings control if you want to be notified via email in case a DDoS was mitigated.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/notificationSettings/ddos \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "nulling": "ENABLED",
  • "scrubbing": "DISABLED"
}

Update DDoS notification settings

Update your DDoS notification settings for this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Request Body schema: application/json
nulling
string
Enum: "ENABLED" "DISABLED"

Enable or disable email notifications for nulling events

scrubbing
string
Enum: "ENABLED" "DISABLED"

Enable or disable email notifications for nulling events

Responses

Request samples

Content type
application/json
{
  • "nulling": "DISABLED",
  • "scrubbing": "ENABLED"
}

Response samples

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

Show bandwidth metrics

At this moment only bandwidth information for the public interface is supported.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

query Parameters
from
required
string <date-time>
Example: from=2019-06-01T00:00:00Z

Start of date interval in ISO-8601 format. The returned data will include everything up from - and including - the specified date time.

to
required
string <date-time>
Example: to=2019-06-05T00:00:00Z

End of date interval in ISO-8601 format. The returned data will include everything up until - but not including - the specified date time.

granularity
string
Enum: "5MIN" "HOUR" "DAY" "WEEK" "MONTH" "YEAR"

Specify the preferred interval for each metric. If granularity is omitted from the request, only one metric is returned.

aggregation
required
string
Enum: "AVG" "95TH"

Aggregate each metric using the given aggregation function. When the aggregation type 95TH is specified the granularity parameter should be omitted from the request.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/servers/12345/metrics/bandwidth?from=2019-06-01T00%3A00%3A00Z&to=2019-06-05T00%3A00%3A00Z&granularity=SOME_STRING_VALUE&aggregation=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Show datatraffic metrics

At this moment only bandwidth information for the public interface is supported.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

query Parameters
from
required
string <date-time>
Example: from=2019-06-01T00:00:00Z

Start of date interval in ISO-8601 format. The returned data will include everything up from - and including - the specified date time.

to
required
string <date-time>
Example: to=2019-06-05T00:00:00Z

End of date interval in ISO-8601 format. The returned data will include everything up until - but not including - the specified date time.

granularity
string
Enum: "DAY" "WEEK" "MONTH" "YEAR"

Specify the preferred interval for each metric. If granularity is omitted from the request, only one metric is returned.

aggregation
required
string
Value: "SUM"

Aggregate each metric using the given aggregation function.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/servers/12345/metrics/datatraffic?from=2019-06-01T00%3A00%3A00Z&to=2019-06-05T00%3A00%3A00Z&granularity=SOME_STRING_VALUE&aggregation=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

List bandwidth notification settings

List all bandwidth notification settings for this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

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/bareMetals/v2/servers/12345/notificationSettings/bandwidth?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Create a bandwidth notification setting

Create a new bandwidth notification setting for this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Request Body schema: application/json
frequency
required
string
Enum: "DAILY" "WEEKLY" "MONTHLY"

Frequency for the Bandwidth Notification

threshold
required
string

Threshold Value for the Bandwidth Notification

unit
required
string
Enum: "Gbps" "Mbps"

Unit for the Bandwidth Notification

Responses

Request samples

Content type
application/json
{
  • "frequency": "DAILY",
  • "threshold": "1",
  • "unit": "Gbps"
}

Response samples

Content type
application/json
{
  • "actions": [
    ],
  • "frequency": "WEEKLY",
  • "id": "12345",
  • "lastCheckedAt": "2021-03-16T01:01:41+00:00",
  • "threshold": "1",
  • "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
  • "unit": "Gbps"
}

Delete a bandwidth notification setting

Remove a Bandwidth Notification setting for this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

notificationSettingId
required
string
Example: 839111

The ID of a notification setting

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/notificationSettings/bandwidth/839111 \
  --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."
}

Show a bandwidth notification setting

Get a bandwidth notification setting for this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

notificationSettingId
required
string
Example: 839111

The ID of a notification setting

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/notificationSettings/bandwidth/839111 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "actions": [
    ],
  • "frequency": "WEEKLY",
  • "id": "12345",
  • "lastCheckedAt": "2021-03-16T01:01:41+00:00",
  • "threshold": "1",
  • "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
  • "unit": "Gbps"
}

Update a bandwidth notification setting

Update an existing bandwidth notification setting for this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

notificationSettingId
required
string
Example: 839111

The ID of a notification setting

Request Body schema: application/json
frequency
required
string
Enum: "DAILY" "WEEKLY" "MONTHLY"

Frequency for the Bandwidth Notification

threshold
required
string

Threshold Value for the Bandwidth Notification

unit
required
string
Enum: "Gbps" "Mbps"

Unit for the Bandwidth Notification

Responses

Request samples

Content type
application/json
{
  • "frequency": "DAILY",
  • "threshold": "1",
  • "unit": "Gbps"
}

Response samples

Content type
application/json
{
  • "actions": [
    ],
  • "frequency": "WEEKLY",
  • "id": "12345",
  • "lastCheckedAt": "2021-03-16T01:01:41+00:00",
  • "threshold": "1",
  • "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
  • "unit": "Gbps"
}

List data traffic notification settings

List all datatraffic notification settings for this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

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/bareMetals/v2/servers/12345/notificationSettings/datatraffic?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Create a data traffic notification setting

Create a new data traffic notification setting for this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Request Body schema: application/json
frequency
required
string
Enum: "DAILY" "WEEKLY" "MONTHLY"

Frequency for the Data Traffic Notification

threshold
required
string

Threshold Value for the Data Traffic Notification

unit
required
string
Enum: "MB" "GB" "TB"

Unit for the Data Traffic Notification

Responses

Request samples

Content type
application/json
{
  • "frequency": "DAILY",
  • "threshold": "1",
  • "unit": "MB"
}

Response samples

Content type
application/json
{
  • "actions": [
    ],
  • "frequency": "WEEKLY",
  • "id": "12345",
  • "lastCheckedAt": "2021-03-16T01:01:41+00:00",
  • "threshold": "1",
  • "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
  • "unit": "GB"
}

Delete a data traffic notification setting

Delete the given data traffic notification setting for this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

notificationSettingId
required
string
Example: 839111

The ID of a notification setting

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/notificationSettings/datatraffic/839111 \
  --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."
}

Show a data traffic notification setting

Get a datatraffic notification setting for this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

notificationSettingId
required
string
Example: 839111

The ID of a notification setting

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/notificationSettings/datatraffic/839111 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "actions": [
    ],
  • "frequency": "WEEKLY",
  • "id": "12345",
  • "lastCheckedAt": "2021-03-16T01:01:41+00:00",
  • "threshold": "1",
  • "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
  • "unit": "GB"
}

Update a data traffic notification setting

Update an existing data traffic notification setting for this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

notificationSettingId
required
string
Example: 839111

The ID of a notification setting

Request Body schema: application/json
frequency
required
string
Enum: "DAILY" "WEEKLY" "MONTHLY"

Frequency for the Data Traffic Notification

threshold
required
string

Threshold Value for the Data Traffic Notification

unit
required
string
Enum: "MB" "GB" "TB"

Unit for the Data Traffic Notification

Responses

Request samples

Content type
application/json
{
  • "frequency": "DAILY",
  • "threshold": "1",
  • "unit": "GB"
}

Response samples

Content type
application/json
{
  • "frequency": "DAILY",
  • "threshold": "1",
  • "unit": "MB"
}

Show hardware information

This information is generated when running a hardware scan for your server. A hardware scan collects hardware information about your system.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/hardwareInfo \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "id": "2378237",
  • "parserVersion": "3.6",
  • "result": {
    },
  • "scannedAt": "2017-09-27T14:21:01Z",
  • "serverId": "62264"
}

List control panels

An id of a control panel can be supplied when (re)installing a dedicated server (for more information on how to install dedicated servers via the API refer to the API documentation).

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/bareMetals/v2/controlPanels?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

List Operating Systems

An id of a operating system can be supplied when (re)installing a dedicated server (for more information on how to install dedicated servers via the API refer to the API documentation).

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.

controlPanelId
string

Filter operating systems by control panel id

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/operatingSystems?limit=20&offset=10&controlPanelId=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Show an operating system

This detailed information shows default options when installing the given operating system on a dedicated server.

For some operating systems these defaults can be adjusted when making the POST request to /install. If the configurable parameter is true these defaults can be adjusted by the client.

Authorizations:
X-LSW-Auth
path Parameters
operatingSystemId
required
string
Example: UBUNTU_22_04_64BIT

Operating system ID

query Parameters
controlPanelId
required
string

The Control Panel ID

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/operatingSystems/UBUNTU_22_04_64BIT?controlPanelId=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "architecture": "64bit",
  • "configurable": true,
  • "defaults": {
    },
  • "family": "centos",
  • "features": [
    ],
  • "id": "CENTOS_7_64BIT",
  • "name": "CentOS 7 (x86_64)",
  • "supportedBootDevices": [
    ],
  • "supportedFileSystems": [
    ],
  • "type": "linux",
  • "version": "7"
}

List control panels by Operating System

An id of a control panel can be supplied when (re)installing a dedicated server (for more information on how to install dedicated servers via the API refer to the API documentation).

Not all operating systems support all control panels. Some operating systems do not allow for installation of a control panel. To filter the list of control panels which are supported for an operating system use the operatingSystemId query string parameter to filter this list.

Authorizations:
X-LSW-Auth
path Parameters
operatingSystemId
required
string
Example: UBUNTU_22_04_64BIT

Operating system 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.

operatingSystemId
string

Filter control panels by operating system id

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/operatingSystems/UBUNTU_22_04_64BIT/controlPanels?limit=20&offset=10&operatingSystemId=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Rescue Images

Lists all Rescue Images which are available for launching a dedicated server into rescue mode.

A rescueImageId can be supplied to the POST /rescueMode API call and will reboot your server into rescue mode.

Launching rescue mode for a server is often used to troubleshoot an existing installation.

Note that launching rescue mode does not modify any data on the disks of your server. It will require your server to be rebooted.

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/bareMetals/v2/rescueImages?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Cancel active job

Canceling an active job will trigger the onfail flow of the current job often resulting in a server reboot. If you do not want the server state to change expire the active job instead.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/cancelActiveJob \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "createdAt": "2021-01-09T08:54:06+0000",
  • "flow": "#stop",
  • "isRunning": false,
  • "node": "80:18:44:E0:AF:C4!JGNTQ92",
  • "payload": {
    },
  • "progress": {
    },
  • "serverId": "99944",
  • "status": "CANCELED",
  • "tasks": [
    ],
  • "type": "install",
  • "updatedAt": "2021-01-09T08:54:15+0000",
  • "uuid": "c77d8a6b-d255-4744-8b95-8bf4af6f8b48"
}

List server credentials

The credentials API allows you to store usernames and passwords securely.

During (re)installations, rescue modes and ipmi resets the newly generated passwords are stored and can be retrieved using this API.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

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/bareMetals/v2/servers/12345/credentials?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Create new server credentials

Password will NOT be updated on the server. The ability to update credentials is for convenience only. It provides a secure way to communicate passwords with Leaseweb engineers in case support is required.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Request Body schema: application/json
password
required
string

The password for the credentials

type
required
string (credentialType2)
Enum: "OPERATING_SYSTEM" "RESCUE_MODE" "REMOTE_MANAGEMENT" "CONTROL_PANEL" "SWITCH" "PDU" "FIREWALL" "LOAD_BALANCER" "VNC" "TEMPORARY_OPERATING_SYSTEM" "VPN_USER" "COMBINATION_LOCK" "DATABASE"

The type of the credential.

username
required
string

The username for the credentials

Responses

Request samples

Content type
application/json
{
  • "password": "mys3cr3tp@ssw0rd",
  • "type": "OPERATING_SYSTEM",
  • "username": "root"
}

Response samples

Content type
application/json
{
  • "password": "mys3cr3tp@ssw0rd",
  • "type": "OPERATING_SYSTEM",
  • "username": "root"
}

List server credentials by type

List all the credentials filtered by the specified type that are associated with this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

type
required
string
Enum: "OPERATING_SYSTEM" "RESCUE_MODE" "REMOTE_MANAGEMENT" "CONTROL_PANEL" "SWITCH" "PDU" "FIREWALL" "LOAD_BALANCER" "VNC" "TEMPORARY_OPERATING_SYSTEM" "VPN_USER" "COMBINATION_LOCK" "DATABASE"

The type of the credential.

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/bareMetals/v2/servers/12345/credentials/%7Btype%7D?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Delete server credentials

This action is purely administrative and will only remove the username and password associated with this resource from our database.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

type
required
string
Enum: "OPERATING_SYSTEM" "RESCUE_MODE" "REMOTE_MANAGEMENT" "CONTROL_PANEL" "SWITCH" "PDU" "FIREWALL" "LOAD_BALANCER" "VNC" "TEMPORARY_OPERATING_SYSTEM" "VPN_USER" "COMBINATION_LOCK" "DATABASE"

The type of the credential.

username
required
string
Example: root

Username

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/credentials/%7Btype%7D/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."
}

Show server credentials

View the password for the given credential, identified by type and username. Auto generated credentials (during a re-install, rescue mode or ipmi reset can be found here).

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

type
required
string
Enum: "OPERATING_SYSTEM" "RESCUE_MODE" "REMOTE_MANAGEMENT" "CONTROL_PANEL" "SWITCH" "PDU" "FIREWALL" "LOAD_BALANCER" "VNC" "TEMPORARY_OPERATING_SYSTEM" "VPN_USER" "COMBINATION_LOCK" "DATABASE"

The type of the credential.

username
required
string
Example: root

Username

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/credentials/%7Btype%7D/root \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "password": "mys3cr3tp@ssw0rd",
  • "type": "OPERATING_SYSTEM",
  • "username": "root"
}

Update server credentials

The usernames or types cannot be changed. In order to change those remove this credentials and create a new one.

This action is purely administrative and will only update the password associated with this resource in our database.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

type
required
string
Enum: "OPERATING_SYSTEM" "RESCUE_MODE" "REMOTE_MANAGEMENT" "CONTROL_PANEL" "SWITCH" "PDU" "FIREWALL" "LOAD_BALANCER" "VNC" "TEMPORARY_OPERATING_SYSTEM" "VPN_USER" "COMBINATION_LOCK" "DATABASE"

The type of the credential.

username
required
string
Example: root

Username

Request Body schema: application/json
password
required
string

The password for the credentials

Responses

Request samples

Content type
application/json
{
  • "password": "mys3cr3tp@ssw0rd"
}

Response samples

Content type
application/json
{
  • "password": "mys3cr3tp@ssw0rd",
  • "type": "OPERATING_SYSTEM",
  • "username": "root"
}

Expire active job

Expiring an active job will not have any influence on the current state of the server and is merely an administrative action.

Often you want to cancel the job, resulting in a server reboot. In that case\nuse the /cancelActiveJob API call instead.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/expireActiveJob \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "createdAt": "2021-01-09T08:50:45+0000",
  • "flow": "#stop",
  • "isRunning": false,
  • "node": "80:18:44:E0:AF:C4!JGNTQ92",
  • "payload": {
    },
  • "progress": {
    },
  • "serverId": "99944",
  • "status": "EXPIRED",
  • "tasks": [
    ],
  • "type": "install",
  • "updatedAt": "2021-01-09T08:51:54+0000",
  • "uuid": "fe54dd20-a815-47da-bcb4-5550a160dbbe"
}

Launch hardware scan

A hardware scan collects hardware related information from your server.

A hardware scan will require a reboot of your server. The contents of your hard drive won't be altered in any way. After a successful hardware scan your server is booted back into the original operating system.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Request Body schema: application/json
callbackUrl
string <uri>

Url which will receive callbacks

powerCycle
boolean
Default: true

If set to true, server will be power cycled in order to complete the operation

Responses

Request samples

Content type
application/json
{
  • "powerCycle": false
}

Response samples

Content type
application/json
{
  • "createdAt": "2018-01-09T09:07:09+0000",
  • "flow": "tasks",
  • "isRunning": true,
  • "node": "80:18:44:E0:AF:C4!JGNTQ92",
  • "payload": {
    },
  • "progress": {
    },
  • "serverId": "99944",
  • "status": "ACTIVE",
  • "tasks": [
    ],
  • "type": "hardwareScan",
  • "updatedAt": "2018-01-09T09:07:09+0000",
  • "uuid": "2dcca92d-b5df-4837-bd99-b568ac54569a"
}

Launch installation

Install your server with an Operating System and optional Control Panel.

To retrieve a list of available operating systems use the /v2/operatingSystems endpoint.

To retrieve a list of available control panels use the /v2/controlPanels endpoint.

The default device / partitions to be used are operating system depended and can be retrieved via the /v2/operatingSystems/{operatingSystemId} endpoint.

You are now able to target a specific diskset, like SATA1TB, SATA2TB, SSD256GB, etc. To see which disksets are available in your server check the /v2/servers/{serverId} endpoint and look for the corresponding diskset id from the hdd array.

For more information about Dedicated Server installation, click here for our related Knowledge Base article.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Request Body schema: application/json
callbackUrl
string <uri>

Url which will receive callbacks when the installation is finished or failed

controlPanelId
string

Control panel identifier

device
string

Block devices in a disk set in which the partitions will be installed. Supported values are any disk set id, SATA_SAS or NVME

hostname
string

Hostname to be used in your installation

operatingSystemId
required
string

Operating system identifier

Array of objects (partition)

Array of partition objects that should be installed per partition

password
string

Server root password. If not provided, it would be automatically generated

postInstallScript
string

Base64 Encoded string containing a valid bash script to be run right after the installation

powerCycle
boolean

If true, allows system reboots to happen automatically within the process. Otherwise, you should do them manually

object (raid)

Contains RAID related information about the installation request

sshKeys
string

List of public sshKeys to be setup in your installation, separated by new lines

timezone
string

Timezone represented as Geographical_Area/City

Responses

Request samples

Content type
application/json
{
  • "controlPanelId": "PLESK_12",
  • "device": "SATA2TB",
  • "hostname": "ubuntu22.local",
  • "operatingSystemId": "UBUNTU_22_04_64BIT",
  • "partitions": [
    ],
  • "sshKeys": "ssh-rsa AAAAB3NzaC1y... user@domain.com"
}

Response samples

Content type
application/json
{
  • "createdAt": "2021-03-06T21:55:32Z",
  • "flow": "tasks",
  • "isRunning": true,
  • "node": "AA:BB:CC:DD:EE:FF!DKFJKD8989",
  • "payload": {
    },
  • "progress": {
    },
  • "serverId": "12345",
  • "status": "ACTIVE",
  • "tasks": [
    ],
  • "type": "install",
  • "updatedAt": "2021-03-06T21:55:32Z",
  • "uuid": "bcf2bedf-8450-4b22-86a8-f30aeb3a38f9"
}

Launch IPMI reset

A reset makes sure that your IPMI interface of your server is compatible with Leaseweb automation.

An IPMI reset will require a reboot of your server. The contents of your hard drive won't be altered in any way. After a successful IPMI reset your server is booted back into the original operating system.",

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Request Body schema: application/json
callbackUrl
string <uri>

Url which will receive callbacks

powerCycle
boolean
Default: true

If set to true, server will be power cycled in order to complete the operation

Responses

Request samples

Content type
application/json

Response samples

Content type
application/json
{
  • "createdAt": "2018-01-09T09:18:06+0000",
  • "flow": "tasks",
  • "isRunning": true,
  • "node": "80:18:44:E0:AF:C4!JGNTQ92",
  • "payload": {
    },
  • "progress": {
    },
  • "serverId": "99944",
  • "status": "ACTIVE",
  • "tasks": [
    ],
  • "type": "ipmiReset",
  • "updatedAt": "2018-01-09T09:18:06+0000",
  • "uuid": "754154c2-cc7f-4d5f-b8bf-b654084ba4a9"
}

List jobs

List all jobs for this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

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.

type
string
Example: type=install

Filter the list of jobs by type.

status
string
Example: status=CANCELED

Filter the list of jobs by status.

isRunning
string
Enum: "true" "false"
Example: isRunning=true

Filter the list for running jobs

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/servers/12345/jobs?limit=20&offset=10&type=install&status=CANCELED&isRunning=true' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Show a job

Get a single job for this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

jobId
required
string
Example: 3a867358-5b4b-44ee-88ac-4274603ef641

The ID of a Job

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/jobs/3a867358-5b4b-44ee-88ac-4274603ef641 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "createdAt": "2021-01-09T10:38:12+00:00",
  • "flow": "tasks",
  • "isRunning": true,
  • "metadata": {
    },
  • "node": "80:18:44:E0:AF:C4!JGNTQ92",
  • "payload": {
    },
  • "progress": {
    },
  • "serverId": "99944",
  • "status": "FINISHED",
  • "tasks": [
    ],
  • "type": "install",
  • "updatedAt": "2021-01-09T10:38:12+00:00",
  • "uuid": "3a867358-5b4b-44ee-88ac-4274603ef641"
}

Retry a job

Retry a job for a specific server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

jobId
required
string
Example: 3a867358-5b4b-44ee-88ac-4274603ef641

The ID of a Job

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/jobs/3a867358-5b4b-44ee-88ac-4274603ef641/retry \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "createdAt": "2021-01-09T10:38:12+0000",
  • "flow": "tasks",
  • "isRunning": true,
  • "metadata": {
    },
  • "node": "80:18:44:E0:AF:C4!JGNTQ92",
  • "payload": {
    },
  • "progress": {
    },
  • "serverId": "99944",
  • "status": "ACTIVE",
  • "tasks": [
    ],
  • "type": "install",
  • "updatedAt": "2021-01-09T10:38:12+0000",
  • "uuid": "3a867358-5b4b-44ee-88ac-4274603ef641"
}

Delete a DHCP reservation

Delete a DHCP reservation for this server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/leases \
  --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."
}

List DHCP reservations

Please note that this will only show reservations for the public network interface.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/leases \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Create a DHCP reservation

After rebooting your server it will acquire this DHCP reservation and boot from the specified bootfile url.

Please note that this API call will not reboot or power cycle your server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Request Body schema: application/json
bootfile
required
string

The URL of PXE boot you want your server to boot from

hostname
string

The hostname for the server

Responses

Request samples

Content type
application/json
{}

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 cycle a server

Powercyle the server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/powerCycle \
  --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."
}

Show power status

The server can either be ON or OFF. Servers can be powered on or off by using the respective /powerOn and /powerOff API calls. In addition servers can also be rebooted using the /powerCycle API call.

The pdu object describes the power status from the power distribution unit (PDU) point of view. If your server is connected to multiple PDU ports the status property will report on if at least one PDU port has power.

The ipmi object describes the power status by quering the remote management interface of your server.

Note that pdu.status can report on but your server can still be powered off if it was shutdown via IPMI for example.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/powerInfo \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "ipmi": {
    },
  • "pdu": {
    }
}

Power off server

Power off the given server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/powerOff \
  --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."
}

Power on server

Power on the given server.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345/powerOn \
  --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."
}

Launch rescue mode

Rescue mode allows you to trouble shoot your server in case your installed operating system is no longer reachable.

You can supply a postInstallScript key in the body of the request which should contain a base64 encoded string with a valid script. This script will be executed as soon as rescue mode is launched and can be used to further automate the process. A requirement for the post install script is that it starts with a shebang line like #!/usr/bin/env bash.

After a rescue mode is launched you can manually reboot the server. After this reboot the server will boot into the existing operating system.

To get a list of available rescue images, you could do so by sending a GET request to /bareMetals/v2/rescueImages.

Authorizations:
X-LSW-Auth
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Request Body schema: application/json
callbackUrl
string <uri>

Url which will receive callbacks

password
string non-empty

Rescue mode password. If not provided, it would be automatically generated

postInstallScript
string

Base64 Encoded string containing a valid bash script to be run right after rescue mode is launched

powerCycle
boolean
Default: true

If set to true, server will be power cycled in order to complete the operation

rescueImageId
required
string
Default: "GRML"

Rescue image identifier

sshKeys
string

User ssh keys

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "createdAt": "2018-03-06T22:53:31+0000",
  • "flow": "tasks",
  • "isRunning": true,
  • "node": "AA:BB:CC:DD:EE:FF!JKDJFK890",
  • "payload": {
    },
  • "progress": {
    },
  • "serverId": "2349839",
  • "status": "ACTIVE",
  • "tasks": [
    ],
  • "type": "rescueMode",
  • "updatedAt": "2018-03-06T22:53:31+0000",
  • "uuid": "ac99431b-640d-4282-95a9-a444eedb9309"
}

Dedicated Network Equipments

Leaseweb Dedicated Network Equipments are network devices that are dedicated to a single customer, providing high performance, scalability, and security. They are ideal for businesses that require a dedicated environment for their critical applications.

List network equipment

List your Dedicated Network Equipment. This api call supports pagination. Use the limit and offset query string parameters to paginate through all your dedicated network equipment.

Every network equipment object in the json response lists a few properties of a network equipment. Use the single resource api call to get more details for a single network equipment.

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.

reference
string
Example: reference=my-switch

Filter the list of network equipment by reference.

ip
string <ipv4>
Example: ip=127.0.0.4

Filter the list of network equipment by ip address.

macAddress
string([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})|([0-9...
Example: macAddress=aa:bb:cc:dd:ee:ff

Filter the list of network equipment by mac address.

site
string
Example: site=FRA-10

Filter the list of network equipment by site (location).

privateRackId
string
Example: privateRackId=123

Filter the list of network equipment by dedicated rack id.

privateNetworkCapable
string
Enum: "true" "false"

Filter the list for private network capable network equipment

privateNetworkEnabled
string
Enum: "true" "false"

Filter the list for private network enabled network equipment

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/networkEquipments?limit=20&offset=10&reference=my-switch&ip=127.0.0.4&macAddress=aa%3Abb%3Acc%3Add%3Aee%3Aff&site=FRA-10&privateRackId=123&privateNetworkCapable=SOME_STRING_VALUE&privateNetworkEnabled=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get network equipment

Use this API to get information about a single network equipment.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "contract": {
    },
  • "featureAvailability": {
    },
  • "id": "12345",
  • "location": {
    },
  • "name": "ABC-DE-001",
  • "networkInterfaces": {
    },
  • "powerPorts": [
    ],
  • "rack": {
    },
  • "serialNumber": "XN51FPD0QX",
  • "specs": {
    },
  • "type": "SWITCH"
}

Update network equipment

Update the reference for a network equipment.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

Request Body schema: application/json
required
reference
required
string

The reference for this network equipment

Responses

Request samples

Content type
application/json
{
  • "reference": "my-private-switch"
}

Response samples

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

List IPs

List all IP Addresses associated with this network equipment. Optionally filtered.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

query Parameters
networkType
string
Enum: "INTERNAL" "PUBLIC" "REMOTE_MANAGEMENT"
Example: networkType=INTERNAL

Filter the collection of ip addresses by network type

version
string

Filter the collection by ip version

nullRouted
string

Filter Ips by Nulled-Status

ips
string

Filter the collection of Ips for the comma separated list of Ips

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/bareMetals/v2/networkEquipments/12345/ips?networkType=INTERNAL&version=SOME_STRING_VALUE&nullRouted=SOME_STRING_VALUE&ips=SOME_STRING_VALUE&limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Show a network equipment IP

Get a single IP address associated with this network equipment.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

ip
required
string
Example: 127.0.0.6

The IP Address

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/ips/127.0.0.6 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "ddos": {
    },
  • "floatingIp": false,
  • "gateway": "12.123.123.254",
  • "ip": "12.123.123.1/24",
  • "mainIp": true,
  • "networkType": "PUBLIC",
  • "nullRouted": false,
  • "reverseLookup": "domain.example.com",
  • "version": 4
}

Update an IP

Update the reverse lookup or DDoS detection profile for the ip address.

DDoS detection profiles can only be changed if the IP address is protected using Advanced DDoS protection.

For more information about DDoS detection profiles click here for our KB related article.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

ip
required
string
Example: 127.0.0.6

The IP Address

Request Body schema: application/json
detectionProfile
string
Enum: "ADVANCED_DEFAULT" "ADVANCED_LOW_UDP" "ADVANCED_MED_UDP"

The detection profile value

reverseLookup
string

The reverse lookup value

Responses

Request samples

Content type
application/json
{
  • "detectionProfile": "ADVANCED_LOW_UDP",
  • "reverseLookup": "domain.example.com"
}

Response samples

Content type
application/json
{
  • "ddos": {
    },
  • "floatingIp": false,
  • "gateway": "12.123.123.254",
  • "ip": "12.123.123.1/24",
  • "mainIp": true,
  • "networkType": "PUBLIC",
  • "nullRouted": false,
  • "reverseLookup": "domain.example.com",
  • "version": 4
}

Null route an IP

Null the given IP address. It might take a few minutes before the change is propagated across the network.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

ip
required
string
Example: 127.0.0.6

The IP Address

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/ips/127.0.0.6/null \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "ddos": {
    },
  • "floatingIp": false,
  • "gateway": "12.123.123.254",
  • "ip": "12.123.123.1/24",
  • "mainIp": true,
  • "networkType": "PUBLIC",
  • "nullRouted": false,
  • "reverseLookup": "domain.example.com",
  • "version": 4
}

Remove a null route

Remove an existing null route for the given IP address. It might take a few minutes before the change is propagated across the network.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

ip
required
string
Example: 127.0.0.6

The IP Address

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/ips/127.0.0.6/unnull \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "ddos": {
    },
  • "floatingIp": false,
  • "gateway": "12.123.123.254",
  • "ip": "12.123.123.1/24",
  • "mainIp": true,
  • "networkType": "PUBLIC",
  • "nullRouted": false,
  • "reverseLookup": "domain.example.com",
  • "version": 4
}

Show null route history

Show all null route history for any ips associated with this a network equipment.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

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/bareMetals/v2/networkEquipments/12345/nullRouteHistory?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

List network equipment credentials

The credentials API allows you to store usernames and passwords securely.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

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/bareMetals/v2/networkEquipments/12345/credentials?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Create new network equipment credentials

Password will NOT be updated on the network equipment. The ability to update credentials is for convenience only. It provides a secure way to communicate passwords with Leaseweb engineers in case support is required.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

Request Body schema: application/json
password
required
string

The password for the credentials

type
required
string (credentialType2)
Enum: "OPERATING_SYSTEM" "RESCUE_MODE" "REMOTE_MANAGEMENT" "CONTROL_PANEL" "SWITCH" "PDU" "FIREWALL" "LOAD_BALANCER" "VNC" "TEMPORARY_OPERATING_SYSTEM" "VPN_USER" "COMBINATION_LOCK" "DATABASE"

The type of the credential.

username
required
string

The username for the credentials

Responses

Request samples

Content type
application/json
{
  • "password": "mys3cr3tp@ssw0rd",
  • "type": "OPERATING_SYSTEM",
  • "username": "root"
}

Response samples

Content type
application/json
{
  • "password": "mys3cr3tp@ssw0rd",
  • "type": "OPERATING_SYSTEM",
  • "username": "root"
}

List network equipment credentials by type

List all the credentials filtered by the specified type that are associated with this network equipment.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

type
required
string
Enum: "OPERATING_SYSTEM" "RESCUE_MODE" "REMOTE_MANAGEMENT" "CONTROL_PANEL" "SWITCH" "PDU" "FIREWALL" "LOAD_BALANCER" "VNC" "TEMPORARY_OPERATING_SYSTEM" "VPN_USER" "COMBINATION_LOCK" "DATABASE"

The type of the credential.

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/bareMetals/v2/networkEquipments/12345/credentials/%7Btype%7D?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Delete network equipment credentials

This action is purely administrative and will only remove the username and password associated with this resource from our database.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

type
required
string
Enum: "OPERATING_SYSTEM" "RESCUE_MODE" "REMOTE_MANAGEMENT" "CONTROL_PANEL" "SWITCH" "PDU" "FIREWALL" "LOAD_BALANCER" "VNC" "TEMPORARY_OPERATING_SYSTEM" "VPN_USER" "COMBINATION_LOCK" "DATABASE"

The type of the credential.

username
required
string
Example: root

Username

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/credentials/%7Btype%7D/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."
}

Show network equipment credentials

View the password for the given credential, identified by type and username.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

type
required
string
Enum: "OPERATING_SYSTEM" "RESCUE_MODE" "REMOTE_MANAGEMENT" "CONTROL_PANEL" "SWITCH" "PDU" "FIREWALL" "LOAD_BALANCER" "VNC" "TEMPORARY_OPERATING_SYSTEM" "VPN_USER" "COMBINATION_LOCK" "DATABASE"

The type of the credential.

username
required
string
Example: root

Username

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/credentials/%7Btype%7D/root \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "password": "mys3cr3tp@ssw0rd",
  • "type": "OPERATING_SYSTEM",
  • "username": "root"
}

Update network equipment credentials

The usernames or types cannot be changed. In order to change those remove this credentials and create a new one.

This action is purely administrative and will only update the password associated with this resource in our database.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

type
required
string
Enum: "OPERATING_SYSTEM" "RESCUE_MODE" "REMOTE_MANAGEMENT" "CONTROL_PANEL" "SWITCH" "PDU" "FIREWALL" "LOAD_BALANCER" "VNC" "TEMPORARY_OPERATING_SYSTEM" "VPN_USER" "COMBINATION_LOCK" "DATABASE"

The type of the credential.

username
required
string
Example: root

Username

Request Body schema: application/json
password
required
string

The password for the credentials

Responses

Request samples

Content type
application/json
{
  • "password": "mys3cr3tp@ssw0rd"
}

Response samples

Content type
application/json
{
  • "password": "mys3cr3tp@ssw0rd",
  • "type": "OPERATING_SYSTEM",
  • "username": "root"
}

Power cycle a network equipment

Powercyle the network equipment.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/powerCycle \
  --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."
}

Show power status

The network equipment can either be ON or OFF. Network Equipment can be powered on or off by using the respective /powerOn and /powerOff API calls. In addition network equipment can also be rebooted using the /powerCycle API call.

The pdu object describes the power status from the power distribution unit (PDU) point of view. If your network equipment is connected to multiple PDU ports the status property will report on if at least one PDU port has power.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/powerInfo \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Power off network equipment

Power off the given network equipment.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/powerOff \
  --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."
}

Power on network equipment

Power on the given network equipment.

Authorizations:
X-LSW-Auth
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/powerOn \
  --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."
}

Dedicated Racks

Leaseweb Dedicated Racks are physical racks that are dedicated to a single customer, providing high performance, scalability, and security. They are ideal for businesses that require a dedicated environment for their critical applications.

List dedicated racks

This API returns a paginated list of all dedicated racks.

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

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

reference
string
Example: reference=my-db

Filter the list of dedicated racks by reference.

privateNetworkCapable
boolean
Enum: true false

Filter the list of private network capable dedicated racks

privateNetworkEnabled
boolean
Enum: true false

Filter the list of private network enabled dedicated racks

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/privateRacks?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&reference=my-db&privateNetworkCapable=SOME_BOOLEAN_VALUE&privateNetworkEnabled=SOME_BOOLEAN_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect a dedicated rack

Retrieve information about a single dedicated rack.

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "contract": {
    },
  • "featureAvailability": {
    },
  • "id": "2893829",
  • "location": {
    },
  • "networkInterfaces": {
    },
  • "powerPorts": [ ],
  • "units": [
    ]
}

Update a dedicated rack

A reference can be used to uniquely identify a dedicated rack with a name, such as production.

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

Request Body schema: application/json
reference
required
string

The reference for this dedicated rack

Responses

Request samples

Content type
application/json
{
  • "reference": "production"
}

Response samples

Content type
application/json
{
  • "correlationId": "945bef2e-1caf-4027-bd0a-8976848f3dee",
  • "errorCode": 400,
  • "errorDetails": { },
  • "errorMessage": "Validation Failed"
}

Inspect null route history

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/nullRouteHistory?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

List IPs

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

query Parameters
networkType
string

Filter the collection of ip addresses by network type

version
string

Filter the collection by ip version

nullRouted
string

Filter Ips by Nulled-Status

ips
string

Filter the collection of Ips for the comma separated list of Ips

limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/ips?networkType=SOME_STRING_VALUE&version=SOME_STRING_VALUE&nullRouted=SOME_STRING_VALUE&ips=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": {
    },
  • "ips": [
    ]
}

Inspect an IP

Authorizations:
X-LSW-Auth
path Parameters
ip
required
string
Example: 192.168.0.1

IP Address

privateRackId
required
string
Example: 2314213

Id of the dedicated rack

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/ips/192.168.0.1 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "ip": "12.123.123.1/24",
  • "gateway": "12.123.123.254",
  • "floatingIp": false,
  • "version": 4,
  • "nullRouted": false,
  • "reverseLookup": "domain.example.com",
  • "mainIp": true,
  • "networkType": "PUBLIC",
  • "ddos": {
    }
}

Update an IP

Update the reverse lookup or DDoS detection profile for the ip address. For more information about DDoS detection profiles click here for our KB related article.

Authorizations:
X-LSW-Auth
path Parameters
ip
required
string
Example: 192.168.0.1

IP Address

privateRackId
required
string
Example: 2314213

Id of the dedicated rack

Request Body schema: application/json
reverseLookup
string

The reverse lookup value

detectionProfile
string
Enum: "ADVANCED_DEFAULT" "ADVANCED_LOW_UDP" "ADVANCED_MED_UDP"

The detection profile value

Responses

Request samples

Content type
application/json
{
  • "reverseLookup": "domain.example.com",
  • "detectionProfile": "ADVANCED_LOW_UDP"
}

Response samples

Content type
application/json
{
  • "ip": "12.123.123.1/24",
  • "gateway": "12.123.123.254",
  • "floatingIp": false,
  • "version": 4,
  • "nullRouted": false,
  • "reverseLookup": "domain.example.com",
  • "mainIp": true,
  • "networkType": "PUBLIC",
  • "ddos": {
    }
}

Null route an IP

It might take a few minutes before the null route is propagated across the network.

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

ip
required
string
Example: 192.168.0.1

IP Address

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/ips/192.168.0.1/null \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "ip": "12.123.123.1/24",
  • "gateway": "12.123.123.254",
  • "floatingIp": false,
  • "version": 4,
  • "nullRouted": false,
  • "reverseLookup": "domain.example.com",
  • "mainIp": true,
  • "networkType": "PUBLIC",
  • "ddos": {
    }
}

Remove a null route

It might take a few minutes before the change is propagated across the network.

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

ip
required
string
Example: 192.168.0.1

IP Address

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/ips/192.168.0.1/unnull \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "ip": "12.123.123.1/24",
  • "gateway": "12.123.123.254",
  • "floatingIp": false,
  • "version": 4,
  • "nullRouted": false,
  • "reverseLookup": "domain.example.com",
  • "mainIp": true,
  • "networkType": "PUBLIC",
  • "ddos": {
    }
}

List credentials

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/credentials?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Create new credentials

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

Request Body schema: application/json
type
required
string
Enum: "OPERATING_SYSTEM" "CONTROL_PANEL" "REMOTE_MANAGEMENT" "RESCUE_MODE" "SWITCH" "PDU" "FIREWALL" "LOAD_BALANCER"

The type of the credential

username
required
string

The username for the credentials

password
required
string

The password for the credentials

Responses

Request samples

Content type
application/json
{
  • "type": "OPERATING_SYSTEM",
  • "username": "root",
  • "password": "my-secret-password"
}

Response samples

Content type
application/json
{
  • "password": "mys3cr3tp@ssw0rd",
  • "type": "OPERATING_SYSTEM",
  • "username": "root"
}

List credentials by type

Authorizations:
X-LSW-Auth
path Parameters
type
required
string
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/credentials/%7Btype%7D?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect user credentials

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

username
required
string
type
required
string

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/credentials/%7Btype%7D/%7Busername%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "password": "mys3cr3tp@ssw0rd",
  • "type": "OPERATING_SYSTEM",
  • "username": "root"
}

Update user credentials

This action is purely administrative and will only update the password associated with this resource in our database.

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

username
required
string
type
required
string
Request Body schema: application/json
password
required
string

The password for the credentials

Responses

Request samples

Content type
application/json
{
  • "password": "Y5TurbBQtP5OzvduSH6g"
}

Response samples

Content type
application/json
{
  • "password": "mys3cr3tp@ssw0rd",
  • "type": "OPERATING_SYSTEM",
  • "username": "root"
}

Delete user credentials

This action is purely administrative and will only remove the username and password associated with this resource from our database.

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

username
required
string
type
required
string

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/credentials/%7Btype%7D/%7Busername%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "errorCode": "ACCESS_DENIED",
  • "errorMessage": "The access token is expired or invalid."
}

Inspect datatraffic metrics

At this moment only bandwidth information for the public interface is supported.

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

query Parameters
from
date

Start of date interval in ISO-8601 format

The returned data will include everything up from - and including - the specified date time.

to
date

End of date interval in ISO-8601 format.

The returned data will include everything up until - but not including - the specified date time.

granularity
string
Enum: "DAY" "WEEK" "MONTH" "YEAR"

Specify the preferred interval for each metric. If granularity is omitted from the request, only one metric is returned.

aggregation
string
Value: "SUM"

Aggregate each metric using the given aggregation function.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/metrics/datatraffic?from=SOME_DATE_VALUE&to=SOME_DATE_VALUE&granularity=SOME_STRING_VALUE&aggregation=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect bandwidth metrics

At this moment only bandwidth information for the public interface is supported.

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

query Parameters
from
date

Start of date interval in ISO-8601 format

The returned data will include everything up from - and including - the specified date time.

to
date

End of date interval in ISO-8601 format.

The returned data will include everything up until - but not including - the specified date time.

granularity
string
Enum: "5MIN" "HOUR" "DAY" "WEEK" "MONTH" "YEAR"

Specify the preferred interval for each metric. If granularity is omitted from the request, only one metric is returned.

aggregation
string
Enum: "AVG" "95TH"

Aggregate each metric using the given aggregation function. When the aggregation type 95TH is specified the granularity parameter should be omitted from the request.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/metrics/bandwidth?from=SOME_DATE_VALUE&to=SOME_DATE_VALUE&granularity=SOME_STRING_VALUE&aggregation=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect DDos notification settings

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/notificationSettings/ddos \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "nulling": "ENABLED",
  • "scrubbing": "DISABLED"
}

Update DDos notification settings

To configure DDoS notification for this resource, send a PUT request. On success the response will be a HTTP 204 No Content.

Notifications will be sent to all technical contact email addresses of the customer.

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

Request Body schema: application/json
scrubbing
required
string
Enum: "ENABLED" "DISABLED"

Enable or disable email notifications for nulling events

nulling
required
string
Enum: "ENABLED" "DISABLED"

Enable or disable email notifications for nulling events

Responses

Request samples

Content type
application/json
{
  • "scrubbing": "ENABLED",
  • "nulling": "DISABLED"
}

Response samples

Content type
application/json
{
  • "correlationId": "945bef2e-1caf-4027-bd0a-8976848f3dee",
  • "errorCode": 400,
  • "errorDetails": { },
  • "errorMessage": "Validation Failed"
}

List bandwidth notification settings

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/notificationSettings/bandwidth?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Create new bandwidth notification setting

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

Request Body schema: application/json
frequency
required
string
Enum: "DAILY" "WEEKLY" "MONTHLY"

Frequency for the Bandwidth Notification

unit
required
string
Enum: "Gbps" "Mbps"

Unit for the Bandwidth Notification

threshold
required
string

Threshold Value for the Bandwidth Notification

Responses

Request samples

Content type
application/json
{
  • "frequency": "DAILY",
  • "unit": "Gbps",
  • "threshold": "1"
}

Response samples

Content type
application/json
{
  • "actions": [
    ],
  • "frequency": "WEEKLY",
  • "id": "12345",
  • "lastCheckedAt": "2021-03-16T01:01:41+00:00",
  • "threshold": "1",
  • "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
  • "unit": "Gbps"
}

Inspect bandwidth notification settings

Retrieve a single Bandwidth Notification that is associated with the given resource.

A Bandwidth Notification can be updated and deleted.

Authorizations:
X-LSW-Auth
path Parameters
notificationId
required
string
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/notificationSettings/bandwidth/%7BnotificationId%7D?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "actions": [
    ],
  • "frequency": "WEEKLY",
  • "id": "12345",
  • "lastCheckedAt": "2021-03-16T01:01:41+00:00",
  • "threshold": "1",
  • "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
  • "unit": "Gbps"
}

Update bandwidth notification settings

Authorizations:
X-LSW-Auth
path Parameters
notificationId
required
string
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

Request Body schema: application/json
frequency
required
string
Enum: "DAILY" "WEEKLY" "MONTHLY"

Frequency for the Bandwidth Notification

unit
required
string
Enum: "Gbps" "Mbps"

Unit for the Bandwidth Notification

threshold
required
string

Threshold Value for the Bandwidth Notification

Responses

Request samples

Content type
application/json
{
  • "frequency": "DAILY",
  • "unit": "Gbps",
  • "threshold": "1"
}

Response samples

Content type
application/json
{
  • "actions": [
    ],
  • "frequency": "WEEKLY",
  • "id": "12345",
  • "lastCheckedAt": "2021-03-16T01:01:41+00:00",
  • "threshold": "1",
  • "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
  • "unit": "Gbps"
}

Delete bandwidth notification settings

Authorizations:
X-LSW-Auth
path Parameters
notificationId
required
string
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/notificationSettings/bandwidth/%7BnotificationId%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "errorCode": "ACCESS_DENIED",
  • "errorMessage": "The access token is expired or invalid."
}

List datatraffic notification settings

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/notificationSettings/datatraffic?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Create datatraffic notification settings

Authorizations:
X-LSW-Auth
path Parameters
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

Request Body schema: application/json
frequency
required
string
Enum: "DAILY" "WEEKLY" "MONTHLY"

Frequency for the Datatraffic Notification

unit
required
string
Enum: "MB" "GB" "TB"

Unit for the Datatraffic Notification

threshold
required
string

Threshold Value for the Datatraffic Notification

Responses

Request samples

Content type
application/json
{
  • "frequency": "DAILY",
  • "unit": "MB",
  • "threshold": "1"
}

Response samples

Content type
application/json
{
  • "actions": [
    ],
  • "frequency": "WEEKLY",
  • "id": "12345",
  • "lastCheckedAt": "2021-03-16T01:01:41+00:00",
  • "threshold": "1",
  • "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
  • "unit": "GB"
}

Inspect datatraffic notification settings

Authorizations:
X-LSW-Auth
path Parameters
notificationId
required
string
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/notificationSettings/datatraffic/%7BnotificationId%7D?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "actions": [
    ],
  • "frequency": "WEEKLY",
  • "id": "12345",
  • "lastCheckedAt": "2021-03-16T01:01:41+00:00",
  • "threshold": "1",
  • "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
  • "unit": "GB"
}

Update datatraffic notification settings

Authorizations:
X-LSW-Auth
path Parameters
notificationId
required
string
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

Request Body schema: application/json
frequency
required
string
Enum: "DAILY" "WEEKLY" "MONTHLY"

Frequency for the Datatraffic Notification

unit
required
string
Enum: "MB" "GB" "TB"

Unit for the Datatraffic Notification

threshold
required
string

Threshold Value for the Datatraffic Notification

Responses

Request samples

Content type
application/json
{
  • "frequency": "DAILY",
  • "unit": "GB",
  • "threshold": "1"
}

Response samples

Content type
application/json
{
  • "actions": [
    ],
  • "frequency": "WEEKLY",
  • "id": "12345",
  • "lastCheckedAt": "2021-03-16T01:01:41+00:00",
  • "threshold": "1",
  • "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
  • "unit": "GB"
}

Delete datatraffic notification settings

Authorizations:
X-LSW-Auth
path Parameters
notificationId
required
string
privateRackId
required
string
Example: 2314213

Id of the dedicated rack

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/notificationSettings/datatraffic/%7BnotificationId%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "errorCode": "ACCESS_DENIED",
  • "errorMessage": "The access token is expired or invalid."
}

IP management

Leaseweb IP management is a service that allows businesses to manage their IP addresses efficiently. It offers a range of IP management options, including IP address allocation, IP address management, and IP address monitoring, to meet different IP management needs and requirements.

List IPs

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.

subnetId
string

Filter by subnet

version
integer
Enum: 4 6

Filter by protocol version

type
string
Enum: "NORMAL_IP" "NETWORK" "BROADCAST" "GATEWAY" "ROUTER1" "ROUTER2" "IPMI"

Filter by IP type

nullRouted
boolean

Filter by whether or not the IP has an active null route (true or false)

primary
boolean

Filter by whether or not the IP is primary (true or false)

fromIp
string

Return only IPs greater or equal to the specified address

toIp
string

Return only IPs lower or equal to the specified address

ips
string

Return only IPs specified as a comma-separated list

equipmentIds
string

Return only IPs assigned to equipment items specified as a comma-separated list of IDs

assignedContractIds
string

Return only IPs assigned to contracts specified as a comma-separated list of IDs

sort
string

Comma-separated list of sort field names. Prepend the field name with '-' for descending order. E.g. sort=ip,-nullrouted. Sortable field names are ip, nullRouted, reverseLookup.

reverseLookup
string
Example: reverseLookup=mydomain1.example.com

Filter by reverse lookup.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/ipMgmt/v2/ips?limit=20&offset=10&subnetId=SOME_STRING_VALUE&version=SOME_INTEGER_VALUE&type=SOME_STRING_VALUE&nullRouted=SOME_BOOLEAN_VALUE&primary=SOME_BOOLEAN_VALUE&fromIp=SOME_STRING_VALUE&toIp=SOME_STRING_VALUE&ips=SOME_STRING_VALUE&equipmentIds=SOME_STRING_VALUE&assignedContractIds=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&reverseLookup=mydomain1.example.com' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect an IP

Authorizations:
X-LSW-Auth
path Parameters
ip
required
string
Example: 192.0.2.1

IP address or IP address with prefixLength {ip}_{prefix}. If prefixLength is not given, then we assume 32 (for IPv4) or 128 (for IPv6). PrefixLength is mandatory for IP range, for example, the IPv6 address range with prefixLength = 112

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "ip": "192.0.2.1",
  • "version": 4,
  • "type": "NORMAL_IP",
  • "prefixLength": 32,
  • "primary": true,
  • "reverseLookup": "mydomain1.example.com",
  • "nullRouted": false,
  • "nullLevel": null,
  • "unnullingAllowed": false,
  • "equipmentId": "1234",
  • "assignedContract": {
    },
  • "subnet": {
    }
}

Update an IP

Use this operation to set reverse lookup for IPv4 IP addresses.

Authorizations:
X-LSW-Auth
path Parameters
ip
required
string <ipv4>

IP address or IP address with prefixLength {ip}_{prefix}. If prefixLength is not given, then we assume 32

Request Body schema: application/json
reverseLookup
required
string

Responses

Request samples

Content type
application/json
{
  • "reverseLookup": "mydomain1.example.com"
}

Response samples

Content type
application/json
{
  • "ip": "192.0.2.1",
  • "version": 4,
  • "type": "NORMAL_IP",
  • "prefixLength": 32,
  • "primary": true,
  • "reverseLookup": "mydomain1.example.com",
  • "nullRouted": false,
  • "nullLevel": null,
  • "unnullingAllowed": false,
  • "equipmentId": "1234",
  • "assignedContract": {
    },
  • "subnet": {
    }
}

List reverse lookup records for an IPv6 range

Get reverse lookup values set for IPs in the specified range

Authorizations:
X-LSW-Auth
path Parameters
ip
required
string
Example: 192.0.2.1

IP address or IP address with prefixLength {ip}_{prefix}. If prefixLength is not given, then we assume 32 (for IPv4) or 128 (for IPv6). PrefixLength is mandatory for IP range, for example, the IPv6 address range with prefixLength = 112

query Parameters
ip
string

Filter the list by IP address

reverseLookup
string
Example: reverseLookup=mydomain1.example.com

Filter by reverse lookup.

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/ipMgmt/v2/ips/192.0.2.1/reverseLookup?ip=SOME_STRING_VALUE&reverseLookup=mydomain1.example.com&limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Set or remove reverse lookup records for an IPv6 range

This endpoint allows to set or unset reverse lookup for multiple IPv6 IPs in a specific IP range. To remove reverse lookup for an IP address set it to null or "". Reverse lookup values of IPs not listed in the request body will not be affected. You can set up to 20 records in a single request.

Authorizations:
X-LSW-Auth
path Parameters
ip
required
string
Example: 192.0.2.1

IP address or IP address with prefixLength {ip}_{prefix}. If prefixLength is not given, then we assume 32 (for IPv4) or 128 (for IPv6). PrefixLength is mandatory for IP range, for example, the IPv6 address range with prefixLength = 112

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

Responses

Request samples

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

Response samples

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

Null route an IP

Authorizations:
X-LSW-Auth
path Parameters
ip
required
string
Example: 192.0.2.1

IP address or IP address with prefixLength {ip}_{prefix}. If prefixLength is not given, then we assume 32 (for IPv4) or 128 (for IPv6). PrefixLength is mandatory for IP range, for example, the IPv6 address range with prefixLength = 112

Request Body schema: application/json
automatedUnnullingAt
string <date-time>

The date and time when the null route is to be deactivated. The date and time should be specified using the format yyyy-mm-ddThh:mm:ss±hh:mm (with time zone designator) or yyyy-mm-ddThh:mm:ssZ (UTC). If this field is not present then the null route will not be automatically removed.

comment
string

A comment to be stored with the null route (e.g. null route reason)

ticketId
string

A reference to be stored with the null route

Responses

Request samples

Content type
application/json
{
  • "automatedUnnullingAt": "2015-06-25T11:13:00Z",
  • "comment": "This IP is evil",
  • "ticketId": "188612"
}

Response samples

Content type
application/json
{
  • "assignedContract": {
    },
  • "automatedUnnullingAt": "2015-06-25T11:13:00Z",
  • "comment": "This IP is evil",
  • "equipmentId": "456",
  • "id": "4534536",
  • "ip": "192.0.2.1",
  • "nullLevel": 1,
  • "nulledAt": "2015-06-28T12:00:00Z",
  • "nulledBy": "john.doe@example.com",
  • "ticketId": "188612",
  • "unnulledAt": null,
  • "unnulledBy": null
}

Remove a null route

Authorizations:
X-LSW-Auth
path Parameters
ip
required
string
Example: 192.0.2.1

IP address or IP address with prefixLength {ip}_{prefix}. If prefixLength is not given, then we assume 32 (for IPv4) or 128 (for IPv6). PrefixLength is mandatory for IP range, for example, the IPv6 address range with prefixLength = 112

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/ipMgmt/v2/ips/192.0.2.1/nullRoute \
  --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."
}

Inspect null route history

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.

fromIp
string

Return only IPs greater or equal to the specified address

toIp
string

Return only IPs lower or equal to the specified address

fromDate
string <date>

Return only null routes active after the specified date and time

toDate
string <date>

Return only null routes active before the specified date and time

nulledBy
string

Filter by the email address of the user who created the null route

unnulledBy
string

Filter by the email address of the user who removed the null route

ticketId
string

Filter by the reference stored with the null route

contractId
string

Filter by ID of the contract assigned to the IP at the time of null route creation

equipmentId
string

Filter by ID of the server assigned to the IP at the time of null route creation

sort
string

Comma-separated list of sort field names. Prepend the field name with '-' for descending order. E.g. sort=ip,-nullrouted. Sortable field names are ip, nullRouted, reverseLookup.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/ipMgmt/v2/nullRoutes?limit=20&offset=10&fromIp=SOME_STRING_VALUE&toIp=SOME_STRING_VALUE&fromDate=SOME_STRING_VALUE&toDate=SOME_STRING_VALUE&nulledBy=SOME_STRING_VALUE&unnulledBy=SOME_STRING_VALUE&ticketId=SOME_STRING_VALUE&contractId=SOME_STRING_VALUE&equipmentId=SOME_STRING_VALUE&sort=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect null route history

Authorizations:
X-LSW-Auth
path Parameters
id
required
string
Example: 23234

Null route ID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/ipMgmt/v2/nullRoutes/23234 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "assignedContract": {
    },
  • "automatedUnnullingAt": "2015-06-25T11:13:00Z",
  • "comment": "This IP is evil",
  • "equipmentId": "456",
  • "id": "4534536",
  • "ip": "192.0.2.1",
  • "nullLevel": 1,
  • "nulledAt": "2015-06-28T12:00:00Z",
  • "nulledBy": "john.doe@example.com",
  • "ticketId": "188612",
  • "unnulledAt": null,
  • "unnulledBy": null
}

Update a null route

Authorizations:
X-LSW-Auth
path Parameters
id
required
string
Example: 23234

Null route ID

Request Body schema: application/json
automatedUnnullingAt
string <date-time>

The date and time when the null route is to be deactivated. The date and time should be specified using the format yyyy-mm-ddThh:mm:ss±hh:mm (with time zone designator) or yyyy-mm-ddThh:mm:ssZ (UTC). If this field is not present then the null route will not be automatically removed.

comment
string

A comment to be stored with the null route (e.g. null route reason)

ticketId
string

A reference to be stored with the null route

Responses

Request samples

Content type
application/json
{
  • "automatedUnnullingAt": "2015-06-25T11:13:00Z",
  • "comment": "This IP is evil",
  • "ticketId": "188612"
}

Response samples

Content type
application/json
{
  • "assignedContract": {
    },
  • "automatedUnnullingAt": "2015-06-25T11:13:00Z",
  • "comment": "This IP is evil",
  • "equipmentId": "456",
  • "id": "4534536",
  • "ip": "192.0.2.1",
  • "nullLevel": 1,
  • "nulledAt": "2015-06-28T12:00:00Z",
  • "nulledBy": "john.doe@example.com",
  • "ticketId": "188612",
  • "unnulledAt": null,
  • "unnulledBy": null
}

Floating IPs

Leaseweb Floating IPs are IP addresses that are dedicated to a single customer, providing high performance, scalability, and security. They are ideal for businesses that require a dedicated environment for their critical applications.

List ranges

A Floating IP range is bound to a particular site or metro.

If you have services in multiple data centers and want to use the Floating IP feature in each of those locations you will need to order a range per site or metro.

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

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

type
string
Enum: "SITE" "METRO"

Filter ranges by range type

location
string

Filter ranges by range location

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/floatingIps/v2/ranges?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&type=SOME_STRING_VALUE&location=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect a range

A Floating IP range is identified by is network IP and the prefix length, separated by a underscore; for example 10.0.0.0_29.

Be aware that every IP address of a Floating IP range is usable and routable. A Floating IP range does not have a network IP, broadcast IP or gateway IP.

So for every IP in the range you can create a Floating IP Definition.

Authorizations:
X-LSW-Auth
path Parameters
rangeId
required
string
Example: 10.0.0.0_29

ID of a Floating IP Range, consisting of network IP and prefix length (separated by an underscore)

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/floatingIps/v2/ranges/10.0.0.0_29 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "id": "88.17.0.0_17",
  • "range": "88.17.0.0/17",
  • "customerId": "10001234",
  • "salesOrgId": "2000",
  • "location": "AMS-01",
  • "type": "SITE"
}

List range definitions

A Floating IP definition describes a mapping between one or more Floating IPs (a.k.a Floating IP) to an anchor IP. Traffic destined for all the Floating IPs will be rerouted to the anchor IP.

The anchor IP is an ip address that belongs to a service you have with Leaseweb. At this moment only dedicated servers, dedicated racks and colocations are supported.

Authorizations:
X-LSW-Auth
path Parameters
rangeId
required
string
Example: 10.0.0.0_29

ID of a Floating IP Range, consisting of network IP and prefix length (separated by an underscore)

query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

location
string

Filter range definations by range location

type
string
Enum: "SITE" "METRO"

Filter range definations by range type

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/floatingIps/v2/ranges/10.0.0.0_29/floatingIpDefinitions?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&location=SOME_STRING_VALUE&type=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Create a range definition

When a Floating IP definition is created, the Floating IP address is then made to route all traffic to the anchor IP address, Hence all services on the server become reachable via the Floating IP. This works in the background by maintaining BGP sessions in each site which announce the Floating IP routes through the border routers.

Floating IP addresses which do not have an anchor IP address have no route, and are thus effectively nullrouted.

How to configure Floating IPs on a server

On the server, Floating IPs should be setup like any other additional IP address. However, the same Floating IP will have to be setup on all servers that you want to be able to route it to.

Note: Currently, Floating IPs does not work on VPS or Cloud servers.

Authorizations:
X-LSW-Auth
path Parameters
rangeId
required
string
Example: 10.0.0.0_29

ID of a Floating IP Range, consisting of network IP and prefix length (separated by an underscore)

Request Body schema: application/json
floatingIp
required
string

The Floating IP address

anchorIp
required
string

The Anchor IP address

passiveAnchorIp
string

The Passive anchor IP address used for Anchor IP toggling

Responses

Request samples

Content type
application/json
{
  • "floatingIp": "88.17.0.5/32",
  • "anchorIp": "95.10.126.1",
  • "passiveAnchorIp": "95.10.126.2"
}

Response samples

Content type
application/json
{
  • "id": "88.17.34.108_32",
  • "rangeId": "88.17.0.0_17",
  • "location": "AMS-01",
  • "type": "SITE",
  • "customerId": "10001234",
  • "salesOrgId": "2000",
  • "floatingIp": "88.17.34.108/32",
  • "anchorIp": "95.10.126.1",
  • "passiveAnchorIp": "95.10.126.2",
  • "status": "ACTIVE",
  • "createdAt": "2019-03-13T09:10:02+0000",
  • "updatedAt": "2019-03-13T09:10:02+0000"
}

Inspect a range definition

Authorizations:
X-LSW-Auth
path Parameters
rangeId
required
string
Example: 10.0.0.0_29

ID of a Floating IP Range, consisting of network IP and prefix length (separated by an underscore)

floatingIpDefinitionId
required
string

ID of a Floating IP Definition, consisting of network IP and prefix length (separated by an underscore)

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/floatingIps/v2/ranges/10.0.0.0_29/floatingIpDefinitions/%7BfloatingIpDefinitionId%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "id": "88.17.34.108_32",
  • "rangeId": "88.17.0.0_17",
  • "location": "AMS-01",
  • "type": "SITE",
  • "customerId": "10001234",
  • "salesOrgId": "2000",
  • "floatingIp": "88.17.34.108/32",
  • "anchorIp": "95.10.126.1",
  • "passiveAnchorIp": "95.10.126.2",
  • "status": "ACTIVE",
  • "createdAt": "2019-03-13T09:10:02+0000",
  • "updatedAt": "2019-03-13T09:10:02+0000"
}

Update a range definition

Imagine you have 2 dedicated servers in AMS-01, in different racks. And you have a Floating IP definition for Floating IP 10.0.0.0_32. You have configured the ip address 10.0.0.0/32 on both dedicated servers.

If the anchor IP in the Floating IP definition is pointing to your first server, all traffic goes to that server. With this PUT request you can change the Anchor IP address to point to, for example, your second server. Within a matter of seconds all the traffic destined for the Floating IP will now end up at the new Anchor IP. In the above example, your second server.

Authorizations:
X-LSW-Auth
path Parameters
rangeId
required
string
Example: 10.0.0.0_29

ID of a Floating IP Range, consisting of network IP and prefix length (separated by an underscore)

floatingIpDefinitionId
required
string

ID of a Floating IP Definition, consisting of network IP and prefix length (separated by an underscore)

Request Body schema: application/json
anchorIp
required
string

The Anchor IP address

passiveAnchorIp
string

The Passive anchor IP address used for Anchor IP toggling

Responses

Request samples

Content type
application/json
{
  • "anchorIp": "95.10.126.1"
}

Response samples

Content type
application/json
{
  • "id": "88.17.34.108_32",
  • "rangeId": "88.17.0.0_17",
  • "location": "AMS-01",
  • "type": "SITE",
  • "customerId": "10001234",
  • "salesOrgId": "2000",
  • "floatingIp": "88.17.34.108/32",
  • "anchorIp": "95.10.126.1",
  • "passiveAnchorIp": "95.10.126.2",
  • "status": "ACTIVE",
  • "createdAt": "2019-03-13T09:10:02+0000",
  • "updatedAt": "2019-03-13T09:10:02+0000"
}

Remove a range definition

Authorizations:
X-LSW-Auth
path Parameters
rangeId
required
string
Example: 10.0.0.0_29

ID of a Floating IP Range, consisting of network IP and prefix length (separated by an underscore)

floatingIpDefinitionId
required
string

ID of a Floating IP Definition, consisting of network IP and prefix length (separated by an underscore)

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/floatingIps/v2/ranges/10.0.0.0_29/floatingIpDefinitions/%7BfloatingIpDefinitionId%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "id": "88.17.34.108_32",
  • "rangeId": "88.17.0.0_17",
  • "location": "AMS-01",
  • "type": "SITE",
  • "customerId": "10001234",
  • "salesOrgId": "2000",
  • "floatingIp": "88.17.34.108/32",
  • "anchorIp": "95.10.126.1",
  • "passiveAnchorIp": "95.10.126.2",
  • "status": "ACTIVE",
  • "createdAt": "2019-03-13T09:10:02+0000",
  • "updatedAt": "2019-03-13T09:10:02+0000"
}

Toggle the anchor IP with the passive anchor IP

Imagine you have 2 dedicated servers in AMS-01, in different racks. And you have a Floating IP definition for Floating IP 10.0.0.0_32. You have configured the ip address 10.0.0.0/32 on both dedicated servers.

If the Anchor IP in the Floating IP definition is pointing to your first server, all traffic goes to that server. With this PUT request you can toggle the Anchor IP address to point to, for example, your second server, or any other server registered as the Passive Anchor IP. Within a matter of seconds the Anchor IP and the Passive Anchor IP will switch places and all the traffic destined for the Floating IP will now end up at the new Anchor IP. In the above example, your second server.

Authorizations:
X-LSW-Auth
path Parameters
rangeId
required
string
Example: 10.0.0.0_29

ID of a Floating IP Range, consisting of network IP and prefix length (separated by an underscore)

floatingIpDefinitionId
required
string

ID of a Floating IP Definition, consisting of network IP and prefix length (separated by an underscore)

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/floatingIps/v2/ranges/10.0.0.0_29/floatingIpDefinitions/%7BfloatingIpDefinitionId%7D/toggleAnchorIp \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "id": "88.17.34.108_32",
  • "rangeId": "88.17.0.0_17",
  • "location": "AMS-01",
  • "type": "SITE",
  • "customerId": "10001234",
  • "salesOrgId": "2000",
  • "floatingIp": "88.17.34.108/32",
  • "anchorIp": "95.10.126.2",
  • "passiveAnchorIp": "95.10.126.1",
  • "status": "ACTIVE",
  • "createdAt": "2019-03-13T09:10:02+0000",
  • "updatedAt": "2019-03-13T09:10:02+0000"
}

Private Networks

Leaseweb Private Networks is a service that allows customers to connect multiple servers and cloud instances within a secure, isolated, and high-speed private network. This eliminates the need to use public internet connections for internal communications, improving security, reducing latency, and enhancing data transfer efficiency.

List private networks

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

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

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

Response samples

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

Create a private network

Currently only one Private Network is allowed per customer.

Optionally you can give your Private Network a name by supplying the name parameter in the request.

Once a Private Network is created you can add dedicated servers to this private network.

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

A name to describe this private network

Responses

Request samples

Content type
application/json
{
  • "name": "production"
}

Response samples

Content type
application/json
{
  • "id": "12345",
  • "name": "default",
  • "createdAt": "2015-01-21T14:34:12+0000",
  • "updatedAt": "2015-01-21T14:34:12+0000",
  • "equipmentCount": 0,
  • "servers": [ ]
}

Inspect a private network

Every dedicated server in your private network contains a status key explaining the current state of your server in your private network.

Possible state values are:

  • CONFIGURING Your server is currently being added to the private network (can take ~5 minute)
  • REMOVING Your server is currently being removed from the private network (can take ~5 minute)
  • CONFIGURED Your server is part of the private network.
Authorizations:
X-LSW-Auth
path Parameters
privateNetworkId
required
string

Id of the privateNetwork

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/privateNetworks/%7BprivateNetworkId%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "id": "12345",
  • "name": "default",
  • "createdAt": "2015-01-21T14:34:12+0000",
  • "updatedAt": "2015-01-21T14:34:12+0000"
}

Update a private network

Authorizations:
X-LSW-Auth
path Parameters
privateNetworkId
required
string

Id of the privateNetwork

Request Body schema: application/json
name
string

A name to describe this private network

Responses

Request samples

Content type
application/json
{
  • "name": "production"
}

Response samples

Content type
application/json
{
  • "id": "12345",
  • "name": "default",
  • "createdAt": "2015-01-21T14:34:12+0000",
  • "updatedAt": "2015-01-21T14:34:12+0000",
  • "servers": [ ]
}

Delete a private network

You can only delete a private network if it has no equipments attached to it anymore.

Authorizations:
X-LSW-Auth
path Parameters
privateNetworkId
required
string

Id of the privateNetwork

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/bareMetals/v2/privateNetworks/%7BprivateNetworkId%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "36ddff0b-0fc5-4bc5-cb4f-4a16a3895204",
  • "errorCode": 400,
  • "errorMessage": "You can only delete a private network if all equipments are removed from it."
}

Get DHCP reservations

Use this API to get DHCP the reservations of a private network.

Authorizations:
X-LSW-Auth
path Parameters
privateNetworkId
required
string
Example: 892

The ID of a Private Network

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/privateNetworks/892/reservations \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Create a DHCP reservation

Create a DHCP reservation for a private network.

Authorizations:
X-LSW-Auth
path Parameters
privateNetworkId
required
string
Example: 892

The ID of a Private Network

Request Body schema: application/json
required
ip
required
string

The IP address for this DHCP reservation

mac
required
string

The Mac address for this DHCP reservation

sticky
required
boolean

If false, this DHCP reservation will be automatically removed if not used for a longer period

Responses

Request samples

Content type
application/json
{
  • "ip": "127.0.0.1",
  • "mac": "D8:87:03:52:0A:0F",
  • "sticky": true
}

Response samples

Content type
application/json
{
  • "ip": "127.0.0.1",
  • "mac": "d8:87:03:52:0a:0f",
  • "sticky": true
}

Delete a DHCP reservation

This API call will delete a DHCP reservation from a private network.

Authorizations:
X-LSW-Auth
path Parameters
privateNetworkId
required
string
Example: 892

The ID of a Private Network

ip
required
string
Example: 127.0.0.6

The IP Address

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/bareMetals/v2/privateNetworks/892/reservations/127.0.0.6 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "400",
  • "errorDetails": { },
  • "errorMessage": "Validation Failed."
}

Remote Management

Leaseweb Remote Management is a service that allows businesses to manage their servers remotely. It offers a range of remote management options, including remote management, remote monitoring, and remote management, to meet different remote management needs and requirements.

Change OpenVPN credentials

Users can change their OpenVPN credentials. These credentials are stored using one way encryption so the user is responsible for storing and/or remembering this password.

If the password is lost a new one can be generated using this API call. If a new password is generated it will replace the old password.

Authorizations:
X-LSW-Auth
Request Body schema: application/json
password
string >= 8 characters

The password should be at least 8 characters and consisting of uppercase, lowercase, digits and special characters

Responses

Request samples

Content type
application/json
{
  • "password": "mys3cretp@ssw0rd"
}

Response samples

Content type
application/json
{
  • "errorCode": "ACCESS_DENIED",
  • "errorMessage": "The access token is expired or invalid."
}

List OpenVPN profiles

These profiles are used to establish a OpenVPN connection to a data center which will give you access to the IPMI interface of your dedicated server. Access to this interface allows a user to remotely administer the server in case it is not reachable.

Authorizations:
X-LSW-Auth

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/remoteManagement/profiles \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{}

Inspect an OpenVPN profile

Retrieve a OpenVPN profile for the given data center.

On success the response will be a pop specific OpenVPN profile containing a certificate and configuration.

This file can be used with OpenVPN clients to initiate a connection to Leaseweb Remote Management network.

Authorizations:
X-LSW-Auth
path Parameters
datacenter
required
string

Datacenter location

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/remoteManagement/profiles/lsw-rmvpn-%7Bdatacenter%7D.ovpn \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/x-openvpn-profile
client

proto udp
port 1194
dev tun

remote-random
remote

keepalive 10 60

remote-cert-tls server
resolv-retry infinite

comp-lzo
auth-user-pass
auth-retry interact
explicit-exit-notify 2

<ca>
-----BEGIN CERTIFICATE-----
AAAAAAAAAAAAAA.................
-----END CERTIFICATE-----
</ca>

Aggregation Packs

Leaseweb Aggregation Packs are a service that allows businesses to manage their servers remotely. It offers a range of aggregation packs options, including aggregation packs, aggregation packs monitoring, and aggregation packs management, to meet different aggregation packs needs and requirements.

List aggregation packs

List your Aggregation Packs. This api call supports pagination. Use the limit and offset query string parameters to paginate through all your aggregation packs.

Every aggregation pack object in the json response lists a few properties of a aggregation pack. Use the single resource api call to get more details for a single aggregation pack.

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/bareMetals/v2/aggregationPacks?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get aggregation pack

Use this API to get information about a single aggregation pack.

Authorizations:
X-LSW-Auth
path Parameters
aggregationPackId
required
string

The ID of aggregation pack

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/aggregationPacks/%7BaggregationPackId%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "aggregationType": "Hybrid",
  • "billingType": "95TH",
  • "connectivityType": "BANDWIDTH_POOL",
  • "contractStartDate": "2022-07-01T00:00:00Z",
  • "contractTerm": 36,
  • "customerId": "1234",
  • "dataTrafficCommit": 20000,
  • "dataTrafficCommitUnit": "Mbps",
  • "id": "123456",
  • "networkPerformanceType": "VOLUME",
  • "salesOrgId": "2000"
}

CDN

Leaseweb CDN is a service that allows businesses to manage their servers remotely. It offers a range of CDN options, including CDN, CDN monitoring, and CDN management, to meet different CDN needs and requirements.

Create Origin

Create origin resouces to be used within distributions.

There are 2 types of origins:

  • Simple Origin
  • Advanced Origin
Authorizations:
X-LSW-Auth
Request Body schema: application/json
required
resourceType
required
string
Enum: "SIMPLE_ORIGIN" "ADVANCED_ORIGIN"
required
Array of items

Responses

Request samples

Content type
application/json
{
  • "resourceType": "SIMPLE_ORIGIN",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "resourceType": "SIMPLE_ORIGIN",
  • "data": [
    ]
}

Get All Origins

Get the list of origins including all of the origin types. Types are specified in each record.

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/cdn/v2/origins?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get Origin By Id

Get an origin by its ID.

Authorizations:
X-LSW-Auth
path Parameters
origin_id
required
string (Origin Id)

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/cdn/v2/origins/%7Borigin_id%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
Example
{
  • "resourceType": "SIMPLE_ORIGIN",
  • "data": [
    ]
}

Update Origin By Id

Update the options available in an origin.

Note: Type of the origin can't be changed since it's considered a different type of entity.

Authorizations:
X-LSW-Auth
path Parameters
origin_id
required
string (Origin Id)
Request Body schema: application/json
required
resourceType
required
string (Resourcetype)
required
Array of objects (Data)

Responses

Request samples

Content type
application/json
{
  • "resourceType": "SIMPLE_ORIGIN",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "resourceType": "SIMPLE_ORIGIN",
  • "data": [
    ]
}

Delete Origin By Id

Authorizations:
X-LSW-Auth
path Parameters
origin_id
required
string (Origin Id)

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/cdn/v2/origins/%7Borigin_id%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."
}

Create Origin Group

Using origin groups you can define loadbalancers on top of your origins.

Available loadbalancing methods:

  • ROUNDROBIN
  • CONSISTENT
  • STICKY
  • FAILOVER
Authorizations:
X-LSW-Auth
Request Body schema: application/json
required
resourceType
required
string (Resourcetype)
required
Array of objects (Data)

Responses

Request samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP",
  • "data": [
    ]
}

Get All Origin Groups

Get the list of your origin 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.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/cdn/v2/originGroups?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get Origin Group By Id

Get the details of an origin group by its ID.

Authorizations:
X-LSW-Auth
path Parameters
origin_group_id
required
string (Origin Group Id)

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/cdn/v2/originGroups/%7Borigin_group_id%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP",
  • "data": [
    ]
}

Update Origin Group By Id

Update the parameters in an origin group.

Note: members are managed by another endpoint.

Authorizations:
X-LSW-Auth
path Parameters
origin_group_id
required
string (Origin Group Id)
Request Body schema: application/json
required
resourceType
required
string (Resourcetype)
required
Array of objects (Data)

Responses

Request samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP",
  • "data": [
    ]
}

Delete Origin Group By Id

Delete an origin group by its ID.

Authorizations:
X-LSW-Auth
path Parameters
origin_group_id
required
string (Origin Group Id)

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/cdn/v2/originGroups/%7Borigin_group_id%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."
}

Create Origin Group Member

Add members (origins) to your origin group.

These are the backend servers that are going to be used within the loadbalancer.

Authorizations:
X-LSW-Auth
path Parameters
origin_group_id
required
string (Origin Group Id)
Request Body schema: application/json
required
resourceType
required
string (Resourcetype)
required
Array of objects (Data)

Responses

Request samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP_MEMBER",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP_MEMBER",
  • "data": [
    ]
}

Get All Origin Group Members

Get all of the members belonging to an origin group.

Authorizations:
X-LSW-Auth
path Parameters
origin_group_id
required
string (Origin 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/cdn/v2/originGroups/%7Borigin_group_id%7D/members?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get Origin Group Member By Id

Get the details of an origin group member by its ID.

Authorizations:
X-LSW-Auth
path Parameters
origin_group_id
required
string (Origin Group Id)
origin_group_member_id
required
string (Origin Group Member Id)

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/cdn/v2/originGroups/%7Borigin_group_id%7D/members/%7Borigin_group_member_id%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP_MEMBER",
  • "data": [
    ]
}

Update Origin Group Member By Id

Update the parameters in an origin group member.

Authorizations:
X-LSW-Auth
path Parameters
origin_group_id
required
string (Origin Group Id)
origin_group_member_id
required
string (Origin Group Member Id)
Request Body schema: application/json
required
resourceType
required
string (Resourcetype)
required
Array of objects (Data)

Responses

Request samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP_MEMBER",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "resourceType": "ORIGIN_GROUP_MEMBER",
  • "data": [
    ]
}

Delete Origin Group Member By Id

Authorizations:
X-LSW-Auth
path Parameters
origin_group_id
required
string (Origin Group Id)
origin_group_member_id
required
string (Origin Group Member Id)

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/cdn/v2/originGroups/%7Borigin_group_id%7D/members/%7Borigin_group_member_id%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."
}

Debug Url

You can use this endpoint to debug your distributions on each CDN provider independently. All of the returned headers per provider are included in the response.

Note: Use the specific domain you want to debug since each distribution can have multiple custom domains.

Authorizations:
X-LSW-Auth
Request Body schema: application/json
required
url
required
string <uri> (Url) [ 1 .. 2083 ] characters

Responses

Request samples

Content type
application/json

Response samples

Content type
application/json
{}

Do Invalidation

You can submit multiple URLs to be invalidated and purged on all of the CDN PoPs. The time to finish the purge depends on the CDN providers and the number of cached files.

Authorizations:
X-LSW-Auth
Request Body schema: application/json
required
files
Array of strings (Files)

Responses

Request samples

Content type
application/json

Response samples

Content type
application/json
{
  • "type": "INVALIDATION",
  • "resource": {
    },
  • "status": "PENDING",
  • "id": "0533396e-e5c6-4de2-bd08-06dfa91a3ab6",
  • "customerId": "47927462",
  • "created": "2024-07-11T12:14:43Z",
  • "updated": ""
}

Create Certificate

Using this endpoint, you can upload your custom TLS certificates to be used in your distributions.

Note: some CDN providers need more time to apply your new certificate to your newly created distribution. Please be aware and always try to upload your certificates as soon as possible.

Authorizations:
X-LSW-Auth
Request Body schema: application/json
required
Any of
Description (string) or Description (null) (Description)
certificate
required
string (Certificate)
privateKey
required
string (Privatekey)
caBundle
required
string (Cabundle)
validation
boolean (Validation)
Default: true

Responses

Request samples

Content type
application/json
{
  • "description": "Main LSW Certificate 2024",
  • "certificate": "-----BEGIN CERTIFICATE----- {***} -----END CERTIFICATE-----",
  • "privateKey": "-----BEGIN PRIVATE KEY----- {***} -----END PRIVATE KEY-----",
  • "caBundle": "-----BEGIN CERTIFICATE----- {***} -----END CERTIFICATE-----",
  • "validation": true
}

Response samples

Content type
application/json
{
  • "description": "Main LSW Certificate 2024",
  • "certificate": "Hidden for security reasons",
  • "privateKey": "Hidden for security reasons",
  • "caBundle": "Hidden for security reasons",
  • "validation": true,
  • "id": "ce-5g8wbh25",
  • "commonName": "c1",
  • "issuer": "c1",
  • "valid": true,
  • "trusted": true,
  • "daysLeft": 364,
  • "validFrom": 1723118047,
  • "validUntil": 1754646847,
  • "created": "2024-03-19T08:15:23",
  • "updated": "2024-03-19T08:15:23"
}

Get All Certificates

Get the list of your certificates.

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/cdn/v2/certificates?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get Certificate By Id

Get the details of a certificate by its ID

Authorizations:
X-LSW-Auth
path Parameters
certificate_id
required
string (Certificate Id)

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/cdn/v2/certificates/%7Bcertificate_id%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "description": "Main LSW Certificate 2024",
  • "certificate": "Hidden for security reasons",
  • "privateKey": "Hidden for security reasons",
  • "caBundle": "Hidden for security reasons",
  • "validation": true,
  • "id": "ce-5g8wbh25",
  • "commonName": "c1",
  • "issuer": "c1",
  • "valid": true,
  • "trusted": true,
  • "daysLeft": 364,
  • "validFrom": 1723118047,
  • "validUntil": 1754646847,
  • "created": "2024-03-19T08:15:23",
  • "updated": "2024-03-19T08:15:23"
}

Delete Certificate By Id

Authorizations:
X-LSW-Auth
path Parameters
certificate_id
required
string (Certificate Id)

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/cdn/v2/certificates/%7Bcertificate_id%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."
}

Get All Actions

Get the list of all of the actions to monitor the progress of your background jobs.

Authorizations:
X-LSW-Auth
query Parameters
filters
Array of strings (Filters)
Items Enum: "INVALIDATION" "CREATE_DIST" "UPDATE_DIST" "DELETE_DIST"
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/cdn/v2/actions?filters=SOME_ARRAY_VALUE&limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get Action By Id

Get an action by ID to monitor the progress.

Authorizations:
X-LSW-Auth
path Parameters
action_id
required
string <uuid> (Action Id)

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/cdn/v2/actions/%7Baction_id%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "type": "INVALIDATION",
  • "status": "PENDING",
  • "id": "50ea5204-4827-41d2-a940-cb5afdfb2426",
  • "customerId": "215468472",
  • "created": "2019-08-24T14:15:22Z",
  • "updated": "2019-08-24T14:15:22Z"
}

Create Distribution

Create any kind of distribution using this endpoint.

Available distribution types:

  • DISTRIBUTION_VOLUME
  • DISTRIBUTION_PREMIUM
  • SHIELD_CDN
Authorizations:
X-LSW-Auth
Request Body schema: application/json
required
resourceType
required
string (Resourcetype)
required
Array of objects (Data)

Responses

Request samples

Content type
application/json
Example
{
  • "resourceType": "DISTRIBUTION_VOLUME",
  • "data": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "resourceType": "DISTRIBUTION_VOLUME",
  • "data": [
    ]
}

Get All Distributions

Get the list of your distributions.

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/cdn/v2/distributions?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get Distribution By Id

Get the general details of a distribution by its ID.

Authorizations:
X-LSW-Auth
path Parameters
distribution_id
required
string (Distribution Id)

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/cdn/v2/distributions/%7Bdistribution_id%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "resourceType": "DISTRIBUTION_VOLUME",
  • "data": [
    ]
}

Update Distribution By Id

Authorizations:
X-LSW-Auth
path Parameters
distribution_id
required
string (Distribution Id)
Request Body schema: application/json
required
resourceType
required
string (Resourcetype)
required
Array of objects (Data)

Responses

Request samples

Content type
application/json
{
  • "resourceType": "DISTRIBUTION_VOLUME",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "resourceType": "DISTRIBUTION_VOLUME",
  • "data": [
    ]
}

Delete Distribution By Id

Authorizations:
X-LSW-Auth
path Parameters
distribution_id
required
string (Distribution Id)

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/cdn/v2/distributions/%7Bdistribution_id%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."
}

Create Domain

Add custom domains to a distribution.

Authorizations:
X-LSW-Auth
path Parameters
distribution_id
required
string (Distribution Id)
Request Body schema: application/json
required
domain
required
string (Domain)

Responses

Request samples

Content type
application/json
{
  • "domain": "test2.com"
}

Response samples

Content type
application/json
{
  • "domain": "test2.com",
  • "id": "test2.com",
  • "distributionId": "di-yt84vrj",
  • "created": "2024-07-31T02:15:32",
  • "updated": "2024-08-04T23:24:29"
}

Get All Domains

Get the list of custom domains attached to a distribution.

Authorizations:
X-LSW-Auth
path Parameters
distribution_id
required
string (Distribution 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/cdn/v2/distributions/%7Bdistribution_id%7D/domains?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Get Domain By Id

Get the details of a custom domain attached to a dsitribution.

Authorizations:
X-LSW-Auth
path Parameters
distribution_id
required
string (Distribution Id)
domain_id
required
string (Domain Id)

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/cdn/v2/distributions/%7Bdistribution_id%7D/domains/%7Bdomain_id%7D \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "domain": "test2.com",
  • "id": "test2.com",
  • "distributionId": "di-yt84vrj",
  • "created": "2024-07-31T02:15:32",
  • "updated": "2024-08-04T23:24:29"
}

Delete Domain By Id

Authorizations:
X-LSW-Auth
path Parameters
distribution_id
required
string (Distribution Id)
domain_id
required
string (Domain Id)

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/cdn/v2/distributions/%7Bdistribution_id%7D/domains/%7Bdomain_id%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."
}

Create Policy

Apply custom configurations using policies.

Note: Policies only exist for Volume and Shield distributions and only one policy can be added for volume distributions.

Authorizations:
X-LSW-Auth
path Parameters
distribution_id
required
string (Distribution Id)
Request Body schema: application/json
required
securityToken
boolean (Securitytoken)
Default: false
"LEASEWEB" (any) or Securitytokenvendor (null) (Securitytokenvendor)
securityTokenMethod
string or null (Securitytokenmethod)
Enum: "SIMPLE" "ENCRYPTED"
securityTokenSecret
string or null (Securitytokensecret) <= 125 characters
securityTokenAesKey
string or null (Securitytokenaeskey)
securityTokenShaKey
string or null (Securitytokenshakey)
securityTokenClientIp
boolean (Securitytokenclientip)
Default: false
securityTokenExpirationParam
string or null (Securitytokenexpirationparam)
securityTokenParam
string or null (Securitytokenparam)
securityTokenNumberOfPathComponents
integer (Securitytokennumberofpathcomponents) [ -1 .. 10 ]
Default: -1
securityTokenEmbedIntoPath
boolean (Securitytokenembedintopath)
Default: false