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:
query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

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&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:
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:
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:
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": [