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" "lsw.g6.xlarge" "lsw.g6.2xlarge" "lsw.g6.4xlarge" "lsw.g6.8xlarge" "lsw.g6.12xlarge" "lsw.g6.16xlarge" "lsw.g6.18xlarge" "lsw.g6.24xlarge" "lsw.gr6.4xlarge" "lsw.gr6.8xlarge"

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
integer (contractTerm)
Enum: 0 1 3 6 12 24 36

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. Used only when contract type is MONTHLY

rootDiskSize
required
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": 12,
  • "contractType": "MONTHLY",
  • "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": [ ],
  • "iso": null,
  • "marketAppId": null,
  • "privateNetwork": null,
  • "productType": "INSTANCE",
  • "reference": "my webserver",
  • "region": "eu-west-3",
  • "resources": {
    },
  • "rootDiskSize": 5,
  • "rootDiskStorageType": "CENTRAL",
  • "startedAt": null,
  • "state": "CREATING",
  • "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" "PENDING" "INACTIVE" "CANCELLED"
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" "lsw.g6.xlarge" "lsw.g6.2xlarge" "lsw.g6.4xlarge" "lsw.g6.8xlarge" "lsw.g6.12xlarge" "lsw.g6.16xlarge" "lsw.g6.18xlarge" "lsw.g6.24xlarge" "lsw.gr6.4xlarge" "lsw.gr6.8xlarge"
Example: type=lsw.c3.xlarge

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

securityGroupIds
string
Example: securityGroupIds=166cc685-8273-11f0-b4f8-2687367a8a5e,7e59b33d-05f3-4078-b251-c7831ae8fe14

Filter instances by security group UUIDs, separated by commas.

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&securityGroupIds=166cc685-8273-11f0-b4f8-2687367a8a5e%2C7e59b33d-05f3-4078-b251-c7831ae8fe14' \
  --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

Request Body schema: application/json
reasonCode
string

The reason code for terminating the instance. This is a required field if contract type is Monthly. Please refer at this page for the valid options: Cancel Reasons

reason
string

Required only when reasonCode is CANCEL_OTHER.

Responses

Request samples

Content type
application/json
{
  • "reasonCode": "CANCEL_TRIAL_PERIOD"
}

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" "lsw.g6.xlarge" "lsw.g6.2xlarge" "lsw.g6.4xlarge" "lsw.g6.8xlarge" "lsw.g6.12xlarge" "lsw.g6.16xlarge" "lsw.g6.18xlarge" "lsw.g6.24xlarge" "lsw.gr6.4xlarge" "lsw.gr6.8xlarge"

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 24 36

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. Used only when contract type is MONTHLY

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
{
  • "_metadata": {
    },
  • "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" "CPANEL_ADMIN" "CPANEL_PRO" "CPANEL_PLUS" "CPANEL_PREMIER" "PLESK_WEB_PRO" "PLESK_WEB_ADMIN" "PLESK_WEB_HOST"

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" "lsw.g6.xlarge" "lsw.g6.2xlarge" "lsw.g6.4xlarge" "lsw.g6.8xlarge" "lsw.g6.12xlarge" "lsw.g6.16xlarge" "lsw.g6.18xlarge" "lsw.g6.24xlarge" "lsw.gr6.4xlarge" "lsw.gr6.8xlarge"

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
integer (contractTerm)
Enum: 0 1 3 6 12 24 36

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. Used only when contract type is MONTHLY

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": {
    },
  • "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" "PENDING" "INACTIVE" "CANCELLED"
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": {
    },
  • "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

Request Body schema: application/json
required
reasonCode
required
string

The reason code for terminating the instance. This is a required field. Please refer at this page for the valid options: Cancel Reasons

reason
string

Required only when reasonCode is CANCEL_OTHER.

Responses

Request samples

Content type
application/json
{
  • "reasonCode": "CANCEL_TRIAL_PERIOD"
}

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" "lsw.g6.xlarge" "lsw.g6.2xlarge" "lsw.g6.4xlarge" "lsw.g6.8xlarge" "lsw.g6.12xlarge" "lsw.g6.16xlarge" "lsw.g6.18xlarge" "lsw.g6.24xlarge" "lsw.gr6.4xlarge" "lsw.gr6.8xlarge"

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": {
    },
  • "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
required
string <date>
Example: from=2025-01-28

The start of the interval to get the metric

