AWS compatible Public Cloud API (v1)

License: Apache 2.0

This is the AWS compatible Public Cloud API Reference. It provides descriptions, API request parameters, and the XML response for each of the API actions that Leaseweb supports.

The purpose of the AWS compatible Public Cloud API is to make the migration easy for the users to switch from the AWS EC2 to the Leaseweb Public Cloud APIs.

NOTE: Since AWS EC2 and Public Cloud APIs are not 100% matched, Leaseweb hard-coded some request/response attributes, which you can see in schema definition.

NOTE: This API is in BETA. Documentation might be incorrect or incomplete. Functionality might change with the final release.

BETA

Errors

AWS compatible APIs have two types of error codes:

Client errors: These errors are usually caused by something the client did, such as specifying an incorrect or invalid parameter in the request, or using an action or resource on behalf of a user that doesn't have permission to use the action or resource. These errors are accompanied by a 400-series HTTP response code.

Server errors: These errors are usually caused by an AWS compatible APIs server-side issue. These errors are accompanied by a 500-series HTTP response code.

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Errors>
        <Error>
            <Code>ERROR CODE 1</Code>
            <Message>ERROR MESSAGE 1</Message>
        </Error>
        <Error>
            <Code>ERROR CODE 2</Code>
            <Message>ERROR MESSAGE 2</Message>
        </Error>
    </Errors>
    <RequestID>REQUEST ID</RequestID>
</Response>

DescribeInstances

Describes the specified instances or all instances.

If you specify instance IDs, the output includes information for only the specified instances.

If you specify filters, the output includes information for only those instances that meet the filter criteria.

If you do not specify instance IDs or filters, the output includes information for all instances, which can affect performance. We recommend that you use pagination to ensure that the operation returns quickly and successfully.

If you specify an instance ID that is not valid, an error is returned. If you specify an instance that you do not own, it is not included in the output.

AWS CLI example

aws ec2 describe-instances --filters "Name=<FILTER_NAME>,Values=<FILTER_VALUE>" --endpoint-url <LEASEWEB_AWS_EC2_SERVER_URL>
Authorizations:
Authorization
query Parameters
Filter.N.instance-id
string
Example: Filter.N.instance-id=29145c92-4a68-4c63-aaeb-f2212d85a74a

The ID of the instance.

Filter.N.ip-address
string
Example: Filter.N.ip-address=123.456.7.8

The public IPv4 address of the instance.

Filter.N.tag:reference
string
Example: Filter.N.tag:reference=reference

The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key reference and the value TeamA, specify tag:reference for the filter name and TeamA for the filter value.

Filter.N.instance-state-name
string
Enum: "pending" "running" "shutting-down" "terminated" "stopping" "stopped"
Example: Filter.N.instance-state-name=pending

The state of the instance.

Filter.N.instance-type
string
Example: Filter.N.instance-type=t2.micro

The type of instance. The documentation has a complete list.

Filter.N.availability-zone
string
Example: Filter.N.availability-zone=eu-west-1

The Availability Zone of the instance.

MaxResults
integer
Example: MaxResults=10

The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output.

NextToken
integer
Example: NextToken=1

The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/aws/ec2/?Filter.N.instance-id=SOME_STRING_VALUE&Filter.N.ip-address=SOME_STRING_VALUE&Filter.N.tag%3Areference=SOME_STRING_VALUE&Filter.N.instance-state-name=SOME_STRING_VALUE&Filter.N.instance-type=SOME_STRING_VALUE&Filter.N.availability-zone=SOME_STRING_VALUE&MaxResults=SOME_INTEGER_VALUE&NextToken=SOME_INTEGER_VALUE&Action=DescribeInstances' \
  --header 'Authorization: REPLACE_KEY_VALUE'

Response samples

