Class AlibabaInstancesComputeSource
java.lang.Object
co.yellowdog.platform.model.AlibabaInstancesComputeSource
- All Implemented Interfaces:
AlibabaComputeSource
,ComputeSource
,Credentialed
,Identified
,Named
,Serializable
@JsonClassDescription("Details needed for provisioning instances from Alibaba Cloud")
public class AlibabaInstancesComputeSource
extends Object
implements AlibabaComputeSource
Defines a source of compute composed of Alibaba Cloud ECS instances.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A builder that can be used to build a new AlibabaInstancesComputeSource that is automatically validated on build. -
Field Summary
Fields inherited from interface co.yellowdog.platform.model.ComputeSource
DEFAULT_ASSIGN_PUBLIC_IP
-
Constructor Summary
ConstructorsConstructorDescriptionAlibabaInstancesComputeSource
(String name, String credential, String region, String availabilityZone, String securityGroupId, String vSwitchId, String instanceType, String imageId, AlibabaInstanceChargeType instanceChargeType, AlibabaSpotStrategy spotStrategy, Float spotPriceLimit, int limit, boolean specifyMinimum, Boolean assignPublicIp, String keyName, String ramRoleName, String userData, Map<String, String> instanceTags) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
protected boolean
boolean
The Alibaba Cloud availability zone within the region where instances will be provisioned.Gets the ID of the source template if this source was created from a template.Return the names of the credentials to be used for this Credentialed entity.If this source is associated with an exhausted allowance, gets the exhaustion state.getId()
Returns the IDThe region-specific Alibaba Cloud ID for the image to use for the provisioned instances.The Alibaba Cloud charge type to use for the provisioned instances.Gets the instance pricing for this source, e.g.A summary of instance counts according to instance statusGets the custom instance tags to be set on the provisioned instance at startup.The Alibaba Cloud instance type for the provisioned instances.The name of the Alibaba Cloud key pair to use when logging into any instances provisioned from this source.int
getLimit()
Returns the limit in number of instances that can be provisioned from this source.getName()
The name of the compute source.The name of the RAM Role to use for the provisioned instances.The Alibaba Cloud region where instances will be provisioned.The ID of the Alibaba Cloud Security Group for the provisioned instances.The Alibaba Cloud spot price limit to use with SPOT_WITH_PRICE_LIMIT spot strategy.The Alibaba Cloud spot strategy to use when provisioning instances.Gets the current provisioning status of this source.Gets the message associated with the current provisioning status of this source.Indicates if supporting resources have been created for this source.Returns an object describing behavioural traits specific to this compute source.Gets the user-data script to be passed to the provisioned instance at startup.The ID of the virtual switch to use for the provisioned instances.int
hashCode()
boolean
Indicates if provisioned instances should be assigned public IP addresses.boolean
Indicates if YellowDog Compute should specify the minimum when requesting instances from Alibaba Cloud.void
setAssignPublicIp
(boolean assignPublicIp) Indicates if provisioned instances should be assigned public IP addresses.void
setAvailabilityZone
(String availabilityZone) The Alibaba Cloud availability zone within the region where instances will be provisioned.void
setCreatedFromId
(String createdFromId) Sets the source template IDvoid
setCredential
(String credential) void
setExhaustion
(ComputeSourceExhaustion exhaustion) void
Sets the IDvoid
setImageId
(String imageId) The region-specific Alibaba Cloud ID for the image to use for the provisioned instances.void
setInstanceChargeType
(AlibabaInstanceChargeType instanceChargeType) The Alibaba Cloud charge type to use for the provisioned instances.void
setInstanceSummary
(InstanceSummary instanceSummary) void
setInstanceTags
(Map<@AlibabaInstanceTagKey String, @AlibabaInstanceTagValue String> instanceTags) Sets the custom instance tags to be set on the provisioned instance at startup.void
setInstanceType
(String instanceType) The Alibaba Cloud instance type for the provisioned instances.void
setKeyName
(String keyName) The name of the Alibaba Cloud key pair to use when logging into any instances provisioned from this source.void
setLimit
(int limit) Sets the limit in number of instances that can be provisioned from this source.void
The name of the compute source.void
setRamRoleName
(String ramRoleName) The name of the RAM Role to use for the provisioned instances.void
The Alibaba Cloud region where instances will be provisioned.void
setSecurityGroupId
(String securityGroupId) The ID of the Alibaba Cloud Security Group for the provisioned instances.void
setSpecifyMinimum
(boolean specifyMinimum) Indicates if YellowDog Compute should specify the minimum when requesting instances from Alibaba Cloud.void
setSpotPriceLimit
(Float spotPriceLimit) The Alibaba Cloud spot price limit to use with SPOT_WITH_PRICE_LIMIT spot strategy.void
setSpotStrategy
(AlibabaSpotStrategy spotStrategy) The Alibaba Cloud spot strategy to use when provisioning instances.void
setStatus
(ComputeSourceStatus status) Sets the current provisioning status of this source.void
setStatusMessage
(String statusMessage) Sets the message associated with the current provisioning status of this source.void
setUserData
(String userData) Sets the user-data script to be passed to the provisioned instance at startup.void
setVSwitchId
(String vSwitchId) The ID of the virtual switch to use for the provisioned instances.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface co.yellowdog.platform.model.AlibabaComputeSource
getProvider, getSubregion
-
Constructor Details
-
AlibabaInstancesComputeSource
public AlibabaInstancesComputeSource(String name, String credential, String region, String availabilityZone, String securityGroupId, String vSwitchId, String instanceType, String imageId, AlibabaInstanceChargeType instanceChargeType, AlibabaSpotStrategy spotStrategy, Float spotPriceLimit, int limit, boolean specifyMinimum, Boolean assignPublicIp, String keyName, String ramRoleName, String userData, Map<String, String> instanceTags)
-
-
Method Details
-
getTraits
Description copied from interface:ComputeSource
Returns an object describing behavioural traits specific to this compute source.- Specified by:
getTraits
in interfaceComputeSource
- Returns:
- an object describing behavioural traits specific to this compute source
-
getInstancePricing
Description copied from interface:ComputeSource
Gets the instance pricing for this source, e.g. Spot- Specified by:
getInstancePricing
in interfaceComputeSource
- Returns:
- the instance pricing for this source
-
getCredentials
Description copied from interface:Credentialed
Return the names of the credentials to be used for this Credentialed entity.- Specified by:
getCredentials
in interfaceCredentialed
- Returns:
- the names of the credentials to be used
-
getSupportingResourceCreated
Description copied from interface:ComputeSource
Indicates if supporting resources have been created for this source.- Specified by:
getSupportingResourceCreated
in interfaceComputeSource
- Returns:
- true, if supporting resources have been created for this source; false, if no supporting resources have been created; null, if unknown
-
builder
-
toBuilder
-
getId
Description copied from interface:Identified
Returns the ID- Specified by:
getId
in interfaceComputeSource
- Specified by:
getId
in interfaceIdentified
- Returns:
- the ID
-
getCreatedFromId
Description copied from interface:ComputeSource
Gets the ID of the source template if this source was created from a template.- Specified by:
getCreatedFromId
in interfaceComputeSource
- Returns:
- the ID of the source template if this source was created from a template
-
getName
The name of the compute source. This must be unique within a compute requirement.- Specified by:
getName
in interfaceComputeSource
- Specified by:
getName
in interfaceNamed
- Returns:
- the name of the compute source
-
getCredential
- Specified by:
getCredential
in interfaceAlibabaComputeSource
- Specified by:
getCredential
in interfaceComputeSource
-
getRegion
The Alibaba Cloud region where instances will be provisioned.- Specified by:
getRegion
in interfaceComputeSource
- Returns:
- the Alibaba Cloud region where instances will be provisioned
-
getAvailabilityZone
The Alibaba Cloud availability zone within the region where instances will be provisioned.- Specified by:
getAvailabilityZone
in interfaceAlibabaComputeSource
- Returns:
- the Alibaba Cloud availability zone where instances will be provisioned
-
getSecurityGroupId
The ID of the Alibaba Cloud Security Group for the provisioned instances.- Returns:
- the ID of the Alibaba Cloud Security Group for the provisioned instances
-
getInstanceType
The Alibaba Cloud instance type for the provisioned instances.- Specified by:
getInstanceType
in interfaceComputeSource
- Returns:
- the Alibaba Cloud instance type for the provisioned instances
-
getImageId
The region-specific Alibaba Cloud ID for the image to use for the provisioned instances.- Specified by:
getImageId
in interfaceComputeSource
- Returns:
- the Alibaba Cloud ID for the image to use for the provisioned instances
-
getUserData
Description copied from interface:ComputeSource
Gets the user-data script to be passed to the provisioned instance at startup.- Specified by:
getUserData
in interfaceComputeSource
- Returns:
- the user-data script
-
getInstanceTags
Description copied from interface:ComputeSource
Gets the custom instance tags to be set on the provisioned instance at startup.- Specified by:
getInstanceTags
in interfaceComputeSource
- Returns:
- the custom instance tags
-
getRamRoleName
The name of the RAM Role to use for the provisioned instances.- Returns:
- the name of the RAM Role to use
-
getKeyName
The name of the Alibaba Cloud key pair to use when logging into any instances provisioned from this source.- Returns:
- the name of the key pair to use
-
getInstanceChargeType
The Alibaba Cloud charge type to use for the provisioned instances.- Returns:
- the Alibaba Cloud charge type to use for the provisioned instances
-
isAssignPublicIp
public boolean isAssignPublicIp()Indicates if provisioned instances should be assigned public IP addresses.- Returns:
- true, if provisioned instances should be assigned public IP addresses; otherwise, false
-
getSpotStrategy
The Alibaba Cloud spot strategy to use when provisioning instances.- Returns:
- the Alibaba Cloud spot strategy to use when provisioning instances
-
getSpotPriceLimit
The Alibaba Cloud spot price limit to use with SPOT_WITH_PRICE_LIMIT spot strategy.- Returns:
- the Alibaba Cloud spot price limit to use with SPOT_WITH_PRICE_LIMIT spot strategy
-
getLimit
public int getLimit()Description copied from interface:ComputeSource
Returns the limit in number of instances that can be provisioned from this source.- Specified by:
getLimit
in interfaceComputeSource
- Returns:
- the limit in number of instances that can be provisioned from this source
-
isSpecifyMinimum
public boolean isSpecifyMinimum()Indicates if YellowDog Compute should specify the minimum when requesting instances from Alibaba Cloud. If true, then no instances are provisioned unless all requested instances are available; otherwise, if false, YellowDog Compute will provision as many instances as possible up to the number requested from this compute source.- Returns:
- true, if YellowDog Compute should specify minimum instance count to Alibaba Cloud; otherwise, false
-
getInstanceSummary
Description copied from interface:ComputeSource
A summary of instance counts according to instance status- Specified by:
getInstanceSummary
in interfaceComputeSource
- Returns:
- a summary of instance counts according to instance status
-
getStatus
Description copied from interface:ComputeSource
Gets the current provisioning status of this source.- Specified by:
getStatus
in interfaceComputeSource
- Returns:
- the current provisioning status of this source
-
getStatusMessage
Description copied from interface:ComputeSource
Gets the message associated with the current provisioning status of this source. Returns null if no further detail is relevant to the status.- Specified by:
getStatusMessage
in interfaceComputeSource
- Returns:
- the message associated with the current provisioning status of this source
-
getExhaustion
Description copied from interface:ComputeSource
If this source is associated with an exhausted allowance, gets the exhaustion state.- Specified by:
getExhaustion
in interfaceComputeSource
- Returns:
- the exhaustion state, if the source is associated with an exhausted allowance; otherwise, null
-
setId
Description copied from interface:ComputeSource
Sets the ID- Specified by:
setId
in interfaceComputeSource
- Parameters:
id
- This should only be set by the YellowDog Platform
-
setCreatedFromId
Description copied from interface:ComputeSource
Sets the source template ID- Specified by:
setCreatedFromId
in interfaceComputeSource
- Parameters:
createdFromId
- This should only be set by the YellowDog Platform
-
setName
The name of the compute source. This must be unique within a compute requirement.- Specified by:
setName
in interfaceComputeSource
- Parameters:
name
- the name of the compute source
This should not be changed once the requirement has been submitted to YellowDog Compute.
-
setCredential
-
setRegion
The Alibaba Cloud region where instances will be provisioned.- Parameters:
region
- the Alibaba Cloud region where instances will be provisioned
This should not be changed once the requirement has been submitted to YellowDog Compute.
-
setAvailabilityZone
The Alibaba Cloud availability zone within the region where instances will be provisioned.- Parameters:
availabilityZone
- the Alibaba Cloud availability zone where instances will be provisioned
This should not be changed once the requirement has been submitted to YellowDog Compute.
-
setVSwitchId
The ID of the virtual switch to use for the provisioned instances.- Parameters:
vSwitchId
- the ID of the virtual switch to use
-
setSecurityGroupId
The ID of the Alibaba Cloud Security Group for the provisioned instances.- Parameters:
securityGroupId
- the ID of the Alibaba Cloud Security Group for the provisioned instances
-
setInstanceType
The Alibaba Cloud instance type for the provisioned instances.- Specified by:
setInstanceType
in interfaceComputeSource
- Parameters:
instanceType
- the Alibaba Cloud instance type for the provisioned instances
-
setImageId
The region-specific Alibaba Cloud ID for the image to use for the provisioned instances.- Specified by:
setImageId
in interfaceComputeSource
- Parameters:
imageId
- the Alibaba Cloud ID for the image to use for the provisioned instances
-
setUserData
Description copied from interface:ComputeSource
Sets the user-data script to be passed to the provisioned instance at startup.- Specified by:
setUserData
in interfaceComputeSource
- Parameters:
userData
- the user-data script
-
setInstanceTags
public void setInstanceTags(Map<@AlibabaInstanceTagKey String, @AlibabaInstanceTagValue String> instanceTags) Description copied from interface:ComputeSource
Sets the custom instance tags to be set on the provisioned instance at startup.- Specified by:
setInstanceTags
in interfaceComputeSource
- Parameters:
instanceTags
- the custom instance tags
-
setRamRoleName
The name of the RAM Role to use for the provisioned instances.- Parameters:
ramRoleName
- the name of the RAM Role to use
-
setKeyName
The name of the Alibaba Cloud key pair to use when logging into any instances provisioned from this source.- Parameters:
keyName
- the name of the key pair to use
-
setInstanceChargeType
The Alibaba Cloud charge type to use for the provisioned instances.- Parameters:
instanceChargeType
- the Alibaba Cloud charge type to use for the provisioned instances
-
setAssignPublicIp
public void setAssignPublicIp(boolean assignPublicIp) Indicates if provisioned instances should be assigned public IP addresses.- Parameters:
assignPublicIp
- true, if provisioned instances should be assigned public IP addresses; otherwise, false
-
setSpotStrategy
The Alibaba Cloud spot strategy to use when provisioning instances.- Parameters:
spotStrategy
- the Alibaba Cloud spot strategy to use when provisioning instances
-
setSpotPriceLimit
The Alibaba Cloud spot price limit to use with SPOT_WITH_PRICE_LIMIT spot strategy.- Parameters:
spotPriceLimit
- the Alibaba Cloud spot price limit to use with SPOT_WITH_PRICE_LIMIT spot strategy
-
setLimit
public void setLimit(int limit) Description copied from interface:ComputeSource
Sets the limit in number of instances that can be provisioned from this source.- Specified by:
setLimit
in interfaceComputeSource
- Parameters:
limit
- the limit in number of instances that can be provisioned from this source
-
setSpecifyMinimum
public void setSpecifyMinimum(boolean specifyMinimum) Indicates if YellowDog Compute should specify the minimum when requesting instances from Alibaba Cloud. If true, then no instances are provisioned unless all requested instances are available; otherwise, if false, YellowDog Compute will provision as many instances as possible up to the number requested from this compute source.- Parameters:
specifyMinimum
- true, if YellowDog Compute should specify minimum instance count to Alibaba Cloud; otherwise, false
-
setInstanceSummary
- Specified by:
setInstanceSummary
in interfaceComputeSource
-
setStatus
Description copied from interface:ComputeSource
Sets the current provisioning status of this source.- Specified by:
setStatus
in interfaceComputeSource
- Parameters:
status
- This should only be set by the YellowDog Platform
-
setStatusMessage
Description copied from interface:ComputeSource
Sets the message associated with the current provisioning status of this source.- Specified by:
setStatusMessage
in interfaceComputeSource
- Parameters:
statusMessage
- This should only be set by the YellowDog Platform
-
setExhaustion
- Specified by:
setExhaustion
in interfaceComputeSource
-
equals
-
canEqual
-
hashCode
-
toString
-
getVSwitchId
The ID of the virtual switch to use for the provisioned instances.- Returns:
- the ID of the virtual switch to use
-