public class EC2Api extends Object
| Constructor and Description |
|---|
EC2Api() |
| Modifier and Type | Method and Description |
|---|---|
com.amazonaws.services.ec2.AmazonEC2 |
connect(String awsCredentialsId,
String regionName,
String endpoint) |
Set<String> |
describeTerminated(com.amazonaws.services.ec2.AmazonEC2 ec2,
Set<String> instanceIds) |
Set<String> |
describeTerminated(com.amazonaws.services.ec2.AmazonEC2 ec2,
Set<String> instanceIds,
int batchSize) |
String |
getEndpoint(String regionName,
String endpoint)
Derive EC2 API endpoint.
|
public Set<String> describeTerminated(com.amazonaws.services.ec2.AmazonEC2 ec2, Set<String> instanceIds)
public Set<String> describeTerminated(com.amazonaws.services.ec2.AmazonEC2 ec2, Set<String> instanceIds, int batchSize)
public com.amazonaws.services.ec2.AmazonEC2 connect(String awsCredentialsId, String regionName, String endpoint)
@Nullable public String getEndpoint(@Nullable String regionName, @Nullable String endpoint)
endpoint parameter not empty will use
it as first priority, otherwise will try to find region in RegionUtils by regionName
and use endpoint from it, if not available will generate endpoint as string and check if
region name looks like China cn- prefix.
Implementation details
RegionUtils is static information, and to get new region required to be updated,
as it's not possible too fast as you need to check new version of lib, moreover new version of lib
could be pointed to new version of Jenkins which is not a case for our plugin as some of installation
still on 1.6.x
For example latest AWS SDK lib depends on Jackson2 plugin which starting from version 2.8.7.0
require Jenkins at least 2.60 https://plugins.jenkins.io/jackson2-api
List of all AWS endpoints
https://docs.aws.amazon.com/general/latest/gr/rande.htmlregionName - like us-east-1 not a airport code, could be nullendpoint - custom endpoint could be nullnull or actual endpointCopyright © 2016–2019. All rights reserved.