to
required
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
required
string
Value: "DAY"

The interval for each metric

aggregation
required
string
Value: "SUM"

The metric aggregation function

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 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
required
string <date>
Example: from=2025-01-28

The start of the interval to get the metric

to
required
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
required
string
Enum: "5m" "10m" "30m" "60m" "DAY"

The interval for each metric

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/instances/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 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
required
string <date>
Example: from=2025-01-28

The start of the interval to get the metric

to
required
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
required
string
Value: "DAY"

The interval for each metric

aggregation
required
string
Value: "SUM"

The metric aggregation function

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 load balancer CPU metrics

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

Load balancer ID

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

The start of the interval to get the metric

to
required
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
required
string
Enum: "5m" "10m" "30m" "60m" "DAY"

The interval for each metric

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/metrics/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. Not available for listeners with TCP protocol

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

Load balancer ID

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

The start of the interval to get the metric

to
required
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
required
string
Enum: "5m" "10m" "30m" "60m" "DAY"

The interval for each metric

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/metrics/requests?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 per second metrics. Not available for listeners with TCP protocol

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

Load balancer ID

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

The start of the interval to get the metric

to
required
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
required
string
Enum: "5m" "10m" "30m" "60m" "DAY"

The interval for each metric

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/metrics/requestsPerSecond?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 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
required
string <date>
Example: from=2025-01-28

The start of the interval to get the metric

to
required
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
required
string
Enum: "5m" "10m" "30m" "60m" "DAY"

The interval for each metric

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/metrics/dataTransferred?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 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
required
string <date>
Example: from=2025-01-28

The start of the interval to get the metric

to
required
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
required
string
Enum: "5m" "10m" "30m" "60m" "DAY"

The interval for each metric

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/metrics/dataTransferredPerSecond?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 connections metrics

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

Load balancer ID

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

The start of the interval to get the metric

to
required
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
required
string
Enum: "5m" "10m" "30m" "60m" "DAY"

The interval for each metric

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/metrics/connections?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 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
required
string <date>
Example: from=2025-01-28

The start of the interval to get the metric

to
required
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
required
string
Enum: "5m" "10m" "30m" "60m" "DAY"

The interval for each metric

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/metrics/connectionsPerSecond?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 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
required
string <date>
Example: from=2025-01-28

The start of the interval to get the metric

to
required
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
required
string
Enum: "5m" "10m" "30m" "60m" "DAY"

The interval for each metric

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/loadBalancers/695ddd91-051f-4dd6-9120-938a927a47d0/metrics/responseCodes?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 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
required
string <date>
Example: from=2025-01-28

The start of the interval to get the metric

to
required
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
required
string
Enum: "5m" "10m" "30m" "60m" "DAY"

The interval for each metric

Responses

Request samples

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

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

Attach security groups to instance

Attach security groups to an 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
securityGroupIds
required
Array of strings <uuid> (ids) [ items <uuid > ]

Responses

Request samples

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

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 security groups from instance

Detach security groups from an 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
securityGroupIds
required
Array of strings <uuid> (ids) [ items <uuid > ]

Responses

Request samples

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

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 Instance Security Groups

List security groups associated with the instance

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

Response samples

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

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>
Example: 54eee4c2-aef2-4cda-9fd5-74bfbf438abf

Snapshot's ID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/snapshots/54eee4c2-aef2-4cda-9fd5-74bfbf438abf \
  --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>
Example: 54eee4c2-aef2-4cda-9fd5-74bfbf438abf

Snapshot's ID

Responses

Request samples

curl --request PUT \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/snapshots/54eee4c2-aef2-4cda-9fd5-74bfbf438abf \
  --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>
Example: 54eee4c2-aef2-4cda-9fd5-74bfbf438abf

Snapshot's ID

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/snapshots/54eee4c2-aef2-4cda-9fd5-74bfbf438abf \
  --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."
}

List the notification settings of a customer

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/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
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's 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/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/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
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's 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
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's 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
instanceId
required
string <uuid>
Example: ace712e9-a166-47f1-9065-4af0f7e7fce1

Instance's 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/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/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."
}

Get Security Group list

List and filter security 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.

state
string
Enum: "CREATING" "ACTIVE" "FAILED" "SYNCING"

Filter by state

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/publicCloud/v1/securityGroups?limit=20&offset=10&state=SOME_STRING_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Create Security Group

