public abstract class EC2Cloud extends Cloud
Modifier and Type | Class and Description |
---|---|
static class |
EC2Cloud.DescriptorImpl |
static class |
EC2Cloud.EC2ConnectionUpdater |
Cloud.CloudState
ExtensionPoint.LegacyInstancesAreScopedToHudson
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem
Modifier and Type | Field and Description |
---|---|
static String |
AWS_CN_URL_HOST |
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)
Deprecated.
|
protected |
EC2Cloud(String id,
boolean useInstanceProfileForCredentials,
String credentialsId,
String privateKey,
String sshKeysCredentialsId,
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(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) |
static String |
getAwsPartitionHostForService(String region,
String service)
Returns the DNS endpoint for a AWS service based on region provided
|
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()
Deprecated.
|
String |
getRoleArn() |
String |
getRoleSessionName() |
abstract URL |
getS3EndpointUrl() |
static String |
getSlaveTypeTagValue(String slaveType,
String templateDescription) |
String |
getSshKeysCredentialsId() |
SlaveTemplate |
getTemplate(Label label)
Deprecated.
|
SlaveTemplate |
getTemplate(String template) |
List<SlaveTemplate> |
getTemplates() |
Collection<SlaveTemplate> |
getTemplates(Label label)
Gets list of
SlaveTemplate that matches Label . |
boolean |
isUseInstanceProfileForCredentials() |
static void |
log(Logger logger,
Level level,
TaskListener listener,
String message) |
static void |
log(Logger logger,
Level level,
TaskListener listener,
String message,
Throwable exception) |
Collection<NodeProvisioner.PlannedNode> |
provision(Label label,
int excessWorkload) |
void |
provision(SlaveTemplate t,
int number) |
protected Object |
readResolve() |
EC2PrivateKey |
resolvePrivateKey() |
all, canProvision, getACL, getDescriptor, getDisplayName, getSearchUrl, getUrl, provision
addAction, addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, removeAction, removeActions, replaceAction, replaceActions
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2
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 AWS_CN_URL_HOST
public static final String EC2_SLAVE_TYPE_SPOT
public static final String EC2_SLAVE_TYPE_DEMAND
protected EC2Cloud(String id, boolean useInstanceProfileForCredentials, String credentialsId, String privateKey, String sshKeysCredentialsId, String instanceCapStr, List<? extends SlaveTemplate> templates, String roleArn, String roleSessionName)
@Deprecated protected EC2Cloud(String id, boolean useInstanceProfileForCredentials, String credentialsId, String privateKey, String instanceCapStr, List<? extends SlaveTemplate> templates, String roleArn, String roleSessionName)
@CheckForNull public EC2PrivateKey resolvePrivateKey()
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()
@CheckForNull public String getSshKeysCredentialsId()
@Deprecated public EC2PrivateKey getPrivateKey()
public String getInstanceCapStr()
public int getInstanceCap()
public List<SlaveTemplate> getTemplates()
@CheckForNull public SlaveTemplate getTemplate(String template)
@Deprecated public SlaveTemplate getTemplate(Label label)
SlaveTemplate
that has the matching Label
.public Collection<SlaveTemplate> getTemplates(Label label)
SlaveTemplate
that matches Label
.@CheckForNull 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<NodeProvisioner.PlannedNode> provision(Label label, int excessWorkload)
public void provision(SlaveTemplate t, int number)
public boolean canProvision(Label label)
canProvision
in class 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 getAwsPartitionHostForService(String region, String service)
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 FormValidation
FormValidation
public static void log(Logger logger, Level level, TaskListener listener, String message)
public static void log(Logger logger, Level level, TaskListener listener, String message, Throwable exception)
Copyright © 2016–2022. All rights reserved.