Content type
application/xml
 <?xml version='1.0' encoding='UTF-8'?>
 <DescribeInstancesResponse xmlns='http://ec2.amazonaws.com/doc/2016-11-15/'>
 	<nextToken>1</nextToken>
 	<requestId>f7f55139-53d4-4b5f-bd7f-dbeddee039c0</requestId>
 	<reservationSet>
 		<item>
 			<reservationId></reservationId>
 			<instancesSet>
 				<item>
 					<instanceId>10a6163b-03c6-4303-a274-c96fa2217503</instanceId>
 					<imageId>UBUNTU_22_04_64BIT</imageId>
 					<instanceState>
 						<code>16</code>
 						<name>RUNNING</name>
 					</instanceState>
 					<amiLaunchIndex>-1</amiLaunchIndex>
 					<instanceType>lsw.m3.large</instanceType>
 					<launchTime>2024-05-07T12:02:49+0000</launchTime>
 					<placement>
 						<availabilityZone>eu-west-3</availabilityZone>
 						<groupName></groupName>
 						<tenancy></tenancy>
 					</placement>
 					<subnetId></subnetId>
 					<vpcId></vpcId>
 					<privateIpAddress></privateIpAddress>
 					<ipAddress>85.17.17.88</ipAddress>
 					<architecture>x86_64</architecture>
 					<rootDeviceType></rootDeviceType>
 					<virtualizationType></virtualizationType>
 					<tagSet>
 						<item>
 							<key>reference</key>
 							<value>test ono 3</value>
 						</item>
 					</tagSet>
 					<cpuOptions>
 						<coreCount>2</coreCount>
 						<threadsPerCore>-1</threadsPerCore>
 					</cpuOptions>
 					<networkInterfaceSet>
 						<item>
 							<networkInterfaceId></networkInterfaceId>
 							<subnetId></subnetId>
 							<vpcId></vpcId>
 							<description></description>
 							<ownerId></ownerId>
 							<status></status>
 							<macAddress></macAddress>
 							<privateIpAddress></privateIpAddress>
 							<privateDnsName></privateDnsName>
 							<sourceDestCheck></sourceDestCheck>
 							<groupSet>
 								<item>
 									<groupId></groupId>
 									<groupName></groupName>
 								</item>
 							</groupSet>
 							<attachment>
 								<attachmentId></attachmentId>
 								<deviceIndex>-1</deviceIndex>
 								<status></status>
 								<attachTime>2000-01-01T00:00:00+0000</attachTime>
 								<deleteOnTermination></deleteOnTermination>
 							</attachment>
 							<association>
 								<publicIp>85.17.17.88</publicIp>
 								<publicDnsName></publicDnsName>
 								<ipOwnerId></ipOwnerId>
 							</association>
 							<privateIpAddressesSet>
 								<item>
 									<privateIpAddress></privateIpAddress>
 									<privateDnsName></privateDnsName>
 									<primary></primary>
 									<association>
 										<publicIp></publicIp>
 										<publicDnsName></publicDnsName>
 										<ipOwnerId></ipOwnerId>
 									</association>
 								</item>
 							</privateIpAddressesSet>
 							<ipv6AddressesSet>
 								<item>
 										<ipv6Address>85.17.17.88</ipv6Address>
 									</item>
 							</ipv6AddressesSet>
 						</item>
 					</networkInterfaceSet>
 				</item>
 			</instancesSet>
 		</item>
 	</reservationSet>
 </DescribeInstancesResponse>
 

RunInstances

Launches an instance using an image for which you have permissions.

AWS CLI example

aws ec2 run-instances --image-id <IMAGE_ID> --placement AvailabilityZone=<REGION> --instance-type <INSTANCE_TYPE> --endpoint-url <LEASEWEB_AWS_EC2_SERVER_URL>
Authorizations:
Authorization
query Parameters
InstanceType
required
string
Example: InstanceType=lsw.t2.micro

The instance type.

ImageId
required
string
Example: ImageId=UBUNTU_22_04_64BIT

The name of the image. An image is required to launch an instance and must be specified here. The documentation has a complete list.

Placement
required
string
Example: Placement=eu-west-1

The placement for the instance.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/aws/ec2/?InstanceType=SOME_STRING_VALUE&ImageId=SOME_STRING_VALUE&Placement=SOME_STRING_VALUE&Action=RunInstances' \
  --header 'Authorization: REPLACE_KEY_VALUE'

Response samples