Create a Security Group

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

The name of the security group

Responses

Request samples

Content type
application/json
{
  • "name": "My Security Group"
}

Response samples

Content type
application/json
{
  • "default": false,
  • "id": "7e59b33d-05f3-4078-b251-c7831ae8fe14",
  • "name": "My Security Group",
  • "state": "CREATING"
}

Get Security Group details

Authorizations:
X-LSW-Auth
path Parameters
securityGroupId
required
string <uuid>
Example: 166cc685-8273-11f0-b4f8-2687367a8a5e

Security Group ID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/securityGroups/166cc685-8273-11f0-b4f8-2687367a8a5e \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "default": false,
  • "id": "166cc685-8273-11f0-b4f8-2687367a8a5e",
  • "name": "My Security Group",
  • "state": "ACTIVE"
}

Update Security Group

Update a Security Group

Authorizations:
X-LSW-Auth
path Parameters
securityGroupId
required
string <uuid>
Example: 166cc685-8273-11f0-b4f8-2687367a8a5e

Security Group ID

Request Body schema: application/json
required
name
required
string

The name of the security group

Responses

Request samples

Content type
application/json
{
  • "name": "My Security Group"
}

Response samples

Content type
application/json
{
  • "default": false,
  • "id": "166cc685-8273-11f0-b4f8-2687367a8a5e",
  • "name": "My Security Group",
  • "state": "ACTIVE"
}

Delete Security Group

Delete a Security Group

Authorizations:
X-LSW-Auth
path Parameters
securityGroupId
required
string <uuid>
Example: 166cc685-8273-11f0-b4f8-2687367a8a5e

Security Group ID

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/securityGroups/166cc685-8273-11f0-b4f8-2687367a8a5e \
  --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."
}

Add firewall rules to security group

Add firewall rules to security group

Authorizations:
X-LSW-Auth
path Parameters
securityGroupId
required
string <uuid>
Example: 166cc685-8273-11f0-b4f8-2687367a8a5e

Security Group ID

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

Array of firewall rules to authorize

Responses

Request samples

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

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 firewall rules from security group

Remove firewall rules from security group

Authorizations:
X-LSW-Auth
path Parameters
securityGroupId
required
string <uuid>
Example: 166cc685-8273-11f0-b4f8-2687367a8a5e

Security Group ID

Request Body schema: application/json
required
rules
required
Array of strings <uuid> (ids) [ items <uuid > ]

Responses

Request samples

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

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 Security Group Firewall Rules

Get firewall rules for a security group

Authorizations:
X-LSW-Auth
path Parameters
securityGroupId
required
string <uuid>
Example: 166cc685-8273-11f0-b4f8-2687367a8a5e

Security 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/securityGroups/166cc685-8273-11f0-b4f8-2687367a8a5e/firewallRules?limit=20&offset=10' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

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
required
string <date>
Example: from=2025-01-28

The start of the interval to get the metric

to
required
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
required
string
Enum: "5m" "10m" "30m" "60m" "DAY"

The interval for each metric

aggregation
required
string
Value: "SUM"

The metric aggregation function

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>
Example: 54eee4c2-aef2-4cda-9fd5-74bfbf438abf

Snapshot's ID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/snapshots/54eee4c2-aef2-4cda-9fd5-74bfbf438abf \
  --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>
Example: 54eee4c2-aef2-4cda-9fd5-74bfbf438abf

Snapshot's ID

Responses

Request samples

curl --request PUT \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/snapshots/54eee4c2-aef2-4cda-9fd5-74bfbf438abf \
  --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>
Example: 54eee4c2-aef2-4cda-9fd5-74bfbf438abf

Snapshot's ID

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/snapshots/54eee4c2-aef2-4cda-9fd5-74bfbf438abf \
  --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 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/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/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/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."
}

Get service monitoring status

Get monitoring status

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/monitoring/status \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "description": "Service is Up",
  • "status": "UP"
}

Enable monitoring

Enable service monitoring

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/monitoring \
  --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."
}

GP VPS

Leaseweb GP VPS is a hosting solution that provides dedicated virtualized resources.

List virtual servers DEPRECATED

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/cloud/v2/virtualServers?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect a virtual server DEPRECATED

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

