Dedicated Network Equipment API (v2)

This is the description of the Dedicated Network Equipment API.

The base url of this API is https://api.leaseweb.com.

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" : "https://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.

Getting Started

List network equipment

List your Dedicated Network Equipment. This api call supports pagination. Use the limit and offset query string parameters to paginate through all your dedicated network equipment.

Every network equipment object in the json response lists a few properties of a network equipment. Use the single resouce api call to get more details for a single network equipment.

Authorizations:
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

ip
string
Example: ip=127.0.0.4

Filter the list of network equipment by ip address.

macAddress
string
Example: macAddress=aa:bb:cc:dd:ee:ff

Filter the list of network equipment by mac address.

site
string
Example: site=FRA-10

Filter the list of network equipment by site (location).

privateRackId
string
Example: privateRackId=123

Filter the list of network equipment by private rack id.

privateNetworkCapable
string
Enum: "true" "false"

Filter the list for private network capable network equipment

privateNetworkEnabled
string
Enum: "true" "false"

Filter the list for private network enabled network equipment

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/networkEquipments?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&ip=SOME_STRING_VALUE&macAddress=SOME_STRING_VALUE&site=SOME_STRING_VALUE&privateRackId=SOME_STRING_VALUE&privateNetworkCapable=SOME_STRING_VALUE&privateNetworkEnabled=SOME_STRING_VALUE' \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples

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

Get network equipment

Use this API to get information about a single network equipment.

Authorizations:
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/networkEquipments/12345 \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "contract": {
    },
  • "featureAvailability": {
    },
  • "id": "12345",
  • "location": {
    },
  • "name": "ABC-DE-001",
  • "networkInterfaces": {
    },
  • "powerPorts": [
    ],
  • "rack": {
    },
  • "serialNumber": "XN51FPD0QX",
  • "specs": {
    },
  • "type": "SWITCH"
}

Update network equipment

Update the reference for a network equipment.

Authorizations:
path Parameters
networkEquipmentId
required
string
Example: 12345

The ID of a dedicated network equipment

Request Body schema: application/json
reference
required
string

The reference for this network equipment

Responses

Request samples