Bare Metal (v2)

The base URL for this API is: https://api.leaseweb.com/bareMetals/v2/

Errors

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

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

Authentication

Authentication for the APIs is required. To authenticate your call, you will need to sent your API key as X-LSW-Auth header.

You can generate API keys in the Customer Portal.

Dedicated racks

List dedicated racks

This API returns a paginated list of all dedicated racks.

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

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

reference
string
Example: reference=my-db

Filter the list of dedicated racks by reference.

privateNetworkCapable
boolean
Enum: true false

Filter the list of private network capable dedicated racks

privateNetworkEnabled
boolean
Enum: true false

Filter the list of private network enabled dedicated racks

Responses

Request samples

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

Response samples

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

Inspect a dedicated rack

Retrieve information about a single dedicated rack.

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

Id of the dedicated rack

Responses

Request samples

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

Response samples

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

Update a dedicated rack

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

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

Id of the dedicated rack

Request Body schema: application/json
reference
required
string

The reference for this dedicated rack

Responses

Request samples

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

Response samples

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

Inspect null route history

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

Id of the dedicated rack

query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

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

Response samples

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

List IPs

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

Id of the dedicated rack

query Parameters
networkType
string

Filter the collection of ip addresses by network type

version
string

Filter the collection by ip version

nullRouted
string

Filter Ips by Nulled-Status

ips
string

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

limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

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

Response samples

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

Inspect an IP

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

IP Address

privateRackId
required
string
Example: 2314213

Id of the dedicated rack

Responses

Request samples

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

Response samples

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

Update an IP

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

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

IP Address

privateRackId
required
string
Example: 2314213

Id of the dedicated rack

Request Body schema: application/json
reverseLookup
string

The reverse lookup value

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

The detection profile value

Responses

Request samples

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

Response samples

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

Null route an IP

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

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

Id of the dedicated rack

ip
required
string
Example: 192.168.0.1

IP Address

Responses

Request samples

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

Response samples

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

Remove a null route

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

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

Id of the dedicated rack

ip
required
string
Example: 192.168.0.1

IP Address

Responses

Request samples

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

Response samples

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

List credentials

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

Id of the dedicated rack

query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

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

Response samples

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

Create new credentials

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

Id of the dedicated rack

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

The type of the credential

username
required
string

The username for the credentials

password
required
string

The password for the credentials

Responses

Request samples

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

Response samples

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

List credentials by type

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

Id of the dedicated rack

query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

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

Response samples

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

Inspect user credentials

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

Id of the dedicated rack

username
required
string
type
required
string

Responses

Request samples

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

Response samples

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

Update user credentials

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

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

Id of the dedicated rack

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

The password for the credentials

Responses

Request samples

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

Response samples

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

Delete user credentials

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

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

Id of the dedicated rack

username
required
string
type
required
string

Responses

Request samples

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

Response samples

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

Inspect datatraffic metrics

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

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

Id of the dedicated rack

query Parameters
from
date

Start of date interval in ISO-8601 format

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

to
date

End of date interval in ISO-8601 format.

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

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

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

aggregation
string
Value: "SUM"

Aggregate each metric using the given aggregation function.

Responses

Request samples

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

Response samples

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

Inspect bandwidth metrics

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

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

Id of the dedicated rack

query Parameters
from
date

Start of date interval in ISO-8601 format

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

to
date

End of date interval in ISO-8601 format.

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

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

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

aggregation
string
Enum: "AVG" "95TH"

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

Responses

Request samples

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

Response samples

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

Inspect DDos notification settings

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

Id of the dedicated rack

Responses

Request samples

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

Response samples

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

Update DDos notification settings

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

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

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

Id of the dedicated rack

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

Enable or disable email notifications for nulling events

nulling
required
string
Enum: "ENABLED" "DISABLED"

Enable or disable email notifications for nulling events

Responses

Request samples

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

Response samples

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

List bandwidth notification settings

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

Id of the dedicated rack

query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

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

Response samples

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

Create new bandwidth notification setting

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

Id of the dedicated rack

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

Frequency for the Bandwidth Notification

unit
required
string
Enum: "Gbps" "Mbps"

Unit for the Bandwidth Notification

threshold
required
string

Threshold Value for the Bandwidth Notification

Responses

Request samples

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

Response samples

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

Inspect bandwidth notification settings

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

A Bandwidth Notification can be updated and deleted.

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

Id of the dedicated rack

query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

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

Response samples

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

Update bandwidth notification settings

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

Id of the dedicated rack

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

Frequency for the Bandwidth Notification

unit
required
string
Enum: "Gbps" "Mbps"

Unit for the Bandwidth Notification

threshold
required
string

Threshold Value for the Bandwidth Notification

Responses

Request samples

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

Response samples

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

Delete bandwidth notification settings

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

Id of the dedicated rack

Responses

Request samples

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

Response samples

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

List datatraffic notification settings

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

Id of the dedicated rack

query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

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

Response samples

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

Create datatraffic notification settings

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

Id of the dedicated rack

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

Frequency for the Datatraffic Notification

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

Unit for the Datatraffic Notification

threshold
required
string

Threshold Value for the Datatraffic Notification

Responses

Request samples

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

Response samples

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

Inspect datatraffic notification settings

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

Id of the dedicated rack

query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

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

Response samples

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

Update datatraffic notification settings

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

Id of the dedicated rack

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

Frequency for the Datatraffic Notification

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

Unit for the Datatraffic Notification

threshold
required
string

Threshold Value for the Datatraffic Notification

Responses

Request samples

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

Response samples

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

Delete datatraffic notification settings

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

Id of the dedicated rack

Responses

Request samples

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

Response samples

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