The base URL for this API is: https://api.leaseweb.com/bareMetals/v2/
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 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.
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.
password | string >= 8 characters The password should be at least 8 characters and consisting of uppercase, lowercase, digits and special characters |
{- "password": "mys3cretp@ssw0rd"
}
{- "errorCode": "ACCESS_DENIED",
- "errorMessage": "The access token is expired or invalid."
}
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.
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/remoteManagement/profiles \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 1
}, - "profiles": [
- {
- "datacenter": "AMS-01",
- "satelliteDatacenters": [
- "AMS-10",
- "AMS-11",
- "AMS-12"
],
}
]
}
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.
datacenter required | string Datacenter location |
curl --request GET \ --url https://api.leaseweb.com/bareMetals/v2/remoteManagement/profiles/lsw-rmvpn-%7Bdatacenter%7D.ovpn \ --header 'X-LSW-Auth: REPLACE_KEY_VALUE'
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>