This is the description of the Dedicated Server API.
The base url of this API is https://api.leaseweb.com
.
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 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.
List your Dedicated Servers. This api call supports pagination. Use the
limit
and offset
query string parameters to paginate through all your
dedicated servers.
Every server
object in the json response lists a few properties of a server.
Use the single resource api call to get more details for a single server.
limit | integer Example: limit=20 Limit the number of results returned. |
offset | integer Example: offset=10 Return results starting from the given offset. |
reference | string Example: reference=my-db Filter the list of servers by reference. |
ip | string Example: ip=127.0.0.4 Filter the list of servers by ip address. |
macAddress | string Example: macAddress=aa:bb:cc:dd:ee:ff Filter the list of servers by mac address. |
site | string Example: site=FRA-10 Filter the list of servers by site (location). |
privateRackId | string Example: privateRackId=123 Filter the list of servers by dedicated rack id. |
privateNetworkCapable | string Enum: "true" "false" Filter the list for private network capable servers |
privateNetworkEnabled | string Enum: "true" "false" Filter the list for private network enabled servers |
curl --request GET \ --url 'https://api.leaseweb.com/bareMetals/v2/servers?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&reference=SOME_STRING_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'
{- "_metadata": {
- "limit": 2,
- "offset": 80,
- "totalCount": 132
}, - "servers": [
- {
- "assetId": "627293",
- "contract": {
- "customerId": "32923828192",
- "deliveryStatus": "ACTIVE",
- "id": "674382",
- "reference": "database.server",
- "salesOrgId": "2300"
}, - "featureAvailability": {
- "automation": true,
- "ipmiReboot": false,
- "powerCycle": true,
- "privateNetwork": true,
- "remoteManagement": false
}, - "id": "12345",
- "location": {
- "rack": "A83",
- "site": "AMS-01",
- "suite": "99",
- "unit": "16-17"
}, - "networkInterfaces": {
- "internal": {
- "gateway": "10.22.192.12",
- "ip": "10.22.192.3",
- "mac": "AA:BB:CC:DD:EE:FF",
- "ports": [
- {
- "name": "EVO-AABB-01",
- "port": "30"
}
]
}, - "public": {
- "gateway": "95.211.162.62",
- "ip": "95.211.162.0",
- "mac": "AA:AC:CC:88:EE:E4",
- "ports": [ ]
}, - "remoteManagement": {
- "gateway": "10.22.192.126",
- "ip": "10.22.192.1",
- "mac": "AA:AC:CC:88:EE:E4",
- "ports": [ ]
}
}, - "powerPorts": [
- {
- "name": "EVO-JV12-APC02",
- "port": "10"
}
], - "privateNetworks": [
- {
- "id": "1",
- "linkSpeed": 1000,
- "status": "CONFIGURED",
- "subnet": "127.0.0.80/24",
- "vlanId": "2120"
}
], - "rack": {
- "type": "SHARED"
}
}, - {
- "assetId": "627294",
- "contract": {
- "customerId": "32923828192",
- "deliveryStatus": "ACTIVE",
- "id": "929282",
- "reference": "web.server",
- "salesOrgId": "2300"
}, - "featureAvailability": {
- "automation": false,
- "powerCycle": false,
- "privateNetwork": false,
- "remoteManagement": false
}, - "id": "47854",
- "location": {
- "rack": "13",
- "site": "AMS-01",
- "suite": "A6",
- "unit": "18"
}, - "networkInterfaces": {
- "internal": null,
- "public": null,
- "remoteManagement": null
}, - "privateNetworks": [
- {
- "id": "2",
- "linkSpeed": 1000,
- "status": "CONFIGURED",
- "subnet": "127.0.0.80/24",
- "vlanId": "2130"
}
], - "rack": {
- "type": "SHARED"
}
}
]
}
Use this API to get information about a single server.
serverId required | string Example: 12345 The ID of a server |
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/servers/12345 \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'