Class GceInstancesComputeSource
java.lang.Object
co.yellowdog.platform.model.GceInstancesComputeSource
- All Implemented Interfaces:
ComputeSource
,Credentialed
,GceComputeSource
,Identified
,Named
,Serializable
@ValidatedBy(GceInstancesComputeSourceValidator.class)
@JsonClassDescription("Details needed for provisioning distinct instances from Google Compute Engine (GCE)")
public class GceInstancesComputeSource
extends Object
implements GceComputeSource
Defines a source of compute composed of Google Compute Engine (GCE) instances individually provisioned.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A builder that can be used to build a new GceInstancesComputeSource that is automatically validated on build. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The maximum number of instances that can be requested in a single API call to GCEFields inherited from interface co.yellowdog.platform.model.ComputeSource
DEFAULT_ASSIGN_PUBLIC_IP
-
Constructor Summary
ConstructorsConstructorDescriptionGceInstancesComputeSource
(String name, String credential, int limit, Boolean assignPublicIp, String userData, Map<String, String> instanceTags, String sshKeys, String project, String region, String zone, String machineType, String image, String network, String subnetwork, boolean preemptible, boolean spot, boolean confidential, String acceleratorType, int acceleratorCount) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
protected boolean
boolean
int
Indicates if instances should be provisioned using a compact placement policy.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 IDgetImage()
A summary of instance counts according to instance statusGets the custom instance tags to be set on the provisioned instance at startup.int
getLimit()
Returns the limit in number of instances that can be provisioned from this source.getName()
Returns the name of this compute source (which must be unique within the containing ComputeRequirement).Gets the provider-specific region where instances will be provisioned.A list of public SSH keys.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.getZone()
int
hashCode()
boolean
Indicates if provisioned instances should be assigned public IP addresses.boolean
boolean
boolean
Indicates if YellowDog Compute should specify the minimum when requesting instances.boolean
isSpot()
void
setAcceleratorCount
(int acceleratorCount) void
setAcceleratorType
(String acceleratorType) void
setAssignPublicIp
(boolean assignPublicIp) Indicates if provisioned instances should be assigned public IP addresses.void
setConfidential
(boolean confidential) void
setCreateCompactPlacementPolicy
(Boolean createCompactPlacementPolicy) Indicates if instances should be provisioned using a compact placement policy.void
setCreatedFromId
(String createdFromId) Sets the source template IDvoid
setCredential
(String credential) void
setExhaustion
(ComputeSourceExhaustion exhaustion) void
setHostMaintenanceBehaviour
(GceHostMaintenanceBehaviour hostMaintenanceBehaviour) void
Sets the IDvoid
void
setInstanceSummary
(InstanceSummary instanceSummary) void
setInstanceTags
(Map<@GceInstanceTagKey String, @GceInstanceTagValue String> instanceTags) Sets the custom instance tags to be set on the provisioned instance at startup.void
setLimit
(int limit) Sets the limit in number of instances that can be provisioned from this source.void
setMachineType
(String machineType) void
Sets the name of this compute source (which must be unique within the containing ComputeRequirement).void
setNetwork
(String network) void
setPreemptible
(boolean preemptible) void
setProject
(String project) void
void
setSpecifyMinimum
(boolean specifyMinimum) Indicates if YellowDog Compute should specify the minimum when requesting instances.void
setSpot
(boolean spot) void
setSshKeys
(String sshKeys) A list of public SSH keys.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
setSubnetwork
(String subnetwork) void
setSupportingResourceCreated
(Boolean supportingResourceCreated) void
setUserData
(String userData) Sets the user-data script to be passed to the provisioned instance at startup.void
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface co.yellowdog.platform.model.GceComputeSource
getImageId, getInstancePricing, getInstanceType, getProvider, getSubregion, setImageId, setInstanceType
-
Field Details
-
BULK_INSERT_SINGLE_REQUEST_MAX
public static final int BULK_INSERT_SINGLE_REQUEST_MAXThe maximum number of instances that can be requested in a single API call to GCE- See Also:
-
-
Constructor Details
-
GceInstancesComputeSource
public GceInstancesComputeSource(String name, String credential, int limit, Boolean assignPublicIp, String userData, Map<String, String> instanceTags, String sshKeys, String project, String region, String zone, String machineType, String image, String network, String subnetwork, boolean preemptible, boolean spot, boolean confidential, String acceleratorType, int acceleratorCount)
-
-
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
-
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
-
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
Description copied from interface:ComputeSource
Returns the name of this compute source (which must be unique within the containing ComputeRequirement).- Specified by:
getName
in interfaceComputeSource
- Specified by:
getName
in interfaceNamed
- Returns:
- the name of this compute source
-
getCredential
- Specified by:
getCredential
in interfaceComputeSource
- Specified by:
getCredential
in interfaceGceComputeSource
-
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
-
isAssignPublicIp
public boolean isAssignPublicIp()Indicates if provisioned instances should be assigned public IP addresses.- Specified by:
isAssignPublicIp
in interfaceGceComputeSource
- Returns:
- true, if provisioned instances should be assigned public IP addresses; otherwise, false
-
isSpecifyMinimum
public boolean isSpecifyMinimum()Indicates if YellowDog Compute should specify the minimum when requesting instances. NB: This can only be used with a limit set between 1..1000 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 GCE; otherwise, false
-
getCreateCompactPlacementPolicy
Indicates if instances should be provisioned using a compact placement policy.- Returns:
- true, if provisioned instances should be provisioned using a compact placement policy; otherwise, false or null
-
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
-
getSshKeys
A list of public SSH keys. If provided, instances will be accessible with the matching private keys through SSH.- Specified by:
getSshKeys
in interfaceGceComputeSource
- Returns:
- the public SSH keys
-
getProject
- Specified by:
getProject
in interfaceGceComputeSource
-
getRegion
Description copied from interface:ComputeSource
Gets the provider-specific region where instances will be provisioned.- Specified by:
getRegion
in interfaceComputeSource
- Specified by:
getRegion
in interfaceGceComputeSource
- Returns:
- the provider-specific region where instances will be provisioned
-
getZone
- Specified by:
getZone
in interfaceGceComputeSource
-
getMachineType
- Specified by:
getMachineType
in interfaceGceComputeSource
-
getImage
- Specified by:
getImage
in interfaceGceComputeSource
-
getNetwork
- Specified by:
getNetwork
in interfaceGceComputeSource
-
getSubnetwork
- Specified by:
getSubnetwork
in interfaceGceComputeSource
-
isPreemptible
public boolean isPreemptible()- Specified by:
isPreemptible
in interfaceGceComputeSource
-
isSpot
public boolean isSpot()- Specified by:
isSpot
in interfaceGceComputeSource
-
isConfidential
public boolean isConfidential()- Specified by:
isConfidential
in interfaceGceComputeSource
-
getAcceleratorType
- Specified by:
getAcceleratorType
in interfaceGceComputeSource
-
getAcceleratorCount
public int getAcceleratorCount()- Specified by:
getAcceleratorCount
in interfaceGceComputeSource
-
getHostMaintenanceBehaviour
- Specified by:
getHostMaintenanceBehaviour
in interfaceGceComputeSource
-
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
-
getSupportingResourceCreated
Description copied from interface:ComputeSource
Indicates if supporting resources have been created for this source.- Specified by:
getSupportingResourceCreated
in interfaceComputeSource
- Specified by:
getSupportingResourceCreated
in interfaceGceComputeSource
- Returns:
- true, if supporting resources have been created for this source; false, if no supporting resources have been created; null, if unknown
-
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
Description copied from interface:ComputeSource
Sets the name of this compute source (which must be unique within the containing ComputeRequirement).- Specified by:
setName
in interfaceComputeSource
- Parameters:
name
- the name of this compute source
-
setCredential
-
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
-
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
-
setSpecifyMinimum
public void setSpecifyMinimum(boolean specifyMinimum) Indicates if YellowDog Compute should specify the minimum when requesting instances. NB: This can only be used with a limit set between 1..1000 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 GCE; otherwise, false
-
setCreateCompactPlacementPolicy
Indicates if instances should be provisioned using a compact placement policy.- Parameters:
createCompactPlacementPolicy
- true, if provisioned instances should be provisioned using a compact placement policy; otherwise, false or null
-
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<@GceInstanceTagKey String, @GceInstanceTagValue 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
-
setSshKeys
A list of public SSH keys. If provided, instances will be accessible with the matching private keys through SSH.- Parameters:
sshKeys
- the public SSH keys
-
setProject
-
setRegion
-
setZone
-
setMachineType
- Specified by:
setMachineType
in interfaceGceComputeSource
-
setImage
- Specified by:
setImage
in interfaceGceComputeSource
-
setNetwork
-
setSubnetwork
-
setPreemptible
public void setPreemptible(boolean preemptible) -
setSpot
public void setSpot(boolean spot) -
setConfidential
public void setConfidential(boolean confidential) -
setAcceleratorType
-
setAcceleratorCount
public void setAcceleratorCount(int acceleratorCount) -
setHostMaintenanceBehaviour
-
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
-
setSupportingResourceCreated
- Specified by:
setSupportingResourceCreated
in interfaceGceComputeSource
-
equals
-
canEqual
-
hashCode
-
toString
-