Id of the virtual server

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "id": "222903",
  • "reference": "Web server",
  • "customerId": "1301178860",
  • "dataCenter": "AMS-01",
  • "cloudServerId": null,
  • "state": "STOPPED",
  • "firewallState": "DISABLED",
  • "template": "Ubuntu 14.04 64 40 20140707T1340",
  • "serviceOffering": "S",
  • "sla": "Bronze",
  • "contract": {
    },
  • "hardware": {
    },
  • "iso": {
    },
  • "ips": [
    ]
}

Update a virtual server DEPRECATED

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

Id of the virtual server

Request Body schema: application/json
required
reference
required
string

The reference description for the virtual server

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "id": "222903",
  • "reference": "Web server",
  • "customerId": "1301178860",
  • "dataCenter": "AMS-01",
  • "cloudServerId": null,
  • "state": "STOPPED",
  • "firewallState": "DISABLED",
  • "template": "Ubuntu 14.04 64 40 20140707T1340",
  • "serviceOffering": "S",
  • "sla": "Bronze",
  • "contract": {
    },
  • "hardware": {
    },
  • "iso": {
    },
  • "ips": [
    ]
}

Power on DEPRECATED

The power on call is an asynchronous call, meaning the power on will be performed as soon as possible.

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

Id of the virtual server

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "id": "cs01.237daad0-2aed-4260-b0e4-488d9cd55607",
  • "name": "virtualServers.powerOn",
  • "status": "PENDING",
  • "createdAt": "2016-12-31T01:00:59+00:00"
}

Power off DEPRECATED

The power off call is an asynchronous call, meaning the power off will be performed as soon as possible.

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

Id of the virtual server

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "id": "cs01.237daad0-2aed-4260-b0e4-488d9cd55607",
  • "name": "virtualServers.powerOff",
  • "status": "PENDING",
  • "createdAt": "2016-12-31T01:00:59+00:00"
}

Reboot DEPRECATED

The reboot call is an asynchronous call, meaning the reboot will be performed as soon as possible.

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

Id of the virtual server

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "id": "cs01.237daad0-2aed-4260-b0e4-488d9cd55607",
  • "name": "virtualServers.reboot",
  • "status": "PENDING",
  • "createdAt": "2016-12-31T01:00:59+00:00"
}

Reinstall DEPRECATED

The virtual server will be reinstalled with any supported operating system. The reinstall call is an asynchronous call, meaning the reinstall will be performed as soon as possible. To get the list of supported operating system please check the api documentation for templates.

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

Id of the virtual server

Request Body schema: application/json
operatingSystemId
required
string

Id of the operating system that needs to be used for reinstallation.

Responses

Request samples

Content type
application/json
{
  • "operatingSystemId": "CENTOS_7_64_PLESK"
}

Response samples

Content type
application/json
{
  • "id": "cs01.237daad0-2aed-4260-b0e4-488d9cd55607",
  • "name": "virtualServers.reinstall",
  • "status": "PENDING",
  • "createdAt": "2016-12-31T01:00:59+00:00"
}

Update credentials of a virtual machine DEPRECATED

This API call will only update the password displayed for your machine in the customer portal. It will not make any changes to the root password of your machine.

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

Id of the virtual server

Request Body schema: application/json
username
required
string

Username of the virtual server (mostly root)

password
required
string

Password of the virtual server

type
required
string
Enum: "OPERATING_SYSTEM" "CONTROL_PANEL"

Type of credentials

Responses

Request samples

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

Response samples

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

List credentials DEPRECATED

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.

The password is not returned in this call, you must use the endpoint to get a credential by the username to retrieve it.

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

Id of the virtual server

credentialType
required
string
Enum: "OPERATING_SYSTEM" "CONTROL_PANEL"

Type of credential pair

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/cloud/v2/virtualServers/123242/credentials/%7BcredentialType%7D?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect user credentials DEPRECATED

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
virtualServerId
required
string
Example: 123242

Id of the virtual server

credentialType
required
string
Enum: "OPERATING_SYSTEM" "CONTROL_PANEL"

Type of credential pair

username
required
string

Name of the user in your server.

Responses

Request samples

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

Response samples

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

Inspect datatraffic metrics DEPRECATED

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

Id of the virtual server

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

List templates DEPRECATED

Retrieves all the supported operating system templates for the specified virtual server

Authorizations:
X-LSW-Auth
path Parameters
virtualServerId
required
string

