Private Clouds API (v2)

The base URL for this API is: https://api.leaseweb.com/cloud/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 clouds

List private clouds

Authorizations:
query Parameters
limit
integer
Default: 10
Example: limit=10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/cloud/v2/privateClouds?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect a private cloud

Authorizations:
path Parameters
privateCloudId
required
string
Example: 123242

Id of the private cloud

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/cloud/v2/privateClouds/123242 \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "id": "218030",
  • "customerId": "1301178860",
  • "dataCenter": "AMS-01",
  • "serviceOffering": "FLAT_FEE",
  • "sla": "Bronze",
  • "contract": {
    },
  • "hardware": {
    },
  • "ips": [
    ],
  • "networkTraffic": {
    }
}

List credentials

Please note that this feature is only available for CloudStack Private Clouds.

Also note that you will only be able to retrieve the last password that we configured in your remote management tool. If you changed it, the information retrieved by this API call will not work.

Name Type Description
type string Type of credential pair. Possible values are REMOTE_MANAGEMENT.
username string Name of the user in the remote management tool.
domain string Domain name to log in to the remote management tool.
Please note that the password is not returned in this call, you must use the endpoint to get a credential by the username to retrieve it.

The _metadata object contains the following attributes:

Name Type Description
totalCount integer Total amount of credentials that were found.
limit integer Maximum amount of credentials that will be included in the credentials array.
offset integer Offset of the request.
Authorizations:
path Parameters
credentialType
required
string
Value: "REMOTE_MANAGEMENT"

Type of credential pair

privateCloudId
required
string
Example: 123242

Id of the private cloud

query Parameters
limit
integer
Default: 10
Example: limit=10

Limit the number of results returned

offset
integer
Default: 0

Return results starting from the given offset

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/cloud/v2/privateClouds/123242/credentials/%7BcredentialType%7D?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples

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

Inspect user credentials

Please note that this feature is only available for CloudStack Private Clouds.

Also note that you will only be able to retrieve the last password that we configured in your server or control panel. If you changed it, the information retrieved by this API call will not work.

Authorizations:
path Parameters
credentialType
required
string
Value: "REMOTE_MANAGEMENT"

Type of credential pair

username
required
string

Name of the user in the remote management tool

privateCloudId
required
string
Example: 123242

Id of the private cloud

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/cloud/v2/privateClouds/123242/credentials/%7BcredentialType%7D/%7Busername%7D \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples