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 servers

List dedicated servers

Authorizations:
query Parameters
limit
integer
Default: 10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

ip
string

Filter the list of servers by ip address

macAddress
string

Filter the list of servers by mac address

deliveryStatus
string
Default: "active"
Example: deliveryStatus=active

Filter the list of servers by their delivery status

site
string

Filter the list of servers by data center (location)

privateRackId
string

Filter the list of servers by private rack id

Responses

200
401

Authentication is required.

403
500
503
get/servers
https://api.leaseweb.com/bareMetals/v2/servers

Request samples

Copy
curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/servers?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&ip=SOME_STRING_VALUE&macAddress=SOME_STRING_VALUE&deliveryStatus=SOME_STRING_VALUE&site=SOME_STRING_VALUE&privateRackId=SOME_STRING_VALUE' \
  --header 'leaseweb api key: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_metadata":
    {
    },
  • "servers":
    [
    ]
}

Inspect a dedicated server

Authorizations:
path Parameters
serverId
required
string
Example: 23143213

Id of the server

Responses

200
400

The errorDetails value is an object describing why validation failed.

401

Authentication is required.

403
404
500
503
get/servers/{serverId}
https://api.leaseweb.com/bareMetals/v2/servers/{serverId}

Request samples

Copy
curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/servers/23143213 \
  --header 'leaseweb api key: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "12345",
  • "location":
    {
    },
  • "rack":
    {
    },
  • "specs":
    {
    },
  • "serialNumber": "JDK18291JK",
  • "networkInterfaces":
    {
    },
  • "powerPorts":
    [
    ],
  • "featureAvailability":
    {
    },
  • "assetId": "627294",
  • "contract":
    {
    }
}

Update reference

Authorizations:
path Parameters
serverId
required
string
Example: 23143213

Id of the server

Request Body schema: application/json
reference
required
string

The reference for this server

Responses

204

If the reference was successfully set a 204 No Content is returned

401

Authentication is required.

403
put/servers/{serverId}
https://api.leaseweb.com/bareMetals/v2/servers/{serverId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "reference": "database-server"
}

Response samples

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

Inspect 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: 23143213

Id of the server

Responses

200
401

Authentication is required.

403
get/servers/{serverId}/hardwareInfo
https://api.leaseweb.com/bareMetals/v2/servers/{serverId}/hardwareInfo

Request samples

Copy
curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/servers/23143213/hardwareInfo \
  --header 'leaseweb api key: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "2378237",
  • "serverId": "62264",
  • "scannedAt": "2017-09-27 14:21:01",
  • "parserVe