Id of the virtual server

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/cloud/v2/virtualServers/%7BvirtualServerId%7D/templates \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

List snapshots DEPRECATED

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

Id of the virtual server

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/cloud/v2/virtualServers/123242/snapshots?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

Create snapshot DEPRECATED

To create a snapshot, the VPS must be Running and have a General Purpose (GP) pack

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

Id of the virtual server

Request Body schema: application/json
required
name
required
string

The snapshot name, starting with letters, containing only letters, numbers and spaces

Responses

Request samples

Content type
application/json
{
  • "name": "Snapshot 1"
}

Response samples

Content type
application/json
{
  • "id": "2e78c712-ba58-4078-95ad-ba86617c9f54",
  • "name": "virtualServer.createVMSnapshot",
  • "status": "PENDING",
  • "createdAt": "2023-02-23T15:52:54+00:00"
}

Get snapshot DEPRECATED

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

Id of the virtual server

snapshotId
required
string
Example: 8083e330-9888-4ae6-8f11-d372c5a50e63

The snapshot's UUID

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/cloud/v2/virtualServers/123242/snapshots/8083e330-9888-4ae6-8f11-d372c5a50e63 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "id": "8083e330-9888-4ae6-8f11-d372c5a50e63",
  • "name": "Snapshot 1",
  • "state": "READY",
  • "created_at": "2023-02-24T09:33:01+00:00"
}

Delete snapshot DEPRECATED

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

Id of the virtual server

snapshotId
required
string
Example: 8083e330-9888-4ae6-8f11-d372c5a50e63

The snapshot's UUID

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/cloud/v2/virtualServers/123242/snapshots/8083e330-9888-4ae6-8f11-d372c5a50e63 \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "id": "2e78c712-ba58-4078-95ad-ba86617c9f54",
  • "name": "virtualServer.deleteVMSnapshot",
  • "status": "PENDING",
  • "createdAt": "2023-02-23T15:52:54+00:00"
}

Restore snapshot DEPRECATED

Restore the VPS state (disk and memory) to the snapshot. The VPS must be running in order to have its snapshot restored

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

Id of the virtual server

snapshotId
required
string

The snapshot's UUID

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/cloud/v2/virtualServers/123242/snapshots/%7BsnapshotId%7D/restore \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "id": "2e78c712-ba58-4078-95ad-ba86617c9f54",
  • "name": "virtualServer.restoreVMSnapshot",
  • "status": "PENDING",
  • "createdAt": "2023-02-23T15:52:54+00:00"
}

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.

Get storage

Get storage for the given customer.

Authorizations:
X-LSW-Auth
query Parameters
productId
required
string

The id of the ObjectStorage product.

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "id": "10812374",
  • "quantity": {
    },
  • "type": "SANS"
}

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

Acronis Backup

Acronis Backup API allows customers to retrieve information about their Acronis Backup services, including current usage and limits.

List backup items

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

Response samples

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

Inspect a backup item

Authorizations:
X-LSW-Auth
path Parameters
equipmentId
required
string
Example: 12345678

Equipment ID of the backup item.

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "id": "12345678",
  • "location": "EU2",
  • "storageSize": 60,
  • "status": "ACTIVE",
  • "startDate": "2019-05-01T00:00:00Z",
  • "endDate": "2021-04-30T00:00:00Z",
  • "contractTerm": 3,
  • "billingCycle": 1
}

Get usage metrics

Authorizations:
X-LSW-Auth
query Parameters
locations
required
Array of strings
Items Enum: "EU2" "EU3" "US2" "SG1" "AU1" "CA1" "CA2"
Example: locations=EU2,EU3

Comma-separated list of locations

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/backup/v1/metrics/storage?locations=EU2%2CEU3' \
  --header 'X-LSW-Auth: REPLACE_KEY_VALUE'

