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.
The API uses standard HTTP status codes to indicate the success or failure of the API call. The response will be JSON. Most APIs use the following format:
{
"errorCode": "APP00800",
"errorMessage": "The connection with the DB cannot be established.",
"correlationId": "550e8400-e29b-41d4-a716-446655440000",
"userMessage": "Cannot handle your request at the moment. Please try again later.",
"reference": "https://developer.leaseweb.com/errors/APP00800"
}
Authentication for the APIs is required. To authenticate your call, you will need to sent your API key as X-LSW-Auth header.
You can generate API keys in the Customer Portal.
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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url 'https://api.leaseweb.com/publicCloud/v1/regions?limit=20&offset=10' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "totalCount": 7,
- "limit": 20,
- "offset": 0
}, - "regions": [
- {
- "name": "eu-west-3",
- "location": "Amsterdam"
}, - {
- "name": "eu-central-1",
- "location": "Frankfurt"
}, - {
- "name": "eu-west-2",
- "location": "London"
}, - {
- "name": "ap-southeast-1",
- "location": "Singapore"
}, - {
- "name": "ca-central-1",
- "location": "Montreal"
}, - {
- "name": "us-east-1",
- "location": "Washington"
}, - {
- "name": "us-west-1",
- "location": "San Francisco"
}
]
}List instance types
Get instance types
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "instanceTypes": [
- {
- "name": "lsw.c3.large",
- "resources": {
- "cpu": {
- "value": 2,
- "unit": "vCPU"
}, - "memory": {
- "value": 3,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.0395",
- "monthly": "26.0200"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.c3.xlarge",
- "resources": {
- "cpu": {
- "value": 4,
- "unit": "vCPU"
}, - "memory": {
- "value": 7,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.0798",
- "monthly": "52.5000"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.c3.2xlarge",
- "resources": {
- "cpu": {
- "value": 8,
- "unit": "vCPU"
}, - "memory": {
- "value": 15,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.1604",
- "monthly": "105.4500"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.c3.4xlarge",
- "resources": {
- "cpu": {
- "value": 16,
- "unit": "vCPU"
}, - "memory": {
- "value": 30,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.3203",
- "monthly": "210.5100"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.m3.large",
- "resources": {
- "cpu": {
- "value": 2,
- "unit": "vCPU"
}, - "memory": {
- "value": 7,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.0447",
- "monthly": "29.4400"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.m3.xlarge",
- "resources": {
- "cpu": {
- "value": 4,
- "unit": "vCPU"
}, - "memory": {
- "value": 15,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.0902",
- "monthly": "59.3300"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.m3.2xlarge",
- "resources": {
- "cpu": {
- "value": 8,
- "unit": "vCPU"
}, - "memory": {
- "value": 30,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.1799",
- "monthly": "118.2700"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.r3.large",
- "resources": {
- "cpu": {
- "value": 2,
- "unit": "vCPU"
}, - "memory": {
- "value": 15.25,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.0555",
- "monthly": "36.4900"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.r3.xlarge",
- "resources": {
- "cpu": {
- "value": 4,
- "unit": "vCPU"
}, - "memory": {
- "value": 30.5,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.1104",
- "monthly": "72.5700"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.r3.2xlarge",
- "resources": {
- "cpu": {
- "value": 8,
- "unit": "vCPU"
}, - "memory": {
- "value": 61,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.2202",
- "monthly": "144.7400"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}
], - "_metadata": {
- "totalCount": 10,
- "limit": 50,
- "offset": 0,
- "currency": "EUR",
- "currencySymbol": "€"
}
}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:
Request Body schema: application/jsonrequired
| 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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "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
- 201
- 400
- 401
- 403
- 500
- 503
{- "autoScalingGroup": null,
- "contract": {
- "id": "",
- "billingFrequency": 1,
- "term": 12,
- "type": "HOURLY",
- "state": "PENDING",
- "endsAt": "2024-10-24T21:13:25+00:00",
- "startsAt": "2024-10-24T21:13:25+00:00",
- "sla": "Basic",
- "controlPanel": null,
- "inModification": false
}, - "hasPrivateNetwork": false,
- "hasPublicIpV4": true,
- "hasUserData": true,
- "id": "ace712e9-a166-47f1-9065-4af0f7e7fce1",
- "image": {
- "id": "UBUNTU_20_04_64BIT",
- "name": "Ubuntu 20.04 LTS (x86_64)",
- "family": "linux",
- "flavour": "ubuntu",
- "custom": false
}, - "ips": [ ],
- "iso": null,
- "marketAppId": null,
- "privateNetwork": null,
- "productType": "INSTANCE",
- "reference": "my webserver",
- "region": "eu-west-3",
- "resources": {
- "cpu": {
- "value": 2,
- "unit": "vCPU"
}, - "memory": {
- "value": 7,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "rootDiskSize": 5,
- "rootDiskStorageType": "CENTRAL",
- "startedAt": null,
- "state": "CREATING",
- "type": "lsw.m3.large"
}Get instance list
List and filter instances
Authorizations:
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 |
| 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 |
| 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 |
| 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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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®ion=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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "totalCount": 4,
- "limit": 20,
- "offset": 0
}, - "instances": [
- {
- "marketAppId": null,
- "productType": "INSTANCE",
- "autoScalingGroup": {
- "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",
- "type": "MANUAL",
- "updatedAt": "2024-04-26T09:22:25+00:00",
- "warmupTime": null
}, - "id": "ace712e9-a166-47f1-9065-4af0f7e7fce1",
- "type": "lsw.m3.large",
- "resources": {
- "cpu": {
- "value": 16,
- "unit": "vCPU"
}, - "memory": {
- "value": 30,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "region": "eu-west-3",
- "reference": "my webserver",
- "image": {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (x86_64)",
- "family": "linux",
- "flavour": "ubuntu",
- "custom": false
}, - "state": "STOPPED",
- "hasPublicIpV4": true,
- "hasPrivateNetwork": false,
- "hasUserData": false,
- "rootDiskStorageType": "CENTRAL",
- "rootDiskSize": 10,
- "ips": [
- {
- "ip": "10.32.60.12",
- "prefixLength": "32",
- "version": 4,
- "nullRouted": false,
- "reverseLookup": null,
- "mainIp": false,
- "networkType": "INTERNAL"
}
], - "startedAt": "2024-04-09T15:11:37+00:00",
- "contract": {
- "billingFrequency": 1,
- "term": 0,
- "type": "HOURLY"
}
}, - {
- "marketAppId": null,
- "productType": "INSTANCE",
- "autoScalingGroup": {
- "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",
- "type": "MANUAL",
- "updatedAt": "2024-04-26T09:22:25+00:00",
- "warmupTime": null
}, - "id": "f28ba2af-7508-4594-a63a-aa663db4fb3e",
- "type": "lsw.m3.large",
- "resources": {
- "cpu": {
- "value": 16,
- "unit": "vCPU"
}, - "memory": {
- "value": 30,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "region": "eu-west-3",
- "reference": "my webserver",
- "image": {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (x86_64)",
- "family": "linux",
- "flavour": "ubuntu",
- "custom": false
}, - "state": "RUNNING",
- "hasPublicIpV4": true,
- "hasPrivateNetwork": false,
- "hasUserData": false,
- "rootDiskStorageType": "CENTRAL",
- "rootDiskSize": 10,
- "ips": [
- {
- "ip": "10.32.60.12",
- "prefixLength": "32",
- "version": 4,
- "nullRouted": false,
- "reverseLookup": null,
- "mainIp": false,
- "networkType": "INTERNAL"
}
], - "startedAt": "2024-04-09T15:11:37+00:00",
- "contract": {
- "billingFrequency": 1,
- "term": 0,
- "type": "HOURLY"
}
}, - {
- "marketAppId": null,
- "productType": "INSTANCE",
- "autoScalingGroup": {
- "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",
- "type": "MANUAL",
- "updatedAt": "2024-04-26T09:22:25+00:00",
- "warmupTime": null
}, - "id": "6871686d-36c4-44f5-b692-a548e62dcf25",
- "type": "lsw.m3.large",
- "resources": {
- "cpu": {
- "value": 16,
- "unit": "vCPU"
}, - "memory": {
- "value": 30,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "region": "eu-west-3",
- "reference": "my webserver",
- "image": {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (x86_64)",
- "family": "linux",
- "flavour": "ubuntu",
- "custom": false
}, - "state": "STOPPED",
- "hasPublicIpV4": true,
- "hasPrivateNetwork": false,
- "hasUserData": false,
- "rootDiskStorageType": "CENTRAL",
- "rootDiskSize": 101,
- "ips": [
- {
- "ip": "10.32.60.12",
- "prefixLength": "32",
- "version": 4,
- "nullRouted": false,
- "reverseLookup": null,
- "mainIp": false,
- "networkType": "INTERNAL"
}
], - "startedAt": "2024-04-09T15:11:37+00:00",
- "contract": {
- "billingFrequency": 1,
- "term": 0,
- "type": "HOURLY"
}
}, - {
- "marketAppId": null,
- "productType": "INSTANCE",
- "autoScalingGroup": {
- "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",
- "type": "MANUAL",
- "updatedAt": "2024-04-26T09:22:25+00:00",
- "warmupTime": null
}, - "id": "9c095e3a-e9e3-403b-8d1b-37bb21b5598e",
- "type": "lsw.m3.large",
- "resources": {
- "cpu": {
- "value": 16,
- "unit": "vCPU"
}, - "memory": {
- "value": 30,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "region": "eu-west-3",
- "reference": "my webserver",
- "image": {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (x86_64)",
- "family": "linux",
- "flavour": "windows",
- "custom": false
}, - "state": "STOPPED",
- "hasPublicIpV4": true,
- "hasPrivateNetwork": false,
- "hasUserData": false,
- "rootDiskStorageType": "CENTRAL",
- "rootDiskSize": 10,
- "ips": [
- {
- "ip": "10.32.60.12",
- "prefixLength": "32",
- "version": 4,
- "nullRouted": false,
- "reverseLookup": null,
- "mainIp": false,
- "networkType": "INTERNAL"
}
], - "startedAt": "2024-04-09T15:11:37+00:00",
- "contract": {
- "billingFrequency": 1,
- "term": 0,
- "type": "HOURLY"
}
}
]
}Get instance details
Get details about the instance
Authorizations:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "autoScalingGroup": null,
- "contract": {
- "id": "",
- "billingFrequency": 1,
- "term": 0,
- "type": "HOURLY",
- "state": "ACTIVE",
- "endsAt": null,
- "startsAt": "2024-10-24T21:13:25+00:00",
- "sla": "Basic",
- "controlPanel": "cPanel Admin 5",
- "inModification": false
}, - "hasPrivateNetwork": false,
- "hasPublicIpV4": true,
- "hasUserData": false,
- "id": "ace712e9-a166-47f1-9065-4af0f7e7fce1",
- "image": {
- "id": "UBUNTU_20_04_64BIT",
- "name": "Ubuntu 20.04 LTS (x86_64)",
- "family": "linux",
- "flavour": "ubuntu",
- "custom": false
}, - "ips": [
- {
- "ip": "10.32.60.12",
- "prefixLength": "27",
- "version": 4,
- "reverseLookup": null,
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": false,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
], - "iso": {
- "id": "ACRONIS_BOOT_MEDIA",
- "name": "Acronis Boot Media"
}, - "marketAppId": null,
- "privateNetwork": null,
- "productType": "INSTANCE",
- "reference": "my webserver",
- "region": "eu-west-3",
- "resources": {
- "cpu": {
- "value": 1,
- "unit": "vCPU"
}, - "memory": {
- "value": 3,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "reasonCode": "CANCEL_TRIAL_PERIOD"
}Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Request Body schema: application/jsonrequired
| 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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "reference": "new-reference"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "autoScalingGroup": null,
- "contract": {
- "id": "",
- "billingFrequency": 1,
- "term": 0,
- "type": "HOURLY",
- "state": "ACTIVE",
- "endsAt": null,
- "startsAt": "2024-10-24T21:13:25+00:00",
- "sla": "Basic",
- "controlPanel": "cPanel Admin 5",
- "inModification": false
}, - "hasPrivateNetwork": false,
- "hasPublicIpV4": true,
- "hasUserData": false,
- "id": "ace712e9-a166-47f1-9065-4af0f7e7fce1",
- "image": {
- "id": "UBUNTU_20_04_64BIT",
- "name": "Ubuntu 20.04 LTS (x86_64)",
- "family": "linux",
- "flavour": "ubuntu",
- "custom": false
}, - "ips": [
- {
- "ip": "10.32.60.12",
- "prefixLength": "27",
- "version": 4,
- "reverseLookup": null,
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": false,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
], - "iso": {
- "id": "ACRONIS_BOOT_MEDIA",
- "name": "Acronis Boot Media"
}, - "marketAppId": null,
- "privateNetwork": null,
- "productType": "INSTANCE",
- "reference": "my webserver",
- "region": "eu-west-3",
- "resources": {
- "cpu": {
- "value": 1,
- "unit": "vCPU"
}, - "memory": {
- "value": 3,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "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:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| loadBalancerId required | string <uuid> Example: 695ddd91-051f-4dd6-9120-938a927a47d0 Load balancer ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| loadBalancerId required | string <uuid> Example: 695ddd91-051f-4dd6-9120-938a927a47d0 Load balancer ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| loadBalancerId required | string <uuid> Example: 695ddd91-051f-4dd6-9120-938a927a47d0 Load balancer ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/console \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
List available instance types for update
Get available instance types for update
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "instanceTypes": [
- {
- "name": "lsw.c3.large",
- "resources": {
- "cpu": {
- "value": 2,
- "unit": "vCPU"
}, - "memory": {
- "value": 3,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.0395",
- "monthly": "26.0200"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.c3.xlarge",
- "resources": {
- "cpu": {
- "value": 4,
- "unit": "vCPU"
}, - "memory": {
- "value": 7,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.0798",
- "monthly": "52.5000"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.c3.2xlarge",
- "resources": {
- "cpu": {
- "value": 8,
- "unit": "vCPU"
}, - "memory": {
- "value": 15,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.1604",
- "monthly": "105.4500"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.c3.4xlarge",
- "resources": {
- "cpu": {
- "value": 16,
- "unit": "vCPU"
}, - "memory": {
- "value": 30,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.3203",
- "monthly": "210.5100"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.m3.large",
- "resources": {
- "cpu": {
- "value": 2,
- "unit": "vCPU"
}, - "memory": {
- "value": 7,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.0447",
- "monthly": "29.4400"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.m3.xlarge",
- "resources": {
- "cpu": {
- "value": 4,
- "unit": "vCPU"
}, - "memory": {
- "value": 15,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.0902",
- "monthly": "59.3300"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.m3.2xlarge",
- "resources": {
- "cpu": {
- "value": 8,
- "unit": "vCPU"
}, - "memory": {
- "value": 30,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.1799",
- "monthly": "118.2700"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.r3.large",
- "resources": {
- "cpu": {
- "value": 2,
- "unit": "vCPU"
}, - "memory": {
- "value": 15.25,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.0555",
- "monthly": "36.4900"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.r3.xlarge",
- "resources": {
- "cpu": {
- "value": 4,
- "unit": "vCPU"
}, - "memory": {
- "value": 30.5,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.1104",
- "monthly": "72.5700"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}, - {
- "name": "lsw.r3.2xlarge",
- "resources": {
- "cpu": {
- "value": 8,
- "unit": "vCPU"
}, - "memory": {
- "value": 61,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "prices": {
- "hourly": "0.2202",
- "monthly": "144.7400"
}, - "storageTypes": [
- "CENTRAL"
], - "minDiskSize": 5
}
], - "_metadata": {
- "totalCount": 10,
- "limit": 50,
- "offset": 0,
- "currency": "EUR",
- "currencySymbol": "€"
}
}List credentials stored for a specific Instance
Authorizations:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 1,
- "limit": 20,
- "offset": 0
}, - "credentials": [
- {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
]
}Store credentials for a specific Instance
Authorizations:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Request Body schema: application/jsonrequired
| type required | string (credentialType) Enum: "OPERATING_SYSTEM" "CONTROL_PANEL" |
| username required | string Can contain only alphanumeric values and characters |
| password required | string The password you'd like to store |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "password": "12341234",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "password": "12341234",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}Delete all credentials associated with a specific Instance
Authorizations:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 401
- 403
- 404
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 1,
- "limit": 20,
- "offset": 0
}, - "credentials": [
- {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
]
}Get Instance credentials by type and username.
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "password": "12341234",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}Update credentials for a given type and username
Authorizations:
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/jsonrequired
| password required | string The new password |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "password": "12341234"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "password": "12341234",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}Delete Instance credential for a given type and username
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "currency": "EUR",
- "currencySymbol": "€"
}, - "billing": {
- "instances": [
- {
- "id": "b778824a-a96e-4f6f-9713-7b7196f09c4f",
- "reference": "test-instance",
- "resources": {
- "cpu": {
- "value": 2,
- "unit": "vCPU"
}, - "memory": {
- "value": 8,
- "unit": "GB"
}, - "publicNetworkSpeed": {
- "value": 5,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 1000,
- "unit": "Mbps"
}
}, - "contract": {
- "billingFrequency": 1,
- "term": 0,
- "type": "HOURLY"
}, - "startedAt": "2023-11-30T16:31:46+00:00",
- "endedAt": "2023-11-30T16:40:46+00:00",
- "rootDiskSize": 15,
- "billingType": "POSTPAID",
- "hours": 14,
- "from": "2023-12-01T00:00:00+00:00",
- "to": "2023-12-01T13:18:41+00:00",
- "rootDiskStorageType": "CENTRAL",
- "price": "0.72"
}
], - "traffic": {
- "unit": "GB",
- "values": {
- "tier_0": {
- "usage": 1000,
- "price": 0
}, - "tier_1": {
- "usage": 10000,
- "price": 15.54
}, - "tier_2": {
- "usage": 10000,
- "price": 13.45
}, - "tier_3": {
- "usage": 34.5,
- "price": 2.34
}
}
}, - "totalValue": "11.223,00"
}
}List available ISOs
List all available ISO images
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url 'https://api.leaseweb.com/publicCloud/v1/isos?limit=20&offset=10' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "totalCount": 2,
- "limit": 20,
- "offset": 0
}, - "isos": [
- {
- "id": "GRML",
- "name": "GRML 2022.11"
}, - {
- "id": "ACRONIS_BOOT_MEDIA",
- "name": "Acronis Boot Media"
}
]
}List all available Images
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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®ion=eu-west-3' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 500
- 503
{- "images": [
- {
- "id": "UBUNTU_24_04_64BIT",
- "name": "Ubuntu 24.04 LTS (x86_64)",
- "version": "24.04",
- "family": "linux",
- "flavour": "ubuntu",
- "architecture": "x86_64",
- "marketApps": [ ],
- "storageTypes": [
- "LOCAL",
- "CENTRAL"
], - "storageSize": null,
- "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": null,
- "updatedAt": null,
- "custom": false,
- "minDiskSize": null
}, - {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (x86_64)",
- "version": "22.04",
- "family": "linux",
- "flavour": "ubuntu",
- "architecture": "x86_64",
- "marketApps": [
- "PLESK_WEB_ADMIN"
], - "storageTypes": [
- "LOCAL",
- "CENTRAL"
], - "storageSize": null,
- "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": null,
- "updatedAt": null,
- "custom": false,
- "minDiskSize": null
}, - {
- "id": "UBUNTU_20_04_64BIT",
- "name": "Ubuntu 20.04 LTS (x86_64)",
- "version": "20.04",
- "family": "linux",
- "flavour": "ubuntu",
- "architecture": "x86_64",
- "marketApps": [ ],
- "storageTypes": [
- "LOCAL",
- "CENTRAL"
], - "storageSize": null,
- "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": null,
- "updatedAt": null,
- "custom": false,
- "minDiskSize": null
}, - {
- "id": "abcc1630-362f-48ba-832f-c496aff24121",
- "name": "Custom image - 01",
- "flavour": "ubuntu",
- "family": "linux",
- "version": null,
- "architecture": null,
- "marketApps": [ ],
- "storageTypes": [ ],
- "storageSize": {
- "size": 2.03,
- "unit": "GB"
}, - "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": "2024-07-05T10:44:08+00:00",
- "updatedAt": "2024-07-18T08:52:08+00:00",
- "custom": true,
- "minDiskSize": null
}, - {
- "id": "8600b94b-45b4-4887-86e1-2792b06dbb32",
- "name": "Custom image - 02",
- "flavour": "ubuntu",
- "family": "linux",
- "version": null,
- "architecture": null,
- "marketApps": [ ],
- "storageTypes": [ ],
- "storageSize": {
- "size": 2.03,
- "unit": "GB"
}, - "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": "2024-07-05T10:47:01+00:00",
- "updatedAt": "2024-07-17T13:14:01+00:00",
- "custom": true,
- "minDiskSize": null
}, - {
- "id": "ace712e9-a166-47f1-9065-4af0f7e7fce1",
- "name": "Custom image - 03",
- "flavour": "ubuntu",
- "family": "linux",
- "version": null,
- "architecture": null,
- "marketApps": [ ],
- "storageTypes": [ ],
- "storageSize": {
- "size": 2.03,
- "unit": "GB"
}, - "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": "2024-07-05T10:54:27+00:00",
- "updatedAt": "2024-07-17T13:14:01+00:00",
- "custom": true,
- "minDiskSize": null
}
], - "_metadata": {
- "totalCount": 6,
- "limit": 6,
- "offset": 0
}
}Create Custom Image
Create a Custom Image
Authorizations:
Request Body schema: application/jsonrequired
| 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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "name": "New custom image",
- "instanceId": "695ddd91-051f-4dd6-9120-938a927a47d0"
}Response samples
- 201
- 400
- 401
- 403
- 500
- 503
{- "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": {
- "size": 2.03,
- "unit": "GB"
}, - "storageTypes": [ ],
- "updatedAt": "2024-07-17T13:14:01+00:00",
- "version": null
}Update Custom Image
Update a Custom Image
Authorizations:
path Parameters
| imageId required | string <uuid> Example: 695ddd91-051f-4dd6-9120-938a927a47d0 Image's ID |
Request Body schema: application/jsonrequired
| name required | string The name of the custom image to be updated. |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "name": "Custom image"
}Response samples
- 201
- 400
- 401
- 403
- 500
- 503
{- "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": {
- "size": 2.03,
- "unit": "GB"
}, - "storageTypes": [ ],
- "updatedAt": "2024-07-17T13:14:01+00:00",
- "version": null
}Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/marketApps \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "totalCount": 1,
- "limit": 20,
- "offset": 0
}, - "marketApps": [
- {
- "id": "LOADBALANCER",
- "name": "Load Balancer",
- "category": "LOAD_BALANCER",
- "version": null,
- "family": "loadbalancer",
- "image": {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (x86_64)",
- "family": "linux",
- "flavour": "ubuntu",
- "custom": false
}
}
]
}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:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Request Body schema: application/jsonrequired
| isoId required | string The ISO ID, obtained using the ISO endpoints |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "isoId": "GRML"
}Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}List images available for reinstall
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "images": [
- {
- "id": "UBUNTU_24_04_64BIT",
- "name": "Ubuntu 24.04 LTS (x86_64)",
- "version": "24.04",
- "family": "linux",
- "flavour": "ubuntu",
- "architecture": "x86_64",
- "marketApps": [ ],
- "storageTypes": [
- "LOCAL",
- "CENTRAL"
], - "storageSize": null,
- "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": null,
- "updatedAt": null,
- "custom": false,
- "minDiskSize": null
}, - {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (x86_64)",
- "version": "22.04",
- "family": "linux",
- "flavour": "ubuntu",
- "architecture": "x86_64",
- "marketApps": [
- "PLESK_WEB_ADMIN"
], - "storageTypes": [
- "LOCAL",
- "CENTRAL"
], - "storageSize": null,
- "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": null,
- "updatedAt": null,
- "custom": false,
- "minDiskSize": null
}, - {
- "id": "UBUNTU_20_04_64BIT",
- "name": "Ubuntu 20.04 LTS (x86_64)",
- "version": "20.04",
- "family": "linux",
- "flavour": "ubuntu",
- "architecture": "x86_64",
- "marketApps": [ ],
- "storageTypes": [
- "LOCAL",
- "CENTRAL"
], - "storageSize": null,
- "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": null,
- "updatedAt": null,
- "custom": false,
- "minDiskSize": null
}, - {
- "id": "abcc1630-362f-48ba-832f-c496aff24121",
- "name": "Custom image - 01",
- "flavour": "ubuntu",
- "family": "linux",
- "version": null,
- "architecture": null,
- "marketApps": [ ],
- "storageTypes": [ ],
- "storageSize": {
- "size": 2.03,
- "unit": "GB"
}, - "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": "2024-07-05T10:44:08+00:00",
- "updatedAt": "2024-07-18T08:52:08+00:00",
- "custom": true,
- "minDiskSize": null
}, - {
- "id": "8600b94b-45b4-4887-86e1-2792b06dbb32",
- "name": "Custom image - 02",
- "flavour": "ubuntu",
- "family": "linux",
- "version": null,
- "architecture": null,
- "marketApps": [ ],
- "storageTypes": [ ],
- "storageSize": {
- "size": 2.03,
- "unit": "GB"
}, - "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": "2024-07-05T10:47:01+00:00",
- "updatedAt": "2024-07-17T13:14:01+00:00",
- "custom": true,
- "minDiskSize": null
}, - {
- "id": "ace712e9-a166-47f1-9065-4af0f7e7fce1",
- "name": "Custom image - 03",
- "flavour": "ubuntu",
- "family": "linux",
- "version": null,
- "architecture": null,
- "marketApps": [ ],
- "storageTypes": [ ],
- "storageSize": {
- "size": 2.03,
- "unit": "GB"
}, - "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": "2024-07-05T10:54:27+00:00",
- "updatedAt": "2024-07-17T13:14:01+00:00",
- "custom": true,
- "minDiskSize": null
}
], - "_metadata": {
- "totalCount": 6,
- "limit": 6,
- "offset": 0
}
}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:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Request Body schema: application/jsonrequired
| imageId required | string The Image ID |
| marketAppId | string The Market App to be installed |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "imageId": "UBUNTU_22_04_64BIT"
}Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
Request Body schema: application/jsonrequired
| 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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "billingFrequency": 1,
- "contractTerm": 0,
- "contractType": "HOURLY",
- "reference": "my-loadbalancer-1",
- "region": "eu-west-3",
- "type": "lsw.m3.large"
}Response samples
- 201
- 400
- 401
- 403
- 500
- 503
{- "privateNetwork": null,
- "id": "32082a93-d1e2-4bc0-8f5e-8fe4312b0844",
- "type": "lsw.m3.large",
- "resources": {
- "cpu": {
- "value": 2,
- "unit": "vCPU"
}, - "memory": {
- "value": 7,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "region": "eu-west-3",
- "reference": "my-loadbalancer1",
- "state": "RUNNING",
- "ips": [
- {
- "ip": "85.99.99.99",
- "prefixLength": "28",
- "version": 4,
- "nullRouted": false,
- "reverseLookup": null,
- "mainIp": false,
- "networkType": "PUBLIC",
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
], - "startedAt": "2024-04-09T15:11:37+00:00",
- "contract": {
- "id": "",
- "billingFrequency": 1,
- "term": 0,
- "type": "HOURLY",
- "state": "ACTIVE",
- "endsAt": null,
- "startsAt": "2024-10-24T21:13:25+00:00",
- "sla": "Basic",
- "controlPanel": "cPanel Admin 5",
- "inModification": false
}, - "configuration": {
- "stickySession": null,
- "balance": "roundrobin",
- "xForwardedFor": false,
- "idleTimeOut": 60
}
}Get load balancer list
List and filter load balancers
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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®ion=eu-west-3&type=lsw.c3.xlarge' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "totalCount": 1,
- "limit": 20,
- "offset": 0
}, - "loadBalancers": [
- {
- "privateNetwork": null,
- "id": "5fd135a9-3ff6-4794-8b92-8cd8747a3ea3",
- "type": "lsw.c3.4xlarge",
- "resources": {
- "cpu": {
- "value": 16,
- "unit": "vCPU"
}, - "memory": {
- "value": 30,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "region": "eu-west-3",
- "reference": "my-load-balancer",
- "state": "RUNNING",
- "ips": [
- {
- "ip": "85.99.99.99",
- "prefixLength": "28",
- "version": 4,
- "nullRouted": false,
- "reverseLookup": null,
- "networkType": "PUBLIC",
- "mainIp": false
}
], - "startedAt": "2024-04-09T15:11:37+00:00",
- "contract": {
- "billingFrequency": 1,
- "term": 0,
- "type": "HOURLY"
}, - "configuration": {
- "stickySession": {
- "enabled": true,
- "maxLifeTime": 1000
}, - "balance": "roundrobin",
- "xForwardedFor": false,
- "idleTimeOut": 60
}
}
]
}Get load balancer details
Get details about the load balancer
Authorizations:
path Parameters
| loadBalancerId required | string <uuid> Example: 695ddd91-051f-4dd6-9120-938a927a47d0 Load balancer ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "privateNetwork": null,
- "id": "32082a93-d1e2-4bc0-8f5e-8fe4312b0844",
- "type": "lsw.m3.large",
- "resources": {
- "cpu": {
- "value": 2,
- "unit": "vCPU"
}, - "memory": {
- "value": 7,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "region": "eu-west-3",
- "reference": "my-loadbalancer1",
- "state": "RUNNING",
- "ips": [
- {
- "ip": "85.99.99.99",
- "prefixLength": "28",
- "version": 4,
- "nullRouted": false,
- "reverseLookup": null,
- "mainIp": false,
- "networkType": "PUBLIC",
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
], - "startedAt": "2024-04-09T15:11:37+00:00",
- "contract": {
- "id": "",
- "billingFrequency": 1,
- "term": 0,
- "type": "HOURLY",
- "state": "ACTIVE",
- "endsAt": null,
- "startsAt": "2024-10-24T21:13:25+00:00",
- "sla": "Basic",
- "controlPanel": "cPanel Admin 5",
- "inModification": false
}, - "configuration": {
- "stickySession": null,
- "balance": "roundrobin",
- "xForwardedFor": false,
- "idleTimeOut": 60
}
}Delete load balancer
Terminate a Load balancer
Authorizations:
path Parameters
| loadBalancerId required | string <uuid> Example: 695ddd91-051f-4dd6-9120-938a927a47d0 Load balancer ID |
Request Body schema: application/jsonrequired
| 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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "reasonCode": "CANCEL_TRIAL_PERIOD"
}Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| loadBalancerId required | string <uuid> Example: 695ddd91-051f-4dd6-9120-938a927a47d0 Load balancer ID |
Request Body schema: application/jsonrequired
| 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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "balance": "roundrobin",
- "contractType": "HOURLY",
- "idleTimeOut": 60,
- "reference": "foo",
- "type": "lsw.m3.xlarge",
- "xForwardedFor": false
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "privateNetwork": null,
- "id": "32082a93-d1e2-4bc0-8f5e-8fe4312b0844",
- "type": "lsw.m3.large",
- "resources": {
- "cpu": {
- "value": 2,
- "unit": "vCPU"
}, - "memory": {
- "value": 7,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "region": "eu-west-3",
- "reference": "my-loadbalancer1",
- "state": "RUNNING",
- "ips": [
- {
- "ip": "85.99.99.99",
- "prefixLength": "28",
- "version": 4,
- "nullRouted": false,
- "reverseLookup": null,
- "mainIp": false,
- "networkType": "PUBLIC",
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
], - "startedAt": "2024-04-09T15:11:37+00:00",
- "contract": {
- "id": "",
- "billingFrequency": 1,
- "term": 0,
- "type": "HOURLY",
- "state": "ACTIVE",
- "endsAt": null,
- "startsAt": "2024-10-24T21:13:25+00:00",
- "sla": "Basic",
- "controlPanel": "cPanel Admin 5",
- "inModification": false
}, - "configuration": {
- "stickySession": null,
- "balance": "roundrobin",
- "xForwardedFor": false,
- "idleTimeOut": 60
}
}Get listener list
List listeners
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 1,
- "limit": 10,
- "offset": 0
}, - "listeners": [
- {
- "protocol": "HTTPS",
- "port": 443,
- "id": "fac06878-6655-4956-8ea7-124a97f133ab",
- "rules": [
- {
- "id": "b05917e1-96a4-442a-900c-c41f273d95c9",
- "default": true,
- "targetGroupId": "b05917e1-96a4-442a-900c-c41f273d95c9"
}
]
}
]
}Create listener
Create listener
Authorizations:
path Parameters
| loadBalancerId required | string <uuid> Example: 695ddd91-051f-4dd6-9120-938a927a47d0 Load balancer ID |
Request Body schema: application/jsonrequired
| 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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "protocol": "HTTPS",
- "port": 443,
- "defaultRule": {
- "targetGroupId": "b05917e1-96a4-442a-900c-c41f273d95c9"
}, - "certificate": {
- "chain": "-----BEGIN CERTIFICATE-----MIICNDCCAZ2gAwIBAgIUEby6nzM+o7vkKfzcMS/DGA8tgwQwDQYJKoZIhvcNAQELBQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA0MjUwODE3MjZaFw0yNTA0MjUwODE3MjZaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMMiux2r1AFLVpIhdZ0bvgIvhiT9XCnfHJlGE7OarGKDKJDQ6XAquCfosLws2XAugGcMJWrsqVWtJEYSu6OMsDLYCJhh39AKqZIW0pktkr8LGlo4VLvzGPqwpHnzWthyCEFsE6p+JJQumDA/izJm2zjZL+xHDocOlNqDTB87AIdrAgMBAAGjITAfMB0GA1UdDgQWBBT3sXUrIR2vcwak0QCXoIsxHa4dDDANBgkqhkiG9w0BAQsFAAOBgQCh/l+5s713J02b8sWicUK2KjTPfyKmZFkoS+Mlo+//B/aM612ZJpGL2tAKGF3v0NDOrRYLZj0t/tlZI55pUNJI9cNj/RExvnfTSSNJIbV+8kQt5AHo50wGxj/apkuEtQre2Fpf4pyovcfIoF6HJvvp1jy96yL14UoEehZypR8FlA==-----END CERTIFICATE-----",
- "certificate": "-----BEGIN CERTIFICATE-----\nMIIGCTCCA/GgAwIBAgIUbgSw+3dtcx8IsHuUN0L/n6xRKjMwDQYJKoZIhvcNAQEL\nBQAwgZMxCzAJBgNVBAYTAk5MMRMwEQYDVQQIDApTb21lLVN0YXRlMRIwEAYDVQQH\nDAlBbXN0ZXJkYW0xFTATBgNVBAoMDExlYXNld2ViIExkYTELMAkGA1UECwwCSVQx\nFTATBgNVBAMMDGxlYXNld2ViLmNvbTEgMB4GCSqGSIb3DQEJARYRdGVzdEBsZWFz\nZXdlYi5jb20wHhcNMjQxMTE5MDg1MDI3WhcNMjUxMTE5MDg1MDI3WjCBkzELMAkG\nA1UEBhMCTkwxEzARBgNVBAgMClNvbWUtU3RhdGUxEjAQBgNVBAcMCUFtc3RlcmRh\nbTEVMBMGA1UECgwMTGVhc2V3ZWIgTGRhMQswCQYDVQQLDAJJVDEVMBMGA1UEAwwM\nbGVhc2V3ZWIuY29tMSAwHgYJKoZIhvcNAQkBFhF0ZXN0QGxlYXNld2ViLmNvbTCC\nAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJqDbIUyZ34g8BvPmtsQxdrf\nteHbvH+27kVFjTKFVVtsKqMpUJ1OL4S4WvzcdGCp1051Qs2ePA6Xmh94yAUrwcsF\n1HZyXlguVs9lc25F0fVaL7kiSBYKbjVDb1muPmlzOEPb3c6jvOoERB4gtMSaGsd/\nC5HRIrXtA2aHDoLDSPeDlPO/zFYWRmT6QAgM8m6IsfmYH5071m8XtNPWWXr6By74\nPv9cjtjuHXNNyaKTrH/ak1OUNq1+BcRk30Mq0WRlpJ0bKk0NpBvVoaccFaYbNoBg\ngorofLVJZDAeachCovepGw6Bhi0Re4W0YNHghPJpUyd9+2JutRzSSqX5FKlceHUy\nu719B3eJ2D8YxMYw4r+CUx+bFbJxxa+8QVOQzCW8rM9BzcP5ia4sQy7yboqxl5Xx\npZK9VLp1SmhRewFJUm59pZLxfq/yKON0O6Xt1ROwca4T8C+TyeLGAFXjOTopa26I\nHMV/HMr2jeX15h3vMQw1VBFtUzIfaQEDlf0NUXAMbJuFWCC9gfYQhsWWVry98teD\n/wEyD1OHGVpo4ZBK852/PSYBozOSrg5VEdRGv7pcrYVj13EJariW4aWFYGnVHEDy\ncPg3yLS2B0+EfCKaaIPWG/H3x8BlrfUq/Nw7VXRZbFCCHQ5s40aJbMgxlsn+peJy\nxI3f4RIn6TBz04KZsUFdAgMBAAGjUzBRMB0GA1UdDgQWBBSQUaWTlJw4MUG916ds\nHL7eaKvh9TAfBgNVHSMEGDAWgBSQUaWTlJw4MUG916dsHL7eaKvh9TAPBgNVHRMB\nAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4ICAQBOU+aAsHw5cgpE/C1ZcXs1ofGp\n6OeoE3e1GRxyJMKB+iG5oG9RlbYgGG9Y4CRmxDKpeEVr/L2udCtFlBUonG2dHzbk\nxe0FdSAeTXgAfUbZypwCgu7Vdu0lT6WOsormoU2i1t+zoyZjT5S2fsfllaSa3rhy\nevVxY4V8p1KS9t123hb/Ic6J4bTCnKniRYyACqb+/36W8NxPU9EoP8t1pgNGLBnV\nDofoL/Z5kTjXTULQ2opXjbtCRrxoBl3NjIfxVQqIoFuo8uEisHIPDzfzP30hBNpr\n+4I5VHY1ERKZoPQ13PhQ63MhaXu2Dpb6e7WXrajbn2sulxaYbyJliN8Qcgh66TE7\nkpEjaTOFc3XUTIzYnI5CkVnp9evGyE68YCzuHsUrpTqCcCQ+fTNvEyskavHa+HnS\n5q06AQaP5aTXXhE/wxR3+X9k5G7dM/gmvdM+PvH+Bl8oPbclRNJ0X7J7K5toXFN6\ngqtcNiWrOHwiWthoSL9cB1pqQqynhfh9YbrcMG1thZtZxBpsOznJBVnh+fD9WZ5c\nuDMDnYBuL9DwsbPYHe8+5XUtX/aO07ea0LlNie56N3t5JgYZQJA3q0DiRrPjfI4C\nHogUG60UcBk51FyrnF3UQAbwhCnldKLGp0F69r2+qbByJudMTeBUIak+RXkicbWA\nFdk6z55BF6MzAC6iXA==\n-----END CERTIFICATE-----\n",
- "privateKey": "-----BEGIN PRIVATE KEY-----\nMIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQCag2yFMmd+IPAb\nz5rbEMXa37Xh27x/tu5FRY0yhVVbbCqjKVCdTi+EuFr83HRgqddOdULNnjwOl5of\neMgFK8HLBdR2cl5YLlbPZXNuRdH1Wi+5IkgWCm41Q29Zrj5pczhD293Oo7zqBEQe\nILTEmhrHfwuR0SK17QNmhw6Cw0j3g5Tzv8xWFkZk+kAIDPJuiLH5mB+dO9ZvF7TT\n1ll6+gcu+D7/XI7Y7h1zTcmik6x/2pNTlDatfgXEZN9DKtFkZaSdGypNDaQb1aGn\nHBWmGzaAYIKK6Hy1SWQwHmnIQqL3qRsOgYYtEXuFtGDR4ITyaVMnfftibrUc0kql\n+RSpXHh1Mru9fQd3idg/GMTGMOK/glMfmxWyccWvvEFTkMwlvKzPQc3D+YmuLEMu\n8m6KsZeV8aWSvVS6dUpoUXsBSVJufaWS8X6v8ijjdDul7dUTsHGuE/Avk8nixgBV\n4zk6KWtuiBzFfxzK9o3l9eYd7zEMNVQRbVMyH2kBA5X9DVFwDGybhVggvYH2EIbF\nlla8vfLXg/8BMg9ThxlaaOGQSvOdvz0mAaMzkq4OVRHURr+6XK2FY9dxCWq4luGl\nhWBp1RxA8nD4N8i0tgdPhHwimmiD1hvx98fAZa31KvzcO1V0WWxQgh0ObONGiWzI\nMZbJ/qXicsSN3+ESJ+kwc9OCmbFBXQIDAQABAoICABqhMe/W2w1a4eb5JchBoMfz\nLGart1YPkgswTIB7iFWEU+jg8vrZgckO+OeBmzEZtHjaLtQ/RDyDllV8PITfoLu7\n2n07gtURz3ZZFsbXk7MEgxsWNHRQAeR+Jc+//xOvfu/7EcROZf2zFIZYvq7vnFPr\nqnPMJn5SRfbCqhaRT58Q93f3A2GG30UB+E0q5hF0z6+jrzcrG+7zl/+2fp96Pgiz\nUjAypI/wofTAYFL7vowegKuz7KSEBrxtYikyVPpHplJJX0X+Zt1BOWYSqgyBvifr\n+jO0k+Gur2y3oSWZjnq+k2Ixoo1b6P0HNHSXjHI3AtTYmp3BVMeN2r22KwBxZnUP\n5inbLkF28QezyzrhtR9PDZiqb3X0xKn+WhUYuO6VL6qUbbibbWM5bM/AdW4DC0Ig\nop4nQLebMEJ8fyjC7jfdJJ6EahCNKHUR5RgV4YXXfi+fanLsdMZJWUMt7hCPBFXg\nKXviSItVpnh5iPwDporAwUQMtwtDv7a1Dgyn04bMje+TEbiBj0hc2CcE8YEdpnJz\nPsKeBUET1vKah5GZLWSatuxRRfydd54vOkU1EGyTPxN+Shvg0pJpnq40NAYTHGUh\n0OmyXAOlfPe7WJsdLREZp9c9kfptGJ9frmjgWVnxi50qsi5/QQvgSucr2UBnWSVy\nd5Kw1rjM/ilEUwvR8FtlAoIBAQDHjUYZvsAKXN2XD51iTwN/Gh7zbL9zIBPBzjCO\nF1fKQVXL4Vm/yp99d1cpLf9WVaFJIzu5TfNsDOUiqKbig/pup0X/jwBfM4Sr0Nvn\nQm6zBljgbw1mzZ6oOLvP2Fi9rzqdnFAZnDx6u6uHklAKdxAXkwGK85kztW9wTuNX\nxU/ybccqNRzFpbg7eU9Qc0vRPos4AJoIFxqfTq/p5D7xHmQNxR46/7J0WbusT3sd\nq5ZbXlAGWnp4IuOHI+uq1wnSjRN1fKvo26zMISdWEnvgGuxZW/zPEXpy1GZOVxcl\nvBEn5X4dv+I945ye3dl2zMdWeTM7YQgv/QlIkDjt0O74dnQ3AoIBAQDGOKYAcJ1z\nmCaU+W70yj49uRDKptUeAEY2yDAdhKhGdKLpnvfa6qCO7bkRr11zBujlxzNd5U38\nKmnNwYepTkPuzFrWf6GhTh7tidz5XjoUSZrWNs6/lruxitkUal22mYcnJRhoXvQE\nm7dh5YbwHUVFk3EplZu2k05hDs6w8TglrIH4D9P1JTObhHSvLXxph5+NTyk/mEeR\nR3i2j1hE+z1FmDyJDSAUa2dVRihPXje7JZQ1oS2IC7g6NoisaIzK85983NQKzUEt\nLV11mHGg+3h3IVnfXQqn0/L9EDEK8QansFPqNwXwIvkCUO78De5tHro9ggC/hSrm\nIAyoqFguHFULAoIBAA0/jNrith86ASApUjqXolTK6CkjHCbJh2ZDiSe11wc/hTGu\n+WVpT2NmC+xY+G3D65xOcYWg7jtLM980MTgyqOq1wkjwNocbhYBesmrNF0pdboMf\n/FTJ6/GhKp7m7yVQv+R83ziEDePcF8w9Y4D+XJwkD2MpPw+WyRo8so0+NUuUDDf6\nJLnegbe5GxHtRahTrax/JbrJxeOztqwhkigx61SatKIYHcHpvzL2Z+cVYDsarNdv\nJFhbgJ2VPe0ur6FB6nvPVh50jylSPilRutWrE+vu1n7s2yNKhKxIzemcbcsnSlMx\nTRTsypYlhm2DtOxByav0ijWdaANgR9dKGsN2IcsCggEAahiMEZQ1UlfP3tEbaH6P\nje3uZOmjDGnNKyk/R61nfD6VrEHgHBaVVas78ZFRjW3XXpWektVXRm9VLkI14JL5\nnWlX/ZNW6cWsnCu8UOT0ZUN4UswHIVkGoWLWCi1cd435XyRlygd4yLaoEwgNj5u7\nJiBi44UmUTTLMPwB+YdDLDcHYcTnCEGfO9BLvC+2da2X4sTKKTXSqJn+rIhREKsB\nAq0XSavyzbsnFed1T/X4En1stL/OZREQzGfAA7f6E+8OIID6JcXy6sFrUrQDrcyr\nj+gT+JAOUgIJ/xWZimezzjF82NIWpY+yhGDZaaPzSAi4Wo+o4tneOkpRPDzO5e9Y\nPQKCAQApI1xb8+x7ye2OU06flFnpOP1UGo5OQnlBU1xdc+TeyKebmBsODxVNQbk6\nqmQm1pheNhNQ3fSy1wDVsa1pzLMhLHhez/q3Qd9fD4EfDptzhA58T0+JD8udZZDi\n9SCej498NV3u0W9G5Os2D5dVpY9TV+ji9mW07RYx4mzb6RECDzBxACVy+NnZpQrb\nF3oMitM/6gGltiR2fQiPmnsvP0Ww2YDvP3LG/Zi3xVqDH9IsVYPCLXov4EiVal9O\nxID6vIb5sesjKCvivG0gOVE+nmpkqCSRezXzy1Tjl68sfK9Mt5U5/LNgk/no/ugg\nm+plMlI71CJsCRJtYctOeGAYm/6V\n-----END PRIVATE KEY-----\n"
}
}Response samples
- 201
- 400
- 401
- 403
- 500
- 503
{- "protocol": "HTTPS",
- "port": 443,
- "id": "fac06878-6655-4956-8ea7-124a97f133ab",
- "rules": [
- {
- "id": "b05917e1-96a4-442a-900c-c41f273d95c9",
- "default": true,
- "targetGroupId": "b05917e1-96a4-442a-900c-c41f273d95c9"
}
]
}Get listener details
Get details about a listener
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "protocol": "HTTPS",
- "port": 443,
- "id": "fac06878-6655-4956-8ea7-124a97f133ab",
- "rules": [
- {
- "id": "b05917e1-96a4-442a-900c-c41f273d95c9",
- "default": true,
- "targetGroupId": "b05917e1-96a4-442a-900c-c41f273d95c9"
}
], - "sslCertificates": [
- {
- "chain": "-----BEGIN CERTIFICATE-----MIICNDCCAZ2gAwIBAgIUEby6nzM+o7vkKfzcMS/DGA8tgwQwDQYJKoZIhvcNAQELBQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA0MjUwODE3MjZaFw0yNTA0MjUwODE3MjZaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMMiux2r1AFLVpIhdZ0bvgIvhiT9XCnfHJlGE7OarGKDKJDQ6XAquCfosLws2XAugGcMJWrsqVWtJEYSu6OMsDLYCJhh39AKqZIW0pktkr8LGlo4VLvzGPqwpHnzWthyCEFsE6p+JJQumDA/izJm2zjZL+xHDocOlNqDTB87AIdrAgMBAAGjITAfMB0GA1UdDgQWBBT3sXUrIR2vcwak0QCXoIsxHa4dDDANBgkqhkiG9w0BAQsFAAOBgQCh/l+5s713J02b8sWicUK2KjTPfyKmZFkoS+Mlo+//B/aM612ZJpGL2tAKGF3v0NDOrRYLZj0t/tlZI55pUNJI9cNj/RExvnfTSSNJIbV+8kQt5AHo50wGxj/apkuEtQre2Fpf4pyovcfIoF6HJvvp1jy96yL14UoEehZypR8FlA==-----END CERTIFICATE-----",
- "certificate": "-----BEGIN CERTIFICATE-----MIIBhDCB7gIBADBFMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCtWdKNbZxvkXKAADjJMJ7VTJz6uFoMD403C+gMIF8hwqIsHggzCao6iXrW9sZoyZtUBVBiiq5RumHbbpwvOdMmXrShEB4sTJkWRMDy7yD4D91WCU1fc10E/zBJMwssAvmHZo5kGW1Pj1N9ktb+O/TMsEc6yd5suvdQj6aaJbQlTQIDAQABoAAwDQYJKoZIhvcNAQELBQADgYEAWOQ2CJLRo8MQgJgvhdoSIkHITnrbjB5hS3f/dx0lIcnyI6Q9nOyuQHXkCgkdBaV8lz7l+IbqcGc3CaIRP2ZIVFvo2252n630tOOSsqoqJS1tYIoIKsohi3T3d8T1i/s0BWbTJi8Xgd186wyUn/jHwXROKx2rq6yYsAO6fISDKw8=-----END CERTIFICATE-----",
- "privateKey": "-----BEGIN EC PRIVATE KEY-----MIHcAgEBBEIBVlC0IObonfQZIQ81l/WILKfWT5Fv96eNnYmQZ7uleu73igfiVESVuPfNlbW9oNEK1XcXli4YNZMxWMkKuzC3w8CgBwYFK4EEACOhgYkDgYYABAHvOqz9d2xeSpm1FNdw0NR5j/q6PMd6whZFsTPNYNj0/PsTpsHk78ZB4MYnJUXwHJjpj+gnKkLNc02f4w/vSF8VXADX4l40XU/w82TAOCftQwoxO5o0jZcwEUIYzl02Zd7uNxhjtKJQnYFi9x8WI8L8zQ6GZB/fJKYwoHaUr0I1h/5LzQ==-----END EC PRIVATE KEY-----"
}
]
}Update a listener
Authorizations:
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/jsonrequired
| protocol | string (protocol) Enum: "HTTP" "HTTPS" "TCP" |
| port | integer Port that the listener listens to |
object (sslCertificate) | |
object (loadBalancerListenerDefaultRule) |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "protocol": "HTTPS",
- "port": 443,
- "defaultRule": {
- "targetGroupId": "b05917e1-96a4-442a-900c-c41f273d95c9"
}, - "certificate": {
- "chain": "-----BEGIN CERTIFICATE-----MIICNDCCAZ2gAwIBAgIUEby6nzM+o7vkKfzcMS/DGA8tgwQwDQYJKoZIhvcNAQELBQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA0MjUwODE3MjZaFw0yNTA0MjUwODE3MjZaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMMiux2r1AFLVpIhdZ0bvgIvhiT9XCnfHJlGE7OarGKDKJDQ6XAquCfosLws2XAugGcMJWrsqVWtJEYSu6OMsDLYCJhh39AKqZIW0pktkr8LGlo4VLvzGPqwpHnzWthyCEFsE6p+JJQumDA/izJm2zjZL+xHDocOlNqDTB87AIdrAgMBAAGjITAfMB0GA1UdDgQWBBT3sXUrIR2vcwak0QCXoIsxHa4dDDANBgkqhkiG9w0BAQsFAAOBgQCh/l+5s713J02b8sWicUK2KjTPfyKmZFkoS+Mlo+//B/aM612ZJpGL2tAKGF3v0NDOrRYLZj0t/tlZI55pUNJI9cNj/RExvnfTSSNJIbV+8kQt5AHo50wGxj/apkuEtQre2Fpf4pyovcfIoF6HJvvp1jy96yL14UoEehZypR8FlA==-----END CERTIFICATE-----",
- "certificate": "-----BEGIN CERTIFICATE-----\nMIIGCTCCA/GgAwIBAgIUbgSw+3dtcx8IsHuUN0L/n6xRKjMwDQYJKoZIhvcNAQEL\nBQAwgZMxCzAJBgNVBAYTAk5MMRMwEQYDVQQIDApTb21lLVN0YXRlMRIwEAYDVQQH\nDAlBbXN0ZXJkYW0xFTATBgNVBAoMDExlYXNld2ViIExkYTELMAkGA1UECwwCSVQx\nFTATBgNVBAMMDGxlYXNld2ViLmNvbTEgMB4GCSqGSIb3DQEJARYRdGVzdEBsZWFz\nZXdlYi5jb20wHhcNMjQxMTE5MDg1MDI3WhcNMjUxMTE5MDg1MDI3WjCBkzELMAkG\nA1UEBhMCTkwxEzARBgNVBAgMClNvbWUtU3RhdGUxEjAQBgNVBAcMCUFtc3RlcmRh\nbTEVMBMGA1UECgwMTGVhc2V3ZWIgTGRhMQswCQYDVQQLDAJJVDEVMBMGA1UEAwwM\nbGVhc2V3ZWIuY29tMSAwHgYJKoZIhvcNAQkBFhF0ZXN0QGxlYXNld2ViLmNvbTCC\nAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJqDbIUyZ34g8BvPmtsQxdrf\nteHbvH+27kVFjTKFVVtsKqMpUJ1OL4S4WvzcdGCp1051Qs2ePA6Xmh94yAUrwcsF\n1HZyXlguVs9lc25F0fVaL7kiSBYKbjVDb1muPmlzOEPb3c6jvOoERB4gtMSaGsd/\nC5HRIrXtA2aHDoLDSPeDlPO/zFYWRmT6QAgM8m6IsfmYH5071m8XtNPWWXr6By74\nPv9cjtjuHXNNyaKTrH/ak1OUNq1+BcRk30Mq0WRlpJ0bKk0NpBvVoaccFaYbNoBg\ngorofLVJZDAeachCovepGw6Bhi0Re4W0YNHghPJpUyd9+2JutRzSSqX5FKlceHUy\nu719B3eJ2D8YxMYw4r+CUx+bFbJxxa+8QVOQzCW8rM9BzcP5ia4sQy7yboqxl5Xx\npZK9VLp1SmhRewFJUm59pZLxfq/yKON0O6Xt1ROwca4T8C+TyeLGAFXjOTopa26I\nHMV/HMr2jeX15h3vMQw1VBFtUzIfaQEDlf0NUXAMbJuFWCC9gfYQhsWWVry98teD\n/wEyD1OHGVpo4ZBK852/PSYBozOSrg5VEdRGv7pcrYVj13EJariW4aWFYGnVHEDy\ncPg3yLS2B0+EfCKaaIPWG/H3x8BlrfUq/Nw7VXRZbFCCHQ5s40aJbMgxlsn+peJy\nxI3f4RIn6TBz04KZsUFdAgMBAAGjUzBRMB0GA1UdDgQWBBSQUaWTlJw4MUG916ds\nHL7eaKvh9TAfBgNVHSMEGDAWgBSQUaWTlJw4MUG916dsHL7eaKvh9TAPBgNVHRMB\nAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4ICAQBOU+aAsHw5cgpE/C1ZcXs1ofGp\n6OeoE3e1GRxyJMKB+iG5oG9RlbYgGG9Y4CRmxDKpeEVr/L2udCtFlBUonG2dHzbk\nxe0FdSAeTXgAfUbZypwCgu7Vdu0lT6WOsormoU2i1t+zoyZjT5S2fsfllaSa3rhy\nevVxY4V8p1KS9t123hb/Ic6J4bTCnKniRYyACqb+/36W8NxPU9EoP8t1pgNGLBnV\nDofoL/Z5kTjXTULQ2opXjbtCRrxoBl3NjIfxVQqIoFuo8uEisHIPDzfzP30hBNpr\n+4I5VHY1ERKZoPQ13PhQ63MhaXu2Dpb6e7WXrajbn2sulxaYbyJliN8Qcgh66TE7\nkpEjaTOFc3XUTIzYnI5CkVnp9evGyE68YCzuHsUrpTqCcCQ+fTNvEyskavHa+HnS\n5q06AQaP5aTXXhE/wxR3+X9k5G7dM/gmvdM+PvH+Bl8oPbclRNJ0X7J7K5toXFN6\ngqtcNiWrOHwiWthoSL9cB1pqQqynhfh9YbrcMG1thZtZxBpsOznJBVnh+fD9WZ5c\nuDMDnYBuL9DwsbPYHe8+5XUtX/aO07ea0LlNie56N3t5JgYZQJA3q0DiRrPjfI4C\nHogUG60UcBk51FyrnF3UQAbwhCnldKLGp0F69r2+qbByJudMTeBUIak+RXkicbWA\nFdk6z55BF6MzAC6iXA==\n-----END CERTIFICATE-----\n",
- "privateKey": "-----BEGIN PRIVATE KEY-----\nMIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQCag2yFMmd+IPAb\nz5rbEMXa37Xh27x/tu5FRY0yhVVbbCqjKVCdTi+EuFr83HRgqddOdULNnjwOl5of\neMgFK8HLBdR2cl5YLlbPZXNuRdH1Wi+5IkgWCm41Q29Zrj5pczhD293Oo7zqBEQe\nILTEmhrHfwuR0SK17QNmhw6Cw0j3g5Tzv8xWFkZk+kAIDPJuiLH5mB+dO9ZvF7TT\n1ll6+gcu+D7/XI7Y7h1zTcmik6x/2pNTlDatfgXEZN9DKtFkZaSdGypNDaQb1aGn\nHBWmGzaAYIKK6Hy1SWQwHmnIQqL3qRsOgYYtEXuFtGDR4ITyaVMnfftibrUc0kql\n+RSpXHh1Mru9fQd3idg/GMTGMOK/glMfmxWyccWvvEFTkMwlvKzPQc3D+YmuLEMu\n8m6KsZeV8aWSvVS6dUpoUXsBSVJufaWS8X6v8ijjdDul7dUTsHGuE/Avk8nixgBV\n4zk6KWtuiBzFfxzK9o3l9eYd7zEMNVQRbVMyH2kBA5X9DVFwDGybhVggvYH2EIbF\nlla8vfLXg/8BMg9ThxlaaOGQSvOdvz0mAaMzkq4OVRHURr+6XK2FY9dxCWq4luGl\nhWBp1RxA8nD4N8i0tgdPhHwimmiD1hvx98fAZa31KvzcO1V0WWxQgh0ObONGiWzI\nMZbJ/qXicsSN3+ESJ+kwc9OCmbFBXQIDAQABAoICABqhMe/W2w1a4eb5JchBoMfz\nLGart1YPkgswTIB7iFWEU+jg8vrZgckO+OeBmzEZtHjaLtQ/RDyDllV8PITfoLu7\n2n07gtURz3ZZFsbXk7MEgxsWNHRQAeR+Jc+//xOvfu/7EcROZf2zFIZYvq7vnFPr\nqnPMJn5SRfbCqhaRT58Q93f3A2GG30UB+E0q5hF0z6+jrzcrG+7zl/+2fp96Pgiz\nUjAypI/wofTAYFL7vowegKuz7KSEBrxtYikyVPpHplJJX0X+Zt1BOWYSqgyBvifr\n+jO0k+Gur2y3oSWZjnq+k2Ixoo1b6P0HNHSXjHI3AtTYmp3BVMeN2r22KwBxZnUP\n5inbLkF28QezyzrhtR9PDZiqb3X0xKn+WhUYuO6VL6qUbbibbWM5bM/AdW4DC0Ig\nop4nQLebMEJ8fyjC7jfdJJ6EahCNKHUR5RgV4YXXfi+fanLsdMZJWUMt7hCPBFXg\nKXviSItVpnh5iPwDporAwUQMtwtDv7a1Dgyn04bMje+TEbiBj0hc2CcE8YEdpnJz\nPsKeBUET1vKah5GZLWSatuxRRfydd54vOkU1EGyTPxN+Shvg0pJpnq40NAYTHGUh\n0OmyXAOlfPe7WJsdLREZp9c9kfptGJ9frmjgWVnxi50qsi5/QQvgSucr2UBnWSVy\nd5Kw1rjM/ilEUwvR8FtlAoIBAQDHjUYZvsAKXN2XD51iTwN/Gh7zbL9zIBPBzjCO\nF1fKQVXL4Vm/yp99d1cpLf9WVaFJIzu5TfNsDOUiqKbig/pup0X/jwBfM4Sr0Nvn\nQm6zBljgbw1mzZ6oOLvP2Fi9rzqdnFAZnDx6u6uHklAKdxAXkwGK85kztW9wTuNX\nxU/ybccqNRzFpbg7eU9Qc0vRPos4AJoIFxqfTq/p5D7xHmQNxR46/7J0WbusT3sd\nq5ZbXlAGWnp4IuOHI+uq1wnSjRN1fKvo26zMISdWEnvgGuxZW/zPEXpy1GZOVxcl\nvBEn5X4dv+I945ye3dl2zMdWeTM7YQgv/QlIkDjt0O74dnQ3AoIBAQDGOKYAcJ1z\nmCaU+W70yj49uRDKptUeAEY2yDAdhKhGdKLpnvfa6qCO7bkRr11zBujlxzNd5U38\nKmnNwYepTkPuzFrWf6GhTh7tidz5XjoUSZrWNs6/lruxitkUal22mYcnJRhoXvQE\nm7dh5YbwHUVFk3EplZu2k05hDs6w8TglrIH4D9P1JTObhHSvLXxph5+NTyk/mEeR\nR3i2j1hE+z1FmDyJDSAUa2dVRihPXje7JZQ1oS2IC7g6NoisaIzK85983NQKzUEt\nLV11mHGg+3h3IVnfXQqn0/L9EDEK8QansFPqNwXwIvkCUO78De5tHro9ggC/hSrm\nIAyoqFguHFULAoIBAA0/jNrith86ASApUjqXolTK6CkjHCbJh2ZDiSe11wc/hTGu\n+WVpT2NmC+xY+G3D65xOcYWg7jtLM980MTgyqOq1wkjwNocbhYBesmrNF0pdboMf\n/FTJ6/GhKp7m7yVQv+R83ziEDePcF8w9Y4D+XJwkD2MpPw+WyRo8so0+NUuUDDf6\nJLnegbe5GxHtRahTrax/JbrJxeOztqwhkigx61SatKIYHcHpvzL2Z+cVYDsarNdv\nJFhbgJ2VPe0ur6FB6nvPVh50jylSPilRutWrE+vu1n7s2yNKhKxIzemcbcsnSlMx\nTRTsypYlhm2DtOxByav0ijWdaANgR9dKGsN2IcsCggEAahiMEZQ1UlfP3tEbaH6P\nje3uZOmjDGnNKyk/R61nfD6VrEHgHBaVVas78ZFRjW3XXpWektVXRm9VLkI14JL5\nnWlX/ZNW6cWsnCu8UOT0ZUN4UswHIVkGoWLWCi1cd435XyRlygd4yLaoEwgNj5u7\nJiBi44UmUTTLMPwB+YdDLDcHYcTnCEGfO9BLvC+2da2X4sTKKTXSqJn+rIhREKsB\nAq0XSavyzbsnFed1T/X4En1stL/OZREQzGfAA7f6E+8OIID6JcXy6sFrUrQDrcyr\nj+gT+JAOUgIJ/xWZimezzjF82NIWpY+yhGDZaaPzSAi4Wo+o4tneOkpRPDzO5e9Y\nPQKCAQApI1xb8+x7ye2OU06flFnpOP1UGo5OQnlBU1xdc+TeyKebmBsODxVNQbk6\nqmQm1pheNhNQ3fSy1wDVsa1pzLMhLHhez/q3Qd9fD4EfDptzhA58T0+JD8udZZDi\n9SCej498NV3u0W9G5Os2D5dVpY9TV+ji9mW07RYx4mzb6RECDzBxACVy+NnZpQrb\nF3oMitM/6gGltiR2fQiPmnsvP0Ww2YDvP3LG/Zi3xVqDH9IsVYPCLXov4EiVal9O\nxID6vIb5sesjKCvivG0gOVE+nmpkqCSRezXzy1Tjl68sfK9Mt5U5/LNgk/no/ugg\nm+plMlI71CJsCRJtYctOeGAYm/6V\n-----END PRIVATE KEY-----\n"
}
}Response samples
- 200
- 400
- 401
- 403
- 500
- 503
{- "protocol": "HTTPS",
- "port": 443,
- "id": "fac06878-6655-4956-8ea7-124a97f133ab",
- "rules": [
- {
- "id": "b05917e1-96a4-442a-900c-c41f273d95c9",
- "default": true,
- "targetGroupId": "b05917e1-96a4-442a-900c-c41f273d95c9"
}
]
}Delete load balancer listener
Delete a listener
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 1,
- "limit": 20,
- "offset": 0
}, - "ips": [
- {
- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": null,
- "mainIp": false,
- "nullRouted": false,
- "networkType": "INTERNAL",
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
]
}List IP addresses associated with a specific Load Balancer
List the Load Balancers IPs
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 1,
- "limit": 20,
- "offset": 0
}, - "ips": [
- {
- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": null,
- "mainIp": false,
- "nullRouted": false,
- "networkType": "INTERNAL",
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
]
}Get IP details for a specific Instance
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}Update the IP address for a specific Instance
Allows you to set the reverse lookup for the IP
Authorizations:
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/jsonrequired
| reverseLookup required | string |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "reverseLookup": "a-valid-domain.xpto"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}Get IP details for a specific Load Balancer
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}Update the IP address for a specific Load Balancer
Allows you to set the reverse lookup for the IP
Authorizations:
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/jsonrequired
| reverseLookup required | string |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "reverseLookup": "a-valid-domain.xpto"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}Null route 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:
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/jsonoptional
| 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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "automatedUnnulingAt": 2,
- "comment": "Getting DDoS"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}Null route 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:
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/jsonoptional
| 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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "automatedUnnulingAt": 2,
- "comment": "Getting DDoS"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}Remove an IP null route for a specific Instance
Remove an IP null route. It may take a few minutes before the change is propagated across the network
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}Remove an IP null route 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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}Get data traffic metrics for a specific Instance
Authorizations:
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 |
| granularity required | string Value: "DAY" The interval for each metric |
| aggregation required | string Value: "SUM" The metric aggregation function |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2023-10-01T00:00:00+00:00",
- "to": "2023-10-31T00:00:00+00:00",
- "granularity": "DAY",
- "aggregation": "SUM",
- "unit": "B",
- "summary": {
- "downPublic": {
- "average": 340733979,
- "expected": 10222019370,
- "total": 1022201937,
- "peak": {
- "value": 896116855,
- "timestamp": "2023-10-28T00:00:00+00:00"
}
}, - "upPublic": {
- "average": 59920023.67,
- "expected": 1797600710.1,
- "total": 179760071,
- "peak": {
- "value": 85089279,
- "timestamp": "2023-10-28T00:00:00+00:00"
}
}
}
}, - "metrics": {
- "downPublic": {
- "values": [
- {
- "value": 461323,
- "timestamp": "2023-10-27T00:00:00+00:00"
}, - {
- "value": 1249243,
- "timestamp": "2023-10-28T00:00:00+00:00"
}
], - "unit": "B"
}, - "upPublic": {
- "values": [
- {
- "value": 437565,
- "timestamp": "2023-10-27T00:00:00+00:00"
}, - {
- "value": 6938590,
- "timestamp": "2023-10-28T00:00:00+00:00"
}
], - "unit": "B"
}
}
}Get instance CPU metrics
Authorizations:
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 |
| granularity required | string Enum: "5m" "10m" "30m" "60m" "DAY" The interval for each metric |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2023-10-27T08:00:00+00:00",
- "to": "2023-10-28T08:00:00+00:00",
- "granularity": "5m",
- "unit": "%",
- "summary": {
- "cpuMetrics": {
- "average": 8.13,
- "expected": 8.13,
- "peak": {
- "value": 9.98,
- "timestamp": "2023-10-27T08:10:24+00:00"
}
}
}
}, - "metrics": {
- "cpuMetrics": {
- "values": [
- {
- "value": 5.45,
- "timestamp": "2023-10-27T08:00:00+00:00"
}, - {
- "value": 8.98,
- "timestamp": "2023-10-27T08:05:32+00:00"
}, - {
- "value": 9.98,
- "timestamp": "2023-10-27T08:10:24+00:00"
}
], - "unit": "%"
}
}
}Get data traffic metrics for a specific Load Balancer
Authorizations:
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 |
| granularity required | string Value: "DAY" The interval for each metric |
| aggregation required | string Value: "SUM" The metric aggregation function |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2023-10-01T00:00:00+00:00",
- "to": "2023-10-31T00:00:00+00:00",
- "granularity": "DAY",
- "aggregation": "SUM",
- "unit": "B",
- "summary": {
- "downPublic": {
- "average": 340733979,
- "expected": 10222019370,
- "total": 1022201937,
- "peak": {
- "value": 896116855,
- "timestamp": "2023-10-28T00:00:00+00:00"
}
}, - "upPublic": {
- "average": 59920023.67,
- "expected": 1797600710.1,
- "total": 179760071,
- "peak": {
- "value": 85089279,
- "timestamp": "2023-10-28T00:00:00+00:00"
}
}
}
}, - "metrics": {
- "downPublic": {
- "values": [
- {
- "value": 461323,
- "timestamp": "2023-10-27T00:00:00+00:00"
}, - {
- "value": 1249243,
- "timestamp": "2023-10-28T00:00:00+00:00"
}
], - "unit": "B"
}, - "upPublic": {
- "values": [
- {
- "value": 437565,
- "timestamp": "2023-10-27T00:00:00+00:00"
}, - {
- "value": 6938590,
- "timestamp": "2023-10-28T00:00:00+00:00"
}
], - "unit": "B"
}
}
}Get load balancer CPU metrics
Authorizations:
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 |
| granularity required | string Enum: "5m" "10m" "30m" "60m" "DAY" The interval for each metric |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2023-10-27T08:00:00+00:00",
- "to": "2023-10-28T08:00:00+00:00",
- "granularity": "5m",
- "unit": "%",
- "summary": {
- "cpuMetrics": {
- "average": 8.13,
- "expected": 8.13,
- "peak": {
- "value": 9.98,
- "timestamp": "2023-10-27T08:10:24+00:00"
}
}
}
}, - "metrics": {
- "cpuMetrics": {
- "values": [
- {
- "value": 5.45,
- "timestamp": "2023-10-27T08:00:00+00:00"
}, - {
- "value": 8.98,
- "timestamp": "2023-10-27T08:05:32+00:00"
}, - {
- "value": 9.98,
- "timestamp": "2023-10-27T08:10:24+00:00"
}
], - "unit": "%"
}
}
}Get load balancer requests metrics. Not available for listeners with TCP protocol
Authorizations:
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 |
| granularity required | string Enum: "5m" "10m" "30m" "60m" "DAY" The interval for each metric |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2024-09-14T00:00:00+00:00",
- "to": "2024-09-15T00:00:00+00:00",
- "granularity": "60m",
- "aggregation": "SUM"
}, - "metrics": {
- "values": [
- {
- "value": 0,
- "timestamp": "2024-09-20T14:25:00+00:00"
}, - {
- "value": 1,
- "timestamp": "2024-09-20T14:30:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-20T14:35:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-22T14:20:00+00:00"
}, - {
- "value": 1,
- "timestamp": "2024-09-22T14:25:00+00:00"
}
], - "unit": "requests"
}
}Get load balancer requests per second metrics. Not available for listeners with TCP protocol
Authorizations:
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 |
| granularity required | string Enum: "5m" "10m" "30m" "60m" "DAY" The interval for each metric |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2024-08-20T00:00:00+00:00",
- "to": "2024-09-24T12:10:00+00:00",
- "granularity": "60m",
- "aggregation": "SUM"
}, - "metrics": {
- "values": [
- {
- "value": 0.0038027332144979203,
- "timestamp": "2024-09-18T00:00:00+00:00"
}, - {
- "value": 0.005555555555555556,
- "timestamp": "2024-09-19T00:00:00+00:00"
}, - {
- "value": 0.0021064814814814813,
- "timestamp": "2024-09-23T00:00:00+00:00"
}, - {
- "value": 0.003321759259259259,
- "timestamp": "2024-09-24T00:00:00+00:00"
}
], - "unit": "requests/sec"
}
}Get load balancer data transferred metrics
Authorizations:
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 |
| granularity required | string Enum: "5m" "10m" "30m" "60m" "DAY" The interval for each metric |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2024-09-14T00:00:00+00:00",
- "to": "2024-09-17T23:59:59+00:00",
- "granularity": "60m",
- "aggregation": "SUM"
}, - "metrics": {
- "dataIn": {
- "values": [
- {
- "value": 1491,
- "timestamp": "2024-09-14T00:00:00+00:00"
}, - {
- "value": 1566,
- "timestamp": "2024-09-14T01:00:00+00:00"
}, - {
- "value": 2643,
- "timestamp": "2024-09-14T02:00:00+00:00"
}, - {
- "value": 2047,
- "timestamp": "2024-09-14T03:00:00+00:00"
}
], - "unit": "B"
}, - "dataOut": {
- "values": [
- {
- "value": 3255,
- "timestamp": "2024-09-14T00:00:00+00:00"
}, - {
- "value": 3472,
- "timestamp": "2024-09-14T01:00:00+00:00"
}, - {
- "value": 2170,
- "timestamp": "2024-09-14T02:00:00+00:00"
}, - {
- "value": 2821,
- "timestamp": "2024-09-14T03:00:00+00:00"
}
], - "unit": "B"
}
}
}Get load balancer data transferred per second metrics
Authorizations:
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 |
| granularity required | string Enum: "5m" "10m" "30m" "60m" "DAY" The interval for each metric |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2024-09-14T00:00:00+00:00",
- "to": "2024-09-15T09:00:00+00:00",
- "granularity": "60m",
- "aggregation": "SUM"
}, - "metrics": {
- "dataIn": {
- "values": [
- {
- "value": 3.3133333333333335,
- "timestamp": "2024-09-14T00:00:00+00:00"
}, - {
- "value": 3.48,
- "timestamp": "2024-09-14T01:00:00+00:00"
}, - {
- "value": 5.873333333333333,
- "timestamp": "2024-09-14T02:00:00+00:00"
}, - {
- "value": 4.5488888888888885,
- "timestamp": "2024-09-14T03:00:00+00:00"
}
], - "unit": "b/s"
}, - "dataOut": {
- "values": [
- {
- "value": 7.2333333333333325,
- "timestamp": "2024-09-14T00:00:00+00:00"
}, - {
- "value": 7.7155555555555555,
- "timestamp": "2024-09-14T01:00:00+00:00"
}, - {
- "value": 4.822222222222222,
- "timestamp": "2024-09-14T02:00:00+00:00"
}, - {
- "value": 6.268888888888888,
- "timestamp": "2024-09-14T03:00:00+00:00"
}
], - "unit": "b/s"
}
}
}Get connections metrics
Authorizations:
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 |
| granularity required | string Enum: "5m" "10m" "30m" "60m" "DAY" The interval for each metric |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2024-09-14T00:00:00+00:00",
- "to": "2024-09-15T00:00:00+00:00",
- "granularity": "60m",
- "aggregation": "SUM"
}, - "metrics": {
- "values": [
- {
- "value": 17,
- "timestamp": "2024-09-14T00:00:00+00:00"
}, - {
- "value": 18,
- "timestamp": "2024-09-14T01:00:00+00:00"
}, - {
- "value": 8,
- "timestamp": "2024-09-14T02:00:00+00:00"
}, - {
- "value": 13,
- "timestamp": "2024-09-14T03:00:00+00:00"
}, - {
- "value": 4,
- "timestamp": "2024-09-14T04:00:00+00:00"
}, - {
- "value": 6,
- "timestamp": "2024-09-14T05:00:00+00:00"
}, - {
- "value": 20,
- "timestamp": "2024-09-14T06:00:00+00:00"
}, - {
- "value": 16,
- "timestamp": "2024-09-14T07:00:00+00:00"
}, - {
- "value": 16,
- "timestamp": "2024-09-14T08:00:00+00:00"
}, - {
- "value": 27,
- "timestamp": "2024-09-14T09:00:00+00:00"
}, - {
- "value": 13,
- "timestamp": "2024-09-14T10:00:00+00:00"
}, - {
- "value": 20,
- "timestamp": "2024-09-14T11:00:00+00:00"
}, - {
- "value": 6,
- "timestamp": "2024-09-14T12:00:00+00:00"
}, - {
- "value": 21,
- "timestamp": "2024-09-14T13:00:00+00:00"
}, - {
- "value": 11,
- "timestamp": "2024-09-14T14:00:00+00:00"
}, - {
- "value": 7,
- "timestamp": "2024-09-14T15:00:00+00:00"
}, - {
- "value": 15,
- "timestamp": "2024-09-14T16:00:00+00:00"
}, - {
- "value": 6,
- "timestamp": "2024-09-14T17:00:00+00:00"
}, - {
- "value": 18,
- "timestamp": "2024-09-14T18:00:00+00:00"
}, - {
- "value": 7,
- "timestamp": "2024-09-14T19:00:00+00:00"
}, - {
- "value": 39,
- "timestamp": "2024-09-14T20:00:00+00:00"
}, - {
- "value": 12,
- "timestamp": "2024-09-14T21:00:00+00:00"
}, - {
- "value": 19,
- "timestamp": "2024-09-14T22:00:00+00:00"
}, - {
- "value": 3,
- "timestamp": "2024-09-14T23:00:00+00:00"
}, - {
- "value": 57,
- "timestamp": "2024-09-15T00:00:00+00:00"
}
], - "unit": "connections"
}
}Get connections per second metrics
Authorizations:
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 |
| granularity required | string Enum: "5m" "10m" "30m" "60m" "DAY" The interval for each metric |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2024-09-14T00:00:00+00:00",
- "to": "2024-09-15T00:00:00+00:00",
- "granularity": "60m",
- "aggregation": "SUM"
}, - "metrics": {
- "values": [
- {
- "value": 0.004722222222222222,
- "timestamp": "2024-09-14T00:00:00+00:00"
}, - {
- "value": 0.005,
- "timestamp": "2024-09-14T01:00:00+00:00"
}, - {
- "value": 0.0022222222222222222,
- "timestamp": "2024-09-14T02:00:00+00:00"
}, - {
- "value": 0.003611111111111111,
- "timestamp": "2024-09-14T03:00:00+00:00"
}, - {
- "value": 0.0011111111111111111,
- "timestamp": "2024-09-14T04:00:00+00:00"
}, - {
- "value": 0.0016666666666666668,
- "timestamp": "2024-09-14T05:00:00+00:00"
}, - {
- "value": 0.005555555555555556,
- "timestamp": "2024-09-14T06:00:00+00:00"
}, - {
- "value": 0.0044444444444444444,
- "timestamp": "2024-09-14T07:00:00+00:00"
}, - {
- "value": 0.0044444444444444444,
- "timestamp": "2024-09-14T08:00:00+00:00"
}, - {
- "value": 0.0075,
- "timestamp": "2024-09-14T09:00:00+00:00"
}, - {
- "value": 0.003611111111111111,
- "timestamp": "2024-09-14T10:00:00+00:00"
}, - {
- "value": 0.005555555555555556,
- "timestamp": "2024-09-14T11:00:00+00:00"
}, - {
- "value": 0.0016666666666666668,
- "timestamp": "2024-09-14T12:00:00+00:00"
}, - {
- "value": 0.005833333333333334,
- "timestamp": "2024-09-14T13:00:00+00:00"
}, - {
- "value": 0.0030555555555555557,
- "timestamp": "2024-09-14T14:00:00+00:00"
}, - {
- "value": 0.0019444444444444444,
- "timestamp": "2024-09-14T15:00:00+00:00"
}, - {
- "value": 0.004166666666666667,
- "timestamp": "2024-09-14T16:00:00+00:00"
}, - {
- "value": 0.0016666666666666666,
- "timestamp": "2024-09-14T17:00:00+00:00"
}, - {
- "value": 0.005,
- "timestamp": "2024-09-14T18:00:00+00:00"
}, - {
- "value": 0.0019444444444444444,
- "timestamp": "2024-09-14T19:00:00+00:00"
}, - {
- "value": 0.010833333333333334,
- "timestamp": "2024-09-14T20:00:00+00:00"
}, - {
- "value": 0.003333333333333333,
- "timestamp": "2024-09-14T21:00:00+00:00"
}, - {
- "value": 0.005277777777777778,
- "timestamp": "2024-09-14T22:00:00+00:00"
}, - {
- "value": 0.0008333333333333334,
- "timestamp": "2024-09-14T23:00:00+00:00"
}, - {
- "value": 0.01583333333333333,
- "timestamp": "2024-09-15T00:00:00+00:00"
}
], - "unit": "connections/s"
}
}Get response codes metrics
Authorizations:
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 |
| granularity required | string Enum: "5m" "10m" "30m" "60m" "DAY" The interval for each metric |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2024-09-14T00:00:00+00:00",
- "to": "2024-09-15T00:00:00+00:00",
- "granularity": "60m",
- "aggregation": "SUM"
}, - "metrics": {
- "2xx": {
- "values": [
- {
- "value": 0,
- "timestamp": "2024-09-14T00:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T01:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T02:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T03:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T04:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T05:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T06:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T07:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T08:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T09:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T10:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T11:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T12:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T13:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T14:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T15:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T16:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T17:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T18:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T19:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T20:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T21:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T22:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T23:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-15T00:00:00+00:00"
}
], - "unit": "responses"
}, - "3xx": {
- "values": [
- {
- "value": 0,
- "timestamp": "2024-09-14T00:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T01:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T02:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T03:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T04:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T05:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T06:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T07:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T08:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T09:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T10:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T11:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T12:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T13:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T14:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T15:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T16:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T17:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T18:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T19:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T20:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T21:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T22:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T23:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-15T00:00:00+00:00"
}
], - "unit": "responses"
}, - "4xx": {
- "values": [
- {
- "value": 2,
- "timestamp": "2024-09-14T00:00:00+00:00"
}, - {
- "value": 2,
- "timestamp": "2024-09-14T01:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T02:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T03:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T04:00:00+00:00"
}, - {
- "value": 1,
- "timestamp": "2024-09-14T05:00:00+00:00"
}, - {
- "value": 1,
- "timestamp": "2024-09-14T06:00:00+00:00"
}, - {
- "value": 5,
- "timestamp": "2024-09-14T07:00:00+00:00"
}, - {
- "value": 1,
- "timestamp": "2024-09-14T08:00:00+00:00"
}, - {
- "value": 12,
- "timestamp": "2024-09-14T09:00:00+00:00"
}, - {
- "value": 1,
- "timestamp": "2024-09-14T10:00:00+00:00"
}, - {
- "value": 2,
- "timestamp": "2024-09-14T11:00:00+00:00"
}, - {
- "value": 1,
- "timestamp": "2024-09-14T12:00:00+00:00"
}, - {
- "value": 4,
- "timestamp": "2024-09-14T13:00:00+00:00"
}, - {
- "value": 1,
- "timestamp": "2024-09-14T14:00:00+00:00"
}, - {
- "value": 3,
- "timestamp": "2024-09-14T15:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T16:00:00+00:00"
}, - {
- "value": 1,
- "timestamp": "2024-09-14T17:00:00+00:00"
}, - {
- "value": 4,
- "timestamp": "2024-09-14T18:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T19:00:00+00:00"
}, - {
- "value": 18,
- "timestamp": "2024-09-14T20:00:00+00:00"
}, - {
- "value": 1,
- "timestamp": "2024-09-14T21:00:00+00:00"
}, - {
- "value": 2,
- "timestamp": "2024-09-14T22:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T23:00:00+00:00"
}, - {
- "value": 5,
- "timestamp": "2024-09-15T00:00:00+00:00"
}
], - "unit": "responses"
}, - "5xx": {
- "values": [
- {
- "value": 15,
- "timestamp": "2024-09-14T00:00:00+00:00"
}, - {
- "value": 16,
- "timestamp": "2024-09-14T01:00:00+00:00"
}, - {
- "value": 10,
- "timestamp": "2024-09-14T02:00:00+00:00"
}, - {
- "value": 13,
- "timestamp": "2024-09-14T03:00:00+00:00"
}, - {
- "value": 4,
- "timestamp": "2024-09-14T04:00:00+00:00"
}, - {
- "value": 5,
- "timestamp": "2024-09-14T05:00:00+00:00"
}, - {
- "value": 19,
- "timestamp": "2024-09-14T06:00:00+00:00"
}, - {
- "value": 11,
- "timestamp": "2024-09-14T07:00:00+00:00"
}, - {
- "value": 15,
- "timestamp": "2024-09-14T08:00:00+00:00"
}, - {
- "value": 15,
- "timestamp": "2024-09-14T09:00:00+00:00"
}, - {
- "value": 12,
- "timestamp": "2024-09-14T10:00:00+00:00"
}, - {
- "value": 18,
- "timestamp": "2024-09-14T11:00:00+00:00"
}, - {
- "value": 5,
- "timestamp": "2024-09-14T12:00:00+00:00"
}, - {
- "value": 17,
- "timestamp": "2024-09-14T13:00:00+00:00"
}, - {
- "value": 10,
- "timestamp": "2024-09-14T14:00:00+00:00"
}, - {
- "value": 4,
- "timestamp": "2024-09-14T15:00:00+00:00"
}, - {
- "value": 15,
- "timestamp": "2024-09-14T16:00:00+00:00"
}, - {
- "value": 5,
- "timestamp": "2024-09-14T17:00:00+00:00"
}, - {
- "value": 14,
- "timestamp": "2024-09-14T18:00:00+00:00"
}, - {
- "value": 7,
- "timestamp": "2024-09-14T19:00:00+00:00"
}, - {
- "value": 20,
- "timestamp": "2024-09-14T20:00:00+00:00"
}, - {
- "value": 12,
- "timestamp": "2024-09-14T21:00:00+00:00"
}, - {
- "value": 17,
- "timestamp": "2024-09-14T22:00:00+00:00"
}, - {
- "value": 3,
- "timestamp": "2024-09-14T23:00:00+00:00"
}, - {
- "value": 52,
- "timestamp": "2024-09-15T00:00:00+00:00"
}
], - "unit": "responses"
}
}
}Get response codes per second metrics
Authorizations:
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 |
| granularity required | string Enum: "5m" "10m" "30m" "60m" "DAY" The interval for each metric |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2024-09-14T00:00:00+00:00",
- "to": "2024-09-15T00:00:00+00:00",
- "granularity": "60m",
- "aggregation": "SUM"
}, - "metrics": {
- "2xx": {
- "values": [
- {
- "value": 0,
- "timestamp": "2024-09-14T00:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T01:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T02:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T03:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T04:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T05:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T06:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T07:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T08:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T09:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T10:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T11:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T12:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T13:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T14:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T15:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T16:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T17:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T18:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T19:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T20:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T21:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T22:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T23:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-15T00:00:00+00:00"
}
], - "unit": "responses/s"
}, - "3xx": {
- "values": [
- {
- "value": 0,
- "timestamp": "2024-09-14T00:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T01:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T02:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T03:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T04:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T05:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T06:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T07:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T08:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T09:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T10:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T11:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T12:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T13:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T14:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T15:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T16:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T17:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T18:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T19:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T20:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T21:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T22:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T23:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-15T00:00:00+00:00"
}
], - "unit": "responses/s"
}, - "4xx": {
- "values": [
- {
- "value": 0.0005555555555555556,
- "timestamp": "2024-09-14T00:00:00+00:00"
}, - {
- "value": 0.0005555555555555556,
- "timestamp": "2024-09-14T01:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T02:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T03:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T04:00:00+00:00"
}, - {
- "value": 0.0002777777777777778,
- "timestamp": "2024-09-14T05:00:00+00:00"
}, - {
- "value": 0.0002777777777777778,
- "timestamp": "2024-09-14T06:00:00+00:00"
}, - {
- "value": 0.001388888888888889,
- "timestamp": "2024-09-14T07:00:00+00:00"
}, - {
- "value": 0.0002777777777777778,
- "timestamp": "2024-09-14T08:00:00+00:00"
}, - {
- "value": 0.0033333333333333335,
- "timestamp": "2024-09-14T09:00:00+00:00"
}, - {
- "value": 0.0002777777777777778,
- "timestamp": "2024-09-14T10:00:00+00:00"
}, - {
- "value": 0.0005555555555555556,
- "timestamp": "2024-09-14T11:00:00+00:00"
}, - {
- "value": 0.0002777777777777778,
- "timestamp": "2024-09-14T12:00:00+00:00"
}, - {
- "value": 0.0011111111111111111,
- "timestamp": "2024-09-14T13:00:00+00:00"
}, - {
- "value": 0.0002777777777777778,
- "timestamp": "2024-09-14T14:00:00+00:00"
}, - {
- "value": 0.0008333333333333334,
- "timestamp": "2024-09-14T15:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T16:00:00+00:00"
}, - {
- "value": 0.0002777777777777778,
- "timestamp": "2024-09-14T17:00:00+00:00"
}, - {
- "value": 0.0011111111111111111,
- "timestamp": "2024-09-14T18:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T19:00:00+00:00"
}, - {
- "value": 0.005,
- "timestamp": "2024-09-14T20:00:00+00:00"
}, - {
- "value": 0.0002777777777777778,
- "timestamp": "2024-09-14T21:00:00+00:00"
}, - {
- "value": 0.0005555555555555556,
- "timestamp": "2024-09-14T22:00:00+00:00"
}, - {
- "value": 0,
- "timestamp": "2024-09-14T23:00:00+00:00"
}, - {
- "value": 0.001388888888888889,
- "timestamp": "2024-09-15T00:00:00+00:00"
}
], - "unit": "responses/s"
}, - "5xx": {
- "values": [
- {
- "value": 0.004166666666666667,
- "timestamp": "2024-09-14T00:00:00+00:00"
}, - {
- "value": 0.0044444444444444444,
- "timestamp": "2024-09-14T01:00:00+00:00"
}, - {
- "value": 0.002777777777777778,
- "timestamp": "2024-09-14T02:00:00+00:00"
}, - {
- "value": 0.003611111111111111,
- "timestamp": "2024-09-14T03:00:00+00:00"
}, - {
- "value": 0.0011111111111111111,
- "timestamp": "2024-09-14T04:00:00+00:00"
}, - {
- "value": 0.001388888888888889,
- "timestamp": "2024-09-14T05:00:00+00:00"
}, - {
- "value": 0.005277777777777778,
- "timestamp": "2024-09-14T06:00:00+00:00"
}, - {
- "value": 0.0030555555555555557,
- "timestamp": "2024-09-14T07:00:00+00:00"
}, - {
- "value": 0.004166666666666667,
- "timestamp": "2024-09-14T08:00:00+00:00"
}, - {
- "value": 0.004166666666666667,
- "timestamp": "2024-09-14T09:00:00+00:00"
}, - {
- "value": 0.003333333333333333,
- "timestamp": "2024-09-14T10:00:00+00:00"
}, - {
- "value": 0.005,
- "timestamp": "2024-09-14T11:00:00+00:00"
}, - {
- "value": 0.001388888888888889,
- "timestamp": "2024-09-14T12:00:00+00:00"
}, - {
- "value": 0.004722222222222222,
- "timestamp": "2024-09-14T13:00:00+00:00"
}, - {
- "value": 0.002777777777777778,
- "timestamp": "2024-09-14T14:00:00+00:00"
}, - {
- "value": 0.0011111111111111111,
- "timestamp": "2024-09-14T15:00:00+00:00"
}, - {
- "value": 0.004166666666666667,
- "timestamp": "2024-09-14T16:00:00+00:00"
}, - {
- "value": 0.001388888888888889,
- "timestamp": "2024-09-14T17:00:00+00:00"
}, - {
- "value": 0.0038888888888888888,
- "timestamp": "2024-09-14T18:00:00+00:00"
}, - {
- "value": 0.0019444444444444444,
- "timestamp": "2024-09-14T19:00:00+00:00"
}, - {
- "value": 0.005555555555555556,
- "timestamp": "2024-09-14T20:00:00+00:00"
}, - {
- "value": 0.003333333333333333,
- "timestamp": "2024-09-14T21:00:00+00:00"
}, - {
- "value": 0.004722222222222222,
- "timestamp": "2024-09-14T22:00:00+00:00"
}, - {
- "value": 0.0008333333333333334,
- "timestamp": "2024-09-14T23:00:00+00:00"
}, - {
- "value": 0.014444444444444444,
- "timestamp": "2024-09-15T00:00:00+00:00"
}
], - "unit": "responses/s"
}
}
}Add instance to Private Network
Add instance to Private Network.
Cannot be performed when the instance has snapshots.
Authorizations:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Request Body schema: application/jsonrequired
| securityGroupIds required | Array of strings <uuid> (ids) [ items <uuid > ] |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "securityGroupIds": [
- "7e59b33d-05f3-4078-b251-c7831ae8fe14",
- "166cc685-8273-11f0-b4f8-2687367a8a5e"
]
}Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Request Body schema: application/jsonrequired
| securityGroupIds required | Array of strings <uuid> (ids) [ items <uuid > ] |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "securityGroupIds": [
- "7e59b33d-05f3-4078-b251-c7831ae8fe14",
- "166cc685-8273-11f0-b4f8-2687367a8a5e"
]
}Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 3,
- "limit": 10,
- "offset": 0
}, - "securityGroups": [
- {
- "id": "166cc685-8273-11f0-b4f8-2687367a8a5e",
- "name": "Default Security Group",
- "default": true,
- "state": "ACTIVE"
}, - {
- "id": "7e59b33d-05f3-4078-b251-c7831ae8fe14",
- "name": "My Security Group",
- "default": false,
- "state": "ACTIVE"
}, - {
- "id": "fb769dab-3daa-47e4-89ed-06a4b6499176",
- "name": "My Security Group",
- "default": false,
- "state": "ACTIVE"
}
]
}List snapshots
List instance snapshots
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 1,
- "limit": 20,
- "offset": 0
}, - "snapshots": [
- {
- "id": "624c53c3-48e9-41d1-833f-90a9abf5fd95",
- "displayName": "snapshot 1",
- "state": "READY",
- "created": "2023-11-02T07:31:28+0000"
}
]
}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:
path Parameters
| instanceId required | string <uuid> Example: ace712e9-a166-47f1-9065-4af0f7e7fce1 Instance's ID |
Request Body schema: application/jsonrequired
| name required | string A name to identify your snapshot |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "name": "my snapshot"
}Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}Get snapshot detail
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "created": "2023-11-02T07:31:28+0000",
- "displayName": "snapshot 1",
- "id": "ef73e9e2-95cd-49ef-940f-a24e6ad6c4a0",
- "state": "READY"
}Restore instance snapshot
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}Delete instance snapshot
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
Request Body schema: application/jsonrequired
| 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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "reference": "Manual scaling",
- "type": "MANUAL",
- "desiredAmount": 2,
- "instanceId": "6762182e-7ae9-4d0b-b3b7-bea5a49b3f94"
}Response samples
- 201
- 400
- 401
- 403
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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®ion=eu-west-3&reference=SOME_STRING_VALUE&state=SOME_STRING_VALUE' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 400
- 401
- 403
- 500
- 503
{- "_metadata": {
- "totalCount": 3,
- "limit": 10,
- "offset": 0
}, - "autoScalingGroups": [
- {
- "id": "fb769dab-3daa-47e4-89ed-06a4b6499176",
- "type": "MANUAL",
- "state": "ACTIVE",
- "desiredAmount": 2,
- "minimumAmount": null,
- "maximumAmount": null,
- "cpuThreshold": null,
- "warmupTime": null,
- "cooldownTime": null,
- "region": "eu-west-3",
- "reference": "Manual Auto Scaling Group",
- "createdAt": "2024-04-26T09:22:25+00:00",
- "updatedAt": "2024-04-26T09:22:25+00:00",
- "startsAt": null,
- "endsAt": null
}, - {
- "id": "aa0f2138-3a83-46fe-bdcf-1ad231f94a26",
- "type": "SCHEDULED",
- "state": "SCALING",
- "desiredAmount": 2,
- "minimumAmount": null,
- "maximumAmount": null,
- "cpuThreshold": null,
- "cooldownTime": null,
- "warmupTime": null,
- "region": "eu-west-3",
- "reference": "Scheduled Auto Scaling Group",
- "createdAt": "2024-05-13T15:49:52+00:00",
- "updatedAt": "2024-05-13T15:49:52+00:00",
- "startsAt": "2024-05-01T08:00:00+00:00",
- "endsAt": "2024-05-01T12:00:00+00:00"
}, - {
- "id": "49e28a6c-3f2a-442e-b3b1-981856d21677",
- "type": "CPU_BASED",
- "state": "CREATING",
- "desiredAmount": 1,
- "minimumAmount": 1,
- "maximumAmount": 3,
- "cpuThreshold": 50,
- "warmupTime": 300,
- "cooldownTime": 300,
- "region": "eu-west-3",
- "reference": "CPU Based Auto Scaling Group",
- "createdAt": "2024-05-13T15:49:52+00:00",
- "updatedAt": "2024-05-13T15:49:52+00:00",
- "startsAt": null,
- "endsAt": null
}
]
}Delete Auto Scaling Group
Delete an Auto Scaling Group.
Authorizations:
path Parameters
| autoScalingGroupId required | string <uuid> Example: fb769dab-3daa-47e4-89ed-06a4b6499176 Auto Scaling Group ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| autoScalingGroupId required | string <uuid> Example: fb769dab-3daa-47e4-89ed-06a4b6499176 Auto Scaling Group ID |
Request Body schema: application/jsonrequired
| desiredAmount | integer >= 1 When "SCHEDULED", the number of instances that need to be running at the specified date and time. |
| 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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "reference": "Changed reference",
- "desiredAmount": 4
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "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": [
- {
- "id": "c737e9e2-a1b7-4f06-af77-92fc62c0e4bd",
- "name": "foo",
- "protocol": "HTTP",
- "port": 80,
- "healthCheck": null,
- "region": "eu-west-3"
}
], - "type": "MANUAL",
- "updatedAt": "2024-04-26T09:22:25+00:00",
- "warmupTime": null
}Get Auto Scaling Group details
Get details about Auto Scaling Group.
Authorizations:
path Parameters
| autoScalingGroupId required | string <uuid> Example: fb769dab-3daa-47e4-89ed-06a4b6499176 Auto Scaling Group ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "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": [
- {
- "id": "c737e9e2-a1b7-4f06-af77-92fc62c0e4bd",
- "name": "foo",
- "protocol": "HTTP",
- "port": 80,
- "healthCheck": null,
- "region": "eu-west-3"
}
], - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 1,
- "limit": 10,
- "offset": 0
}, - "instances": [
- {
- "id": "59bc4aa1-7e14-42cd-848f-7de2921ffdc0",
- "type": "lsw.m3.large",
- "resources": {
- "cpu": {
- "value": 2,
- "unit": "vCPU"
}, - "memory": {
- "value": 7,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 1,
- "unit": "Gbps"
}, - "privateNetworkSpeed": {
- "value": 100,
- "unit": "Mbps"
}
}, - "region": "eu-west-3",
- "reference": "My web server",
- "state": "RUNNING",
- "productType": "INSTANCE",
- "ips": [
- {
- "ip": "0.0.0.0",
- "prefixLength": "32",
- "version": 4,
- "reverseLookup": "www.example.com",
- "mainIp": true,
- "networkType": "PUBLIC",
- "nullRouted": false,
- "ddos": null
}
], - "hasPrivateNetwork": false
}
]
}Register Target Group
Associates an auto scaling group with a target group.
Authorizations:
path Parameters
| autoScalingGroupId required | string <uuid> Example: fb769dab-3daa-47e4-89ed-06a4b6499176 Auto Scaling Group ID |
Request Body schema: application/jsonrequired
| targetGroupId required | string <uuid> The target group unique identifier |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "targetGroupId": "b05917e1-96a4-442a-900c-c41f273d95c9"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "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": [
- {
- "id": "c737e9e2-a1b7-4f06-af77-92fc62c0e4bd",
- "name": "foo",
- "protocol": "HTTP",
- "port": 80,
- "healthCheck": null,
- "region": "eu-west-3"
}
], - "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:
path Parameters
| autoScalingGroupId required | string <uuid> Example: fb769dab-3daa-47e4-89ed-06a4b6499176 Auto Scaling Group ID |
Request Body schema: application/jsonrequired
| targetGroupId required | string <uuid> The target group unique identifier |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "targetGroupId": "b05917e1-96a4-442a-900c-c41f273d95c9"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "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": [
- {
- "id": "c737e9e2-a1b7-4f06-af77-92fc62c0e4bd",
- "name": "foo",
- "protocol": "HTTP",
- "port": 80,
- "healthCheck": null,
- "region": "eu-west-3"
}
], - "type": "MANUAL",
- "updatedAt": "2024-04-26T09:22:25+00:00",
- "warmupTime": null
}Get Target Group list
List and filter Target Groups
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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®ion=SOME_STRING_VALUE' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 400
- 401
- 403
- 500
- 503
{- "_metadata": {
- "totalCount": 1,
- "limit": 10,
- "offset": 0
}, - "targetGroups": [
- {
- "id": "7e59b33d-05f3-4078-b251-c7831ae8fe14",
- "name": "Target group name",
- "protocol": "HTTP",
- "port": 80,
- "region": "eu-west-2",
- "healthCheck": {
- "protocol": "HTTP",
- "method": "GET",
- "uri": "/",
- "host": "my-host",
- "port": 80
}
}
]
}Create Target Group
Create a Target Group
Authorizations:
Request Body schema: application/jsonrequired
| 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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "name": "Target group name",
- "protocol": "HTTP",
- "port": 80,
- "region": "eu-west-2",
- "healthCheck": {
- "protocol": "HTTP",
- "method": "GET",
- "uri": "/",
- "host": "example.com",
- "port": 80
}
}Response samples
- 201
- 400
- 401
- 403
- 500
- 503
{- "id": "7e59b33d-05f3-4078-b251-c7831ae8fe14",
- "name": "Target group name",
- "protocol": "HTTP",
- "port": 80,
- "region": "eu-west-2",
- "healthCheck": {
- "protocol": "HTTP",
- "method": "GET",
- "uri": "/",
- "host": "example.com",
- "port": 80
}
}Get Target Group details
Get Target Group details.
Authorizations:
path Parameters
| targetGroupId required | string <uuid> Example: fb769dab-3daa-47e4-89ed-06a4b6499176 Target Group ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "id": "7e59b33d-05f3-4078-b251-c7831ae8fe14",
- "name": "Target group name",
- "protocol": "HTTP",
- "port": 80,
- "region": "eu-west-2",
- "healthCheck": {
- "protocol": "HTTP",
- "method": "GET",
- "uri": "/",
- "host": "example.com",
- "port": 80
}
}Update Target Group
Update a Target Group
Authorizations:
path Parameters
| targetGroupId required | string <uuid> Example: fb769dab-3daa-47e4-89ed-06a4b6499176 Target Group ID |
Request Body schema: application/jsonrequired
| name | string The name of the target group |
| port | integer The port of the target group |
object (healthCheckOpts) |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "name": "Target group name",
- "port": 80,
- "healthCheck": {
- "protocol": "HTTP",
- "method": "GET",
- "uri": "/",
- "host": "example.com",
- "port": 80
}
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "id": "7e59b33d-05f3-4078-b251-c7831ae8fe14",
- "name": "Target group name",
- "protocol": "HTTP",
- "port": 80,
- "region": "eu-west-2",
- "healthCheck": {
- "protocol": "HTTP",
- "method": "GET",
- "uri": "/",
- "host": "example.com",
- "port": 80
}
}Delete Target Group
Delete a Target Group.
Authorizations:
path Parameters
| targetGroupId required | string <uuid> Example: fb769dab-3daa-47e4-89ed-06a4b6499176 Target Group ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 1,
- "limit": 10,
- "offset": 0
}, - "targets": [
- {
- "id": "8be7f8c6-e8c0-4321-a01e-ac754e2f6872",
- "reference": "Target reference",
- "image": {
- "id": "9be7f8c6-e8c0-4321-a01e-ac754e2f6873",
- "name": "Custom image",
- "family": "linux",
- "flavour": "ubuntu",
- "custom": true
}, - "state": "RUNNING",
- "ips": [
- {
- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true
}
], - "healthCheck": {
- "state": "HEALTHY",
- "description": "HTTP check passed"
}
}
]
}Register Targets
Register Targets in a Target Group
Authorizations:
path Parameters
| targetGroupId required | string <uuid> Example: fb769dab-3daa-47e4-89ed-06a4b6499176 Target Group ID |
Request Body schema: application/jsonrequired
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
[- "695ddd91-051f-4dd6-9120-938a927a47d0"
]Response samples
- 400
- 401
- 403
- 404
- 423
- 500
- 503
{- "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:
path Parameters
| targetGroupId required | string <uuid> Example: fb769dab-3daa-47e4-89ed-06a4b6499176 Target Group ID |
Request Body schema: application/jsonrequired
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
[- "695ddd91-051f-4dd6-9120-938a927a47d0"
]Response samples
- 400
- 401
- 403
- 404
- 423
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 2,
- "limit": 10,
- "offset": 0
}, - "notificationSettings": [
- {
- "id": "ff6bbd04-c24c-4ecf-b09d-e6c415a65d63",
- "threshold": {
- "unit": "GB",
- "value": 2000
}, - "type": "DATA_TRAFFIC",
- "timePeriod": "DAY",
- "action": "POWER_OFF",
- "channels": [
- {
- "type": "EMAIL",
- "contactGroup": "TECHNICAL",
- "contacts": [
- "john.doe@example.com"
]
}
]
}, - {
- "id": "cc6bbd04-c24c-4ecf-b09d-e6c415a65d78",
- "threshold": {
- "unit": "GB",
- "value": 1000
}, - "type": "DATA_TRAFFIC",
- "timePeriod": "DAY",
- "action": null,
- "channels": [
- {
- "type": "EMAIL",
- "contactGroup": "TECHNICAL",
- "contacts": [
- "jim.doe@example.com"
]
}
]
}
]
}Get details of a notification Setting
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "action": "POWER_OFF",
- "channels": [
- {
- "type": "EMAIL",
- "contactGroup": "TECHNICAL",
- "contacts": [
- "john.doe@example.com",
- "jim.doe@example.com"
]
}
], - "id": "ff6bbd04-c24c-4ecf-b09d-e6c415a65d63",
- "threshold": {
- "unit": "GB",
- "value": 1000
}, - "timePeriod": "DAY",
- "type": "DATA_TRAFFIC"
}Create a notification setting
Create a notification setting
Authorizations:
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/jsonrequired
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "action": "POWER_OFF",
- "channels": [
- {
- "type": "EMAIL",
- "contactGroup": "GENERAL"
}
], - "threshold": {
- "unit": "GB",
- "value": 1000
}, - "timePeriod": "DAY"
}Response samples
- 201
- 400
- 401
- 403
- 404
- 500
- 503
{- "action": "POWER_OFF",
- "channels": [
- {
- "type": "EMAIL",
- "contactGroup": "TECHNICAL",
- "contacts": [
- "john.doe@example.com",
- "jim.doe@example.com"
]
}
], - "id": "ff6bbd04-c24c-4ecf-b09d-e6c415a65d63",
- "threshold": {
- "unit": "GB",
- "value": 1000
}, - "timePeriod": "DAY",
- "type": "DATA_TRAFFIC"
}Update Notification Setting details
Authorizations:
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/jsonrequired
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "action": "POWER_OFF",
- "channels": [
- {
- "type": "EMAIL",
- "contactGroup": "GENERAL"
}
], - "threshold": {
- "unit": "GB",
- "value": 1000
}, - "timePeriod": "DAY"
}Response samples
- 200
- 401
- 403
- 404
- 500
- 503
{- "action": "POWER_OFF",
- "channels": [
- {
- "type": "EMAIL",
- "contactGroup": "TECHNICAL",
- "contacts": [
- "john.doe@example.com",
- "jim.doe@example.com"
]
}
], - "id": "ff6bbd04-c24c-4ecf-b09d-e6c415a65d63",
- "threshold": {
- "unit": "GB",
- "value": 1000
}, - "timePeriod": "DAY",
- "type": "DATA_TRAFFIC"
}Delete a notification setting setting
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 401
- 403
- 404
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "totalCount": 3,
- "limit": 10,
- "offset": 0
}, - "securityGroups": [
- {
- "id": "166cc685-8273-11f0-b4f8-2687367a8a5e",
- "name": "Default Security Group",
- "default": true,
- "state": "ACTIVE"
}, - {
- "id": "7e59b33d-05f3-4078-b251-c7831ae8fe14",
- "name": "My Security Group",
- "default": false,
- "state": "ACTIVE"
}, - {
- "id": "fb769dab-3daa-47e4-89ed-06a4b6499176",
- "name": "My Security Group",
- "default": false,
- "state": "ACTIVE"
}
]
}Create Security Group
Create a Security Group
Authorizations:
Request Body schema: application/jsonrequired
| name required | string The name of the security group |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "name": "My Security Group"
}Response samples
- 201
- 400
- 401
- 403
- 500
- 503
{- "default": false,
- "id": "7e59b33d-05f3-4078-b251-c7831ae8fe14",
- "name": "My Security Group",
- "state": "CREATING"
}Get Security Group details
Authorizations:
path Parameters
| securityGroupId required | string <uuid> Example: 166cc685-8273-11f0-b4f8-2687367a8a5e Security Group ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "default": false,
- "id": "166cc685-8273-11f0-b4f8-2687367a8a5e",
- "name": "My Security Group",
- "state": "ACTIVE"
}Update Security Group
Update a Security Group
Authorizations:
path Parameters
| securityGroupId required | string <uuid> Example: 166cc685-8273-11f0-b4f8-2687367a8a5e Security Group ID |
Request Body schema: application/jsonrequired
| name required | string The name of the security group |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "name": "My Security Group"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "default": false,
- "id": "166cc685-8273-11f0-b4f8-2687367a8a5e",
- "name": "My Security Group",
- "state": "ACTIVE"
}Delete Security Group
Delete a Security Group
Authorizations:
path Parameters
| securityGroupId required | string <uuid> Example: 166cc685-8273-11f0-b4f8-2687367a8a5e Security Group ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| securityGroupId required | string <uuid> Example: 166cc685-8273-11f0-b4f8-2687367a8a5e Security Group ID |
Request Body schema: application/jsonrequired
| rules required | Array of strings <uuid> (ids) [ items <uuid > ] |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "rules": [
- "7e59b33d-05f3-4078-b251-c7831ae8fe14",
- "166cc685-8273-11f0-b4f8-2687367a8a5e"
]
}Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 2,
- "limit": 20,
- "offset": 0
}, - "firewallRules": [
- {
- "protocol": "TCP",
- "source": "0.0.0.0/0",
- "startPort": 80,
- "endPort": 80,
- "icmpCode": null,
- "icmpType": null,
- "state": "ACTIVE"
}, - {
- "protocol": "ICMP",
- "source": "10.0.0.0/8",
- "icmpType": -1,
- "icmpCode": -1,
- "startPort": null,
- "endPort": null,
- "state": "ACTIVE"
}
]
}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:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/start \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/stop \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/reboot \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/console \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
List credentials stored for a specific VPS
Authorizations:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/credentials \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 1,
- "limit": 20,
- "offset": 0
}, - "credentials": [
- {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
]
}Store credentials for a specific VPS
Authorizations:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
Request Body schema: application/jsonrequired
| type required | string (credentialType) Enum: "OPERATING_SYSTEM" "CONTROL_PANEL" |
| username required | string Can contain only alphanumeric values and characters |
| password required | string The password you'd like to store |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "password": "12341234",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "password": "12341234",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}Delete all credentials associated with a specific VPS
Delete all credentials stored for a given VPS.
Authorizations:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request DELETE \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/credentials \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
| type required | string (credentialType) Enum: "OPERATING_SYSTEM" "CONTROL_PANEL" Type of credential |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/credentials/%7Btype%7D \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 1,
- "limit": 20,
- "offset": 0
}, - "credentials": [
- {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
]
}Get VPS credential by type and username.
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "password": "12341234",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}Update credentials for a given type and username
Authorizations:
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/jsonrequired
| password required | string The new password |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "password": "12341234"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "password": "12341234",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}Delete VPS credential
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/resetPassword \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
Request Body schema: application/jsonrequired
| isoId required | string The ISO ID, obtained using the ISO endpoints |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "isoId": "GRML"
}Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/detachIso \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}List images available for reinstall
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "images": [
- {
- "id": "UBUNTU_24_04_64BIT",
- "name": "Ubuntu 24.04 LTS (x86_64)",
- "version": "24.04",
- "family": "linux",
- "flavour": "ubuntu",
- "architecture": "x86_64",
- "marketApps": [ ],
- "storageTypes": [
- "LOCAL",
- "CENTRAL"
], - "storageSize": null,
- "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": null,
- "updatedAt": null,
- "custom": false,
- "minDiskSize": null
}, - {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (x86_64)",
- "version": "22.04",
- "family": "linux",
- "flavour": "ubuntu",
- "architecture": "x86_64",
- "marketApps": [
- "PLESK_WEB_ADMIN"
], - "storageTypes": [
- "LOCAL",
- "CENTRAL"
], - "storageSize": null,
- "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": null,
- "updatedAt": null,
- "custom": false,
- "minDiskSize": null
}, - {
- "id": "UBUNTU_20_04_64BIT",
- "name": "Ubuntu 20.04 LTS (x86_64)",
- "version": "20.04",
- "family": "linux",
- "flavour": "ubuntu",
- "architecture": "x86_64",
- "marketApps": [ ],
- "storageTypes": [
- "LOCAL",
- "CENTRAL"
], - "storageSize": null,
- "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": null,
- "updatedAt": null,
- "custom": false,
- "minDiskSize": null
}, - {
- "id": "abcc1630-362f-48ba-832f-c496aff24121",
- "name": "Custom image - 01",
- "flavour": "ubuntu",
- "family": "linux",
- "version": null,
- "architecture": null,
- "marketApps": [ ],
- "storageTypes": [ ],
- "storageSize": {
- "size": 2.03,
- "unit": "GB"
}, - "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": "2024-07-05T10:44:08+00:00",
- "updatedAt": "2024-07-18T08:52:08+00:00",
- "custom": true,
- "minDiskSize": null
}, - {
- "id": "8600b94b-45b4-4887-86e1-2792b06dbb32",
- "name": "Custom image - 02",
- "flavour": "ubuntu",
- "family": "linux",
- "version": null,
- "architecture": null,
- "marketApps": [ ],
- "storageTypes": [ ],
- "storageSize": {
- "size": 2.03,
- "unit": "GB"
}, - "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": "2024-07-05T10:47:01+00:00",
- "updatedAt": "2024-07-17T13:14:01+00:00",
- "custom": true,
- "minDiskSize": null
}, - {
- "id": "ace712e9-a166-47f1-9065-4af0f7e7fce1",
- "name": "Custom image - 03",
- "flavour": "ubuntu",
- "family": "linux",
- "version": null,
- "architecture": null,
- "marketApps": [ ],
- "storageTypes": [ ],
- "storageSize": {
- "size": 2.03,
- "unit": "GB"
}, - "state": "READY",
- "stateReason": null,
- "region": "eu-west-3",
- "createdAt": "2024-07-05T10:54:27+00:00",
- "updatedAt": "2024-07-17T13:14:01+00:00",
- "custom": true,
- "minDiskSize": null
}
], - "_metadata": {
- "totalCount": 6,
- "limit": 6,
- "offset": 0
}
}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:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
Request Body schema: application/jsonrequired
| imageId required | string The Image ID |
| marketAppId | string The Market App to be installed |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "imageId": "UBUNTU_22_04_64BIT"
}Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 1,
- "limit": 20,
- "offset": 0
}, - "ips": [
- {
- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": null,
- "mainIp": false,
- "nullRouted": false,
- "networkType": "INTERNAL",
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
]
}Get IP details for a specific VPS
Authorizations:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
| ip required | string <ip> Example: 10.0.0.1 |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}Update the IP address for a specific VPS
Allows you to set the reverse lookup for the IP
Authorizations:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
| ip required | string <ip> Example: 10.0.0.1 |
Request Body schema: application/jsonrequired
| reverseLookup required | string |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "reverseLookup": "a-valid-domain.xpto"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}Null route 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:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
| ip required | string <ip> Example: 10.0.0.1 |
Request Body schema: application/jsonoptional
| 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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "automatedUnnulingAt": 2,
- "comment": "Getting DDoS"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}Remove an IP null route for a specific VPS
Remove an IP null route. It may take a few minutes before the change is propagated across the network
Authorizations:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
| ip required | string <ip> Example: 10.0.0.1 |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "ip": "10.0.0.1",
- "prefixLength": "28",
- "version": 4,
- "reverseLookup": "a-valid-domain.xpto",
- "mainIp": false,
- "networkType": "INTERNAL",
- "nullRouted": true,
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}Get data traffic metrics for a specific VPS
Authorizations:
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 |
| 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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2023-10-01T00:00:00+00:00",
- "to": "2023-10-31T00:00:00+00:00",
- "granularity": "DAY",
- "aggregation": "SUM",
- "unit": "B",
- "summary": {
- "downPublic": {
- "average": 340733979,
- "expected": 10222019370,
- "total": 1022201937,
- "peak": {
- "value": 896116855,
- "timestamp": "2023-10-28T00:00:00+00:00"
}
}, - "upPublic": {
- "average": 59920023.67,
- "expected": 1797600710.1,
- "total": 179760071,
- "peak": {
- "value": 85089279,
- "timestamp": "2023-10-28T00:00:00+00:00"
}
}
}
}, - "metrics": {
- "downPublic": {
- "values": [
- {
- "value": 461323,
- "timestamp": "2023-10-27T00:00:00+00:00"
}, - {
- "value": 1249243,
- "timestamp": "2023-10-28T00:00:00+00:00"
}
], - "unit": "B"
}, - "upPublic": {
- "values": [
- {
- "value": 437565,
- "timestamp": "2023-10-27T00:00:00+00:00"
}, - {
- "value": 6938590,
- "timestamp": "2023-10-28T00:00:00+00:00"
}
], - "unit": "B"
}
}
}List snapshots
List VPS snapshots
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 1,
- "limit": 20,
- "offset": 0
}, - "snapshots": [
- {
- "id": "624c53c3-48e9-41d1-833f-90a9abf5fd95",
- "displayName": "snapshot 1",
- "state": "READY",
- "created": "2023-11-02T07:31:28+0000"
}
]
}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:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
Request Body schema: application/jsonrequired
| name required | string A name to identify your snapshot |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "name": "my snapshot"
}Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}Get snapshot detail
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "created": "2023-11-02T07:31:28+0000",
- "displayName": "snapshot 1",
- "id": "ef73e9e2-95cd-49ef-940f-a24e6ad6c4a0",
- "state": "READY"
}Restore VPS snapshot
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}Delete VPS snapshot
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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®ion=SOME_STRING_VALUE' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 400
- 401
- 403
- 500
- 503
{- "_metadata": {
- "totalCount": 1,
- "limit": 10,
- "offset": 0
}, - "vps": [
- {
- "id": "123581321",
- "pack": "Leaseweb VPS 2",
- "region": "eu-central-1",
- "datacenter": "FRA-01",
- "reference": "testing",
- "image": {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (x86_64)",
- "family": "linux",
- "flavour": "ubuntu",
- "custom": false
}, - "marketAppId": null,
- "state": "RUNNING",
- "hasPublicIpV4": true,
- "rootDiskSize": 50,
- "ips": [
- {
- "ip": "88.17.128.0",
- "prefixLength": "16",
- "version": 4,
- "nullRouted": false,
- "reverseLookup": "",
- "mainIp": true,
- "networkType": "PUBLIC"
}
], - "startedAt": "2024-10-24T21:13:25+00:00"
}
]
}Get VPS details
Get VPS details.
Authorizations:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 400
- 401
- 403
- 500
- 503
{- "contract": {
- "id": "41228459000100",
- "billingFrequency": 1,
- "term": 12,
- "type": "MONTHLY",
- "state": "ACTIVE",
- "endsAt": "2024-10-24T21:13:25+00:00",
- "startsAt": "2024-10-24T21:13:25+00:00",
- "sla": "Basic",
- "controlPanel": "cPanel Admin 5",
- "inModification": false,
- "dataTraffic": {
- "value": 30,
- "unit": "TB"
}
}, - "datacenter": "FRA-01",
- "hasPublicIpV4": true,
- "id": "123581321",
- "image": {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (x86_64)",
- "family": "linux",
- "flavour": "ubuntu",
- "custom": false
}, - "ips": [
- {
- "ip": "88.17.128.0",
- "prefixLength": "16",
- "version": 4,
- "nullRouted": false,
- "reverseLookup": "",
- "mainIp": true,
- "networkType": "PUBLIC",
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
], - "iso": null,
- "marketAppId": null,
- "pack": "Leaseweb VPS 2",
- "reference": "testing",
- "region": "eu-central-1",
- "resources": {
- "cpu": {
- "value": 4,
- "unit": "vCPU"
}, - "memory": {
- "value": 6,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 10000,
- "unit": "Mbps"
}
}, - "rootDiskSize": 50,
- "startedAt": "2024-10-24T21:13:25+00:00",
- "state": "RUNNING"
}Update VPS details
Authorizations:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
Request Body schema: application/jsonrequired
| reference | string An identifying name you can refer to the VPS |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "reference": "updated reference"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "contract": {
- "id": "41228459000100",
- "billingFrequency": 1,
- "term": 12,
- "type": "MONTHLY",
- "state": "ACTIVE",
- "endsAt": "2024-10-24T21:13:25+00:00",
- "startsAt": "2024-10-24T21:13:25+00:00",
- "sla": "Basic",
- "controlPanel": "cPanel Admin 5",
- "inModification": false,
- "dataTraffic": {
- "value": 30,
- "unit": "TB"
}
}, - "datacenter": "FRA-01",
- "hasPublicIpV4": true,
- "id": "123581321",
- "image": {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (x86_64)",
- "family": "linux",
- "flavour": "ubuntu",
- "custom": false
}, - "ips": [
- {
- "ip": "88.17.128.0",
- "prefixLength": "16",
- "version": 4,
- "nullRouted": false,
- "reverseLookup": "",
- "mainIp": true,
- "networkType": "PUBLIC",
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
], - "iso": null,
- "marketAppId": null,
- "pack": "Leaseweb VPS 2",
- "reference": "testing",
- "region": "eu-central-1",
- "resources": {
- "cpu": {
- "value": 4,
- "unit": "vCPU"
}, - "memory": {
- "value": 6,
- "unit": "GiB"
}, - "publicNetworkSpeed": {
- "value": 10000,
- "unit": "Mbps"
}
}, - "rootDiskSize": 50,
- "startedAt": "2024-10-24T21:13:25+00:00",
- "state": "RUNNING"
}List available ISOs
List all available ISO images
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "totalCount": 2,
- "limit": 20,
- "offset": 0
}, - "isos": [
- {
- "id": "GRML",
- "name": "GRML 2022.11"
}, - {
- "id": "ACRONIS_BOOT_MEDIA",
- "name": "Acronis Boot Media"
}
]
}List the notification settings of a customer
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 2,
- "limit": 10,
- "offset": 0
}, - "notificationSettings": [
- {
- "id": "ff6bbd04-c24c-4ecf-b09d-e6c415a65d63",
- "threshold": {
- "unit": "GB",
- "value": 2000
}, - "type": "DATA_TRAFFIC",
- "timePeriod": "DAY",
- "action": "POWER_OFF",
- "channels": [
- {
- "type": "EMAIL",
- "contactGroup": "TECHNICAL",
- "contacts": [
- "john.doe@example.com"
]
}
]
}, - {
- "id": "cc6bbd04-c24c-4ecf-b09d-e6c415a65d78",
- "threshold": {
- "unit": "GB",
- "value": 1000
}, - "type": "DATA_TRAFFIC",
- "timePeriod": "DAY",
- "action": null,
- "channels": [
- {
- "type": "EMAIL",
- "contactGroup": "TECHNICAL",
- "contacts": [
- "jim.doe@example.com"
]
}
]
}
]
}Get details of a notification Setting
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 404
- 500
- 503
{- "action": "POWER_OFF",
- "channels": [
- {
- "type": "EMAIL",
- "contactGroup": "TECHNICAL",
- "contacts": [
- "john.doe@example.com",
- "jim.doe@example.com"
]
}
], - "id": "ff6bbd04-c24c-4ecf-b09d-e6c415a65d63",
- "threshold": {
- "unit": "GB",
- "value": 1000
}, - "timePeriod": "DAY",
- "type": "DATA_TRAFFIC"
}Create a notification setting
Create a notification setting
Authorizations:
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/jsonrequired
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "action": "POWER_OFF",
- "channels": [
- {
- "type": "EMAIL",
- "contactGroup": "GENERAL"
}
], - "threshold": {
- "unit": "GB",
- "value": 1000
}, - "timePeriod": "DAY"
}Response samples
- 201
- 400
- 401
- 403
- 404
- 500
- 503
{- "action": "POWER_OFF",
- "channels": [
- {
- "type": "EMAIL",
- "contactGroup": "TECHNICAL",
- "contacts": [
- "john.doe@example.com",
- "jim.doe@example.com"
]
}
], - "id": "ff6bbd04-c24c-4ecf-b09d-e6c415a65d63",
- "threshold": {
- "unit": "GB",
- "value": 1000
}, - "timePeriod": "DAY",
- "type": "DATA_TRAFFIC"
}Update Notification Setting details
Authorizations:
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/jsonrequired
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "action": "POWER_OFF",
- "channels": [
- {
- "type": "EMAIL",
- "contactGroup": "GENERAL"
}
], - "threshold": {
- "unit": "GB",
- "value": 1000
}, - "timePeriod": "DAY"
}Response samples
- 200
- 401
- 403
- 404
- 500
- 503
{- "action": "POWER_OFF",
- "channels": [
- {
- "type": "EMAIL",
- "contactGroup": "TECHNICAL",
- "contacts": [
- "john.doe@example.com",
- "jim.doe@example.com"
]
}
], - "id": "ff6bbd04-c24c-4ecf-b09d-e6c415a65d63",
- "threshold": {
- "unit": "GB",
- "value": 1000
}, - "timePeriod": "DAY",
- "type": "DATA_TRAFFIC"
}Delete a notification setting setting
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/monitoring/status \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "description": "Service is Up",
- "status": "UP"
}Enable monitoring
Enable service monitoring
Authorizations:
path Parameters
| vpsId required | string Example: 999999999 VPS ID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/vps/999999999/monitoring \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}List virtual servers DEPRECATED
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 500
- 503
{- "virtualServers": [
- {
- "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": {
- "id": "30000778",
- "startsAt": "2016-02-01T00:00:00+0200",
- "endsAt": "2017-01-31T00:00:00+0200",
- "billingCycle": 12,
- "billingFrequency": "MONTH",
- "pricePerFrequency": 4.7,
- "currency": "EUR"
}, - "hardware": {
- "cpu": {
- "cores": 1
}, - "memory": {
- "unit": "MB",
- "amount": 1024
}, - "storage": {
- "unit": "GB",
- "amount": 40
}
}, - "iso": null,
- "ips": [
- {
- "ip": "10.11.116.130",
- "version": 4,
- "type": "PUBLIC"
}
]
}, - {
- "id": "301708",
- "reference": null,
- "customerId": "1301178860",
- "dataCenter": "AMS-01",
- "cloudServerId": null,
- "state": "STOPPED",
- "firewallState": "ENABLED",
- "template": "CentOS 7.0 64 60 20140711T1039",
- "serviceOffering": "M",
- "sla": "Bronze",
- "contract": {
- "id": "30000779",
- "startsAt": "2016-02-01T00:00:00+0200",
- "endsAt": "2017-01-31T00:00:00+0200",
- "billingCycle": 12,
- "billingFrequency": "MONTH",
- "pricePerFrequency": 4.7,
- "currency": "EUR"
}, - "hardware": {
- "cpu": {
- "cores": 2
}, - "memory": {
- "unit": "MB",
- "amount": 2048
}, - "storage": {
- "unit": "GB",
- "amount": 60
}
}, - "iso": {
- "id": "9eadbe14-69be-4dee-8f56-5ebb23bb3c33",
- "name": "Knoppix",
- "displayName": "Knoppix"
}, - "ips": [
- {
- "ip": "10.11.116.132",
- "version": 4,
- "type": "PUBLIC"
}
]
}
], - "_metadata": {
- "totalCount": 2,
- "offset": 0,
- "limit": 10
}
}Inspect a virtual server DEPRECATED
Authorizations:
path Parameters
| virtualServerId required | string Example: 123242 Id of the virtual server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/cloud/v2/virtualServers/123242 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 403
- 404
- 500
- 503
{- "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": {
- "id": "30000778",
- "startsAt": "2016-02-01T00:00:00+0200",
- "endsAt": "2017-01-31T00:00:00+0200",
- "billingCycle": 12,
- "billingFrequency": "MONTH",
- "pricePerFrequency": 4.7,
- "currency": "EUR"
}, - "hardware": {
- "cpu": {
- "cores": 1
}, - "memory": {
- "unit": "MB",
- "amount": 1024
}, - "storage": {
- "unit": "GB",
- "amount": 40
}
}, - "iso": {
- "id": "9eadbe14-69be-4dee-8f56-5ebb23bb3c33",
- "name": "Knoppix",
- "displayName": "Knoppix"
}, - "ips": [
- {
- "ip": "10.11.116.130",
- "version": 4,
- "type": "PUBLIC"
}
]
}Update a virtual server DEPRECATED
Authorizations:
path Parameters
| virtualServerId required | string Example: 123242 Id of the virtual server |
Request Body schema: application/jsonrequired
| reference required | string The reference description for the virtual server |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "reference": "My reference"
}Response samples
- 200
- 403
- 404
- 500
- 503
{- "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": {
- "id": "30000778",
- "startsAt": "2016-02-01T00:00:00+0200",
- "endsAt": "2017-01-31T00:00:00+0200",
- "billingCycle": 12,
- "billingFrequency": "MONTH",
- "pricePerFrequency": 4.7,
- "currency": "EUR"
}, - "hardware": {
- "cpu": {
- "cores": 1
}, - "memory": {
- "unit": "MB",
- "amount": 1024
}, - "storage": {
- "unit": "GB",
- "amount": 40
}
}, - "iso": {
- "id": "9eadbe14-69be-4dee-8f56-5ebb23bb3c33",
- "name": "Knoppix",
- "displayName": "Knoppix"
}, - "ips": [
- {
- "ip": "10.11.116.130",
- "version": 4,
- "type": "PUBLIC"
}
]
}Power on DEPRECATED
The power on call is an asynchronous call, meaning the power on will be performed as soon as possible.
Authorizations:
path Parameters
| virtualServerId required | string Example: 123242 Id of the virtual server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/cloud/v2/virtualServers/123242/powerOn \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 202
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| virtualServerId required | string Example: 123242 Id of the virtual server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/cloud/v2/virtualServers/123242/powerOff \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 202
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| virtualServerId required | string Example: 123242 Id of the virtual server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/cloud/v2/virtualServers/123242/reboot \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 202
- 403
- 404
- 500
- 503
{- "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "operatingSystemId": "CENTOS_7_64_PLESK"
}Response samples
- 202
- 403
- 404
- 500
- 503
{- "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "username": "root",
- "password": "my_secret_password",
- "type": "OPERATING_SYSTEM"
}Response samples
- 403
- 404
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
- 500
- 503
{- "credentials": [
- {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
], - "_metadata": {
- "totalCount": 1,
- "offset": 0,
- "limit": 10
}
}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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
- 500
- 503
{- "type": "OPERATING_SYSTEM",
- "username": "root",
- "password": "password123"
}Inspect datatraffic metrics DEPRECATED
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2016-01-01T00:00:00+00:00",
- "to": "2016-01-31T23:59:59+00:00",
- "granularity": "DAY",
- "aggregation": "SUM"
}, - "metrics": {
- "DATATRAFFIC_UP": {
- "unit": "B",
- "values": [
- {
- "timestamp": "2016-01-01T23:59:59+00:00",
- "value": 900
}, - {
- "timestamp": "2016-01-31T23:59:59+00:00",
- "value": 2500
}
]
}, - "DATATRAFFIC_DOWN": {
- "unit": "B",
- "values": [
- {
- "timestamp": "2016-01-01T23:59:59+00:00",
- "value": 90
}, - {
- "timestamp": "2016-01-31T23:59:59+00:00",
- "value": 250
}
]
}
}
}List templates DEPRECATED
Retrieves all the supported operating system templates for the specified virtual server
Authorizations:
path Parameters
| virtualServerId required | string Id of the virtual server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/cloud/v2/virtualServers/%7BvirtualServerId%7D/templates \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 403
- 404
- 500
- 503
{- "_metadata": {
- "totalCount": 2,
- "limit": 10,
- "offset": 0
}, - "templates": [
- {
- "id": "WINDOWS_SERVER_2012_R2_STANDARD_64",
- "name": "Windows Server 2012 R2 Standard (64-bit)"
}, - {
- "id": "CENTOS_7_64_PLESK",
- "name": "CentOS 7 (64-bit) Plesk"
}
]
}List snapshots DEPRECATED
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 500
- 503
{- "snapshots": [
- {
- "id": "5ab92117-4801-4f86-ad3a-8c5b12ba1b18",
- "name": "snapshot1",
- "state": "READY",
- "created_at": "2023-02-21T14:44:02+00:00"
}, - {
- "id": "5ab92117-5709-4f86-ad3a-8c5b12ba1b18",
- "name": "snapshot2",
- "state": "READY",
- "created_at": "2023-02-21T14:46:02+00:00"
}
], - "_metadata": {
- "totalCount": 2,
- "offset": 0,
- "limit": 10
}
}Create snapshot DEPRECATED
To create a snapshot, the VPS must be Running and have a General Purpose (GP) pack
Authorizations:
path Parameters
| virtualServerId required | string Example: 123242 Id of the virtual server |
Request Body schema: application/jsonrequired
| name required | string The snapshot name, starting with letters, containing only letters, numbers and spaces |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "name": "Snapshot 1"
}Response samples
- 202
- 403
- 404
- 500
- 503
{- "id": "2e78c712-ba58-4078-95ad-ba86617c9f54",
- "name": "virtualServer.createVMSnapshot",
- "status": "PENDING",
- "createdAt": "2023-02-23T15:52:54+00:00"
}Get snapshot DEPRECATED
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
- 500
- 503
{- "id": "8083e330-9888-4ae6-8f11-d372c5a50e63",
- "name": "Snapshot 1",
- "state": "READY",
- "created_at": "2023-02-24T09:33:01+00:00"
}Delete snapshot DEPRECATED
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 202
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| virtualServerId required | string Example: 123242 Id of the virtual server |
| snapshotId required | string The snapshot's UUID |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 202
- 403
- 404
- 500
- 503
{- "id": "2e78c712-ba58-4078-95ad-ba86617c9f54",
- "name": "virtualServer.restoreVMSnapshot",
- "status": "PENDING",
- "createdAt": "2023-02-23T15:52:54+00:00"
}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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url 'https://api.leaseweb.com/cloud/v2/privateClouds?limit=10&offset=0' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 403
- 500
- 503
{- "privateClouds": [
- {
- "id": "218030",
- "customerId": "1301178860",
- "dataCenter": "AMS-01",
- "serviceOffering": "FLAT_FEE",
- "sla": "Bronze",
- "contract": {
- "id": "30000775",
- "startsAt": "2015-11-01T00:00:00+02:00",
- "endsAt": "2016-12-30T10:39:27+01:00",
- "billingCycle": 12,
- "billingFrequency": "MONTH",
- "pricePerFrequency": 0,
- "currency": "EUR"
}, - "hardware": {
- "cpu": {
- "cores": 25
}, - "memory": {
- "unit": "GB",
- "amount": 50
}, - "storage": {
- "unit": "GB",
- "amount": 1
}
}, - "ips": [
- {
- "ip": "10.12.144.32",
- "version": 4,
- "type": "PUBLIC"
}, - {
- "ip": "10.12.144.33",
- "version": 4,
- "type": "PUBLIC"
}
], - "networkTraffic": {
- "type": "DATATRAFFIC",
- "trafficType": "PREMIUM|VOLUME",
- "datatrafficUnit": "TB",
- "datatrafficLimit": 6
}
}, - {
- "id": "218031",
- "customerId": "1301178860",
- "dataCenter": "AMS-01",
- "serviceOffering": "FLAT_FEE",
- "sla": "Bronze",
- "contract": {
- "id": "30000775",
- "startsAt": "2015-11-01T00:00:00+02:00",
- "endsAt": "2016-12-30T10:39:27+01:00",
- "billingCycle": 12,
- "billingFrequency": "MONTH",
- "pricePerFrequency": 0,
- "currency": "EUR"
}, - "hardware": {
- "cpu": {
- "cores": 10
}, - "memory": {
- "unit": "GB",
- "amount": 30
}, - "storage": {
- "unit": "TB",
- "amount": 1
}
}, - "ips": [
- {
- "ip": "10.12.144.63",
- "version": 4,
- "type": "PUBLIC"
}, - {
- "ip": "10.12.144.64",
- "version": 4,
- "type": "PUBLIC"
}
], - "networkTraffic": {
- "type": "DATATRAFFIC",
- "trafficType": "PREMIUM|VOLUME",
- "datatrafficUnit": "TB",
- "datatrafficLimit": 6
}
}
], - "_metadata": {
- "totalCount": 2,
- "offset": 0,
- "limit": 10
}
}Inspect a private cloud
Authorizations:
path Parameters
| privateCloudId required | string Example: 123242 Id of the private cloud |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/cloud/v2/privateClouds/123242 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 403
- 404
- 500
- 503
{- "id": "218030",
- "customerId": "1301178860",
- "dataCenter": "AMS-01",
- "serviceOffering": "FLAT_FEE",
- "sla": "Bronze",
- "contract": {
- "id": "30000775",
- "startsAt": "2015-11-01T00:00:00+02:00",
- "endsAt": "2016-12-30T10:39:27+01:00",
- "billingCycle": 12,
- "billingFrequency": "MONTH",
- "pricePerFrequency": 0,
- "currency": "EUR"
}, - "hardware": {
- "cpu": {
- "cores": 25
}, - "memory": {
- "unit": "GB",
- "amount": 50
}, - "storage": {
- "unit": "GB",
- "amount": 1
}
}, - "ips": [
- {
- "ip": "10.12.144.32",
- "version": 4,
- "type": "PUBLIC"
}, - {
- "ip": "10.12.144.33",
- "version": 4,
- "type": "PUBLIC"
}
], - "networkTraffic": {
- "type": "DATATRAFFIC",
- "trafficType": "PREMIUM|VOLUME",
- "datatrafficUnit": "TB",
- "datatrafficLimit": 6
}
}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.
| Name | Type | Description |
|---|---|---|
| type | string | Type of credential pair. Possible values are REMOTE_MANAGEMENT. |
| username | string | Name of the user in the remote management tool. |
| domain | string | Domain 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:
| Name | Type | Description |
|---|---|---|
| totalCount | integer | Total amount of credentials that were found. |
| limit | integer | Maximum amount of credentials that will be included in the credentials array. |
| offset | integer | Offset of the request. |
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
- 500
- 503
{- "credentials": [
- {
- "type": "REMOTE_MANAGEMENT",
- "username": "root",
- "domain": "123456"
}
], - "_metadata": {
- "totalCount": 1,
- "offset": 0,
- "limit": 10
}
}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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
- 500
- 503
{- "type": "REMOTE_MANAGEMENT",
- "username": "root",
- "password": "password123",
- "domain": "123456"
}Inspect datatraffic metrics
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2017-07-01T00:00:00+00:00",
- "to": "2017-07-01T00:00:00+00:00",
- "granularity": "MONTH",
- "aggregation": "SUM"
}, - "metrics": {
- "DATATRAFFIC_UP": {
- "unit": "GB",
- "values": [
- {
- "timestamp": "2017-07-01T00:00:00+00:00",
- "value": 900
}, - {
- "timestamp": "2017-07-02T00:00:00+00:00",
- "value": 2500
}
]
}, - "DATATRAFFIC_DOWN": {
- "unit": "GB",
- "values": [
- {
- "timestamp": "2017-07-01T00:00:00+00:00",
- "value": 90
}, - {
- "timestamp": "2017-07-02T00:00:00+00:00",
- "value": 250
}
]
}
}
}Inspect bandwidth metrics
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2017-07-01T00:00:00+00:00",
- "to": "2017-08-01T00:00:00+00:00",
- "granularity": "MONTH",
- "aggregation": "AVG"
}, - "metrics": {
- "DOWN_PUBLIC": {
- "unit": "bps",
- "values": [
- {
- "timestamp": "2017-07-01T00:00:00+00:00",
- "value": 28202557
}
]
}, - "UP_PUBLIC": {
- "unit": "bps",
- "values": [
- {
- "timestamp": "2017-07-01T00:00:00+00:00",
- "value": 158317519
}
]
}
}
}Inspect CPU metrics
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2017-07-01T00:00:00+00:00",
- "to": "2017-07-02T00:00:00+00:00",
- "granularity": "MONTH",
- "aggregation": "MAX"
}, - "metrics": {
- "CPU": {
- "unit": "CORES",
- "values": [
- {
- "timestamp": "2017-07-01T00:00:00+00:00",
- "value": 24
}, - {
- "timestamp": "2017-07-02T00:00:00+00:00",
- "value": 24
}
]
}
}
}Inspect memory metrics
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2017-07-01T00:00:00+00:00",
- "to": "2017-07-02T00:00:00+00:00",
- "granularity": "MONTH",
- "aggregation": "MAX"
}, - "metrics": {
- "MEMORY": {
- "unit": "GB",
- "values": [
- {
- "timestamp": "2017-07-01T00:00:00+00:00",
- "value": 8
}, - {
- "timestamp": "2017-07-02T00:00:00+00:00",
- "value": 16
}
]
}
}
}Inspect storage metrics
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2017-07-01T00:00:00+00:00",
- "to": "2017-07-02T00:00:00+00:00",
- "granularity": "MONTH",
- "aggregation": "MAX"
}, - "metrics": {
- "STORAGE": {
- "unit": "GB",
- "values": [
- {
- "timestamp": "2017-07-01T00:00:00+00:00",
- "value": 900
}, - {
- "timestamp": "2017-07-02T00:00:00+00:00",
- "value": 2500
}
]
}
}
}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:
query Parameters
| productId required | string The id of the ObjectStorage product. |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url 'https://api.leaseweb.com/storage/v1/storages?productId=SOME_STRING_VALUE' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 403
- 500
- 503
{- "id": "10812374",
- "quantity": {
- "value": 70000,
- "unit": "GB"
}, - "type": "SANS"
}List StorageVMs
Show all StorageVMs for the given customer.
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 500
- 503
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 1
}, - "storageVMs": [
- {
- "id": "1575dd1c-dddf-11ed-af62-000c299d72cd"
}
]
}List volumes
Show all the volumes in a StorageVM.
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
- 500
- 503
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 2
}, - "volumes": [
- {
- "id": "15ca9bf3-dddf-11ed-af62-000c299d72cd",
- "name": "volume1",
- "space": {
- "size": {
- "value": 0.021,
- "unit": "GB"
}, - "available": {
- "value": 0.018,
- "unit": "GB"
}, - "used": {
- "value": 0.002,
- "unit": "GB"
}
}
}, - {
- "id": "75a7e5ed-dde1-11ed-af62-000c299d72cd",
- "name": "volume2",
- "space": {
- "size": {
- "value": 5.369,
- "unit": "GB"
}, - "available": {
- "value": 5.368,
- "unit": "GB"
}, - "used": {
- "value": 0,
- "unit": "GB"
}
}
}
]
}Grow volume
Grow the size of a volume in StorageVM.
Authorizations:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "growSize": 5
}Response samples
- 202
- 400
- 403
- 404
- 500
- 503
{- "id": "d385ae54-3763-11ee-af62-000c299d72cd",
- "status": "PENDING"
}Show a job
Gets status details about a job running in the specified storage VM.
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
- 500
- 503
{- "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 API allows customers to retrieve information about their Acronis Backup services, including current usage and limits.
List backup items
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url 'https://api.leaseweb.com/backup/v1/backup?limit=20&offset=10' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 500
- 503
{- "backupItems": [
- {
- "id": "12345678",
- "location": "EU2",
- "storageSize": 60,
- "status": "ACTIVE",
- "startDate": "2019-05-01T00:00:00Z",
- "endDate": "2021-04-30T00:00:00Z",
- "contractTerm": 3,
- "billingCycle": 1
}, - {
- "id": "11111111",
- "location": "EU3",
- "storageSize": 250,
- "status": "ACTIVE",
- "startDate": "2019-05-01T00:00:00Z",
- "endDate": "2021-04-30T00:00:00Z",
- "contractTerm": 3,
- "billingCycle": 1
}
], - "_metadata": {
- "totalCount": 2,
- "offset": 0,
- "limit": 20
}
}Inspect a backup item
Authorizations:
path Parameters
| equipmentId required | string Example: 12345678 Equipment ID of the backup item. |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/backup/v1/backup/12345678 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 404
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url 'https://api.leaseweb.com/backup/v1/metrics/storage?locations=EU2%2CEU3' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 500
- 503
{- "metrics": {
- "EU2": {
- "unit": "GB",
- "value": 45.67
}, - "EU3": {
- "unit": "GB",
- "value": 0
}
}
}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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 2,
- "offset": 80,
- "totalCount": 132
}, - "servers": [
- {
- "assetId": "627293",
- "contract": {
- "customerId": "32923828192",
- "deliveryStatus": "ACTIVE",
- "id": "674382",
- "reference": "database.server",
- "salesOrgId": "2300"
}, - "featureAvailability": {
- "automation": true,
- "ipmiReboot": false,
- "powerCycle": true,
- "privateNetwork": true,
- "remoteManagement": false
}, - "id": "12345",
- "location": {
- "rack": "A83",
- "site": "AMS-01",
- "suite": "99",
- "unit": "16-17"
}, - "networkInterfaces": {
- "internal": {
- "gateway": "10.22.192.12",
- "ip": "10.22.192.3",
- "mac": "AA:BB:CC:DD:EE:FF",
- "ports": [
- {
- "name": "EVO-AABB-01",
- "port": "30"
}
]
}, - "public": {
- "gateway": "95.211.162.62",
- "ip": "95.211.162.0",
- "mac": "AA:AC:CC:88:EE:E4",
- "ports": [ ]
}, - "remoteManagement": {
- "gateway": "10.22.192.126",
- "ip": "10.22.192.1",
- "mac": "AA:AC:CC:88:EE:E4",
- "ports": [ ]
}
}, - "powerPorts": [
- {
- "name": "EVO-JV12-APC02",
- "port": "10"
}
], - "privateNetworks": [
- {
- "id": "1",
- "linkSpeed": 1000,
- "status": "CONFIGURED",
- "subnet": "127.0.0.80/24",
- "vlanId": "2120"
}
], - "rack": {
- "type": "SHARED"
}
}, - {
- "assetId": "627294",
- "contract": {
- "customerId": "32923828192",
- "deliveryStatus": "ACTIVE",
- "id": "929282",
- "reference": "web.server",
- "salesOrgId": "2300"
}, - "featureAvailability": {
- "automation": false,
- "powerCycle": false,
- "privateNetwork": false,
- "remoteManagement": false
}, - "id": "47854",
- "location": {
- "rack": "13",
- "site": "AMS-01",
- "suite": "A6",
- "unit": "18"
}, - "networkInterfaces": {
- "internal": {
- "mac": null,
- "ip": null,
- "nullRouted": null,
- "gateway": null,
- "ports": [ ]
}, - "public": {
- "mac": null,
- "ip": null,
- "nullRouted": null,
- "gateway": null,
- "ports": [ ]
}, - "remoteManagement": {
- "mac": null,
- "ip": null,
- "nullRouted": null,
- "gateway": null,
- "ports": [ ]
}
}, - "privateNetworks": [
- {
- "id": "2",
- "linkSpeed": 1000,
- "status": "CONFIGURED",
- "subnet": "127.0.0.80/24",
- "vlanId": "2130"
}
], - "rack": {
- "type": "SHARED"
}
}
]
}Get server
Use this API to get information about a single server.
Authorizations:
path Parameters
| serverId required | string Example: 12345 The ID of a server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 404
- 500
- 503
{- "assetId": "1234561882",
- "contract": {
- "id": "12123412312",
- "customerId": "1235458",
- "salesOrgId": "2200",
- "deliveryStatus": "ACTIVE",
- "reference": "this is ref",
- "privateNetworkPortSpeed": 10000,
- "subnets": [ ],
- "status": "ACTIVE",
- "startsAt": "2024-04-01T00:00:00Z",
- "endsAt": null,
- "sla": "Bronze",
- "contractTerm": 36,
- "contractType": "NORMAL",
- "billingCycle": 1,
- "billingFrequency": "MONTH",
- "pricePerFrequency": "12.5",
- "currency": "EUR",
- "networkTraffic": {
- "type": "90TH",
- "connectivityType": "CONNECTED_AGGREGATION_POOL",
- "trafficType": "VOLUME",
- "datatrafficLimit": null,
- "datatrafficUnit": null
}, - "softwareLicenses": [
- {
- "name": "No Control Panel",
- "price": null,
- "currency": "EUR",
- "type": "CONTROL_PANEL"
}
], - "managedServices": [ ],
- "aggregationPackId": "127648",
- "ipv4Quantity": 1
}, - "featureAvailability": {
- "automation": true,
- "powerCycle": true,
- "ipmiReboot": false,
- "privateNetwork": true,
- "remoteManagement": true
}, - "id": "123456",
- "isPrivateNetworkCapable": true,
- "isPrivateNetworkEnabled": true,
- "isRedundantPrivateNetworkCapable": false,
- "location": {
- "site": "AMS-02",
- "suite": "HALL1",
- "rack": "LK18",
- "unit": "12"
}, - "networkInterfaces": {
- "public": {
- "mac": "macmacmac",
- "ip": "127.0.0.1",
- "nullRouted": false,
- "gateway": "127.0.0.1",
- "ports": [
- {
- "name": "AMS-01-PUB-SW01231",
- "port": "0-0-21"
}
], - "locationId": "274912387"
}, - "internal": {
- "mac": "macmacmac",
- "ip": null,
- "nullRouted": null,
- "gateway": null,
- "ports": [
- {
- "name": "AMS-02-INT-SW0123441",
- "port": "0-0-21"
}
], - "locationId": null
}, - "remoteManagement": {
- "mac": "macmacmac",
- "ip": "127.0.0.1",
- "gateway": "127.0.0.1",
- "ports": [
- {
- "name": "AMS-02-INT-SW0123441",
- "port": "0-0-21"
}
], - "locationId": "1238427449"
}
}, - "powerPorts": [
- {
- "name": "AMS-02-INT-SW0123441",
- "port": "14"
}, - {
- "name": "AMS-02-INT-SW0123441222",
- "port": "11"
}
], - "privateNetworks": [
- {
- "id": "1238793",
- "linkSpeed": 10000,
- "status": "CONFIGURED",
- "dhcp": "DISABLED",
- "subnet": "24",
- "vlanId": "1912639"
}
], - "rack": {
- "id": "5162",
- "type": "SHARED_100GE",
- "capacity": "12G"
}, - "serialNumber": "HN2XGHSD02H04",
- "specs": {
- "brand": "HP",
- "chassis": "Dell R7612121 (8xSF/2NVMe)",
- "hardwareRaidCapable": false,
- "cpu": {
- "type": "AMD INT AMD",
- "quantity": 2
}, - "ram": {
- "size": 64,
- "unit": "GB"
}, - "hdd": [
- {
- "id": "SSDDD480GB",
- "size": 480,
- "unit": "GB",
- "amount": 1,
- "type": "SSD",
- "performanceType": "WRITE_INTENSIVE"
}
], - "pciCards": [ ]
}
}Update server
Update the reference for a server.
Authorizations:
path Parameters
| serverId required | string Example: 12345 The ID of a server |
Request Body schema: application/jsonrequired
| reference required | string The reference for this server |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "reference": "database-server"
}Response samples
- 401
- 403
- 404
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 2
}, - "ips": [
- {
- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}, - "floatingIp": false,
- "gateway": "12.123.123.254",
- "ip": "12.123.123.1/24",
- "mainIp": true,
- "networkType": "PUBLIC",
- "nullRouted": true,
- "reverseLookup": "domain.example.com",
- "version": 4
}, - {
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}, - "floatingIp": false,
- "gateway": "2001:db8:85a3::8a2e:370:1",
- "ip": "2001:db8:85a3::8a2e:370:7334/64",
- "mainIp": false,
- "networkType": "REMOTE_MANAGEMENT",
- "nullRouted": false,
- "reverseLookup": "domain.example.com",
- "version": 6
}
]
}Show a server IP
Get a single IP address associated with this server.
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 500
- 503
{- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}, - "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "detectionProfile": "ADVANCED_LOW_UDP",
- "reverseLookup": "domain.example.com"
}Response samples
- 200
- 400
- 401
- 403
- 500
- 503
{- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}, - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 202
- 400
- 401
- 403
- 500
- 503
{- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}, - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 202
- 400
- 401
- 403
- 500
- 503
{- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}, - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 1
}, - "nullRoutes": [
- {
- "automatedUnnullingAt": "2016-08-12T07:45:33+00:00",
- "comment": "Device Null Route related to DDoS Mitigation",
- "ip": "1.1.1.1/32",
- "nullLevel": 3,
- "nulledAt": "2016-08-12T07:40:27+00:00",
- "ticketId": "282912"
}
]
}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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request DELETE \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/privateNetworks/892 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "linkSpeed": 100
}Response samples
- 400
- 401
- 403
- 404
- 500
- 503
{- "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:
path Parameters
| serverId required | string Example: 12345 The ID of a server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/networkInterfaces \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 1
}, - "networkInterfaces": [
- {
- "linkSpeed": "100Mbps",
- "operStatus": "OPEN",
- "status": "OPEN",
- "switchInterface": "33",
- "switchName": "EVO-AA11-1",
- "type": "PUBLIC"
}
]
}Close all network interfaces
Close all network interfaces for this server.
Authorizations:
path Parameters
| serverId required | string Example: 12345 The ID of a server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/networkInterfaces/close \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 401
- 403
- 500
- 503
{- "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:
path Parameters
| serverId required | string Example: 12345 The ID of a server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/networkInterfaces/open \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 401
- 403
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/networkInterfaces/internal \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/networkInterfaces/internal/close \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 401
- 403
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/networkInterfaces/internal/open \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 401
- 403
- 500
- 503
{- "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:
path Parameters
| serverId required | string Example: 12345 The ID of a server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/notificationSettings/ddos \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 400
- 401
- 403
- 500
- 503
{- "nulling": "ENABLED",
- "scrubbing": "DISABLED"
}Update DDoS notification settings
Update your DDoS notification settings for this server.
Authorizations:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "nulling": "DISABLED",
- "scrubbing": "ENABLED"
}Response samples
- 400
- 401
- 403
- 500
- 503
{- "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:
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 |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 500
- 503
{- "_metadata": {
- "aggregation": "AVG",
- "from": "2016-10-20T09:00:00Z",
- "granularity": "HOUR",
- "to": "2016-10-20T11:00:00Z"
}, - "metrics": {
- "DOWN_PUBLIC": {
- "unit": "bps",
- "values": [
- {
- "timestamp": "2016-10-20T09:00:00Z",
- "value": 202499
}, - {
- "timestamp": "2016-10-20T10:00:00Z",
- "value": 29900
}
]
}, - "UP_PUBLIC": {
- "unit": "bps",
- "values": [
- {
- "timestamp": "2016-10-20T09:00:00Z",
- "value": 43212393
}, - {
- "timestamp": "2016-10-20T10:00:00Z",
- "value": 12342929
}
]
}
}
}Show datatraffic metrics
At this moment only bandwidth information for the public interface is supported.
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 500
- 503
{- "_metadata": {
- "aggregation": "SUM",
- "from": "2016-10-20T09:00:00Z",
- "granularity": "HOUR",
- "to": "2016-10-20T11:00:00Z"
}, - "metrics": {
- "DOWN_PUBLIC": {
- "unit": "B",
- "values": [
- {
- "timestamp": "2016-10-20T09:00:00Z",
- "value": 202499
}, - {
- "timestamp": "2016-10-20T10:00:00Z",
- "value": 29900
}
]
}, - "UP_PUBLIC": {
- "unit": "B",
- "values": [
- {
- "timestamp": "2016-10-20T09:00:00Z",
- "value": 43212393
}, - {
- "timestamp": "2016-10-20T10:00:00Z",
- "value": 12342929
}
]
}
}
}List bandwidth notification settings
List all bandwidth notification settings for this server.
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 2
}, - "bandwidthNotificationSettings": [
- {
- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "frequency": "WEEKLY",
- "id": "12345",
- "lastCheckedAt": "2021-03-16T01:01:41+00:00",
- "threshold": "1",
- "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
- "unit": "Gbps"
}, - {
- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "frequency": "DAILY",
- "id": "123456",
- "lastCheckedAt": "2021-03-16T01:01:41+00:00",
- "threshold": "1",
- "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
- "unit": "Mbps"
}
]
}Create a bandwidth notification setting
Create a new bandwidth notification setting for this server.
Authorizations:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "frequency": "DAILY",
- "threshold": "1",
- "unit": "Gbps"
}Response samples
- 201
- 400
- 401
- 403
- 500
- 503
{- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request DELETE \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/notificationSettings/bandwidth/839111 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 401
- 403
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/notificationSettings/bandwidth/839111 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 500
- 503
{- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "frequency": "DAILY",
- "threshold": "1",
- "unit": "Gbps"
}Response samples
- 200
- 401
- 403
- 500
- 503
{- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 2
}, - "datatrafficNotificationSettings": [
- {
- "id": "64371",
- "frequency": "DAILY",
- "threshold": "25000",
- "unit": "MB",
- "lastCheckedAt": null,
- "thresholdExceededAt": null,
- "actions": [
- {
- "type": "EMAIL",
- "lastTriggeredAt": null
}
]
}, - {
- "id": "64372",
- "frequency": "MONTHLY",
- "threshold": "10000000",
- "unit": "MB",
- "lastCheckedAt": null,
- "thresholdExceededAt": null,
- "actions": [
- {
- "type": "EMAIL",
- "lastTriggeredAt": null
}
]
}
]
}Create a data traffic notification setting
Create a new data traffic notification setting for this server.
Authorizations:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "frequency": "DAILY",
- "threshold": "1",
- "unit": "MB"
}Response samples
- 201
- 400
- 401
- 403
- 500
- 503
{- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request DELETE \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/notificationSettings/datatraffic/839111 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 401
- 403
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/notificationSettings/datatraffic/839111 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 500
- 503
{- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "frequency": "DAILY",
- "threshold": "1",
- "unit": "GB"
}Response samples
- 200
- 401
- 403
- 500
- 503
{- "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:
path Parameters
| serverId required | string Example: 12345 The ID of a server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/hardwareInfo \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 400
- 401
- 403
- 500
- 503
{- "id": "2378237",
- "parserVersion": "3.6",
- "result": {
- "chassis": {
- "description": "Rack Mount Chassis",
- "firmware": {
- "date": "07/01/2013",
- "description": "BIOS",
- "vendor": "HP",
- "version": "J01"
}, - "motherboard": {
- "product": "",
- "serial": "",
- "vendor": ""
}, - "product": "ProLiant DL120 G7 (647339-B21)",
- "serial": "CZ33109CHV",
- "vendor": "HP"
}, - "cpu": [
- {
- "capabilities": {
- "cpufreq": "CPU Frequency scaling",
- "ht": "HyperThreading",
- "vmx": false,
- "x86-64": "64bits extensions (x86-64)"
}, - "description": "Intel(R) Xeon(R) CPU E31230",
- "hz": "2792640000",
- "serial_number": "",
- "settings": {
- "cores": "4",
- "enabledcores": "4",
- "threads": "8"
}, - "slot": "Proc 1",
- "vendor": "Intel Corp."
}
], - "disks": [
- {
- "description": "ATA Disk",
- "id": "disk:0",
- "product": "Hitachi HDS72302",
- "serial_number": "MS77215W07S6SA",
- "size": "2000398934016",
- "smartctl": {
- "ata_version": "ATA8-ACS T13/1699-D revision 4",
- "attributes": {
- "Power_On_Hours": {
- "flag": "0x0012",
- "id": " 9",
- "raw_value": "39832",
- "thresh": "000",
- "type": "Old_age",
- "updated": "Always",
- "value": 95,
- "when_failed": "-",
- "worst": 95
}, - "Reallocated_Sector_Ct": {
- "flag": "0x0033",
- "id": " 5",
- "raw_value": "0",
- "thresh": "005",
- "type": "Pre-fail",
- "updated": "Always",
- "value": "100",
- "when_failed": "-",
- "worst": "100"
}
}, - "device_model": "Hitachi HDS723020BLE640",
- "execution_status": "0",
- "firmware_version": "MX4OAAB0",
- "is_sas": false,
- "overall_health": "PASSED",
- "rpm": "7200 rpm",
- "sata_version": "SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)",
- "sector_size": "512 bytes logical, 4096 bytes physical",
- "serial_number": "MS77215W07S6SA",
- "smart_error_log": "No Errors Logged",
- "smart_support": {
- "available": true,
- "enabled": true
}, - "smartctl_version": "6.2",
- "user_capacity": "2,000,398,934,016 bytes [2.00 TB]"
}, - "vendor": "Hitachi"
}
], - "ipmi": {
- "defgateway": "10.19.79.126",
- "firmware": "1.88",
- "ipaddress": "10.19.79.67",
- "ipsource": "DHCP Address",
- "macaddress": "28:92:4a:33:48:e8",
- "subnetmask": "255.255.255.192",
- "vendor": "Hewlett-Packard"
}, - "memory": [
- {
- "clock_hz": "1333000000",
- "description": "DIMM DDR3 Synchronous 1333 MHz (0.8 ns)",
- "id": "memory/bank:0",
- "serial_number": "8369AF58",
- "size_bytes": "4294967296"
}, - {
- "clock_hz": "1333000000",
- "description": "DIMM DDR3 Synchronous 1333 MHz (0.8 ns)",
- "id": "memory/bank:1",
- "serial_number": "8369B174",
- "size_bytes": "4294967296"
}
], - "network": [
- {
- "capabilities": {
- "autonegotiation": "Auto-negotiation",
- "bus_master": "bus mastering",
- "cap_list": "PCI capabilities listing",
- "ethernet": "",
- "link_speeds": {
- "1000bt-fd": "1Gbit/s (full duplex)",
- "100bt": "100Mbit/s",
- "100bt-fd": "100Mbit/s (full duplex)",
- "10bt": "10Mbit/s",
- "10bt-fd": "10Mbit/s (full duplex)"
}, - "msi": "Message Signalled Interrupts",
- "msix": "MSI-X",
- "pciexpress": "PCI Express",
- "physical": "Physical interface",
- "pm": "Power Management",
- "tp": "twisted pair"
}, - "lldp": {
- "chassis": {
- "description": "Juniper Networks, Inc. ex3300-48t Ethernet Switch, kernel JUNOS 15.1R5.5, Build date: 2016-11-25 16:02:59 UTC Copyright (c) 1996-2016 Juniper Networks, Inc.",
- "mac_address": "4c:16:fc:3a:84:c0",
- "name": "EVO-NS19-1"
}, - "port": {
- "auto_negotiation": {
- "enabled": "yes",
- "supported": "yes"
}, - "description": "ge-0/0/2.0"
}, - "vlan": {
- "id": "0",
- "label": "VLAN",
- "name": "default"
}
}, - "logical_name": "eth0",
- "mac_address": "28:92:4a:33:48:e6",
- "product": "82574L Gigabit Network Connection",
- "settings": {
- "autonegotiation": "on",
- "broadcast": "yes",
- "driver": "e1000e",
- "driverversion": "3.2.6-k",
- "duplex": "full",
- "firmware": "2.1-2",
- "ip": "212.32.230.67",
- "latency": "0",
- "link": "yes",
- "multicast": "yes",
- "port": "twisted pair",
- "speed": "1Gbit/s"
}, - "vendor": "Intel Corporation"
}
]
}, - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url 'https://api.leaseweb.com/bareMetals/v2/controlPanels?limit=20&offset=10' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 2
}, - "controlPanels": [
- {
- "id": "CPANEL_PREMIER_100",
- "name": "cPanel Premier 100"
}, - {
- "id": "CPANEL_PREMIER_150",
- "name": "cPanel Premier 150"
}, - {
- "id": "CPANEL_PREMIER_200",
- "name": "cPanel Premier 200"
}, - {
- "id": "CPANEL_PREMIER_250",
- "name": "cPanel Premier 250"
}, - {
- "id": "PLESK_DEDSER_WEB_ADMIN",
- "name": "Plesk Web Admin 10 Domains"
}, - {
- "id": "PLESK_DEDSER_WEB_PRO",
- "name": "Plesk Web Pro 30 Domains"
}, - {
- "id": "PLESK_DEDSER_WEB_HOST",
- "name": "Plesk Web Host Unlimited Domains"
}, - {
- "id": "VESTA",
- "name": "Vesta CP"
}
]
}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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 100,
- "offset": 0,
- "totalCount": 26
}, - "operatingSystems": [
- {
- "id": "ALMALINUX_8_64BIT",
- "name": "AlmaLinux 8 (x86_64)"
}, - {
- "id": "CENTOS_7_64BIT",
- "name": "CentOS 7 (x86_64)"
}, - {
- "id": "ROCKY_LINUX_8_64BIT",
- "name": "Rocky Linux 8 (x86_64)"
}, - {
- "id": "DEBIAN_11_64BIT",
- "name": "Debian 11 (amd64)"
}, - {
- "id": "DEBIAN_10_64BIT",
- "name": "Debian 10 (amd64)"
}, - {
- "id": "UBUNTU_22_04_64BIT",
- "name": "Ubuntu 22.04 LTS (Jammy Jellyfish) (amd64)"
}, - {
- "id": "UBUNTU_20_04_64BIT",
- "name": "Ubuntu 20.04 LTS (Focal Fossa) (amd64)"
}, - {
- "id": "UBUNTU_18_04_64BIT",
- "name": "Ubuntu 18.04 LTS (Bionic Beaver) (amd64)"
}, - {
- "id": "WINDOWS_SERVER_2019_STANDARD_64BIT",
- "name": "Windows Server 2019 Standard (x64)"
}, - {
- "id": "WINDOWS_SERVER_2019_DATACENTER_64BIT",
- "name": "Windows Server 2019 Datacenter (x64)"
}, - {
- "id": "WINDOWS_SERVER_2016_STANDARD_64BIT",
- "name": "Windows Server 2016 Standard (x64)"
}, - {
- "id": "WINDOWS_SERVER_2016_DATACENTER_64BIT",
- "name": "Windows Server 2016 Datacenter (x64)"
}, - {
- "id": "WINDOWS_SERVER_2012_R2_STANDARD_64BIT",
- "name": "Windows Server 2012 R2 Standard (x64)"
}, - {
- "id": "WINDOWS_SERVER_2012_R2_DATACENTER_64BIT",
- "name": "Windows Server 2012 R2 Datacenter (x64)"
}, - {
- "id": "WINDOWS_SERVER_2012_STANDARD_64BIT",
- "name": "Windows Server 2012 Standard (x64) (Only available to existing license holders)"
}, - {
- "id": "WINDOWS_SERVER_2012_DATACENTER_64BIT",
- "name": "Windows Server 2012 Datacenter (x64) (Only available to existing license holders)"
}, - {
- "id": "ESXI_7_0_64BIT_CSTM",
- "name": "ESXi 7.0 Targeted (x86_64)"
}, - {
- "id": "ESXI_7_0_64BIT",
- "name": "ESXi 7.0 (x86_64)"
}, - {
- "id": "ESXI_6_7_64BIT_CSTM",
- "name": "ESXi 6.7 Targeted (x86_64)"
}, - {
- "id": "ESXI_6_7_64BIT",
- "name": "ESXi 6.7 (x86_64)"
}, - {
- "id": "ESXI_6_5_64BIT_CSTM",
- "name": "ESXi 6.5 Targeted (x86_64)"
}, - {
- "id": "ESXI_6_5_64BIT",
- "name": "ESXi 6.5 (x86_64)"
}, - {
- "id": "FREEBSD_13_64BIT",
- "name": "FreeBSD 13.1 (amd64)"
}, - {
- "id": "FREEBSD_12_64BIT",
- "name": "FreeBSD 12.3 (amd64)"
}
]
}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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "architecture": "64bit",
- "configurable": true,
- "defaults": {
- "device": "SATA_SAS",
- "partitions": [
- {
- "mountpoint": "/boot",
- "size": "1024",
- "filesystem": "ext2"
}, - {
- "size": "4096",
- "filesystem": "swap"
}, - {
- "mountpoint": "/tmp",
- "size": "4096",
- "filesystem": "ext4"
}, - {
- "mountpoint": "/",
- "size": "*",
- "filesystem": "ext4"
}
]
}, - "family": "centos",
- "features": [
- "PARTITIONING",
- "SW_RAID",
- "TIMEZONE",
- "HOSTNAME",
- "SSH_KEYS",
- "POST_INSTALL_SCRIPTS",
- "CONTROL_PANEL",
- "DB_MARIADB",
- "DB_REDIS",
- "DB_MONGODB",
- "DB_POSTGRESQL"
], - "id": "CENTOS_7_64BIT",
- "name": "CentOS 7 (x86_64)",
- "supportedBootDevices": [
- "SATA_SAS",
- "NVME"
], - "supportedFileSystems": [
- "ext2",
- "ext3",
- "ext4",
- "xfs",
- "swap"
], - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 2
}, - "controlPanels": [
- {
- "id": "CPANEL_PREMIER_100",
- "name": "cPanel Premier 100"
}, - {
- "id": "CPANEL_PREMIER_150",
- "name": "cPanel Premier 150"
}, - {
- "id": "CPANEL_PREMIER_200",
- "name": "cPanel Premier 200"
}, - {
- "id": "CPANEL_PREMIER_250",
- "name": "cPanel Premier 250"
}, - {
- "id": "PLESK_DEDSER_WEB_ADMIN",
- "name": "Plesk Web Admin 10 Domains"
}, - {
- "id": "PLESK_DEDSER_WEB_PRO",
- "name": "Plesk Web Pro 30 Domains"
}, - {
- "id": "PLESK_DEDSER_WEB_HOST",
- "name": "Plesk Web Host Unlimited Domains"
}, - {
- "id": "VESTA",
- "name": "Vesta CP"
}
]
}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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url 'https://api.leaseweb.com/bareMetals/v2/rescueImages?limit=20&offset=10' \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 2
}, - "rescueImages": [
- {
- "id": "GRML",
- "name": "GRML Linux Rescue Image (amd64)"
}, - {
- "id": "CENTOS_7",
- "name": "CentOS 7 Linux Rescue Image (amd64)"
}, - {
- "id": "FREEBSD",
- "name": "FreeBSD Rescue Image (amd64)"
}
]
}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:
path Parameters
| serverId required | string Example: 12345 The ID of a server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/cancelActiveJob \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 500
- 503
{- "bareMetalId": "123",
- "createdAt": "2025-03-17T13:24:25+00:00",
- "currentTask": {
- "uuid": "8a10b74b-2a94-4a3b-88da-b9c07faa240d",
- "status": "CANCELED",
- "description": "dummy placeholder",
- "onError": "break",
- "errorMessage": null,
- "flow": "main",
- "statusTimestamps": {
- "PENDING": "2025-03-17T13:24:20+00:00",
- "WAITING": "2025-03-17T13:24:30+00:00",
- "CANCELED": "2025-03-17T13:24:40+00:00"
}, - "type": "test_task",
- "actor": "server",
- "createdAt": "2025-03-17T13:24:25+00:00",
- "updatedAt": "2025-03-17T13:24:40+00:00",
- "timeout": 32400
}, - "flow": "finally",
- "isRunning": true,
- "metadata": {
- "BATCH_ID": "batch-id-123"
}, - "node": "00:11:22:AA:BB:CC",
- "payload": {
- "os": {
- "type": "linux",
- "name": "Ubuntu 24.04 LTS (64bit)",
- "family": "ubuntu",
- "version": "24.04",
- "architecture": "64bit",
- "engine": "tarbuilder"
}, - "device": "SSD256GB",
- "partitions": [
- {
- "mountpoint": "/boot",
- "filesystem": "ext4",
- "size": "1024"
}, - {
- "filesystem": "swap",
- "size": "4096"
}, - {
- "mountpoint": "/tmp",
- "filesystem": "ext4",
- "size": "4096"
}, - {
- "mountpoint": "/",
- "filesystem": "ext4",
- "size": "*"
}
], - "configurable": true,
- "timezone": "UTC",
- "powerCycle": true,
- "doEmailNotification": false,
- "operatingSystemId": "UBUNTU_24_04_64BIT",
- "raid": {
- "type": "SW",
- "level": 0
}, - "hostname": "s123.dedi.leaseweb.net",
- "sshKeys": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKA8HyZ72HYYYtTCjHeN6rvMVkmTY2hb2nouORWMm8vv noname",
- "network": {
- "public": {
- "ip": "192.168.1.1",
- "mac": "00:AA:BB:CC:DD:EE",
- "cidr": "192.168.1.1/27",
- "prefix": 27,
- "gateway": "192.168.1.1",
- "netmask": "255.255.255.224",
- "network": "192.168.1.0",
- "isCustom": false,
- "broadcast": "192.168.1.31",
- "nameservers": [
- "192.168.1.21",
- "127.0.0.1"
], - "netmask_hex": "0xffffffe0"
}, - "internal": {
- "mac": "00:11:22:33:44:55"
}
}, - "featuresUtilized": [
- "PARTITIONING",
- "HOSTNAME",
- "SSH_KEYS",
- "SW_RAID",
- "TIMEZONE"
], - "features": [
- "PARTITIONING",
- "SW_RAID",
- "TIMEZONE",
- "HOSTNAME",
- "SSH_KEYS",
- "POST_INSTALL_SCRIPTS",
- "CONTROL_PANEL",
- "DB_MARIADB",
- "DB_REDIS",
- "DB_MONGODB",
- "DB_POSTGRESQL"
], - "serverBrand": "SUPERMICRO",
- "serverChassis": "SM 846TQ (24xLFF)",
- "serverHardwareRaid": true,
- "site": "AMS-01",
- "fileserverBaseUrl": "192.168.1.123",
- "initiatedBy": "EMPLOYEE"
}, - "progress": {
- "total": 0,
- "waiting": 0,
- "pending": 0,
- "inprogress": 0,
- "finished": 0,
- "failed": 0,
- "expired": 0,
- "canceled": 1,
- "warning": 0,
- "skipped": 0,
- "percentage": 100
}, - "serverId": "123",
- "status": "CANCELED",
- "tasks": [
- {
- "uuid": "8a10b74b-2a94-4a3b-88da-b9c07faa240d",
- "status": "CANCELED",
- "description": "dummy placeholder",
- "onError": "break",
- "errorMessage": null,
- "flow": "main",
- "statusTimestamps": {
- "PENDING": "2025-03-17T13:24:20+00:00",
- "WAITING": "2025-03-17T13:24:30+00:00",
- "CANCELED": "2025-03-17T13:24:40+00:00"
}, - "type": "test_task",
- "actor": "server",
- "createdAt": "2025-03-17T13:24:25+00:00",
- "updatedAt": "2025-03-17T13:24:40+00:00",
- "timeout": 32400
}
], - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 20,
- "offset": 0,
- "totalCount": 13
}, - "credentials": [
- {
- "type": "REMOTE_MANAGEMENT",
- "username": "admin"
}, - {
- "type": "RESCUE_MODE",
- "username": "root"
}, - {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}, - {
- "type": "CONTROL_PANEL",
- "username": "user"
}, - {
- "type": "SWITCH",
- "username": "admin"
}, - {
- "type": "PDU",
- "username": "root"
}, - {
- "type": "FIREWALL",
- "username": "root"
}, - {
- "type": "LOAD_BALANCER",
- "username": "user"
}, - {
- "type": "VNC",
- "username": "admin"
}, - {
- "type": "TEMPORARY_OPERATING_SYSTEM",
- "username": "root"
}, - {
- "type": "VPN_USER",
- "username": "root"
}, - {
- "type": "COMBINATION_LOCK",
- "username": "user"
}, - {
- "type": "DATABASE",
- "username": "user"
}
]
}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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "password": "mys3cr3tp@ssw0rd",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}Response samples
- 200
- 401
- 403
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 20,
- "offset": 0,
- "totalCount": 2
}, - "credentials": [
- {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}, - {
- "type": "OPERATING_SYSTEM",
- "username": "user"
}
]
}Delete server credentials
This action is purely administrative and will only remove the username and password associated with this resource from our database.
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 401
- 403
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "password": "mys3cr3tp@ssw0rd"
}Response samples
- 200
- 400
- 401
- 403
- 500
- 503
{- "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:
path Parameters
| serverId required | string Example: 12345 The ID of a server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/expireActiveJob \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 500
- 503
{- "bareMetalId": "123",
- "createdAt": "2025-03-17T13:33:25+00:00",
- "currentTask": {
- "uuid": "8a10b74b-2a94-4a3b-88da-b9c07faa240d",
- "status": "EXPIRED",
- "description": "dummy placeholder",
- "onError": "break",
- "errorMessage": null,
- "flow": "main",
- "statusTimestamps": {
- "PENDING": "2025-03-17T13:33:20+00:00",
- "WAITING": "2025-03-17T13:33:30+00:00",
- "EXPIRED": "2025-03-17T13:33:40+00:00"
}, - "type": "test_task",
- "actor": "server",
- "createdAt": "2025-03-17T13:33:25+00:00",
- "updatedAt": "2025-03-17T13:33:40+00:00",
- "timeout": 32400
}, - "flow": "finally",
- "isRunning": true,
- "metadata": {
- "BATCH_ID": "batch-id-123"
}, - "node": "00:11:22:AA:BB:CC",
- "payload": {
- "os": {
- "type": "linux",
- "name": "Ubuntu 24.04 LTS (64bit)",
- "family": "ubuntu",
- "version": "24.04",
- "architecture": "64bit",
- "engine": "tarbuilder"
}, - "device": "SSD256GB",
- "partitions": [
- {
- "mountpoint": "/boot",
- "filesystem": "ext4",
- "size": "1024"
}, - {
- "filesystem": "swap",
- "size": "4096"
}, - {
- "mountpoint": "/tmp",
- "filesystem": "ext4",
- "size": "4096"
}, - {
- "mountpoint": "/",
- "filesystem": "ext4",
- "size": "*"
}
], - "configurable": true,
- "timezone": "UTC",
- "powerCycle": true,
- "doEmailNotification": false,
- "operatingSystemId": "UBUNTU_24_04_64BIT",
- "raid": {
- "type": "SW",
- "level": 0
}, - "hostname": "s123.dedi.leaseweb.net",
- "sshKeys": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKA8HyZ72HYYYtTCjHeN6rvMVkmTY2hb2nouORWMm8vv noname",
- "network": {
- "public": {
- "ip": "192.168.1.1",
- "mac": "00:AA:BB:CC:DD:EE",
- "cidr": "192.168.1.1/27",
- "prefix": 27,
- "gateway": "192.168.1.1",
- "netmask": "255.255.255.224",
- "network": "192.168.1.0",
- "isCustom": false,
- "broadcast": "192.168.1.31",
- "nameservers": [
- "192.168.1.21",
- "127.0.0.1"
], - "netmask_hex": "0xffffffe0"
}, - "internal": {
- "mac": "00:11:22:33:44:55"
}
}, - "featuresUtilized": [
- "PARTITIONING",
- "HOSTNAME",
- "SSH_KEYS",
- "SW_RAID",
- "TIMEZONE"
], - "features": [
- "PARTITIONING",
- "SW_RAID",
- "TIMEZONE",
- "HOSTNAME",
- "SSH_KEYS",
- "POST_INSTALL_SCRIPTS",
- "CONTROL_PANEL",
- "DB_MARIADB",
- "DB_REDIS",
- "DB_MONGODB",
- "DB_POSTGRESQL"
], - "serverBrand": "SUPERMICRO",
- "serverChassis": "SM 846TQ (24xLFF)",
- "serverHardwareRaid": true,
- "site": "AMS-01",
- "fileserverBaseUrl": "192.168.1.123",
- "initiatedBy": "EMPLOYEE"
}, - "progress": {
- "total": 1,
- "waiting": 0,
- "pending": 0,
- "inprogress": 0,
- "finished": 0,
- "failed": 0,
- "expired": 1,
- "canceled": 0,
- "warning": 0,
- "skipped": 0,
- "percentage": 100
}, - "serverId": "123",
- "status": "EXPIRED",
- "tasks": [
- {
- "uuid": "8a10b74b-2a94-4a3b-88da-b9c07faa240d",
- "status": "EXPIRED",
- "description": "dummy placeholder",
- "onError": "break",
- "errorMessage": null,
- "flow": "main",
- "statusTimestamps": {
- "PENDING": "2025-03-17T13:33:20+00:00",
- "WAITING": "2025-03-17T13:33:30+00:00",
- "EXPIRED": "2025-03-17T13:33:40+00:00"
}, - "type": "test_task",
- "actor": "server",
- "createdAt": "2025-03-17T13:33:25+00:00",
- "updatedAt": "2025-03-17T13:33:40+00:00",
- "timeout": 32400
}
], - "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:
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 |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "powerCycle": false
}Response samples
- 202
- 400
- 401
- 403
- 500
- 503
{- "bareMetalId": "519",
- "createdAt": "2025-03-17T13:37:19+00:00",
- "currentTask": {
- "uuid": "8a10b74b-2a94-4a3b-88da-b9c07faa240d",
- "status": "PENDING",
- "description": "dummy placeholder",
- "onError": "break",
- "errorMessage": null,
- "flow": "main",
- "statusTimestamps": {
- "WAITING": "2025-03-17T13:37:19+00:00",
- "PENDING": "2025-03-17T13:37:19+00:00"
}, - "type": "test_task",
- "actor": "server",
- "createdAt": "2025-03-17T13:37:19+00:00",
- "updatedAt": "2025-03-17T13:37:19+00:00",
- "timeout": 32400
}, - "flow": "main",
- "isRunning": true,
- "metadata": {
- "BATCH_ID": "batch-id-123"
}, - "node": "00:11:22:AA:BB:CC",
- "payload": {
- "powerCycle": true,
- "network": {
- "public": {
- "ip": "192.168.1.1",
- "mac": "00:AA:BB:CC:DD:EE",
- "cidr": "192.168.1.1/27",
- "prefix": 27,
- "gateway": "192.168.1.1",
- "netmask": "255.255.255.224",
- "network": "192.168.1.0",
- "isCustom": false,
- "broadcast": "192.168.1.31",
- "nameservers": [
- "192.168.1.21",
- "127.0.0.1"
], - "netmask_hex": "0xffffffe0"
}, - "internal": {
- "mac": "00:11:22:33:44:55"
}
}, - "serverBrand": "SUPERMICRO",
- "serverChassis": "SM 846TQ (24xLFF)",
- "serverHardwareRaid": true,
- "site": "AMS-01",
- "fileserverBaseUrl": "192.168.1.123",
- "initiatedBy": "EMPLOYEE"
}, - "progress": {
- "total": 1,
- "waiting": 0,
- "pending": 1,
- "inprogress": 0,
- "finished": 0,
- "failed": 0,
- "expired": 0,
- "canceled": 0,
- "warning": 0,
- "skipped": 0,
- "percentage": 0
}, - "serverId": "519",
- "status": "ACTIVE",
- "tasks": [
- {
- "uuid": "8a10b74b-2a94-4a3b-88da-b9c07faa240d",
- "status": "PENDING",
- "description": "dummy placeholder",
- "onError": "break",
- "errorMessage": null,
- "flow": "main",
- "statusTimestamps": {
- "WAITING": "2025-03-17T13:37:19+00:00",
- "PENDING": "2025-03-17T13:37:19+00:00"
}, - "type": "test_task",
- "actor": "server",
- "createdAt": "2025-03-17T13:37:19+00:00",
- "updatedAt": "2025-03-17T13:37:19+00:00",
- "timeout": 32400
}
], - "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "aiFrameworks": [
- "PYTORCH",
- "XGBOOST"
], - "controlPanelId": "PLESK_12",
- "device": "SATA2TB",
- "hostname": "ubuntu22.local",
- "operatingSystemId": "UBUNTU_22_04_64BIT",
- "partitions": [
- {
- "filesystem": "ext2",
- "mountpoint": "/boot",
- "size": "1024"
}, - {
- "filesystem": "swap",
- "size": "4096"
}, - {
- "filesystem": "ext4",
- "mountpoint": "/tmp",
- "size": "4096"
}, - {
- "filesystem": "ext4",
- "mountpoint": "/",
- "size": "*"
}
], - "sshKeys": "ssh-rsa AAAAB3NzaC1y... user@domain.com"
}Response samples
- 202
- 400
- 401
- 403
- 500
- 503
{- "bareMetalId": "123",
- "createdAt": "2025-03-17T13:44:47+00:00",
- "currentTask": {
- "uuid": "8a10b74b-2a94-4a3b-88da-b9c07faa240d",
- "status": "PENDING",
- "description": "dummy placeholder",
- "onError": "break",
- "errorMessage": null,
- "flow": "main",
- "statusTimestamps": {
- "PENDING": "2025-03-17T13:44:47+00:00",
- "WAITING": "2025-03-17T13:44:47+00:00"
}, - "type": "test_task",
- "actor": "server",
- "createdAt": "2025-03-17T13:44:47+00:00",
- "updatedAt": "2025-03-17T13:44:47+00:00",
- "timeout": 32400
}, - "flow": "main",
- "isRunning": true,
- "metadata": {
- "BATCH_ID": "batch-id-123"
}, - "node": "00:11:22:AA:BB:CC",
- "payload": {
- "os": {
- "type": "linux",
- "name": "Ubuntu 24.04 LTS (64bit)",
- "family": "ubuntu",
- "version": "24.04",
- "architecture": "64bit",
- "engine": "tarbuilder"
}, - "device": "SSD256GB",
- "partitions": [
- {
- "mountpoint": "/boot",
- "filesystem": "ext4",
- "size": "1024"
}, - {
- "filesystem": "swap",
- "size": "4096"
}, - {
- "mountpoint": "/tmp",
- "filesystem": "ext4",
- "size": "4096"
}, - {
- "mountpoint": "/",
- "filesystem": "ext4",
- "size": "*"
}
], - "configurable": true,
- "timezone": "UTC",
- "powerCycle": true,
- "doEmailNotification": false,
- "operatingSystemId": "UBUNTU_24_04_64BIT",
- "database": {
- "networkType": "PUBLIC",
- "dbName": "test_db",
- "type": "MONGODB"
}, - "raid": {
- "type": "SW",
- "level": 0,
- "numberOfDisks": 2
}, - "hostname": "s123.dedi.leaseweb.net",
- "sshKeys": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKA8HyZ72HYYYtTCjHeN6rvMVkmTY2hb2nouORWMm8vv noname",
- "network": {
- "public": {
- "ip": "192.168.1.1",
- "mac": "00:AA:BB:CC:DD:EE",
- "cidr": "192.168.1.1/27",
- "prefix": 27,
- "gateway": "192.168.1.1",
- "netmask": "255.255.255.224",
- "network": "192.168.1.0",
- "isCustom": false,
- "broadcast": "192.168.1.31",
- "nameservers": [
- "192.168.1.21",
- "127.0.0.1"
], - "netmask_hex": "0xffffffe0"
}, - "internal": {
- "mac": "00:11:22:33:44:55"
}
}, - "featuresUtilized": [
- "PARTITIONING",
- "HOSTNAME",
- "SSH_KEYS",
- "DB_MONGODB",
- "SW_RAID",
- "TIMEZONE"
], - "features": [
- "PARTITIONING",
- "SW_RAID",
- "TIMEZONE",
- "HOSTNAME",
- "SSH_KEYS",
- "POST_INSTALL_SCRIPTS",
- "CONTROL_PANEL",
- "DB_MARIADB",
- "DB_REDIS",
- "DB_MONGODB",
- "DB_POSTGRESQL"
], - "serverBrand": "SUPERMICRO",
- "serverChassis": "SM 846TQ (24xLFF)",
- "serverHardwareRaid": true,
- "site": "AMS-01",
- "fileserverBaseUrl": "192.168.1.123",
- "initiatedBy": "EMPLOYEE"
}, - "progress": {
- "total": 1,
- "waiting": 0,
- "pending": 1,
- "inprogress": 0,
- "finished": 0,
- "failed": 0,
- "expired": 0,
- "canceled": 0,
- "warning": 0,
- "skipped": 0,
- "percentage": 0
}, - "serverId": "123",
- "status": "ACTIVE",
- "tasks": [
- {
- "uuid": "8a10b74b-2a94-4a3b-88da-b9c07faa240d",
- "status": "PENDING",
- "description": "dummy placeholder",
- "onError": "break",
- "errorMessage": null,
- "flow": "main",
- "statusTimestamps": {
- "PENDING": "2018-01-09T10:38:12+00:00",
- "WAITING": "2018-01-09T10:38:12+00:00"
}, - "type": "test_task",
- "actor": "server",
- "createdAt": "2025-03-17T13:37:19+00:00",
- "updatedAt": "2025-03-17T13:37:19+00:00",
- "timeout": 32400
}
], - "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:
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 |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{
}Response samples
- 202
- 400
- 401
- 403
- 500
- 503
{- "bareMetalId": "123",
- "createdAt": "2025-03-17T13:48:15+00:00",
- "currentTask": {
- "uuid": "8a10b74b-2a94-4a3b-88da-b9c07faa240d",
- "status": "PENDING",
- "description": "dummy placeholder",
- "onError": "break",
- "errorMessage": null,
- "flow": "main",
- "statusTimestamps": {
- "WAITING": "2025-03-17T13:48:15+00:00",
- "PENDING": "2025-03-17T13:48:15+00:00"
}, - "type": "test_task",
- "actor": "server",
- "createdAt": "2025-03-17T13:48:15+00:00",
- "updatedAt": "2025-03-17T13:48:15+00:00",
- "timeout": 32400
}, - "flow": "main",
- "isRunning": true,
- "metadata": {
- "BATCH_ID": null
}, - "node": "00:11:22:AA:BB:CC",
- "payload": {
- "powerCycle": true,
- "network": {
- "public": {
- "ip": "213.227.153.72",
- "mac": "00:11:22:AA:BB:CC",
- "cidr": "213.227.153.72/27",
- "prefix": 27,
- "netmask": "255.255.255.224",
- "netmask_hex": "0xffffffe0",
- "gateway": "213.227.153.94",
- "network": "213.227.153.64",
- "broadcast": "213.227.153.95",
- "nameservers": [
- "23.19.53.53",
- "23.19.52.52"
], - "isCustom": false
}, - "internal": {
- "mac": "00:25:90:E6:D3:FD"
}
}, - "serverBrand": "SUPERMICRO",
- "serverChassis": "SM 846TQ (24xLFF)",
- "serverHardwareRaid": true,
- "site": "AMS-01",
- "fileserverBaseUrl": "192.168.1.123",
- "initiatedBy": "EMPLOYEE"
}, - "progress": {
- "total": 1,
- "waiting": 0,
- "pending": 1,
- "inprogress": 0,
- "finished": 0,
- "failed": 0,
- "expired": 0,
- "canceled": 0,
- "warning": 0,
- "skipped": 0,
- "percentage": 0
}, - "serverId": "123",
- "status": "ACTIVE",
- "tasks": [
- {
- "uuid": "8a10b74b-2a94-4a3b-88da-b9c07faa240d",
- "status": "PENDING",
- "description": "dummy placeholder",
- "onError": "break",
- "errorMessage": null,
- "flow": "main",
- "statusTimestamps": {
- "WAITING": "2025-03-17T13:48:15+00:00",
- "PENDING": "2025-03-17T13:48:15+00:00"
}, - "type": "test_task",
- "actor": "server",
- "createdAt": "2025-03-17T13:48:15+00:00",
- "updatedAt": "2025-03-17T13:48:15+00:00",
- "timeout": 32400
}
], - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 1
}, - "jobs": [
- {
- "status": "FINISHED",
- "uuid": "cc2112b7-40fd-2000-b841-04bb1bf5aa1b",
- "type": "install",
- "serverId": "123",
- "bareMetalId": "123",
- "node": "00:11:22:AA:BB:CC",
- "createdAt": "2025-03-11T09:53:49+00:00",
- "updatedAt": "2025-03-11T09:54:46+00:00",
- "flow": "#stop",
- "currentTask": null,
- "progress": {
- "total": 13,
- "waiting": 0,
- "pending": 0,
- "inprogress": 0,
- "finished": 11,
- "failed": 1,
- "expired": 0,
- "canceled": 0,
- "warning": 0,
- "skipped": 1,
- "percentage": 100
}, - "isRunning": false,
- "payload": {
- "os": {
- "name": "Ubuntu 24.04 LTS (Noble Numbat) (64bit)",
- "type": "linux",
- "engine": "tarbuilder",
- "family": "ubuntu",
- "version": "24.04",
- "architecture": "64bit"
}, - "raid": {
- "type": "SW",
- "level": 1,
- "numberOfDisks": 2
}, - "site": "AMS-01",
- "device": "SSD256GB",
- "network": {
- "public": {
- "ip": "192.168.1.1",
- "mac": "00:AA:BB:CC:DD:EE",
- "cidr": "192.168.1.1/27",
- "prefix": 27,
- "gateway": "192.168.1.1",
- "netmask": "255.255.255.224",
- "network": "192.168.1.0",
- "isCustom": false,
- "broadcast": "192.168.1.31",
- "nameservers": [
- "192.168.1.21",
- "127.0.0.1"
], - "netmask_hex": "0xffffffe0"
}, - "internal": {
- "mac": "00:11:22:33:44:55"
}
}, - "features": [
- "PARTITIONING",
- "SW_RAID",
- "TIMEZONE",
- "HOSTNAME",
- "SSH_KEYS",
- "POST_INSTALL_SCRIPTS",
- "CONTROL_PANEL",
- "DB_MARIADB",
- "DB_REDIS",
- "DB_POSTGRESQL",
- "AI_FRAMEWORK_PYTORCH",
- "AI_FRAMEWORK_TENSORFLOW",
- "AI_FRAMEWORK_SCIKIT_LEARN",
- "AI_FRAMEWORK_XGBOOST",
- "AI_FRAMEWORK_HUGGING_FACE",
- "AI_FRAMEWORK_NVIDIA_NGC"
], - "hostname": "s123.dedi.leaseweb.net",
- "timezone": "UTC",
- "partitions": [
- {
- "size": "1024",
- "filesystem": "ext4",
- "mountpoint": "/boot"
}, - {
- "size": "4096",
- "filesystem": "swap"
}, - {
- "size": "4096",
- "filesystem": "ext4",
- "mountpoint": "/tmp"
}, - {
- "size": "1024",
- "filesystem": "xfs",
- "mountpoint": "/test"
}, - {
- "size": "*",
- "filesystem": "ext4",
- "mountpoint": "/"
}
], - "aiFrameworks": [
- "PYTORCH",
- "TENSORFLOW",
- "SCIKIT_LEARN",
- "XGBOOST"
], - "sshKeys": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMRnDNPjhz3WnGO6EPTj/rWqBGXxTNUrPW1uYXkGfQ3J",
- "powerCycle": true,
- "initiatedBy": "EMPLOYEE",
- "serverBrand": "SUPERMICRO",
- "configurable": true,
- "serverChassis": "SM 846TQ (24xLFF)",
- "featuresUtilized": [
- "PARTITIONING",
- "HOSTNAME",
- "SW_RAID",
- "TIMEZONE"
], - "fileserverBaseUrl": "192.168.1.123",
- "operatingSystemId": "UBUNTU_24_04_64BIT",
- "serverHardwareRaid": true,
- "doEmailNotification": true
}
}
]
}Show a job
Get a single job for this server.
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "bareMetalId": "123",
- "createdAt": "2025-03-17T13:44:47+00:00",
- "currentTask": {
- "uuid": "8a10b74b-2a94-4a3b-88da-b9c07faa240d",
- "status": "INPROGRESS",
- "description": "dummy placeholder",
- "onError": "break",
- "errorMessage": null,
- "flow": "main",
- "statusTimestamps": {
- "WAITING": "2025-03-17T13:44:47+00:00",
- "PENDING": "2025-03-17T13:44:52+00:00",
- "INPROGRESS": "2025-03-17T13:44:51+00:00"
}, - "type": "test_task",
- "actor": "server",
- "createdAt": "2025-03-17T13:44:47+00:00",
- "updatedAt": "2025-03-17T13:44:51+00:00",
- "timeout": 32400
}, - "flow": "main",
- "isRunning": true,
- "metadata": {
- "BATCH_ID": "batch-id-123"
}, - "node": "00:11:22:AA:BB:CC",
- "payload": {
- "os": {
- "type": "linux",
- "name": "Ubuntu 24.04 LTS (64bit)",
- "family": "ubuntu",
- "version": "24.04",
- "architecture": "64bit",
- "engine": "tarbuilder"
}, - "device": "SSD256GB",
- "partitions": [
- {
- "mountpoint": "/boot",
- "filesystem": "ext4",
- "size": "1024"
}, - {
- "filesystem": "swap",
- "size": "4096"
}, - {
- "mountpoint": "/tmp",
- "filesystem": "ext4",
- "size": "4096"
}, - {
- "mountpoint": "/",
- "filesystem": "ext4",
- "size": "*"
}
], - "configurable": true,
- "timezone": "UTC",
- "powerCycle": true,
- "doEmailNotification": false,
- "operatingSystemId": "UBUNTU_24_04_64BIT",
- "database": {
- "networkType": "PUBLIC",
- "dbName": "test_db",
- "type": "MONGODB"
}, - "raid": {
- "type": "SW",
- "level": 0,
- "numberOfDisks": 2
}, - "hostname": "s123.dedi.leaseweb.net",
- "sshKeys": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKA8HyZ72HYYYtTCjHeN6rvMVkmTY2hb2nouORWMm8vv noname",
- "network": {
- "public": {
- "ip": "192.168.1.1",
- "mac": "00:AA:BB:CC:DD:EE",
- "cidr": "192.168.1.1/27",
- "prefix": 27,
- "gateway": "192.168.1.1",
- "netmask": "255.255.255.224",
- "network": "192.168.1.0",
- "isCustom": false,
- "broadcast": "192.168.1.31",
- "nameservers": [
- "192.168.1.21",
- "127.0.0.1"
], - "netmask_hex": "0xffffffe0"
}, - "internal": {
- "mac": "00:11:22:33:44:55"
}
}, - "featuresUtilized": [
- "PARTITIONING",
- "HOSTNAME",
- "SSH_KEYS",
- "DB_MONGODB",
- "SW_RAID",
- "TIMEZONE"
], - "features": [
- "PARTITIONING",
- "SW_RAID",
- "TIMEZONE",
- "HOSTNAME",
- "SSH_KEYS",
- "POST_INSTALL_SCRIPTS",
- "CONTROL_PANEL",
- "DB_MARIADB",
- "DB_REDIS",
- "DB_MONGODB",
- "DB_POSTGRESQL"
], - "serverBrand": "SUPERMICRO",
- "serverChassis": "SM 846TQ (24xLFF)",
- "serverHardwareRaid": true,
- "site": "AMS-01",
- "fileserverBaseUrl": "192.168.1.123",
- "initiatedBy": "EMPLOYEE"
}, - "progress": {
- "total": 1,
- "waiting": 0,
- "pending": 0,
- "inprogress": 1,
- "finished": 0,
- "failed": 0,
- "expired": 0,
- "canceled": 0,
- "warning": 0,
- "skipped": 0,
- "percentage": 50
}, - "serverId": "123",
- "status": "ACTIVE",
- "tasks": [
- {
- "uuid": "8a10b74b-2a94-4a3b-88da-b9c07faa240d",
- "status": "INPROGRESS",
- "description": "dummy placeholder",
- "onError": "break",
- "errorMessage": null,
- "flow": "main",
- "statusTimestamps": {
- "WAITING": "2025-03-17T13:44:47+00:00",
- "PENDING": "2025-03-17T13:44:52+00:00",
- "INPROGRESS": "2025-03-17T13:44:51+00:00"
}, - "type": "test_task",
- "actor": "server",
- "createdAt": "2025-03-17T13:44:47+00:00",
- "updatedAt": "2025-03-17T13:44:51+00:00",
- "timeout": 32400
}
], - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 404
- 500
- 503
{- "bareMetalId": "123",
- "createdAt": "2025-03-17T14:01:43+00:00",
- "currentTask": {
- "uuid": "8a10b74b-2a94-4a3b-88da-b9c07faa240d",
- "status": "PENDING",
- "description": "dummy placeholder",
- "onError": "break",
- "errorMessage": null,
- "flow": "main",
- "statusTimestamps": {
- "WAITING": "2025-03-17T13:48:15+00:00",
- "PENDING": "2025-03-17T13:48:15+00:00"
}, - "type": "test_task",
- "actor": "server",
- "createdAt": "2025-03-17T13:48:15+00:00",
- "updatedAt": "2025-03-17T13:48:15+00:00",
- "timeout": 32400
}, - "flow": "main",
- "isRunning": true,
- "metadata": {
- "BATCH_ID": null
}, - "node": "00:11:22:AA:BB:CC",
- "payload": {
- "os": {
- "type": "linux",
- "name": "Ubuntu 24.04 LTS (64bit)",
- "family": "ubuntu",
- "version": "24.04",
- "architecture": "64bit",
- "engine": "tarbuilder"
}, - "device": "SSD256GB",
- "partitions": [
- {
- "mountpoint": "/boot",
- "filesystem": "ext4",
- "size": "1024"
}, - {
- "filesystem": "swap",
- "size": "4096"
}, - {
- "mountpoint": "/tmp",
- "filesystem": "ext4",
- "size": "4096"
}, - {
- "mountpoint": "/",
- "filesystem": "ext4",
- "size": "*"
}
], - "configurable": true,
- "timezone": "UTC",
- "powerCycle": true,
- "doEmailNotification": false,
- "operatingSystemId": "UBUNTU_24_04_64BIT",
- "raid": {
- "type": "SW",
- "level": 0
}, - "hostname": "s123.dedi.leaseweb.net",
- "sshKeys": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKA8HyZ72HYYYtTCjHeN6rvMVkmTY2hb2nouORWMm8vv noname",
- "network": {
- "public": {
- "ip": "192.168.1.1",
- "mac": "00:AA:BB:CC:DD:EE",
- "cidr": "192.168.1.1/27",
- "prefix": 27,
- "netmask": "255.255.255.224",
- "netmask_hex": "0xffffffe0",
- "gateway": "192.168.1.1",
- "network": "192.168.1.0",
- "broadcast": "192.168.1.31",
- "nameservers": [
- "192.168.1.21",
- "127.0.0.1"
], - "isCustom": false
}, - "internal": {
- "mac": "00:11:22:33:44:55"
}
}, - "featuresUtilized": [
- "PARTITIONING",
- "HOSTNAME",
- "SSH_KEYS",
- "SW_RAID",
- "TIMEZONE"
], - "features": [
- "PARTITIONING",
- "SW_RAID",
- "TIMEZONE",
- "HOSTNAME",
- "SSH_KEYS",
- "POST_INSTALL_SCRIPTS",
- "CONTROL_PANEL",
- "DB_MARIADB",
- "DB_REDIS",
- "DB_MONGODB",
- "DB_POSTGRESQL"
], - "serverBrand": "SUPERMICRO",
- "serverChassis": "SM 846TQ (24xLFF)",
- "serverHardwareRaid": true,
- "site": "AMS-01",
- "fileserverBaseUrl": "192.168.1.123",
- "initiatedBy": "EMPLOYEE"
}, - "progress": {
- "total": 1,
- "waiting": 0,
- "pending": 1,
- "inprogress": 0,
- "finished": 0,
- "failed": 0,
- "expired": 0,
- "canceled": 0,
- "warning": 0,
- "skipped": 0,
- "percentage": 0
}, - "serverId": "123",
- "status": "ACTIVE",
- "tasks": [
- {
- "uuid": "8a10b74b-2a94-4a3b-88da-b9c07faa240d",
- "status": "PENDING",
- "description": "dummy placeholder",
- "onError": "break",
- "errorMessage": null,
- "flow": "main",
- "statusTimestamps": {
- "WAITING": "2025-03-17T14:01:43+00:00",
- "PENDING": "2025-03-17T14:01:43+00:00"
}, - "type": "test_task",
- "actor": "server",
- "createdAt": "2025-03-17T14:01:43+00:00",
- "updatedAt": "2025-03-17T14:01:43+00:00",
- "timeout": 32400
}
], - "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:
path Parameters
| serverId required | string Example: 12345 The ID of a server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request DELETE \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/leases \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 401
- 403
- 500
- 503
{- "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:
path Parameters
| serverId required | string Example: 12345 The ID of a server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/leases \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 1
}, - "leases": [
- {
- "createdAt": "2019-10-18T17:31:01+00:00",
- "gateway": "192.168.0.254",
- "hostname": "my-server",
- "ip": "192.168.0.100",
- "lastClientRequest": {
- "relayAgent": null,
- "type": "DHCP_REQUEST",
- "userAgent": "Ubuntu 18.04 dhcpc"
}, - "mac": "AA:BB:CC:DD:EE:FF",
- "netmask": "255.255.255.0",
- "site": "AMS-01",
- "updatedAt": "2019-11-18T19:29:01+00:00"
}
]
}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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "hostname": "my-server"
}Response samples
- 400
- 401
- 403
- 500
- 503
{- "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:
path Parameters
| serverId required | string Example: 12345 The ID of a server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/powerCycle \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 400
- 401
- 403
- 500
- 503
{- "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:
path Parameters
| serverId required | string Example: 12345 The ID of a server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/powerInfo \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 400
- 401
- 403
- 500
- 503
{- "ipmi": {
- "status": "off"
}, - "pdu": {
- "status": "on"
}
}Power off server
Power off the given server.
Authorizations:
path Parameters
| serverId required | string Example: 12345 The ID of a server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/powerOff \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 400
- 401
- 403
- 500
- 503
{- "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:
path Parameters
| serverId required | string Example: 12345 The ID of a server |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/powerOn \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 400
- 401
- 403
- 500
- 503
{- "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:
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 |
| rescueImageId required | string Default: "GRML" Rescue image identifier |
| sshKeys | string User ssh keys |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "powerCycle": true,
- "rescueImageId": "GRML",
- "sshKeys": "ssh-rsa AAAAB3NzaC1y... user@domain.com"
}Response samples
- 202
- 400
- 401
- 403
- 500
- 503
{- "bareMetalId": "123",
- "createdAt": "2025-03-17T14:06:12+00:00",
- "currentTask": {
- "uuid": "8a10b74b-2a94-4a3b-88da-b9c07faa240d",
- "status": "PENDING",
- "description": "dummy placeholder",
- "onError": "break",
- "errorMessage": null,
- "flow": "main",
- "statusTimestamps": {
- "WAITING": "2025-03-17T14:06:12+00:00",
- "PENDING": "2025-03-17T14:06:12+00:00"
}, - "type": "test_task",
- "actor": "server",
- "createdAt": "2025-03-17T14:06:12+00:00",
- "updatedAt": "2025-03-17T14:06:12+00:00",
- "timeout": 32400
}, - "flow": "main",
- "isRunning": true,
- "metadata": {
- "BATCH_ID": null
}, - "node": "00:11:22:33:44:55",
- "payload": {
- "powerCycle": true,
- "doEmailNotification": false,
- "rescueImageId": "ROCKY_LINUX",
- "sshKeys": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKA8HyZ72HYYYtTCjHeN6rvMVkmTY2hb2nouORWMm8vv",
- "network": {
- "public": {
- "ip": "192.168.1.1",
- "mac": "00:11:22:33:44:55",
- "cidr": "192.168.1.1/27",
- "prefix": 27,
- "netmask": "255.255.255.224",
- "netmask_hex": "0xffffffe0",
- "gateway": "192.168.1.1",
- "network": "192.168.1.0",
- "broadcast": "192.168.1.31",
- "nameservers": [
- "192.168.1.21",
- "127.0.0.1"
], - "isCustom": false
}, - "internal": {
- "mac": "00:11:22:33:44:55"
}
}, - "serverBrand": "SUPERMICRO",
- "serverChassis": "SM 846TQ (24xLFF)",
- "serverHardwareRaid": true,
- "site": "AMS-01",
- "fileserverBaseUrl": "192.168.1.123",
- "initiatedBy": "EMPLOYEE"
}, - "progress": {
- "total": 1,
- "waiting": 0,
- "pending": 1,
- "inprogress": 0,
- "finished": 0,
- "failed": 0,
- "expired": 0,
- "canceled": 0,
- "warning": 0,
- "skipped": 0,
- "percentage": 0
}, - "serverId": "123",
- "status": "ACTIVE",
- "tasks": [
- {
- "uuid": "8a10b74b-2a94-4a3b-88da-b9c07faa240d",
- "status": "PENDING",
- "description": "dummy placeholder",
- "onError": "break",
- "errorMessage": null,
- "flow": "main",
- "statusTimestamps": {
- "WAITING": "2025-03-17T14:06:12+00:00",
- "PENDING": "2025-03-17T14:06:12+00:00"
}, - "type": "test_task",
- "actor": "server",
- "createdAt": "2025-03-17T14:06:12+00:00",
- "updatedAt": "2025-03-17T14:06:12+00:00",
- "timeout": 32400
}
], - "type": "rescueMode",
- "updatedAt": "2025-03-17T14:06:12+00:00",
- "uuid": "7f869a99-2c26-4281-bd75-a45786a8c2d2"
}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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 20,
- "offset": 0,
- "totalCount": 2
}, - "networkEquipments": [
- {
- "contract": {
- "customerId": "10085996",
- "deliveryStatus": "ACTIVE",
- "id": "49031391001170",
- "reference": "My Private Switch",
- "salesOrgId": "2000"
}, - "featureAvailability": {
- "automation": true,
- "ipmiReboot": false,
- "powerCycle": true,
- "privateNetwork": false,
- "remoteManagement": false
}, - "id": "12345",
- "location": {
- "rack": "YY11",
- "site": "AMS-01",
- "suite": "HALL3",
- "unit": "21"
}, - "networkInterfaces": {
- "internal": {
- "gateway": null,
- "ip": null,
- "ports": [ ]
}, - "public": {
- "gateway": "127.0.2.254",
- "ip": "127.0.2.1/24",
- "locationId": "",
- "nullRouted": false,
- "ports": [ ]
}, - "remoteManagement": {
- "gateway": null,
- "ip": null,
- "locationId": null,
- "ports": [ ]
}
}, - "type": "SWITCH"
}, - {
- "contract": {
- "customerId": "10085996",
- "deliveryStatus": "ACTIVE",
- "id": "49031513001110",
- "reference": "My Other Private Switch",
- "salesOrgId": "2000"
}, - "featureAvailability": {
- "automation": false,
- "ipmiReboot": false,
- "powerCycle": false,
- "privateNetwork": false,
- "remoteManagement": false
}, - "id": "45678",
- "location": {
- "rack": "XX00",
- "site": "AMS-01",
- "suite": "HALL3",
- "unit": "21"
}, - "networkInterfaces": {
- "internal": {
- "gateway": null,
- "ip": null,
- "ports": [ ]
}, - "public": {
- "gateway": "127.1.1.254",
- "ip": "127.1.1.68/24",
- "locationId": "",
- "nullRouted": false,
- "ports": [ ]
}, - "remoteManagement": {
- "gateway": null,
- "ip": null,
- "locationId": null,
- "ports": [ ]
}
}, - "type": "SWITCH"
}
]
}Get network equipment
Use this API to get information about a single network equipment.
Authorizations:
path Parameters
| networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 401
- 403
- 404
- 500
- 503
{- "contract": {
- "aggregationPackId": null,
- "billingCycle": 1,
- "billingFrequency": "MONTH",
- "contractTerm": 12,
- "contractType": "NORMAL",
- "currency": "EUR",
- "customerId": "10085996",
- "deliveryStatus": "ACTIVE",
- "endsAt": null,
- "id": "49031391001170",
- "networkTraffic": {
- "connectivityType": "INTERCONNECTED",
- "datatrafficLimit": null,
- "datatrafficUnit": null,
- "trafficType": null,
- "type": null
}, - "pricePerFrequency": "0.00",
- "reference": "My Switch",
- "salesOrgId": "2000",
- "sla": "Platinum",
- "startsAt": "2017-08-01T00:00:00Z",
- "status": "ACTIVE",
- "subnets": [ ]
}, - "featureAvailability": {
- "automation": true,
- "ipmiReboot": false,
- "powerCycle": true,
- "privateNetwork": false,
- "remoteManagement": false
}, - "id": "12345",
- "location": {
- "rack": "YY11",
- "site": "AMS-01",
- "suite": "HALL3",
- "unit": "21"
}, - "name": "ABC-DE-001",
- "networkInterfaces": {
- "internal": {
- "gateway": null,
- "ip": null,
- "ports": [ ]
}, - "public": {
- "gateway": "127.0.0..254",
- "ip": "127.0.0..124/24",
- "locationId": "",
- "nullRouted": false,
- "ports": [ ]
}, - "remoteManagement": {
- "gateway": null,
- "ip": null,
- "locationId": null,
- "ports": [ ]
}
}, - "powerPorts": [
- {
- "name": "AMS-01-HALL3-YY11-PDU01",
- "port": "7"
}
], - "rack": {
- "capacity": "",
- "id": "11111"
}, - "serialNumber": "XN51FPD0QX",
- "specs": {
- "brand": "HP",
- "model": "PC 2530-48 J9781A"
}, - "type": "SWITCH"
}Update network equipment
Update the reference for a network equipment.
Authorizations:
path Parameters
| networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
Request Body schema: application/jsonrequired
| reference required | string The reference for this network equipment |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "reference": "my-private-switch"
}Response samples
- 401
- 403
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 2
}, - "ips": [
- {
- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}, - "floatingIp": false,
- "gateway": "12.123.123.254",
- "ip": "12.123.123.1/24",
- "mainIp": true,
- "networkType": "PUBLIC",
- "nullRouted": true,
- "reverseLookup": "domain.example.com",
- "version": 4
}, - {
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}, - "floatingIp": false,
- "gateway": "2001:db8:85a3::8a2e:370:1",
- "ip": "2001:db8:85a3::8a2e:370:7334/64",
- "mainIp": false,
- "networkType": "REMOTE_MANAGEMENT",
- "nullRouted": false,
- "reverseLookup": "domain.example.com",
- "version": 6
}
]
}Show a network equipment IP
Get a single IP address associated with this network equipment.
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 401
- 403
- 500
- 503
{- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}, - "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "detectionProfile": "ADVANCED_LOW_UDP",
- "reverseLookup": "domain.example.com"
}Response samples
- 200
- 400
- 401
- 403
- 500
- 503
{- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}, - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 202
- 400
- 401
- 403
- 500
- 503
{- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}, - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 202
- 400
- 401
- 403
- 500
- 503
{- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}, - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 1
}, - "nullRoutes": [
- {
- "automatedUnnullingAt": "2016-08-12T07:45:33+00:00",
- "comment": "Device Null Route related to DDoS Mitigation",
- "ip": "1.1.1.1/32",
- "nullLevel": 3,
- "nulledAt": "2016-08-12T07:40:27+00:00",
- "ticketId": "282912"
}
]
}List network equipment credentials
The credentials API allows you to store usernames and passwords securely.
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 20,
- "offset": 0,
- "totalCount": 13
}, - "credentials": [
- {
- "type": "REMOTE_MANAGEMENT",
- "username": "admin"
}, - {
- "type": "RESCUE_MODE",
- "username": "root"
}, - {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}, - {
- "type": "CONTROL_PANEL",
- "username": "user"
}, - {
- "type": "SWITCH",
- "username": "admin"
}, - {
- "type": "PDU",
- "username": "root"
}, - {
- "type": "FIREWALL",
- "username": "root"
}, - {
- "type": "LOAD_BALANCER",
- "username": "user"
}, - {
- "type": "VNC",
- "username": "admin"
}, - {
- "type": "TEMPORARY_OPERATING_SYSTEM",
- "username": "root"
}, - {
- "type": "VPN_USER",
- "username": "root"
}, - {
- "type": "COMBINATION_LOCK",
- "username": "user"
}, - {
- "type": "DATABASE",
- "username": "user"
}
]
}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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "password": "mys3cr3tp@ssw0rd",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}Response samples
- 200
- 401
- 403
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "_metadata": {
- "limit": 20,
- "offset": 0,
- "totalCount": 2
}, - "credentials": [
- {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}, - {
- "type": "OPERATING_SYSTEM",
- "username": "user"
}
]
}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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 401
- 403
- 500
- 503
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 401
- 403
- 500
- 503
{- "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "password": "mys3cr3tp@ssw0rd"
}Response samples
- 200
- 400
- 401
- 403
- 500
- 503
{- "password": "mys3cr3tp@ssw0rd",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}Power cycle a network equipment
Powercyle the network equipment.
Authorizations:
path Parameters
| networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/powerCycle \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 400
- 401
- 403
- 500
- 503
{- "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:
path Parameters
| networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/powerInfo \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 400
- 401
- 403
- 500
- 503
{- "pdu": {
- "status": "on"
}
}Power off network equipment
Power off the given network equipment.
Authorizations:
path Parameters
| networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/powerOff \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 400
- 401
- 403
- 500
- 503
{- "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:
path Parameters
| networkEquipmentId required | string Example: 12345 The ID of a dedicated network equipment |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345/powerOn \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 400
- 401
- 403
- 500
- 503
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "400",
- "errorDetails": { },
- "errorMessage": "The API could not interpret your request correctly."
}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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 500
- 503
{- "_metadata": {
- "limit": 20,
- "offset": 0,
- "totalCount": 2
}, - "privateRacks": [
- {
- "contract": {
- "customerId": "2738283",
- "deliveryStatus": "ACTIVE",
- "id": "123456",
- "reference": "AAAA - Private rack 001",
- "salesOrgId": "2000"
}, - "featureAvailability": {
- "powerCycle": false,
- "privateNetwork": false
}, - "id": "123456",
- "location": {
- "rack": "22",
- "site": "AMS-01",
- "suite": "8.24"
}, - "networkInterfaces": {
- "public": {
- "ports": [
- {
- "name": "EVO-BB99-1",
- "port": "0-9"
}
]
}
}
}, - {
- "contract": {
- "customerId": "2738283",
- "deliveryStatus": "ACTIVE",
- "id": "267940",
- "reference": "AAAA - Private rack 002",
- "salesOrgId": "2000"
}, - "featureAvailability": {
- "powerCycle": false,
- "privateNetwork": false
}, - "id": "267940",
- "location": {
- "rack": "MX66",
- "site": "AMS-01",
- "suite": "Hall3"
}, - "networkInterfaces": {
- "public": {
- "ports": [
- {
- "name": "ce99.ams-01",
- "port": "0-1"
}
]
}
}
}
]
}Inspect a dedicated rack
Retrieve information about a single dedicated rack.
Authorizations:
path Parameters
| privateRackId required | string Example: 2314213 Id of the dedicated rack |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 400
- 403
- 404
- 500
- 503
{- "contract": {
- "customerId": "2738283",
- "deliveryStatus": "ACTIVE",
- "endsAt": null,
- "id": "2893829",
- "networkTraffic": {
- "datatrafficLimit": 0,
- "datatrafficUnit": null,
- "trafficType": "CUSTOM",
- "type": "CONNECTIVITY"
}, - "reference": "AAAA - Private rack 002",
- "salesOrgId": "2000",
- "sla": "Platinum - 24x7x½",
- "startsAt": "2017-08-01T00:00:00"
}, - "featureAvailability": {
- "powerCycle": false,
- "privateNetwork": false
}, - "id": "2893829",
- "location": {
- "rack": "MI15",
- "site": "AMS-01",
- "suite": "Hall3"
}, - "networkInterfaces": {
- "public": {
- "ports": [
- {
- "name": "ce05.ams-01",
- "port": "0-26"
}
]
}
}, - "powerPorts": [ ],
- "units": [
- {
- "unit": "1",
- "status": "FREE",
- "connectedUnits": [
- "1"
]
}, - {
- "unit": "13",
- "status": "OCCUPIED",
- "connectedUnits": [
- "13",
- "14"
]
}
]
}Update a dedicated rack
A reference can be used to uniquely identify a dedicated rack with a name, such as
production.
Authorizations:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "reference": "production"
}Response samples
- 400
- 403
- 404
- 500
- 503
{- "correlationId": "945bef2e-1caf-4027-bd0a-8976848f3dee",
- "errorCode": 400,
- "errorDetails": { },
- "errorMessage": "Validation Failed"
}Inspect null route history
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 1
}, - "nullRoutes": [
- {
- "automatedUnnullingAt": "2016-08-12T07:45:33+00:00",
- "comment": "Device Null Route related to DDoS Mitigation",
- "ip": "1.1.1.1/32",
- "nullLevel": 3,
- "nulledAt": "2016-08-12T07:40:27+00:00",
- "ticketId": "282912"
}
]
}List IPs
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
- 500
- 503
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 2
}, - "ips": [
- {
- "ip": "12.123.123.1/24",
- "gateway": "12.123.123.254",
- "floatingIp": false,
- "version": 4,
- "nullRouted": true,
- "reverseLookup": "domain.example.com",
- "mainIp": true,
- "networkType": "PUBLIC",
- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}
}, - {
- "ip": "2001:db8:85a3::8a2e:370:7334/64",
- "gateway": "2001:db8:85a3::8a2e:370:1",
- "floatingIp": false,
- "version": 6,
- "nullRouted": false,
- "reverseLookup": "domain.example.com",
- "mainIp": false,
- "networkType": "REMOTE_MANAGEMENT",
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
]
}Inspect an IP
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 403
- 404
- 500
- 503
{- "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": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}
}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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "reverseLookup": "domain.example.com",
- "detectionProfile": "ADVANCED_LOW_UDP"
}Response samples
- 200
- 400
- 403
- 404
- 500
- 503
{- "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": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}
}Null route an IP
It might take a few minutes before the null route is propagated across the network.
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 202
- 400
- 403
- 404
- 500
- 503
{- "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": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}
}Remove a null route
It might take a few minutes before the change is propagated across the network.
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 202
- 400
- 403
- 404
- 500
- 503
{- "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": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}
}List credentials
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 4
}, - "credentials": [
- {
- "type": "REMOTE_MANAGEMENT",
- "username": "admin"
}, - {
- "type": "REMOTE_MANAGEMENT",
- "username": "root"
}, - {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}, - {
- "type": "OPERATING_SYSTEM",
- "username": "user"
}
]
}Create new credentials
Authorizations:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "type": "OPERATING_SYSTEM",
- "username": "root",
- "password": "my-secret-password"
}Response samples
- 200
- 400
- 403
- 404
{- "password": "mys3cr3tp@ssw0rd",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}List credentials by type
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 1
}, - "credentials": [
- {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
]
}Inspect user credentials
Authorizations:
path Parameters
| privateRackId required | string Example: 2314213 Id of the dedicated rack |
| username required | string |
| type required | string |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
{- "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "password": "Y5TurbBQtP5OzvduSH6g"
}Response samples
- 200
- 403
{- "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:
path Parameters
| privateRackId required | string Example: 2314213 Id of the dedicated rack |
| username required | string |
| type required | string |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 403
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2016-10-20T00:00:00Z",
- "to": "2016-10-22T00:00:00Z",
- "granularity": "DAY",
- "aggregation": "SUM"
}, - "metrics": {
- "UP_PUBLIC": {
- "unit": "B",
- "values": [
- {
- "timestamp": "2016-10-20T00:00:00Z",
- "value": 43212393
}, - {
- "timestamp": "2016-10-21T00:00:00Z",
- "value": 12342929
}
]
}, - "DOWN_PUBLIC": {
- "unit": "B",
- "values": [
- {
- "timestamp": "2016-10-20T00:00:00Z",
- "value": 202499
}, - {
- "timestamp": "2016-10-21T00:00:00Z",
- "value": 29900
}
]
}
}
}Inspect bandwidth metrics
At this moment only bandwidth information for the public interface is supported.
Authorizations:
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 |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 403
- 404
- 500
- 503
{- "_metadata": {
- "from": "2016-10-20T09:00:00Z",
- "to": "2016-10-20T11:00:00Z",
- "granularity": "HOUR",
- "aggregation": "AVG"
}, - "metrics": {
- "UP_PUBLIC": {
- "unit": "bps",
- "values": [
- {
- "timestamp": "2016-10-20T09:00:00Z",
- "value": 43212393
}, - {
- "timestamp": "2016-10-20T10:00:00Z",
- "value": 12342929
}
]
}, - "DOWN_PUBLIC": {
- "unit": "bps",
- "values": [
- {
- "timestamp": "2016-10-20T09:00:00Z",
- "value": 202499
}, - {
- "timestamp": "2016-10-20T10:00:00Z",
- "value": 29900
}
]
}
}
}Inspect DDos notification settings
Authorizations:
path Parameters
| privateRackId required | string Example: 2314213 Id of the dedicated rack |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/privateRacks/2314213/notificationSettings/ddos \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 400
- 403
- 404
- 500
- 503
{- "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "scrubbing": "ENABLED",
- "nulling": "DISABLED"
}Response samples
- 400
- 403
- 404
- 500
- 503
{- "correlationId": "945bef2e-1caf-4027-bd0a-8976848f3dee",
- "errorCode": 400,
- "errorDetails": { },
- "errorMessage": "Validation Failed"
}List bandwidth notification settings
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 2
}, - "bandwidthNotificationSettings": [
- {
- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "frequency": "WEEKLY",
- "id": "12345",
- "lastCheckedAt": "2021-03-16T01:01:41+00:00",
- "threshold": "1",
- "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
- "unit": "Gbps"
}, - {
- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "frequency": "DAILY",
- "id": "123456",
- "lastCheckedAt": "2021-03-16T01:01:41+00:00",
- "threshold": "1",
- "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
- "unit": "Mbps"
}
]
}Create new bandwidth notification setting
Authorizations:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "frequency": "DAILY",
- "unit": "Gbps",
- "threshold": "1"
}Response samples
- 201
- 400
- 403
- 404
{- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
{- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "frequency": "DAILY",
- "unit": "Gbps",
- "threshold": "1"
}Response samples
- 200
- 403
{- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "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:
path Parameters
| notificationId required | string |
| privateRackId required | string Example: 2314213 Id of the dedicated rack |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 403
{- "errorCode": "ACCESS_DENIED",
- "errorMessage": "The access token is expired or invalid."
}List datatraffic notification settings
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 2
}, - "datatrafficNotificationSettings": [
- {
- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "frequency": "WEEKLY",
- "id": "12345",
- "lastCheckedAt": "2021-03-16T01:01:41+00:00",
- "threshold": "1",
- "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
- "unit": "MB"
}, - {
- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "frequency": "DAILY",
- "id": "123456",
- "lastCheckedAt": "2021-03-16T01:01:41+00:00",
- "threshold": "1",
- "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
- "unit": "GB"
}
]
}Create datatraffic notification settings
Authorizations:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "frequency": "DAILY",
- "unit": "MB",
- "threshold": "1"
}Response samples
- 201
- 400
- 403
- 404
{- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
{- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "frequency": "DAILY",
- "unit": "GB",
- "threshold": "1"
}Response samples
- 200
- 403
{- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "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:
path Parameters
| notificationId required | string |
| privateRackId required | string Example: 2314213 Id of the dedicated rack |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 403
{- "errorCode": "ACCESS_DENIED",
- "errorMessage": "The access token is expired or invalid."
}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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 418
{- "_metadata": {
- "limit": 20,
- "offset": 0,
- "totalCount": 1
}, - "colocations": [
- {
- "contract": {
- "customerId": "1234567899",
- "deliveryStatus": "ACTIVE",
- "id": "123456",
- "reference": "AAAA - Colocation 001",
- "salesOrgId": "2000"
}, - "featureAvailability": {
- "powerCycle": false,
- "privateNetwork": false
}, - "id": "123456",
- "location": {
- "rack": "22",
- "site": "AMS-01",
- "suite": "8.24"
}, - "networkInterfaces": {
- "public": {
- "ports": [
- {
- "name": "EVO-BB99-1",
- "port": "0-9"
}
]
}
}
}
]
}Inspect a colocation
Authorizations:
path Parameters
| colocationId required | string Example: 12312 Colocation Id |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/colocations/12312 \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 400
- 403
- 404
- 418
{- "contract": {
- "customerId": "1234567899",
- "deliveryStatus": "ACTIVE",
- "endsAt": null,
- "id": "654321",
- "networkTraffic": {
- "datatrafficLimit": 0,
- "datatrafficUnit": null,
- "trafficType": "CUSTOM",
- "type": "95TH"
}, - "reference": "AAAA - Colocation 002",
- "salesOrgId": "2000",
- "startsAt": "2017-08-01T00:00:00"
}, - "featureAvailability": {
- "powerCycle": false,
- "privateNetwork": false
}, - "id": "654321",
- "location": {
- "rack": "rack name",
- "site": "site label",
- "suite": "suite label"
}, - "networkInterfaces": {
- "public": {
- "ports": [
- {
- "name": "ce05.ams-01",
- "port": "0-26"
}
]
}
}, - "powerPorts": [ ],
- "units": [
- {
- "unit": "1",
- "status": "FREE",
- "connectedUnits": [
- "1"
]
}, - {
- "unit": "13",
- "status": "OCCUPIED",
- "connectedUnits": [
- "13",
- "14"
]
}
]
}Update a colocation
A reference can be set to uniquely identify a colocation with a name, such as
production.
Authorizations:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "reference": "production"
}Response samples
- 400
- 403
- 404
- 418
{- "correlationId": "945bef2e-1caf-4027-bd0a-8976848f3dee",
- "errorCode": 400,
- "errorDetails": { },
- "errorMessage": "Validation Failed"
}Inspect null route history
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 1
}, - "nullRoutes": [
- {
- "automatedUnnullingAt": "2016-08-12T07:45:33+00:00",
- "comment": "Device Null Route related to DDoS Mitigation",
- "ip": "1.1.1.1/32",
- "nullLevel": 3,
- "nulledAt": "2016-08-12T07:40:27+00:00",
- "ticketId": "282912"
}
]
}List IPs
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
- 418
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 2
}, - "ips": [
- {
- "ip": "12.123.123.1/24",
- "gateway": "12.123.123.254",
- "floatingIp": false,
- "version": 4,
- "nullRouted": true,
- "reverseLookup": "domain.example.com",
- "mainIp": true,
- "networkType": "PUBLIC",
- "ddos": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}
}, - {
- "ip": "2001:db8:85a3::8a2e:370:7334/64",
- "gateway": "2001:db8:85a3::8a2e:370:1",
- "floatingIp": false,
- "version": 6,
- "nullRouted": false,
- "reverseLookup": "domain.example.com",
- "mainIp": false,
- "networkType": "REMOTE_MANAGEMENT",
- "ddos": {
- "detectionProfile": "STANDARD_DEFAULT",
- "protectionType": "STANDARD"
}
}
]
}Inspect an IP
Authorizations:
path Parameters
| ip required | string Example: 192.168.0.1 IP Address |
| colocationId required | string Example: 12312 Colocation Id |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 403
- 404
- 418
{- "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": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}
}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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "reverseLookup": "domain.example.com",
- "detectionProfile": "ADVANCED_LOW_UDP"
}Response samples
- 200
- 400
- 403
- 404
- 418
{- "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": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}
}Null route an IP
It might take a few minutes before the null route is propagated across the network.
Authorizations:
path Parameters
| colocationId required | string Example: 12312 Colocation Id |
| ip required | string Example: 192.168.0.1 IP Address |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 202
- 400
- 403
- 404
- 418
{- "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": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}
}Remove a null route
It might take a few minutes before the removal is propagated across the network.
Authorizations:
path Parameters
| ip required | string Example: 192.168.0.1 IP Address |
| colocationId required | string Example: 12312 Colocation Id |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 202
- 400
- 403
- 404
- 418
{- "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": {
- "detectionProfile": "ADVANCED_LOW_UDP",
- "protectionType": "ADVANCED"
}
}List credentials
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 4
}, - "credentials": [
- {
- "type": "REMOTE_MANAGEMENT",
- "username": "admin"
}, - {
- "type": "REMOTE_MANAGEMENT",
- "username": "root"
}, - {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}, - {
- "type": "OPERATING_SYSTEM",
- "username": "user"
}
]
}Create new credentials
Authorizations:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "type": "OPERATING_SYSTEM",
- "username": "root",
- "password": "my-secret-password"
}Response samples
- 200
- 400
- 403
- 404
{- "password": "mys3cr3tp@ssw0rd",
- "type": "OPERATING_SYSTEM",
- "username": "root"
}List credentials by type
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 1
}, - "credentials": [
- {
- "type": "OPERATING_SYSTEM",
- "username": "root"
}
]
}Inspect user credentials
Authorizations:
path Parameters
| type required | string |
| username required | string |
| colocationId required | string Example: 12312 Colocation Id |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
{- "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "password": "Y5TurbBQtP5OzvduSH6g"
}Response samples
- 200
- 403
{- "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:
path Parameters
| type required | string |
| username required | string |
| colocationId required | string Example: 12312 Colocation Id |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 403
{- "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 403
- 404
- 418
- 500
- 503
{- "_metadata": {
- "from": "2016-10-20T00:00:00Z",
- "to": "2016-10-22T00:00:00Z",
- "granularity": "DAY",
- "aggregation": "SUM"
}, - "metrics": {
- "UP_PUBLIC": {
- "unit": "B",
- "values": [
- {
- "timestamp": "2016-10-20T00:00:00Z",
- "value": 43212393
}, - {
- "timestamp": "2016-10-21T00:00:00Z",
- "value": 12342929
}
]
}, - "DOWN_PUBLIC": {
- "unit": "B",
- "values": [
- {
- "timestamp": "2016-10-20T00:00:00Z",
- "value": 202499
}, - {
- "timestamp": "2016-10-21T00:00:00Z",
- "value": 29900
}
]
}
}
}Inspect bandwidth metrics
At this moment only bandwidth information for the public interface is supported.
Authorizations:
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 |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 400
- 403
- 404
- 418
- 500
- 503
{- "_metadata": {
- "from": "2016-10-20T09:00:00Z",
- "to": "2016-10-20T11:00:00Z",
- "granularity": "HOUR",
- "aggregation": "AVG"
}, - "metrics": {
- "UP_PUBLIC": {
- "unit": "bps",
- "values": [
- {
- "timestamp": "2016-10-20T09:00:00Z",
- "value": 43212393
}, - {
- "timestamp": "2016-10-20T10:00:00Z",
- "value": 12342929
}
]
}, - "DOWN_PUBLIC": {
- "unit": "bps",
- "values": [
- {
- "timestamp": "2016-10-20T09:00:00Z",
- "value": 202499
}, - {
- "timestamp": "2016-10-20T10:00:00Z",
- "value": 29900
}
]
}
}
}Inspect public network interface
Authorizations:
path Parameters
| colocationId required | string Example: 12312 Colocation Id |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/colocations/12312/networkInterfaces/public \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 403
- 404
- 418
- 500
- 503
{- "linkSpeed": "100Mbps",
- "status": "OPEN",
- "switchInterface": "33",
- "switchName": "EVO-JV12-1",
- "type": "PUBLIC"
}Open or close public network interface
Authorizations:
path Parameters
| action required | string |
| colocationId required | string Example: 12312 Colocation Id |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 403
- 404
- 418
- 500
- 503
{- "errorCode": "ACCESS_DENIED",
- "errorMessage": "The access token is expired or invalid."
}Inspect DDoS notification settings
Authorizations:
path Parameters
| colocationId required | string Example: 12312 Colocation Id |
Responses
Request samples
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/colocations/12312/notificationSettings/ddos \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
Response samples
- 200
- 400
- 403
- 404
- 418
- 500
- 503
{- "nulling": "ENABLED",
- "scrubbing": "DISABLED"
}Update DDoS notifications settings
Authorizations:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "scrubbing": "ENABLED",
- "nulling": "DISABLED"
}Response samples
- 400
- 403
- 404
- 418
- 500
- 503
{- "correlationId": "945bef2e-1caf-4027-bd0a-8976848f3dee",
- "errorCode": 400,
- "errorDetails": { },
- "errorMessage": "Validation Failed"
}List bandwidth notification settings
Authorizations:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 2
}, - "bandwidthNotificationSettings": [
- {
- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "frequency": "WEEKLY",
- "id": "12345",
- "lastCheckedAt": "2021-03-16T01:01:41+00:00",
- "threshold": "1",
- "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
- "unit": "Gbps"
}, - {
- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "frequency": "DAILY",
- "id": "123456",
- "lastCheckedAt": "2021-03-16T01:01:41+00:00",
- "threshold": "1",
- "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
- "unit": "Mbps"
}
]
}Create new bandwidth notification settings
Authorizations:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "frequency": "DAILY",
- "unit": "Gbps",
- "threshold": "1"
}Response samples
- 201
- 400
- 403
- 404
{- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "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:
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
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
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
- 200
- 403
- 404
{- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "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:
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
- Payload
- Shell + Curl
- Python + Python3
- Php + Http2
- Javascript + Jquery
- Go + Native
{- "frequency": "DAILY",
- "unit": "Gbps",
- "threshold": "1"
}Response samples
- 200
- 403
{- "actions": [
- {
- "lastTriggeredAt": "2021-03-16T01:01:44+00:00",
- "type": "EMAIL"
}
], - "frequency": "WEEKLY",
- "id": "12345",
- "lastCheckedAt": "2021-03-16T01:01:41+00:00",
- "threshold": "1",
- "thresholdExceededAt": "2021-03-16T01:01:41+00:00",
- "unit": "Gbps"
}