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.

Remote management

Change OpenVPN credentials

Users can change their OpenVPN credentials. These credentials are stored using one way encryption so the user is responsible for storing and/or remembering this password.

If the password is lost a new one can be generated using this API call. If a new password is generated it will replace the old password.

Authorizations:
Request Body schema: application/json
password
string >= 8 characters

The password should be at least 8 characters and consisting of uppercase, lowercase, digits and special characters

Responses

204

The password is changed successfully and will take effect immediately.

401

Authentication is required.

403
500
503
post/remoteManagement/changeCredentials
https://api.leaseweb.com/bareMetals/v2/remoteManagement/changeCredentials

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "password": "mys3cretp@ssw0rd"
}

Response samples

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

List OpenVPN profiles

These profiles are used to establish a OpenVPN connection to a data center which will give you access to the IPMI interface of your dedicated server. Access to this interface allows a user to remotely administer the server in case it is not reachable.

Authorizations:

Responses

200
401

Authentication is required.

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

Request samples

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

Response samples

Content type
application/json
Copy
Expand all Collapse all
{}

Inspect an OpenVPN profile

Retrieve a OpenVPN profile for the given data center.

On success the response will be a pop specific OpenVPN profile containing a certificate and configuration.

This file can be used with OpenVPN clients to initiate a connection to Leaseweb Remote Management network.

Authorizations:
path Parameters
datacenter
required
string

Datacenter location

Responses

200
401

Authentication is required.

403
404
500
503
get/remoteManagement/profiles/lsw-rmvpn-{datacenter}.ovpn
https://api.leaseweb.com/bareMetals/v2/remoteManagement/profiles/lsw-rmvpn-{datacenter}.ovpn

Request samples

Copy
curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/remoteManagement/profiles/lsw-rmvpn-%7Bdatacenter%7D.ovpn \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/x-openvpn-profile
Copy
client

proto udp
port 1194
dev tun

remote-random
remote

keepalive 10 60

remote-cert-tls server
resolv-retry infinite

comp-lzo
auth-user-pass
auth-retry interact
explicit-exit-notify 2

<ca>
-----BEGIN CERTIFICATE-----
AAAAAAAAAAAAAA.................
-----END CERTIFICATE-----
</ca>