Response samples

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

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, check our Knowledge Base article on DDoS IP Protection.

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
{
  • "bareMetalId": "123",
  • "createdAt": "2025-03-17T13:24:25+00:00",
  • "currentTask": {
    },
  • "flow": "finally",
  • "isRunning": true,
  • "metadata": {
    },
  • "node": "00:11:22:AA:BB:CC",
  • "payload": {
    },
  • "progress": {
    },
  • "serverId": "123",
  • "status": "CANCELED",
  • "tasks": [
    ],
  • "type": "install",
  • "updatedAt": "2025-03-17T13:24:34+00:00",
  • "uuid": "a1234567-ab0b-4ff1-af43-c4ca551ee3ff"
}

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
{
  • "bareMetalId": "123",
  • "createdAt": "2025-03-17T13:33:25+00:00",
  • "currentTask": {
    },
  • "flow": "finally",
  • "isRunning": true,
  • "metadata": {
    },
  • "node": "00:11:22:AA:BB:CC",
  • "payload": {
    },
  • "progress": {
    },
  • "serverId": "123",
  • "status": "EXPIRED",
  • "tasks": [
    ],
  • "type": "install",
  • "updatedAt": "2025-03-17T13:33:37+00:00",
  • "uuid": "a1b28bfd1-da4c-451b-b82e-b382b9063d94"
}

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
{
  • "bareMetalId": "519",
  • "createdAt": "2025-03-17T13:37:19+00:00",
  • "currentTask": {
    },
  • "flow": "main",
  • "isRunning": true,
  • "metadata": {
    },
  • "node": "00:11:22:AA:BB:CC",
  • "payload": {
    },
  • "progress": {
    },
  • "serverId": "519",
  • "status": "ACTIVE",
  • "tasks": [
    ],
  • "type": "hardwareScan",
  • "updatedAt": "2025-03-17T13:37:19+00:00",
  • "uuid": "43758e50-fb34-4c0a-9ab5-772c4e47208c"
}

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, check our Knowledge Base article on reinstalling your Dedicated Server.

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

aiFrameworks
Array of strings or null

The AI frameworks that are being installed on the server

timezone
string

Timezone represented as Geographical_Area/City

Responses

Request samples

Content type
application/json
{
  • "aiFrameworks": [
    ],
  • "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
{
  • "bareMetalId": "123",
  • "createdAt": "2025-03-17T13:44:47+00:00",
  • "currentTask": {
    },
  • "flow": "main",
  • "isRunning": true,
  • "metadata": {
    },
  • "node": "00:11:22:AA:BB:CC",
  • "payload": {
    },
  • "progress": {
    },
  • "serverId": "123",
  • "status": "ACTIVE",
  • "tasks": [
    ],
  • "type": "install",
  • "updatedAt": "2025-03-17T13:44:47+00:00",
  • "uuid": "a1b22827-b6aa-47ce-abad-6bc28a70223d"
}

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
{
  • "bareMetalId": "123",
  • "createdAt": "2025-03-17T13:48:15+00:00",
  • "currentTask": {
    },
  • "flow": "main",
  • "isRunning": true,
  • "metadata": {
    },
  • "node": "00:11:22:AA:BB:CC",
  • "payload": {
    },
  • "progress": {
    },
  • "serverId": "123",
  • "status": "ACTIVE",
  • "tasks": [
    ],
  • "type": "ipmiReset",
  • "updatedAt": "2025-03-17T13:48:15+00:00",
  • "uuid": "101e3a46-e878-4807-bf03-d3d796f42ecf"
}

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
{
  • "bareMetalId": "123",
  • "createdAt": "2025-03-17T13:44:47+00:00",
  • "currentTask": {
    },
  • "flow": "main",
  • "isRunning": true,
  • "metadata": {
    },
  • "node": "00:11:22:AA:BB:CC",
  • "payload": {
    },
  • "progress": {
    },
  • "serverId": "123",
  • "status": "ACTIVE",
  • "tasks": [
    ],
  • "type": "install",
  • "updatedAt": "2025-03-17T13:44:51+00:00",
  • "uuid": "42df2827-b6aa-47ce-abad-6bc28a70223d"
}

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
{
  • "bareMetalId": "123",
  • "createdAt": "2025-03-17T14:01:43+00:00",
  • "currentTask": {
    },
  • "flow": "main",
  • "isRunning": true,
  • "metadata": {
    },
  • "node": "00:11:22:AA:BB:CC",
  • "payload": {
    },
  • "progress": {
    },
  • "serverId": "123",
  • "status": "ACTIVE",
  • "tasks": [
    ],
  • "type": "install",
  • "updatedAt": "2025-03-17T14:01:43+00:00",
  • "uuid": "80d991c8-1bf5-40b9-8b99-cb65255065a5"
}

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
{
  • "bareMetalId": "123",
  • "createdAt": "2025-03-17T14:06:12+00:00",
  • "currentTask": {
    },
  • "flow": "main",
  • "isRunning": true,
  • "metadata": {
    },
  • "node": "00:11:22:33:44:55",
  • "payload": {
    },
  • "progress": {
    },
  • "serverId": "123",
  • "status": "ACTIVE",
  • "tasks": [
    ],
  • "type": "rescueMode",
  • "updatedAt": "2025-03-17T14:06:12+00:00",
  • "uuid": "7f869a99-2c26-4281-bd75-a45786a8c2d2"
}

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, check our Knowledge Base article on DDoS IP Protection.

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

Colocations

Leaseweb colocation provides you with a dependable hosting environment for your essential, mission-critical servers, storage, and Internet infrastructure. Colocation allows you to locate servers, network equipment, and storage in Leaseweb’s state-of-the-art data centers. You can connect your privately-owned servers to a variety of telecommunications and network service providers easily, and at reduced operational expenses.

List colocations

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 colocations by reference.

privateNetworkCapable
boolean
Enum: true false

Filter the list of private network capable colocations

privateNetworkEnabled
boolean
Enum: true false

Filter the list of private network enabled colocations

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/colocations?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": {
    },
  • "colocations": [
    ]
}

