Package hudson.plugins.ec2
Class EC2Cloud
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.Actionable
hudson.slaves.Cloud
hudson.plugins.ec2.EC2Cloud
- All Implemented Interfaces:
 ExtensionPoint,Describable<Cloud>,ModelObject,SearchableModelObject,SearchItem,AccessControlled,ModelObjectWithContextMenu
- Direct Known Subclasses:
 AmazonEC2Cloud
Hudson's view of EC2.
- Author:
 - Kohsuke Kawaguchi
 
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from class hudson.slaves.Cloud
Cloud.CloudStateNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType - 
Field Summary
Fields - 
Constructor Summary
ConstructorsModifierConstructorDescriptionEC2Cloud(String name, boolean useInstanceProfileForCredentials, String credentialsId, String region, String privateKey, String sshKeysCredentialsId, String instanceCapStr, List<? extends SlaveTemplate> templates, String roleArn, String roleSessionName) EC2Cloud(String name, boolean useInstanceProfileForCredentials, String credentialsId, String region, String privateKey, String instanceCapStr, List<? extends SlaveTemplate> templates, String roleArn, String roleSessionName) Deprecated.protectedEC2Cloud(String id, boolean useInstanceProfileForCredentials, String credentialsId, String privateKey, String instanceCapStr, List<? extends SlaveTemplate> templates, String roleArn, String roleSessionName) Deprecated. - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddTemplate(SlaveTemplate newTemplate) booleancanProvision(Label label) static URLcheckEndPoint(String url) software.amazon.awssdk.services.ec2.Ec2Clientconnect()Connects to EC2 and returnsEc2Client, which can then be used to communicate with EC2.static software.amazon.awssdk.core.client.config.ClientOverrideConfigurationprotected software.amazon.awssdk.auth.credentials.AwsCredentialsProviderstatic software.amazon.awssdk.auth.credentials.AwsCredentialsProvidercreateCredentialsProvider(boolean useInstanceProfileForCredentials, String credentialsId) static software.amazon.awssdk.auth.credentials.AwsCredentialsProvidercreateCredentialsProvider(boolean useInstanceProfileForCredentials, String credentialsId, String roleArn, String roleSessionName, String region) voiddoAttach(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, String id) Debug command to attach to a running instance.org.kohsuke.stapler.HttpResponsedoProvision(String template) Deprecated.Use public field "name" instead.static software.amazon.awssdk.http.SdkHttpClientintGets theKeyPairInfoused for the launch.getName()Deprecated.static StringgetSlaveTypeTagValue(String slaveType, String templateDescription) getTemplate(Label label) Deprecated.getTemplate(String template) getTemplates(Label label) Gets list ofSlaveTemplatethat matchesLabel.booleanbooleanbooleanstatic voidlog(Logger logger, Level level, TaskListener listener, String message) static voidstatic URIparseEndpoint(String input) static software.amazon.awssdk.regions.RegionparseRegion(String input) voidprovision(SlaveTemplate t, int number) protected ObjectvoidsetAltEC2Endpoint(String altEC2Endpoint) voidsetCleanUpOrphanedNodes(boolean cleanUpOrphanedNodes) voidsetNoDelayProvisioning(boolean noDelayProvisioning) voidupdateTemplate(SlaveTemplate newTemplate, String oldTemplateDescription) Methods inherited from class hudson.slaves.Cloud
all, canProvision, doConfigSubmit, doDoDelete, getACL, getDescriptor, getDisplayName, getIcon, getIconAltText, getIconClassName, getSearchUrl, getUrl, provision, reconfigure, reconfigure, registerPermissionsMethods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, getDynamic, removeAction, removeActions, replaceAction, replaceActionsMethods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2 
- 
Field Details
- 
DEFAULT_EC2_HOST
- See Also:
 
 - 
EC2_SLAVE_TYPE_SPOT
- See Also:
 
 - 
EC2_SLAVE_TYPE_DEMAND
- See Also:
 
 - 
EC2_REQUEST_EXPIRED_ERROR_CODE
- See Also:
 
 - 
SSH_PRIVATE_KEY_FILEPATH
 
 - 
 - 
Constructor Details
- 
EC2Cloud
 - 