Content type
application/xml
 <?xml version='1.0' encoding='UTF-8'?>
 <RunInstancesResponse xmlns='http: //ec2.amazonaws.com/doc/2016-11-15/'>
 	<groupSet/>
 	<instancesSet>
 		<item>
 			<instanceId>10a6163b-03c6-4303-a274-c96fa2217503</instanceId>
 			<imageId>UBUNTU_22_04_64BIT</imageId>
 			<instanceState>
 				<code>0</code>
 				<name>CREATING</name>
 			</instanceState>
 			<amiLaunchIndex>-1</amiLaunchIndex>
 			<instanceType>lsw.m3.large</instanceType>
 			<launchTime>2024-05-07T12: 02: 49+0000</launchTime>
 			<placement>
 				<availabilityZone>eu-west-3</availabilityZone>
 				<groupName></groupName>
 				<tenancy></tenancy>
 			</placement>
 			<subnetId></subnetId>
 			<vpcId></vpcId>
 			<privateIpAddress></privateIpAddress>
 			<ipAddress>85.17.17.88</ipAddress>
 			<architecture>x86_64</architecture>
 			<rootDeviceType></rootDeviceType>
 			<virtualizationType></virtualizationType>
 			<tagSet>
 				<item>
 					<key>reference</key>
 					<value></value>
 				</item>
 			</tagSet>
 			<cpuOptions>
 				<coreCount>2</coreCount>
 				<threadsPerCore>-1</threadsPerCore>
 			</cpuOptions>
 			<networkInterfaceSet>
 				<item>
 					<networkInterfaceId></networkInterfaceId>
 					<subnetId></subnetId>
 					<vpcId></vpcId>
 					<description></description>
 					<ownerId></ownerId>
 					<status></status>
 					<macAddress></macAddress>
 					<privateIpAddress></privateIpAddress>
 					<privateDnsName></privateDnsName>
 					<sourceDestCheck></sourceDestCheck>
 					<groupSet>
 						<item>
 							<groupId></groupId>
 							<groupName></groupName>
 						</item>
 					</groupSet>
 					<attachment>
 						<attachmentId></attachmentId>
 						<deviceIndex>-1</deviceIndex>
 						<status></status>
 						<attachTime>2000-01-01T00: 00: 00+0000</attachTime>
 						<deleteOnTermination></deleteOnTermination>
 					</attachment>
 					<association>
 						<publicIp>85.17.17.88</publicIp>
 						<publicDnsName></publicDnsName>
 						<ipOwnerId></ipOwnerId>
 					</association>
 					<privateIpAddressesSet>
 						<item>
 							<privateIpAddress></privateIpAddress>
 							<privateDnsName></privateDnsName>
 							<primary></primary>
 							<association>
 								<publicIp></publicIp>
 								<publicDnsName></publicDnsName>
 								<ipOwnerId></ipOwnerId>
 							</association>
 						</item>
 					</privateIpAddressesSet>
 					<ipv6AddressesSet>
 						<item/>
 					</ipv6AddressesSet>
 				</item>
 			</networkInterfaceSet>
 		</item>
 	</instancesSet>
 	<requesterId></requesterId>
 	<requestId></requestId>
 	<reservationId></reservationId>
 </RunInstancesResponse>
 

StartInstances

Starts a Public Cloud instance that you've previously stopped.

AWS CLI example

aws ec2 start-instances --endpoint-url <LEASEWEB_AWS_EC2_SERVER_URL> --instance-ids <INSTANCE_ID>
Authorizations:
Authorization
query Parameters
InstanceId.1
required
string
Example: InstanceId.1=29145c92-4a68-4c63-aaeb-f2212d85a74a

The instance id.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/aws/ec2/?InstanceId.1=SOME_STRING_VALUE&Action=StartInstances' \
  --header 'Authorization: REPLACE_KEY_VALUE'

Response samples

Content type
application/xml
 <?xml version='1.0' encoding='UTF-8'?>
 <StartInstancesResponse xmlns='http: //ec2.amazonaws.com/doc/2016-11-15/'>
 	<instancesSet>
 		<item>
 			<instanceId>10a6163b-03c6-4303-a274-c96fa2217503</instanceId>
 		</item>
 	</instancesSet>
 	<requestId>10a6163b-03c6-4303-a274</requestId>
 </StartInstancesResponse>
 

StopInstances

Stops a Public Cloud instance that you've previously started.

AWS CLI example

aws ec2 stop-instances --endpoint-url <LEASEWEB_AWS_EC2_SERVER_URL> --instance-ids <INSTANCE_ID>
Authorizations:
Authorization
query Parameters
InstanceId.1
required
string
Example: InstanceId.1=29145c92-4a68-4c63-aaeb-f2212d85a74a

The instance id.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/aws/ec2/?InstanceId.1=SOME_STRING_VALUE&Action=StopInstances' \
  --header 'Authorization: REPLACE_KEY_VALUE'

Response samples

Content type
application/xml
 <?xml version='1.0' encoding='UTF-8'?>
 <StopInstancesResponse xmlns='http: //ec2.amazonaws.com/doc/2016-11-15/'>
 	<instancesSet>
 		<item>
 			<instanceId>10a6163b-03c6-4303-a274-c96fa2217503</instanceId>
 		</item>
 	</instancesSet>
 	<requestId>10a6163b-03c6-4303-a274</requestId>
 </StopInstancesResponse>
 