Inspect a colocation

Authorizations:
X-LSW-Auth
path Parameters
colocationId
required
string
Example: 12312

Colocation Id

Responses

Request samples

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

Response samples

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

Update a colocation

A reference can be set to uniquely identify a colocation with a name, such as production.

Authorizations:
X-LSW-Auth
path Parameters
colocationId
required
string
Example: 12312

Colocation Id

Request Body schema: application/json
reference
required
string

The reference for this colocation

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
colocationId
required
string
Example: 12312

Colocation Id

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/colocations/12312/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
colocationId
required
string
Example: 12312

Colocation Id

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/colocations/12312/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

colocationId
required
string
Example: 12312

Colocation Id

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/colocations/12312/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

colocationId
required
string
Example: 12312

Colocation Id

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
colocationId
required
string
Example: 12312

Colocation Id

ip
required
string
Example: 192.168.0.1

IP Address

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/colocations/12312/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 removal is propagated across the network.

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

IP Address

colocationId
required
string
Example: 12312

Colocation Id

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/colocations/12312/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
colocationId
required
string
Example: 12312

Colocation Id

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/colocations/12312/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
colocationId
required
string
Example: 12312

Colocation Id

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
Example: OPERATING_SYSTEM
colocationId
required
string
Example: 12312

Colocation Id

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/colocations/12312/credentials/OPERATING_SYSTEM?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
type
required
string
username
required
string
colocationId
required
string
Example: 12312

Colocation Id

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/colocations/12312/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

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
type
required
string
username
required
string
colocationId
required
string
Example: 12312

Colocation Id

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
type
required
string
username
required
string
colocationId
required
string
Example: 12312

Colocation Id

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/bareMetals/v2/colocations/12312/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
colocationId
required
string
Example: 12312

Colocation Id

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/colocations/12312/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
colocationId
required
string
Example: 12312

Colocation Id

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/colocations/12312/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 public network interface

Authorizations:
X-LSW-Auth
path Parameters
colocationId
required
string
Example: 12312

Colocation Id

Responses

Request samples

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

Response samples

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

Open or close public network interface

Authorizations:
X-LSW-Auth
path Parameters
action
required
string
colocationId
required
string
Example: 12312

Colocation Id

Responses

Request samples

curl --request POST \
  --url https://api.leaseweb.com/bareMetals/v2/colocations/12312/networkInterfaces/public/%7Baction%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 DDoS notification settings

Authorizations:
X-LSW-Auth
path Parameters
colocationId
required
string
Example: 12312

Colocation Id

Responses

Request samples

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

Response samples

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

Update DDoS notifications settings

Authorizations:
X-LSW-Auth
path Parameters
colocationId
required
string
Example: 12312

Colocation Id

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
colocationId
required
string
Example: 12312

Colocation Id

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/colocations/12312/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 settings

Authorizations:
X-LSW-Auth
path Parameters
colocationId
required
string
Example: 12312

Colocation Id

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

Authorizations:
X-LSW-Auth
path Parameters
notificationId
required
string
colocationId
required
string
Example: 12312

Colocation Id

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/colocations/12312/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
colocationId
required
string
Example: 12312

Colocation Id

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