public abstract class EC2Cloud
extends hudson.slaves.Cloud
Modifier and Type | Class and Description |
---|---|
static class |
EC2Cloud.DescriptorImpl |
static class |
EC2Cloud.EC2ConnectionUpdater |
Modifier and Type | Field and Description |
---|---|
static String |
AWS_URL_HOST |
static String |
DEFAULT_EC2_ENDPOINT |
static String |
DEFAULT_EC2_HOST |
static String |
EC2_SLAVE_TYPE_DEMAND |
static String |
EC2_SLAVE_TYPE_SPOT |
Modifier | Constructor and Description |
---|---|
protected |
EC2Cloud(String id,
boolean useInstanceProfileForCredentials,
String credentialsId,
String privateKey,
String instanceCapStr,
List<? extends SlaveTemplate> templates,
String roleArn,
String roleSessionName) |
Modifier and Type | Method and Description |
---|---|
URL |
buildPresignedURL(String path)
Computes the presigned URL for the given S3 resource.
|
boolean |
canProvision(hudson.model.Label label) |
static URL |
checkEndPoint(String url) |
com.amazonaws.services.ec2.AmazonEC2 |
connect()
Connects to EC2 and returns
AmazonEC2 , which can then be used to communicate with EC2. |
static String |
convertHostName(String ec2HostName)
Convert a configured hostname like 'us-east-1' to a FQDN or ip address
|
static Integer |
convertPort(String ec2Port)
Convert a user entered string into a port number "" -> -1 to indicate default based on SSL setting
|
static com.amazonaws.ClientConfiguration |
createClientConfiguration(String host) |
protected com.amazonaws.auth.AWSCredentialsProvider |
createCredentialsProvider() |
static com.amazonaws.auth.AWSCredentialsProvider |
createCredentialsProvider(boolean useInstanceProfileForCredentials,
String credentialsId) |
static com.amazonaws.auth.AWSCredentialsProvider |
createCredentialsProvider(boolean useInstanceProfileForCredentials,
String credentialsId,
String roleArn,
String roleSessionName,
String region) |
void |
doAttach(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp,
String id)
Debug command to attach to a running instance.
|
org.kohsuke.stapler.HttpResponse |
doProvision(String template) |
String |
getCredentialsId() |
abstract URL |
getEc2EndpointUrl() |
int |
getInstanceCap() |
String |
getInstanceCapStr() |
com.amazonaws.services.ec2.model.KeyPair |
getKeyPair()
Gets the
KeyPairInfo used for the launch. |
EC2PrivateKey |
getPrivateKey() |
String |
getRoleArn() |
String |
getRoleSessionName() |
abstract URL |
getS3EndpointUrl() |
static String |
getSlaveTypeTagValue(String slaveType,
String templateDescription) |
SlaveTemplate |
getTemplate(hudson.model.Label label)
Gets
SlaveTemplate that has the matching Label . |
SlaveTemplate |
getTemplate(String template) |
List<SlaveTemplate> |
getTemplates() |
boolean |
isUseInstanceProfileForCredentials() |
static void |
log(Logger logger,
Level level,
hudson.model.TaskListener listener,
String message) |
static void |
log(Logger logger,
Level level,
hudson.model.TaskListener listener,
String message,
Throwable exception) |
Collection<hudson.slaves.NodeProvisioner.PlannedNode> |
provision(hudson.model.Label label,
int excessWorkload) |
void |
provision(SlaveTemplate t,
int number) |
protected Object |
readResolve() |
all, getACL, getDescriptor, getDisplayName, getSearchUrl, getUrl
addAction, addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, removeAction, removeActions, replaceAction, replaceActions
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
public static final String DEFAULT_EC2_HOST
public static final String DEFAULT_EC2_ENDPOINT
public static final String AWS_URL_HOST
public static final String EC2_SLAVE_TYPE_SPOT
public static final String EC2_SLAVE_TYPE_DEMAND
public abstract URL getEc2EndpointUrl() throws IOException
IOException
public abstract URL getS3EndpointUrl() throws IOException
IOException
protected Object readResolve()
public boolean isUseInstanceProfileForCredentials()
public String getRoleArn()
public String getRoleSessionName()
public String getCredentialsId()
public EC2PrivateKey getPrivateKey()
public String getInstanceCapStr()
public int getInstanceCap()
public List<SlaveTemplate> getTemplates()
@CheckForNull public SlaveTemplate getTemplate(String template)
public SlaveTemplate getTemplate(hudson.model.Label label)
SlaveTemplate
that has the matching Label
.public com.amazonaws.services.ec2.model.KeyPair getKeyPair() throws com.amazonaws.AmazonClientException, IOException
KeyPairInfo
used for the launch.com.amazonaws.AmazonClientException
IOException
public void doAttach(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter String id) throws javax.servlet.ServletException, IOException, com.amazonaws.AmazonClientException
javax.servlet.ServletException
IOException
com.amazonaws.AmazonClientException
public org.kohsuke.stapler.HttpResponse doProvision(@QueryParameter String template) throws javax.servlet.ServletException, IOException
javax.servlet.ServletException
IOException
public Collection<hudson.slaves.NodeProvisioner.PlannedNode> provision(hudson.model.Label label, int excessWorkload)
provision
in class hudson.slaves.Cloud
public void provision(SlaveTemplate t, int number)
public boolean canProvision(hudson.model.Label label)
canProvision
in class hudson.slaves.Cloud
protected com.amazonaws.auth.AWSCredentialsProvider createCredentialsProvider()
public static String getSlaveTypeTagValue(String slaveType, String templateDescription)
public static com.amazonaws.auth.AWSCredentialsProvider createCredentialsProvider(boolean useInstanceProfileForCredentials, String credentialsId)
public static com.amazonaws.auth.AWSCredentialsProvider createCredentialsProvider(boolean useInstanceProfileForCredentials, String credentialsId, String roleArn, String roleSessionName, String region)
public com.amazonaws.services.ec2.AmazonEC2 connect() throws com.amazonaws.AmazonClientException
AmazonEC2
, which can then be used to communicate with EC2.com.amazonaws.AmazonClientException
public static com.amazonaws.ClientConfiguration createClientConfiguration(String host)
public static String convertHostName(String ec2HostName)
public static Integer convertPort(String ec2Port)
public URL buildPresignedURL(String path) throws com.amazonaws.AmazonClientException
path
- String like "/bucketName/folder/folder/abc.txt" that represents the resource to request.com.amazonaws.AmazonClientException
public static URL checkEndPoint(String url) throws hudson.util.FormValidation
hudson.util.FormValidation
public static void log(Logger logger, Level level, hudson.model.TaskListener listener, String message)
Copyright © 2016–2020. All rights reserved.