RebootInstances

Reboot a Public Cloud instance.

AWS CLI example

aws ec2 reboot-instances --endpoint-url <LEASEWEB_AWS_EC2_SERVER_URL> --instance-ids <INSTANCE_ID>
Authorizations:
Authorization
query Parameters
InstanceId.1
required
string
Example: InstanceId.1=29145c92-4a68-4c63-aaeb-f2212d85a74a

The instance id.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/aws/ec2/?InstanceId.1=SOME_STRING_VALUE&Action=RebootInstances' \
  --header 'Authorization: REPLACE_KEY_VALUE'

Response samples

Content type
application/xml
 <?xml version='1.0' encoding='UTF-8'?>
 <RebootInstancesResponse xmlns='http: //ec2.amazonaws.com/doc/2016-11-15/'>
 	<return>true</return>
 	<requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
 </RebootInstancesResponse>
 

CreateLoadBalancer

Create a load balancer, by providing the type, subnet, and a name.

AWS CLI example

aws elbv2 create-load-balancer --type <TYPE> --name <NAME> --subnets <REGION> --endpoint-url <LEASEWEB_AWS_EC2_SERVER_URL>
Authorizations:
Authorization
query Parameters
Name
required
string
Example: Name=Test-Load-Blancer

An identifying name you can refer to the load balancer.

Type
required
string
Example: Type=lsw.m3.large

Load balancer type. The documentation has a complete list

Subnets.member.1
required
string
Example: Subnets.member.1=eu-west-3

Region to launch the load balancer into. The documentation has a complete list

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/aws/ec2/?Name=SOME_STRING_VALUE&Type=SOME_STRING_VALUE&Subnets.member.1=SOME_STRING_VALUE&Action=CreateLoadBalancer' \
  --header 'Authorization: REPLACE_KEY_VALUE'

Response samples

Content type
application/xml
 <?xml version='1.0' encoding='UTF-8'?>
 <CreateLoadBalancerResponse xmlns='http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/'>
 	<CreateLoadBalancerResult>
 		<LoadBalancers>
 			<member>
 				<LoadBalancerArn>1ac942f4-cdd9-4c00-973f-ed82a92940cb</LoadBalancerArn>
 				<LoadBalancerName>Test-Load-Blancer</LoadBalancerArn>
 				<CreatedTime>2024-06-14T09:02,:31+00:00</CreatedTime>,
 				<Type>lsw.m3.large</Type>
 				<State>
 					<Code>provisioning</Code>
 				</State>
 				<AvailabilityZones>
 					<member>
 						<ZoneName>eu-west-3</ZoneName>
 					</member>
 				</AvailabilityZones>
 			</member>
 		</LoadBalancers>
 	</CreateLoadBalancerResult>
 	<ResponseMetadata>
 		<RequestId>8008e3fb-f671-46ab-ade4-871ca5508845</RequestId>
 	</ResponseMetadata>
 </CreateLoadBalancerResponse>
 

DescribeLoadBalancers

Describes the specified load balancer or all load balancers.

If you specify load balancer IDs, the output includes information for only the specified load balancer.

If you specify names, the output includes information for only those load balancers that meet the name criteria.

If you do not specify load balancer IDs or names, the output includes information for all load balancers, which can affect performance. We recommend that you use pagination to ensure that the operation returns quickly and successfully.

If you specify a load balancer ID that is not valid, an error is returned. If you specify a load balancer that you do not own, it is not included in the output.

AWS CLI example

aws elbv2 describe-load-balancers --load-balancer-arns <LOAD_BALANCER_ID>  --names <NAME> --endpoint-url <LEASEWEB_AWS_EC2_SERVER_URL>
Authorizations:
Authorization
query Parameters
LoadBalancerArns.member.N
string
Example: LoadBalancerArns.member.N=29145c92-4a68-4c63-aaeb-f2212d85a74a

The ID of the load balancer.

Names.member.N
string
Example: Names.member.N=test-name

The name of the load balancer.

PageSize
integer
Example: PageSize=10

The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output.

Marker
integer
Example: Marker=1

The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/aws/ec2/?LoadBalancerArns.member.N=SOME_STRING_VALUE&Names.member.N=SOME_STRING_VALUE&PageSize=SOME_INTEGER_VALUE&Marker=SOME_INTEGER_VALUE&Action=DescribeLoadBalancers' \
  --header 'Authorization: REPLACE_KEY_VALUE'

