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.

Private racks

List private racks

This API returns a paginated list of all private 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 private racks

privateNetworkEnabled
boolean
Enum: "true" "false"

Filter the list of private network enabled private racks

Responses

200
201

Created

401

Authentication is required.

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

Request samples

Copy
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
Copy
Expand all Collapse all
{
  • "_metadata":
    {
    },
  • "privateRacks":
    [
    ]
}

Inspect a private rack

Retrieve information about a single private rack.

Authorizations:
path Parameters
privateRackId
required
string
Example: 2314213

Id of the private rack

Responses

200
400

The errorDetails value is an object describing why validation failed.

401

Authentication is required.

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

Request samples

Copy
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
Copy
Expand all Collapse all
{
  • "contract":
    {
    },
  • "featureAvailability":
    {
    },
  • "id": "2893829",
  • "location":
    {
    },
  • "networkInterfaces":
    {
    },
  • "powerPorts": [ ],
  • "units":
    [
    ]
}

Update a private rack

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

Authorizations:
path Parameters
privateRackId
required
string
Example: 2314213

Id of the private rack

Request Body schema: application/json
reference
required
string

The reference for this private rack

Responses

204

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

400

The errorDetails value is an object describing why validation failed.

401

Authentication is required.

403
404
500
503
put/privateRacks/{privateRackId}
https://api.leaseweb.com/bareMetals/v2/privateRacks/{privateRackId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "reference": "production"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "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 private 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

200
401

Authentication is required.

403
get/privateRacks/{privateRackId}/nullRouteHistory
https://api.leaseweb.com/bareMetals/v2/privateRacks/{privateRackId}/nullRouteHistory

Request samples

Copy
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
Copy
Expand all Collapse all
{
  • "_metadata":
    {
    },
  • "nullRoutes":
    [
    ]
}

List IPs

Authorizations:
path Parameters
privateRackId
required
string
Example: 2314213

Id of the private 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

200
401

Authentication is required.

403
404
500
503
get/privateRacks/{privateRackId}/ips
https://api.leaseweb.com/bareMetals/v2/privateRacks/{privateRackId}/ips

Request samples

Copy
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
Copy
Expand all Collapse all
{
  • "_metadata":
    {
    },
  • "ips":
    [
    ]
}

Inspect an IP

Authorizations:
path Parameters
ip
required
string
Example: 192.168.0.1

IP Address

privateRackId
required
string
Example: 2314213

Id of the private rack

Responses

200
400

The errorDetails value is an object describing why validation failed.

401

Authentication is required.

403
404
500
503
get/privateRacks/{privateRackId}/ips/{ip}
https://api.leaseweb.com/bareMetals/v2/privateRacks/{privateRackId}/ips/{ip}

Request samples