EC2Cloud
@Deprecated public EC2Cloud(String name, boolean useInstanceProfileForCredentials, String credentialsId, String region, String privateKey, String instanceCapStr, List<? extends SlaveTemplate> templates, String roleArn, String roleSessionName) Deprecated. - 
EC2Cloud
@Deprecated protected EC2Cloud(String id, boolean useInstanceProfileForCredentials, String credentialsId, String privateKey, String instanceCapStr, List<? extends SlaveTemplate> templates, String roleArn, String roleSessionName) Deprecated. 
 - 
 - 
Method Details
- 
resolvePrivateKey
 - 
getCloudName
Deprecated.Use public field "name" instead. - 
getName
 - 
getRegion
 - 
parseRegion
@CheckForNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static software.amazon.awssdk.regions.Region parseRegion(@CheckForNull String input)  - 
parseEndpoint
 - 
isNoDelayProvisioning
public boolean isNoDelayProvisioning() - 
setNoDelayProvisioning
@DataBoundSetter public void setNoDelayProvisioning(boolean noDelayProvisioning)  - 
isCleanUpOrphanedNodes
public boolean isCleanUpOrphanedNodes() - 
setCleanUpOrphanedNodes
@DataBoundSetter public void setCleanUpOrphanedNodes(boolean cleanUpOrphanedNodes)  - 
getAltEC2Endpoint
 - 
setAltEC2Endpoint
 - 
addTemplate
- Throws:
 Exception
 - 
updateTemplate
public void updateTemplate(SlaveTemplate newTemplate, String oldTemplateDescription) throws Exception - Throws:
 Exception
 - 
readResolve
 - 
isUseInstanceProfileForCredentials
public boolean isUseInstanceProfileForCredentials() - 
getRoleArn
 - 
getRoleSessionName
 - 
getCredentialsId
 - 
getSshKeysCredentialsId
 - 
getPrivateKey
Deprecated. - 
getInstanceCapStr
 - 
getInstanceCap
public int getInstanceCap() - 
getTemplates
 - 
getTemplate
 - 
getTemplate
Deprecated.GetsSlaveTemplatethat has the matchingLabel. - 
getTemplates
Gets list ofSlaveTemplatethat matchesLabel. - 
getKeyPair
@CheckForNull public KeyPair getKeyPair() throws software.amazon.awssdk.core.exception.SdkException, IOExceptionGets theKeyPairInfoused for the launch.- Throws:
 software.amazon.awssdk.core.exception.SdkExceptionIOException
 - 
doAttach
public void doAttach(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter String id) throws jakarta.servlet.ServletException, IOException, software.amazon.awssdk.core.exception.SdkException Debug command to attach to a running instance.- Throws:
 jakarta.servlet.ServletExceptionIOExceptionsoftware.amazon.awssdk.core.exception.SdkException
 - 
doProvision
public org.kohsuke.stapler.HttpResponse doProvision(@QueryParameter String template) throws jakarta.servlet.ServletException, IOException - Throws:
 jakarta.servlet.ServletExceptionIOException
 - 
provision
 - 
provision
 - 
canProvision
- Overrides:
 canProvisionin classCloud
 - 
createCredentialsProvider
protected software.amazon.awssdk.auth.credentials.AwsCredentialsProvider createCredentialsProvider() - 
getSlaveTypeTagValue
 - 
createCredentialsProvider
public static software.amazon.awssdk.auth.credentials.AwsCredentialsProvider createCredentialsProvider(boolean useInstanceProfileForCredentials, String credentialsId)  - 
createCredentialsProvider
 - 
connect
public software.amazon.awssdk.services.ec2.Ec2Client connect() throws software.amazon.awssdk.core.exception.SdkExceptionConnects to EC2 and returnsEc2Client, which can then be used to communicate with EC2.- Throws:
 software.amazon.awssdk.core.exception.SdkException
 - 
getHttpClient
public static software.amazon.awssdk.http.SdkHttpClient getHttpClient() - 
createClientOverrideConfiguration
public static software.amazon.awssdk.core.client.config.ClientOverrideConfiguration createClientOverrideConfiguration() - 
checkEndPoint
- Throws:
 FormValidation
 - 
log
 - 
log
public static void log(Logger logger, Level level, TaskListener listener, String message, Throwable exception)  
 -