### Launch OS Installation Source: https://context7.com/leaseweb/api-definitions/llms.txt Install or reinstall an operating system on a dedicated server. Supports custom partitioning, RAID configuration, SSH key injection, hostname, control panel, timezone, post-install scripts, and AI framework setup. Returns a job object (HTTP 202) that can be polled for progress. ```APIDOC ## POST /bareMetals/v2/servers/{serverId}/install — Launch OS installation Install or reinstall an operating system on a dedicated server. Supports custom partitioning, RAID configuration, SSH key injection, hostname, control panel, timezone, post-install scripts, and AI framework setup. Returns a job object (HTTP 202) that can be polled for progress. ### Method POST ### Endpoint /bareMetals/v2/servers/{serverId}/install ### Parameters #### Path Parameters - **serverId** (string) - Required - The ID of the server to install the OS on. #### Request Body - **operatingSystemId** (string) - Required - The ID of the operating system to install. - **hostname** (string) - Optional - The desired hostname for the server. - **device** (string) - Optional - The primary storage device for the OS installation. - **controlPanelId** (string) - Optional - The ID of the control panel to install. - **sshKeys** (string) - Optional - SSH public keys to be added to the server. - **powerCycle** (boolean) - Optional - Whether to power cycle the server after installation. - **timezone** (string) - Optional - The timezone to set for the server. - **partitions** (array) - Optional - Custom partition scheme. - **mountpoint** (string) - The mount point for the partition. - **filesystem** (string) - The filesystem type. - **size** (string) - The size of the partition (e.g., '1024' or '*'). - **raid** (object) - RAID configuration. - **type** (string) - The RAID type (e.g., 'SW'). - **level** (integer) - The RAID level (e.g., 1). - **numberOfDisks** (integer) - The number of disks to use for RAID. - **callbackUrl** (string) - Optional - A URL to notify upon completion of the installation job. ### Request Example ```bash curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/install \ --header 'X-LSW-Auth: YOUR_API_KEY' \ --header 'content-type: application/json' \ --data '{ "operatingSystemId": "UBUNTU_22_04_64BIT", "hostname": "db01.example.com", "device": "SATA2TB", "controlPanelId": "PLESK_12", "sshKeys": "ssh-rsa AAAAB3NzaC1y... user@domain.com", "powerCycle": true, "timezone": "Europe/Amsterdam", "partitions": [ { "mountpoint": "/boot", "filesystem": "ext2", "size": "1024" }, { "filesystem": "swap", "size": "4096" }, { "mountpoint": "/tmp", "filesystem": "ext4", "size": "4096" }, { "mountpoint": "/", "filesystem": "ext4", "size": "*" } ], "raid": { "type": "SW", "level": 1, "numberOfDisks": 2 }, "callbackUrl": "https://example.com/callback" }' ``` ### Response #### Success Response (202 Accepted) - **uuid** (string) - The unique identifier for the installation job. #### Response Example ```json { "uuid": "a1b22827-b6aa-47ce-abad-6bc28a70223d" } ``` ``` -------------------------------- ### Start an instance Source: https://context7.com/leaseweb/api-definitions/llms.txt Starts a stopped Public Cloud instance. This operation returns an HTTP 202 Accepted status upon successful initiation. ```APIDOC ## POST /publicCloud/v1/instances/{instanceId}/start ### Description Start a stopped Public Cloud instance. Returns HTTP 202 Accepted. ### Method POST ### Endpoint /publicCloud/v1/instances/{instanceId}/start ### Parameters #### Path Parameters - **instanceId** (string) - Required - The ID of the instance to start. ### Request Example ```bash curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/start \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` ### Response #### Success Response (202 Accepted) Indicates that the request to start the instance has been accepted. #### Response Example HTTP 202 Accepted ``` -------------------------------- ### Install Operating System on Dedicated Server Source: https://context7.com/leaseweb/api-definitions/llms.txt Install or reinstall an OS on a dedicated server with options for custom partitioning, RAID, SSH keys, hostname, control panel, timezone, and post-install scripts. Returns a job object for progress tracking. ```bash # Install Ubuntu 22.04 with custom partitions and SSH key curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/install \ --header 'X-LSW-Auth: YOUR_API_KEY' \ --header 'content-type: application/json' \ --data '{ "operatingSystemId": "UBUNTU_22_04_64BIT", "hostname": "db01.example.com", "device": "SATA2TB", "controlPanelId": "PLESK_12", "sshKeys": "ssh-rsa AAAAB3NzaC1y... user@domain.com", "powerCycle": true, "timezone": "Europe/Amsterdam", "partitions": [ { "mountpoint": "/boot", "filesystem": "ext2", "size": "1024" }, { "filesystem": "swap", "size": "4096" }, { "mountpoint": "/tmp", "filesystem": "ext4", "size": "4096" }, { "mountpoint": "/", "filesystem": "ext4", "size": "*" } ], "raid": { "type": "SW", "level": 1, "numberOfDisks": 2 }, "callbackUrl": "https://example.com/callback" }' ``` ```json # Response (HTTP 202 Accepted) # { # "uuid": "a1b22827-b6aa-47ce-abad-6bc28a70223d", # } ``` -------------------------------- ### Start Public Cloud Instance Source: https://context7.com/leaseweb/api-definitions/llms.txt Initiates the startup process for a stopped Public Cloud instance. This operation returns an HTTP 202 Accepted status upon successful request. ```bash # Start a stopped instance curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/start \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` -------------------------------- ### Authentication Example Source: https://context7.com/leaseweb/api-definitions/llms.txt All API calls require the `X-LSW-Auth` header. API keys are managed via the Customer Portal or the API Key Management API. ```APIDOC ## Authentication All API calls require the `X-LSW-Auth` header. API keys are managed via the Customer Portal or the API Key Management API (`/apiKeys/v1/`). ```bash # Every request must include the auth header curl --request GET \ --url 'https://api.leaseweb.com/bareMetals/v2/servers' \ --header 'X-LSW-Auth: YOUR_API_KEY' # Error response when auth is missing or invalid (HTTP 401) # { # "errorCode": "AUTH00003", # "errorMessage": "The access token is expired or invalid.", # "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be", # "userMessage": "There are validation errors.", # "reference": "https://developer.leaseweb.com/errors/AUTH00003" # } ``` ``` -------------------------------- ### Get instance details Source: https://context7.com/leaseweb/api-definitions/llms.txt Retrieves comprehensive details for a specific Public Cloud instance, including its current state, IP addresses, associated resources, and contract information. ```APIDOC ## GET /publicCloud/v1/instances/{instanceId} ### Description Retrieve full details of a specific Public Cloud instance including its state, IPs, attached ISO, contract, resources, and associated auto-scaling group. ### Method GET ### Endpoint /publicCloud/v1/instances/{instanceId} ### Parameters #### Path Parameters - **instanceId** (string) - Required - The ID of the instance to retrieve details for. ### Request Example ```bash curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1 \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the instance. - **reference** (string) - The reference name of the instance. - **region** (string) - The region where the instance is located. - **productType** (string) - The type of product (e.g., INSTANCE). - **contract** (object) - Details about the instance's contract. - **type** (string) - The contract type (e.g., HOURLY). - **state** (string) - The current state of the contract (e.g., ACTIVE). - **sla** (string) - The Service Level Agreement for the contract. - **image** (object) - Details about the image used for the instance. - **id** (string) - The image ID. - **name** (string) - The image name. - **family** (string) - The image family (e.g., linux). - **ips** (array) - A list of IP addresses associated with the instance. - **ip** (string) - The IP address. - **prefixLength** (string) - The prefix length of the IP address. - **networkType** (string) - The type of network (e.g., INTERNAL). - **mainIp** (boolean) - Indicates if this is the main IP address. - **resources** (object) - The resources allocated to the instance. - **cpu** (object) - CPU details. - **value** (integer) - The number of vCPUs. - **unit** (string) - The unit for CPU (e.g., vCPU). - **memory** (object) - Memory details. - **value** (integer) - The amount of memory. - **unit** (string) - The unit for memory (e.g., GiB). - **hasPublicIpV4** (boolean) - Indicates if the instance has a public IPv4 address. - **hasPrivateNetwork** (boolean) - Indicates if the instance is connected to a private network. #### Response Example ```json { "id": "ace712e9-a166-47f1-9065-4af0f7e7fce1", "reference": "my webserver", "region": "eu-west-3", "productType": "INSTANCE", "contract": { "type": "HOURLY", "state": "ACTIVE", "sla": "Basic" }, "image": { "id": "UBUNTU_20_04_64BIT", "name": "Ubuntu 20.04 LTS (x86_64)", "family": "linux" }, "ips": [ { "ip": "10.32.60.12", "prefixLength": "27", "networkType": "INTERNAL", "mainIp": false } ], "resources": { "cpu": { "value": 1, "unit": "vCPU" }, "memory": { "value": 3, "unit": "GiB" } }, "hasPublicIpV4": true, "hasPrivateNetwork": false } ``` ``` -------------------------------- ### List Server Jobs Source: https://context7.com/leaseweb/api-definitions/llms.txt List all provisioning jobs for a server. Supports filtering by type, status, and running status. Useful for tracking the progress of operations like installations or rescue mode. ```bash # List running install jobs for server 12345 curl --request GET \ --url 'https://api.leaseweb.com/bareMetals/v2/servers/12345/jobs?type=install&isRunning=true&limit=10' \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` -------------------------------- ### Get Public Cloud Instance Details Source: https://context7.com/leaseweb/api-definitions/llms.txt Retrieves comprehensive details for a specific Public Cloud instance. Information includes state, IP addresses, contract status, resources, and associated auto-scaling groups. ```bash # Get details for a specific instance curl --request GET \ --url https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1 \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` -------------------------------- ### Get Server Bandwidth Metrics Source: https://context7.com/leaseweb/api-definitions/llms.txt Retrieve bandwidth metrics for a server's public interface over a specified time range. Supports custom granularity and aggregation methods. ```bash # Get average daily bandwidth for June 2024 curl --request GET \ --url 'https://api.leaseweb.com/bareMetals/v2/servers/12345/metrics/bandwidth?from=2024-06-01T00:00:00Z&to=2024-06-30T00:00:00Z&granularity=DAY&aggregation=AVG' \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` -------------------------------- ### List Server Credentials Source: https://context7.com/leaseweb/api-definitions/llms.txt Retrieve a list of all stored credentials for a server, including OS passwords, IPMI, and rescue mode credentials. Passwords are set during installations and IPMI resets. ```bash # List all credentials for server 12345 curl --request GET \ --url 'https://api.leaseweb.com/bareMetals/v2/servers/12345/credentials' \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` -------------------------------- ### Get bandwidth metrics Source: https://context7.com/leaseweb/api-definitions/llms.txt Retrieves bandwidth metrics for a server's public interface over a specified time range, with options for granularity and aggregation. ```APIDOC ## GET /bareMetals/v2/servers/{serverId}/metrics/bandwidth — Get bandwidth metrics Retrieve bandwidth metrics for a server's public interface over a given time range. Supports `granularity` (`5MIN`, `HOUR`, `DAY`, `WEEK`, `MONTH`, `YEAR`) and `aggregation` (`AVG`, `95TH`). ### Method GET ### Endpoint /bareMetals/v2/servers/{serverId}/metrics/bandwidth ### Parameters #### Path Parameters - **serverId** (string) - Required - The ID of the server. #### Query Parameters - **from** (string) - Required - The start of the time range (ISO 8601 format). - **to** (string) - Required - The end of the time range (ISO 8601 format). - **granularity** (string) - Optional - The granularity of the metrics (e.g., "5MIN", "DAY"). - **aggregation** (string) - Optional - The aggregation method for the metrics (e.g., "AVG", "95TH"). ### Response #### Success Response (200 OK) (Response body structure not fully detailed in source, but implies a structure containing bandwidth data.) ``` -------------------------------- ### Common Error Response Format - Resource Not Found Source: https://context7.com/leaseweb/api-definitions/llms.txt Example of a common error response when a requested resource is not found, resulting in an HTTP 404 Not Found status. ```json # Response (HTTP 404) # { # "errorCode": "APP00400", # "errorMessage": "SERVER_NOT_FOUND", # "correlationId": "550e8400-e29b-41d4-a716-446655440000", # "userMessage": "The server ID does not exist in your account.", # "reference": "https://developer.leaseweb.com/errors/APP00400" # } ``` -------------------------------- ### Common Error Response Format - Invalid API Key Source: https://context7.com/leaseweb/api-definitions/llms.txt Example of a common error response when using an invalid API key, resulting in an HTTP 401 Unauthorized status. ```bash # Example: calling with an invalid API key (HTTP 401) curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/servers \ --header 'X-LSW-Auth: INVALID_KEY' ``` -------------------------------- ### Launch Public Cloud Instance Source: https://context7.com/leaseweb/api-definitions/llms.txt Launches a new Public Cloud instance with specified configurations. Requires region, type, imageId, contractType, and billingFrequency. Optional parameters include userData, SSH keys, and disk details. ```bash # Launch a large Ubuntu instance in eu-west-3 on a monthly contract curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/instances \ --header 'X-LSW-Auth: YOUR_API_KEY' \ --header 'content-type: application/json' \ --data '{ "region": "eu-west-3", "type": "lsw.m3.large", "imageId": "UBUNTU_22_04_64BIT", "contractType": "MONTHLY", "contractTerm": 12, "billingFrequency": 1, "reference": "my-webserver", "rootDiskSize": 50, "rootDiskStorageType": "CENTRAL", "sshKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQ... user@host", "userData": "#cloud-config\npackages:\n - nginx\nruncmd:\n - systemctl enable nginx\n - systemctl start nginx\n" }' ``` -------------------------------- ### Launch a cloud instance Source: https://context7.com/leaseweb/api-definitions/llms.txt Launches a new Public Cloud instance with specified configurations including region, type, image, and contract details. Optional parameters allow for user data, SSH keys, and disk configurations. ```APIDOC ## POST /publicCloud/v1/instances ### Description Launch a new Public Cloud instance. Requires `region`, `type`, `imageId`, `contractType`, and `billingFrequency`. Optionally supply `userData` (cloud-init), SSH keys, root disk size/type, and marketplace app. ### Method POST ### Endpoint /publicCloud/v1/instances ### Parameters #### Request Body - **region** (string) - Required - The region where the instance will be launched. - **type** (string) - Required - The instance type (e.g., lsw.m3.large). - **imageId** (string) - Required - The ID of the image to use for the instance. - **contractType** (string) - Required - The type of contract (e.g., MONTHLY, HOURLY). - **billingFrequency** (integer) - Required - The billing frequency. - **contractTerm** (integer) - Optional - The contract term in months. - **reference** (string) - Optional - A reference name for the instance. - **rootDiskSize** (integer) - Optional - The size of the root disk in GB. - **rootDiskStorageType** (string) - Optional - The storage type for the root disk (e.g., CENTRAL). - **sshKey** (string) - Optional - The SSH public key for accessing the instance. - **userData** (string) - Optional - Cloud-init user data script. ### Request Example ```json { "region": "eu-west-3", "type": "lsw.m3.large", "imageId": "UBUNTU_22_04_64BIT", "contractType": "MONTHLY", "contractTerm": 12, "billingFrequency": 1, "reference": "my-webserver", "rootDiskSize": 50, "rootDiskStorageType": "CENTRAL", "sshKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQ... user@host", "userData": "#cloud-config\npackages:\n - nginx\nruncmd:\n - systemctl enable nginx\n - systemctl start nginx\n" } ``` ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier of the launched instance. - **reference** (string) - The reference name of the instance. - **region** (string) - The region where the instance was launched. - **productType** (string) - The type of product (e.g., INSTANCE). - **contract** (object) - Details about the instance's contract. - **type** (string) - The contract type. - **term** (integer) - The contract term. - **billingFrequency** (integer) - The billing frequency. - **state** (string) - The state of the contract (e.g., PENDING). - **image** (object) - Details about the image used for the instance. - **id** (string) - The image ID. - **name** (string) - The image name. - **resources** (object) - The resources allocated to the instance. - **cpu** (object) - CPU details. - **value** (integer) - The number of vCPUs. - **unit** (string) - The unit for CPU (e.g., vCPU). - **memory** (object) - Memory details. - **value** (integer) - The amount of memory. - **unit** (string) - The unit for memory (e.g., GiB). #### Response Example ```json { "id": "ace712e9-a166-47f1-9065-4af0f7e7fce1", "reference": "my-webserver", "region": "eu-west-3", "productType": "INSTANCE", "contract": { "type": "MONTHLY", "term": 12, "billingFrequency": 1, "state": "PENDING" }, "image": { "id": "UBUNTU_22_04_64BIT", "name": "Ubuntu 22.04 LTS (x86_64)" }, "resources": { "cpu": { "value": 4, "unit": "vCPU" }, "memory": { "value": 8, "unit": "GiB" } } } ``` ``` -------------------------------- ### Enable rescue mode Source: https://context7.com/leaseweb/api-definitions/llms.txt Boots a server into rescue mode for troubleshooting. Supports specifying rescue image, SSH keys, power cycle behavior, and callback URL or post-install script. ```APIDOC ## POST /bareMetals/v2/servers/{serverId}/rescueMode — Enable rescue mode Boot a server into rescue mode for troubleshooting an unreachable OS. Optionally specify a rescue image, SSH keys, power cycle behavior, and a callback URL or post-install script (base64 encoded, must start with a shebang). ### Method POST ### Endpoint /bareMetals/v2/servers/{serverId}/rescueMode ### Parameters #### Path Parameters - **serverId** (string) - Required - The ID of the server to enable rescue mode on. #### Request Body - **rescueImageId** (string) - Optional - The ID of the rescue image to use. - **powerCycle** (boolean) - Optional - Whether to automatically power cycle the server after enabling rescue mode. - **sshKeys** (string) - Optional - SSH public keys to add for access. - **callbackUrl** (string) - Optional - A URL to notify upon completion. - **postInstallScript** (string) - Optional - A base64 encoded script to run after installation. ### Request Example ```json { "rescueImageId": "GRML", "powerCycle": true, "sshKeys": "ssh-rsa AAAAB3NzaC1y... user@domain.com", "callbackUrl": "https://example.com/rescue-done", "postInstallScript": "IyEvdXNyL2Jpbi9lbnYgYmFzaAplY2hvICJSZXNjdWUgbW9kZSByZWFkeSIK" } ``` ### Response #### Success Response (202 Accepted) - **uuid** (string) - The unique identifier for the job. - **serverId** (string) - The ID of the server. - **type** (string) - The type of operation (e.g., "rescue_mode"). - **status** (string) - The current status of the operation (e.g., "ACTIVE"). - **isRunning** (boolean) - Indicates if the operation is currently running. ``` -------------------------------- ### Reboot a VPS Source: https://context7.com/leaseweb/api-definitions/llms.txt Reboot a Virtual Private Server. ```APIDOC ## POST /publicCloud/v1/vps/{vpsId}/reboot — Reboot a VPS ### Description Reboot a Virtual Private Server. ### Method POST ### Endpoint /publicCloud/v1/vps/{vpsId}/reboot ### Request Example ```bash curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/vps/vps-id-12345/reboot \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` ### Response #### Success Response (202 Accepted) No specific response body details provided in the source. ``` -------------------------------- ### List All IPs Source: https://context7.com/leaseweb/api-definitions/llms.txt Lists all IP addresses across your account with extensive filtering options including version, type, and null-route status. ```bash # List all non-null-routed IPv4 addresses curl --request GET \ --url 'https://api.leaseweb.com/ipMgmt/v2/ips?version=4&nullRouted=false&type=NORMAL_IP&limit=50' \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` -------------------------------- ### List all IPs Source: https://context7.com/leaseweb/api-definitions/llms.txt List all IPs across your account with extensive filter options. ```APIDOC ## GET /ipMgmt/v2/ips — List all IPs ### Description List all IPs across your account. Extensive filter options: `subnetId`, protocol `version` (4 or 6), `type` (`NORMAL_IP`, `GATEWAY`, `IPMI`, etc.), `nullRouted`, `primary`, IP range (`fromIp`/`toIp`), specific `ips` CSV, `equipmentIds`, `reverseLookup`. ### Method GET ### Endpoint /ipMgmt/v2/ips ### Parameters #### Query Parameters - **subnetId** (string) - Optional - Filter by subnet ID. - **version** (integer) - Optional - Filter by IP version (4 or 6). - **type** (string) - Optional - Filter by IP type (e.g., `NORMAL_IP`, `GATEWAY`, `IPMI`). - **nullRouted** (boolean) - Optional - Filter by null-routed status. - **primary** (boolean) - Optional - Filter by primary IP status. - **fromIp** (string) - Optional - Filter by IP range start. - **toIp** (string) - Optional - Filter by IP range end. - **ips** (string) - Optional - Filter by a comma-separated list of IPs. - **equipmentIds** (string) - Optional - Filter by equipment IDs. - **reverseLookup** (string) - Optional - Filter by reverse DNS lookup. - **limit** (integer) - Optional - Number of results to return. - **offset** (integer) - Optional - Offset for pagination. ### Request Example ```bash curl --request GET \ --url 'https://api.leaseweb.com/ipMgmt/v2/ips?version=4&nullRouted=false&type=NORMAL_IP&limit=50' \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` ### Response #### Success Response (200) - **_metadata** (object) - Contains pagination information. - **ips** (array) - List of IP addresses. - **ip** (string) - The IP address. - **version** (integer) - The IP version (4 or 6). - **type** (string) - The type of IP address. - **primary** (boolean) - Indicates if this is the primary IP. - **nullRouted** (boolean) - Indicates if the IP is null-routed. - **reverseLookup** (string) - The reverse DNS lookup entry. - **equipmentId** (string) - The ID of the associated equipment. #### Response Example ```json { "_metadata": { "totalCount": 87, "limit": 50, "offset": 0 }, "ips": [ { "ip": "192.0.2.1", "version": 4, "type": "NORMAL_IP", "primary": true, "nullRouted": false, "reverseLookup": "server1.example.com", "equipmentId": "12345" } ] } ``` ``` -------------------------------- ### Enable Rescue Mode for Bare Metal Server Source: https://context7.com/leaseweb/api-definitions/llms.txt Boot a server into rescue mode for troubleshooting. Supports specifying rescue image, SSH keys, power cycle behavior, and callback URL or post-install script. ```bash # Enable rescue mode with GRML image and auto power cycle curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/rescueMode \ --header 'X-LSW-Auth: YOUR_API_KEY' \ --header 'content-type: application/json' \ --data '{ "rescueImageId": "GRML", "powerCycle": true, "sshKeys": "ssh-rsa AAAAB3NzaC1y... user@domain.com", "callbackUrl": "https://example.com/rescue-done", "postInstallScript": "IyEvdXNyL2Jpbi9lbnYgYmFzaAplY2hvICJSZXNjdWUgbW9kZSByZWFkeSIK" }' ``` -------------------------------- ### List Instance IPs Source: https://context7.com/leaseweb/api-definitions/llms.txt Lists all IP addresses assigned to a Public Cloud instance. Supports filtering by IP version and null-route status. ```bash # List all IPs for an instance curl --request GET \ --url 'https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/ips?version=4&nullRouted=false' \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` -------------------------------- ### List Dedicated Servers with Filters Source: https://context7.com/leaseweb/api-definitions/llms.txt Retrieve a paginated list of dedicated servers, supporting filters for reference, IP, MAC address, site, private rack ID, and private network availability. ```bash # List servers with pagination and filters curl --request GET \ --url 'https://api.leaseweb.com/bareMetals/v2/servers?limit=20&offset=0&site=AMS-01&privateNetworkCapable=true' \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` ```json # Response (HTTP 200) # { # "_metadata": { "limit": 20, "offset": 0, "totalCount": 132 }, # "servers": [ # { # "id": "12345", # "assetId": "627293", # "contract": { # "customerId": "32923828192", # "deliveryStatus": "ACTIVE", # "id": "674382", # "reference": "database.server" # }, # "featureAvailability": { # "automation": true, # "ipmiReboot": false, # "powerCycle": true, # "privateNetwork": true, # "remoteManagement": false # }, # "location": { "rack": "A83", "site": "AMS-01", "suite": "99", "unit": "16-17" }, # "networkInterfaces": { # "public": { "gateway": "95.211.162.62", "ip": "95.211.162.0", "mac": "AA:AC:CC:88:EE:E4" } # }, # "rack": { "type": "SHARED" } # } # ] # } ``` -------------------------------- ### Create Private Network Source: https://context7.com/leaseweb/api-definitions/llms.txt Creates a new private network with a specified name. Requires an API key. ```bash # Create a private network named "production" curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/privateNetworks \ --header 'X-LSW-Auth: YOUR_API_KEY' \ --header 'content-type: application/json' \ --data '{"name": "production"}' ``` -------------------------------- ### List API Keys Source: https://context7.com/leaseweb/api-definitions/llms.txt Retrieves a list of all API keys associated with the account. Requires an OAuth2 token for authentication. ```bash # List all API keys (OAuth2 token required) curl --request GET \ --url 'https://api.leaseweb.com/apiKeys/v1/keys?limit=20&offset=0' \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` -------------------------------- ### List server jobs Source: https://context7.com/leaseweb/api-definitions/llms.txt Retrieves a list of all provisioning jobs for a server, with options to filter by type, status, or running status. ```APIDOC ## GET /bareMetals/v2/servers/{serverId}/jobs — List server jobs List all provisioning jobs (installs, rescue modes, etc.) for a server. Filter by `type` (e.g., `install`), `status` (e.g., `FINISHED`, `CANCELED`), or `isRunning`. ### Method GET ### Endpoint /bareMetals/v2/servers/{serverId}/jobs ### Parameters #### Path Parameters - **serverId** (string) - Required - The ID of the server. #### Query Parameters - **type** (string) - Optional - Filter jobs by type (e.g., "install"). - **status** (string) - Optional - Filter jobs by status (e.g., "FINISHED", "CANCELED"). - **isRunning** (boolean) - Optional - Filter jobs by their running status. - **limit** (integer) - Optional - The maximum number of jobs to return. ### Response #### Success Response (200 OK) - **_metadata** (object) - Metadata about the response. - **limit** (integer) - The limit applied to the number of results. - **offset** (integer) - The offset applied to the results. - **totalCount** (integer) - The total number of jobs available. - **jobs** (array) - A list of job objects. - **uuid** (string) - The unique identifier for the job. - **type** (string) - The type of job. - **status** (string) - The status of the job. - **serverId** (string) - The ID of the server associated with the job. - **createdAt** (string) - The timestamp when the job was created. - **updatedAt** (string) - The timestamp when the job was last updated. - **progress** (object) - The progress of the job. - **total** (integer) - The total number of steps in the job. - **finished** (integer) - The number of finished steps. - **failed** (integer) - The number of failed steps. - **percentage** (integer) - The completion percentage of the job. ``` -------------------------------- ### Reboot a VPS Source: https://context7.com/leaseweb/api-definitions/llms.txt Reboots a Virtual Private Server. Ensure you have the correct VPS ID before executing. ```bash # Reboot a VPS curl --request POST \ --url https://api.leaseweb.com/publicCloud/v1/vps/vps-id-12345/reboot \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` -------------------------------- ### List instance IPs Source: https://context7.com/leaseweb/api-definitions/llms.txt List all IP addresses assigned to a Public Cloud instance. Filter by IP version (4 or 6) and null-route status. ```APIDOC ## GET /publicCloud/v1/instances/{instanceId}/ips — List instance IPs ### Description List all IP addresses assigned to a Public Cloud instance. Filter by IP version (`4` or `6`) and null-route status. ### Method GET ### Endpoint /publicCloud/v1/instances/{instanceId}/ips ### Parameters #### Query Parameters - **version** (integer) - Optional - Filter by IP version (`4` or `6`). - **nullRouted** (boolean) - Optional - Filter by null-route status. ### Request Example ```bash curl --request GET \ --url 'https://api.leaseweb.com/publicCloud/v1/instances/ace712e9-a166-47f1-9065-4af0f7e7fce1/ips?version=4&nullRouted=false' \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` ### Response #### Success Response (200) - **_metadata** (object) - Contains pagination information. - **ips** (array) - List of IP addresses. - **ip** (string) - The IP address. - **prefixLength** (string) - The prefix length of the IP address. - **version** (integer) - The IP version (4 or 6). - **mainIp** (boolean) - Indicates if this is the main IP. - **nullRouted** (boolean) - Indicates if the IP is null-routed. - **networkType** (string) - The type of network. - **ddos** (object) - DDoS protection details. #### Response Example ```json { "_metadata": { "totalCount": 1, "limit": 20, "offset": 0 }, "ips": [ { "ip": "10.0.0.1", "prefixLength": "28", "version": 4, "mainIp": false, "nullRouted": false, "networkType": "INTERNAL", "ddos": { "detectionProfile": "STANDARD_DEFAULT", "protectionType": "STANDARD" } } ] } ``` ``` -------------------------------- ### List Bandwidth Notification Settings Source: https://context7.com/leaseweb/api-definitions/llms.txt Retrieves all bandwidth alert notification settings for a specified server. Includes thresholds, units, frequency, and last-triggered timestamps. ```bash # List bandwidth notifications for server 12345 curl --request GET \ --url 'https://api.leaseweb.com/bareMetals/v2/servers/12345/notificationSettings/bandwidth' \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` -------------------------------- ### Power Cycle Bare Metal Server Source: https://context7.com/leaseweb/api-definitions/llms.txt Perform a hard reset (power cycle) on the server. Returns HTTP 204 No Content on success. Use this for troubleshooting unresponsive servers. ```bash # Power cycle server 12345 curl --request POST \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345/powerCycle \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` -------------------------------- ### List Servers Source: https://context7.com/leaseweb/api-definitions/llms.txt Retrieve a paginated list of all dedicated servers under your account. Supports filtering by `reference`, `ip`, `macAddress`, `site`, `privateRackId`, and private network availability flags. ```APIDOC ## GET /bareMetals/v2/servers — List servers Retrieve a paginated list of all dedicated servers under your account. Supports filtering by `reference`, `ip`, `macAddress`, `site`, `privateRackId`, and private network availability flags. ### Method GET ### Endpoint /bareMetals/v2/servers ### Query Parameters - **limit** (integer) - Optional - The maximum number of servers to return. - **offset** (integer) - Optional - The number of servers to skip. - **reference** (string) - Optional - Filter by server reference. - **ip** (string) - Optional - Filter by server IP address. - **macAddress** (string) - Optional - Filter by server MAC address. - **site** (string) - Optional - Filter by server location site. - **privateNetworkCapable** (boolean) - Optional - Filter by private network capability. ### Request Example ```bash curl --request GET \ --url 'https://api.leaseweb.com/bareMetals/v2/servers?limit=20&offset=0&site=AMS-01&privateNetworkCapable=true' \ --header 'X-LSW-Auth: YOUR_API_KEY' ``` ### Response #### Success Response (200) - **_metadata** (object) - Contains pagination information. - **limit** (integer) - The limit used for pagination. - **offset** (integer) - The offset used for pagination. - **totalCount** (integer) - The total number of servers available. - **servers** (array) - A list of dedicated servers. - **id** (string) - The unique identifier for the server. - **assetId** (string) - The asset identifier for the server. - **contract** (object) - Contract details for the server. - **customerId** (string) - The customer ID. - **deliveryStatus** (string) - The delivery status. - **id** (string) - The contract ID. - **reference** (string) - The contract reference. - **featureAvailability** (object) - Available features for the server. - **automation** (boolean) - Whether automation is available. - **ipmiReboot** (boolean) - Whether IPMI reboot is available. - **powerCycle** (boolean) - Whether power cycle is available. - **privateNetwork** (boolean) - Whether private network is available. - **remoteManagement** (boolean) - Whether remote management is available. - **location** (object) - The physical location of the server. - **rack** (string) - The rack identifier. - **site** (string) - The site identifier. - **suite** (string) - The suite identifier. - **unit** (string) - The unit identifier. - **networkInterfaces** (object) - Network interface details. - **public** (object) - Public network interface details. - **gateway** (string) - The gateway IP address. - **ip** (string) - The IP address. - **mac** (string) - The MAC address. - **rack** (object) - Rack details. - **type** (string) - The type of rack. #### Response Example ```json { "_metadata": { "limit": 20, "offset": 0, "totalCount": 132 }, "servers": [ { "id": "12345", "assetId": "627293", "contract": { "customerId": "32923828192", "deliveryStatus": "ACTIVE", "id": "674382", "reference": "database.server" }, "featureAvailability": { "automation": true, "ipmiReboot": false, "powerCycle": true, "privateNetwork": true, "remoteManagement": false }, "location": { "rack": "A83", "site": "AMS-01", "suite": "99", "unit": "16-17" }, "networkInterfaces": { "public": { "gateway": "95.211.162.62", "ip": "95.211.162.0", "mac": "AA:AC:CC:88:EE:E4" } }, "rack": { "type": "SHARED" } } ] } ``` ``` -------------------------------- ### List API keys Source: https://context7.com/leaseweb/api-definitions/llms.txt Lists all API keys associated with the account, including their metadata and IP whitelisting information. ```APIDOC ## GET /apiKeys/v1/keys ### Description Lists all API keys (OAuth2 token required). ### Method GET ### Endpoint /apiKeys/v1/keys ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of API keys to return. - **offset** (integer) - Optional - The number of API keys to skip. ### Response #### Success Response (200) - **_metadata** (object) - Metadata about the response. - **limit** (integer) - The limit used for the request. - **offset** (integer) - The offset used for the request. - **totalCount** (integer) - The total number of API keys. - **keys** (array) - A list of API keys. - **id** (string) - The unique identifier for the API key. - **name** (string) - The name of the API key. - **createdAt** (string) - The timestamp when the API key was created. - **whiteListedIps** (array) - A list of IP addresses or CIDR ranges whitelisted for this key. #### Response Example ```json { "_metadata": { "limit": 20, "offset": 0, "totalCount": 3 }, "keys": [ { "id": "key-abc123", "name": "CI/CD Pipeline Key", "createdAt": "2024-01-01T00:00:00+00:00", "whiteListedIps": ["203.0.113.0/24"] } ] } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.