public class ElasticImageConfigurationManagerImpl extends Object implements ElasticImageConfigurationManager
DEFAULT_AVAILABILITY_ZONE, IMAGE_CAPABILITIES_FILE, WINDOWS_IMAGE_CAPABILITIES_FILE
Constructor and Description |
---|
ElasticImageConfigurationManagerImpl(ElasticImageConfigurationDao elasticImageConfigurationDao,
ResourceResolver resourceResolver,
ElasticImageConfigurationAccessor elasticImageConfigurationAccessor,
ElasticInstanceScheduleManager elasticInstanceScheduleManager,
AgentAssignmentService agentAssignmentService,
com.atlassian.event.api.EventPublisher eventPublisher,
AwsAccountBean awsAccountBean) |
Modifier and Type | Method and Description |
---|---|
void |
disableElasticImageSchedules(ElasticImageConfiguration elasticImageConfiguration)
Disable all enabled Elastic Image Schedules associated with the Elastic Image Configuration
|
List<ElasticImageConfiguration> |
getAllElasticImageConfigurations()
Retrieves all elastic images that are stored in database
|
List<ElasticImageConfiguration> |
getAllElasticImageConfigurationsForCurrentRegion() |
int |
getBuildsCountForImageConfiguration(long id)
Returns how many builds have been built against the given build configuration.
|
int |
getElasticAgentCountForImageConfiguration(long id)
How many elastic agents are associated with a specific image configuration.
|
ElasticImageConfiguration |
getElasticImageConfigurationById(long configurationId)
Retrieve an elastic image.
|
List<ElasticImageConfiguration> |
getElasticImageConfigurationsByName(String configurationName,
com.atlassian.aws.ec2.awssdk.AwsSupportConstants.Region region)
Retrieve an elastic image by name in a given region.
|
List<ElasticImageConfiguration> |
getElasticImageConfigurationsShippedWithBamboo() |
void |
onInstanceFailedToStartEvent(ElasticImageFailedToStartEvent event) |
void |
populateDefaultCapabilitySet(CapabilitySet capabilitySet,
ElasticImageConfiguration imageConfiguration)
Populates capability set with default capabilities from from
ElasticImageConfigurationManager.IMAGE_CAPABILITIES_FILE . |
void |
removeElasticImageConfiguration(ElasticImageConfiguration elasticImageConfiguration)
Delete an elastic image configuration.
|
void |
saveElasticImageConfiguration(ElasticImageConfiguration elasticImageConfiguration)
Save an elastic image configuration.
|
void |
updateDefaultElasticImageConfiguration()
Performs startup operations for setting up an elastic image, including
retrieving capability information.
|
public ElasticImageConfigurationManagerImpl(ElasticImageConfigurationDao elasticImageConfigurationDao, ResourceResolver resourceResolver, ElasticImageConfigurationAccessor elasticImageConfigurationAccessor, ElasticInstanceScheduleManager elasticInstanceScheduleManager, AgentAssignmentService agentAssignmentService, com.atlassian.event.api.EventPublisher eventPublisher, AwsAccountBean awsAccountBean)
@Nullable public ElasticImageConfiguration getElasticImageConfigurationById(long configurationId)
ElasticImageConfigurationAccessor
getElasticImageConfigurationById
in interface ElasticImageConfigurationAccessor
configurationId
- - id of the ElasticImageConfiguration to find@NotNull public List<ElasticImageConfiguration> getElasticImageConfigurationsByName(@NotNull String configurationName, @NotNull com.atlassian.aws.ec2.awssdk.AwsSupportConstants.Region region)
ElasticImageConfigurationAccessor
getElasticImageConfigurationsByName
in interface ElasticImageConfigurationAccessor
configurationName
- - name of the ElasticImageConfiguration to findregion
- the region to check@NotNull public List<ElasticImageConfiguration> getElasticImageConfigurationsShippedWithBamboo()
getElasticImageConfigurationsShippedWithBamboo
in interface ElasticImageConfigurationAccessor
@NotNull public List<ElasticImageConfiguration> getAllElasticImageConfigurations()
ElasticImageConfigurationAccessor
getAllElasticImageConfigurations
in interface ElasticImageConfigurationAccessor
@NotNull public List<ElasticImageConfiguration> getAllElasticImageConfigurationsForCurrentRegion()
getAllElasticImageConfigurationsForCurrentRegion
in interface ElasticImageConfigurationAccessor
public void saveElasticImageConfiguration(@NotNull ElasticImageConfiguration elasticImageConfiguration)
ElasticImageConfigurationManager
saveElasticImageConfiguration
in interface ElasticImageConfigurationManager
elasticImageConfiguration
- Elastic Image Configuration to be saved.public int getElasticAgentCountForImageConfiguration(long id)
ElasticImageConfigurationManager
getElasticAgentCountForImageConfiguration
in interface ElasticImageConfigurationManager
id
- of the image configurationpublic int getBuildsCountForImageConfiguration(long id)
ElasticImageConfigurationManager
getBuildsCountForImageConfiguration
in interface ElasticImageConfigurationManager
id
- of the elastic image configurationpublic void removeElasticImageConfiguration(@NotNull ElasticImageConfiguration elasticImageConfiguration) throws com.atlassian.aws.AWSException
ElasticImageConfigurationManager
ElasticInstanceSchedule
objectsremoveElasticImageConfiguration
in interface ElasticImageConfigurationManager
elasticImageConfiguration
- Elastic Image Configuration to be deleted.com.atlassian.aws.AWSException
public void disableElasticImageSchedules(@NotNull ElasticImageConfiguration elasticImageConfiguration)
ElasticImageConfigurationManager
disableElasticImageSchedules
in interface ElasticImageConfigurationManager
public void updateDefaultElasticImageConfiguration() throws Exception
ElasticImageConfigurationManager
updateDefaultElasticImageConfiguration
in interface ElasticImageConfigurationManager
Exception
- if it can not find the default image information to setup@EventListener public void onInstanceFailedToStartEvent(@NotNull ElasticImageFailedToStartEvent event)
public void populateDefaultCapabilitySet(CapabilitySet capabilitySet, ElasticImageConfiguration imageConfiguration)
ElasticImageConfigurationManager
ElasticImageConfigurationManager.IMAGE_CAPABILITIES_FILE
.
Will overwrite any existing capabilities.populateDefaultCapabilitySet
in interface ElasticImageConfigurationManager
capabilitySet
- to populate with the defaults.Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.