Response samples

Content type
application/xml
 <?xml version='1.0' encoding='UTF-8'?>
 <DescribeLoadBalancersResponse xmlns='http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/'>
 	<DescribeLoadBalancersResult>
 		<NextMarker>1</NextMarker>
 		<LoadBalancers>
 			<member>
 				<LoadBalancerArn>1ac942f4-cdd9-4c00-973f-ed82a92940cb</LoadBalancerArn>
 				<LoadBalancerName>Test</LoadBalancerArn>
 				<CreatedTime>2024-06-14T09:02,:31+00:00</CreatedTime>,
 				<Type>lsw.m3.large</Type>
 				<State>
 					<Code>active</Code>
 				</State>
 				<AvailabilityZones>
 					<member>
 						<ZoneName>eu-west-3</ZoneName>
 					</member>
 				</AvailabilityZones>
 			</member>
 		</LoadBalancers>
 	</DescribeLoadBalancersResult>
 	<ResponseMetadata>
 		<RequestId>8008e3fb-f671-46ab-ade4-871ca5508845</RequestId>
 	</ResponseMetadata>
 </DescribeLoadBalancersResponse>
 

RegisterTargets

Register one/multiple instance(s) to load balancer.

AWS CLI example

aws elbv2 register-targets --target-group-arn <LOAD_BALANCER_ID> --targets Id=<INSTANCE_ID> Id=<ANOTHER_INSTANCE_ID> --endpoint-url <LEASEWEB_AWS_EC2_SERVER_URL>
Authorizations:
Authorization
query Parameters
TargetGroupArn
required
string
Example: TargetGroupArn=29145c92-4a68-4c63-aaeb-f2212d85a74a

The ID of the load balancer.

Targets.member.N.Id
required
string
Example: Targets.member.N.Id=Targets.member.1.Id=800c43a4-8c74-4f92-9cd0-5fa883c8ca35&Targets.member.2.Id=810c43a4-8c74-4f92-9cd0-5fa883c8ca35

Instance ID(s) register to load balancer.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/aws/ec2/?TargetGroupArn=SOME_STRING_VALUE&Targets.member.N.Id=SOME_STRING_VALUE&Action=RegisterTargets' \
  --header 'Authorization: REPLACE_KEY_VALUE'

Response samples

Content type
application/xml
 <?xml version='1.0' encoding='UTF-8'?>
 <Empty/>
 

CreateListener

Create a listener for a load balancer.

The Load Balancer ID is required.

The default-actions parameter is required.

The protocol and port are optional. If not specified, a listener with "HTTP" and port "80" will be created by default.

AWS CLI example

aws elbv2 create-listener --load-balancer-arn <LOAD_BALANCER_ID> --protocol <PROTOCOL> --port <PORT> --default-actions --endpoint-url <LEASEWEB_AWS_EC2_SERVER_URL>
Authorizations:
Authorization
query Parameters
LoadBalancerArn
required
string
Example: LoadBalancerArn=29145c92-4a68-4c63-aaeb-f2212d85a74a

The ID of the load balancer.

Protocol
string
Enum: "HTTPS" "HTTP" "TCP"
Example: Protocol=HTTP

Protocol of the listener.

Port
integer
Example: Port=80

Port of the listener.

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/aws/ec2/?LoadBalancerArn=SOME_STRING_VALUE&Protocol=SOME_STRING_VALUE&Port=SOME_INTEGER_VALUE&Action=CreateListener' \
  --header 'Authorization: REPLACE_KEY_VALUE'

Response samples

Content type
application/xml
 <?xml version='1.0' encoding='UTF-8'?>
 <CreateListenerResponse xmlns='http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/'>
 	<CreateListenerResult>
 		<Listeners>
 			<member>
 				<LoadBalancerArn>1ac942f4-cdd9-4c00-973f-ed82a92940cb</LoadBalancerArn>
 				<Protocol>HTTP</Protocol>
 				<Port>80</Port>,
 				<ListenerArn>2ac942f4-cdd9-4c00-973f-ed82a92940cb</ListenerArn>
 			</member>
 		</Listeners>
 	</CreateListenerResult>
 	<ResponseMetadata>
 		<RequestId>8008e3fb-f671-46ab-ade4-871ca5508845</RequestId>
 	</ResponseMetadata>
 </CreateListenerResponse>