Class ComputeRequirement
java.lang.Object
co.yellowdog.platform.model.ComputeRequirement
- All Implemented Interfaces:
Identified
,Named
,Tagged
,Serializable
@ValidatedBy(ComputeRequirementValidator.class)
public class ComputeRequirement
extends Object
implements Identified, Named, Tagged, Serializable
Defines the requirement for compute resource and chosen options for how to provision it.
This class is the main model object within the YellowDog Compute API. It is passed between the service and clients in order to request compute resource and to monitor the state of that resource.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A builder that can be used to build a new ComputeRequirement that is automatically validated on build. -
Field Summary
Fields inherited from interface co.yellowdog.platform.model.Tagged
MAX_TAG_LENGTH
-
Constructor Summary
ConstructorsConstructorDescriptionComputeRequirement
(String namespace, String name, String tag, ComputeProvisionStrategy provisionStrategy, int targetInstanceCount, Boolean maintainInstanceCount) Constructs a new compute requirement with the specified values. -
Method Summary
Modifier and TypeMethodDescriptionstatic ComputeRequirement.Builder
builder()
protected boolean
boolean
The ID of the User or Application that first submitted this compute requirement.Gets the ID of the requirement template if this requirement was created from a template.The date and time when this compute requirement was first submitted to YellowDog Compute.int
The number of alive instances expected based on existing instances and the most recent provision action.getId()
The ID of this compute requirement that is generated by YellowDog Compute when the requirement is first submitted.getName()
The user allocated name used to uniquely identify this compute requirement within its namespace.The user allocated namespace used to group compute requirements and other objects together.The next status of this compute requirement when a status transition is being requested.The compute provision strategy that YellowDog Compute must use when provisioning instances to meet this requirement.The status of this compute requirement.The date and time when the status or nextStatus last changedgetTag()
Gets the user defined tagint
The number of instances to be provisioned to meet this compute requirement.int
hashCode()
boolean
Indicates if the Compute Service should automatically attempt to provision new instances if the number of RUNNING instances is below the specified targetInstanceCountvoid
setCreatedById
(String createdById) The ID of the User or Application that first submitted this compute requirement.void
setCreatedFromId
(String createdFromId) Gets the ID of the requirement template if this requirement was created from a template.void
setCreatedTime
(Instant createdTime) The date and time when this compute requirement was first submitted to YellowDog Compute.void
setExpectedInstanceCount
(int expectedInstanceCount) The number of alive instances expected based on existing instances and the most recent provision action.void
The ID of this compute requirement that is generated by YellowDog Compute when the requirement is first submitted.void
setMaintainInstanceCount
(boolean maintainInstanceCount) Indicates if the Compute Service should automatically attempt to provision new instances if the number of RUNNING instances is below the specified targetInstanceCountvoid
The user allocated name used to uniquely identify this compute requirement within its namespace.void
setNamespace
(String namespace) The user allocated namespace used to group compute requirements and other objects together.void
setNextStatus
(ComputeRequirementStatus nextStatus) The next status of this compute requirement when a status transition is being requested.void
setProvisionStrategy
(ComputeProvisionStrategy provisionStrategy) The compute provision strategy that YellowDog Compute must use when provisioning instances to meet this requirement.void
setStatus
(ComputeRequirementStatus status) The status of this compute requirement.void
setStatusChangedTime
(Instant statusChangedTime) The date and time when the status or nextStatus last changedvoid
setSupportedOperations
(ComputeRequirementSupportedOperations supportedOperations) void
Sets the user defined tagvoid
setTargetInstanceCount
(int targetInstanceCount) The number of instances to be provisioned to meet this compute requirement.toString()
-
Constructor Details
-
ComputeRequirement
public ComputeRequirement(String namespace, String name, String tag, ComputeProvisionStrategy provisionStrategy, int targetInstanceCount, Boolean maintainInstanceCount) Constructs a new compute requirement with the specified values.- Parameters:
namespace
- the compute requirement namespacename
- the compute requirement nametag
- the compute requirement tagprovisionStrategy
- the compute provision strategytargetInstanceCount
- the number of instances to be provisionedmaintainInstanceCount
- if the required number of instances should be automatically maintained
-
-
Method Details
-
builder
-
toBuilder
-
getId
The ID of this compute requirement that is generated by YellowDog Compute when the requirement is first submitted.- Specified by:
getId
in interfaceIdentified
- Returns:
- the ID of this compute requirement
-
getCreatedTime
The date and time when this compute requirement was first submitted to YellowDog Compute.- Returns:
- the date and time when this compute requirement was first submitted
-
getCreatedById
The ID of the User or Application that first submitted this compute requirement.- Returns:
- the ID of the User or Application that first submitted this compute requirement
-
getCreatedFromId
Gets the ID of the requirement template if this requirement was created from a template.- Returns:
- the ID of the requirement template if this requirement was created from a template
-
getStatusChangedTime
The date and time when the status or nextStatus last changed- Returns:
- the date and time when the status or nextStatus last changed
-
getSupportedOperations
-
getTag
-
getNamespace
The user allocated namespace used to group compute requirements and other objects together.- Returns:
- the compute requirement namespace
-
getName
-
getProvisionStrategy
The compute provision strategy that YellowDog Compute must use when provisioning instances to meet this requirement.- Returns:
- the compute provision strategy
-
getTargetInstanceCount
public int getTargetInstanceCount()The number of instances to be provisioned to meet this compute requirement.- Returns:
- the number of instances to be provisioned
-
getExpectedInstanceCount
public int getExpectedInstanceCount()The number of alive instances expected based on existing instances and the most recent provision action.- Returns:
- the number of instances expected
-
isMaintainInstanceCount
public boolean isMaintainInstanceCount()Indicates if the Compute Service should automatically attempt to provision new instances if the number of RUNNING instances is below the specified targetInstanceCount- Returns:
- if the Compute Service should automatically maintain the number of instances
-
getStatus
The status of this compute requirement.- Returns:
- the status of this compute requirement
-
getNextStatus
The next status of this compute requirement when a status transition is being requested.- Returns:
- the next status of this compute requirement
-
setId
The ID of this compute requirement that is generated by YellowDog Compute when the requirement is first submitted.- Parameters:
id
- This should not be set outside of the YellowDog Compute service.
-
setCreatedTime
The date and time when this compute requirement was first submitted to YellowDog Compute.- Parameters:
createdTime
- This should not be set outside of the YellowDog Compute service.
-
setCreatedById
The ID of the User or Application that first submitted this compute requirement.- Parameters:
createdById
- This should not be set outside of the YellowDog Compute service.
-
setCreatedFromId
Gets the ID of the requirement template if this requirement was created from a template.- Parameters:
createdFromId
- This should not be set outside of the YellowDog Compute service.
-
setStatusChangedTime
The date and time when the status or nextStatus last changed- Parameters:
statusChangedTime
- This should not be set outside of the YellowDog Compute service.
-
setSupportedOperations
-
setTag
-
setNamespace
The user allocated namespace used to group compute requirements and other objects together.- Parameters:
namespace
- the compute requirement namespace
This should not be changed once the requirement has been submitted to YellowDog Compute.
-
setName
The user allocated name used to uniquely identify this compute requirement within its namespace.- Parameters:
name
- the compute requirement name
This should not be changed once the requirement has been submitted to YellowDog Compute.
-
setProvisionStrategy
The compute provision strategy that YellowDog Compute must use when provisioning instances to meet this requirement.- Parameters:
provisionStrategy
- the compute provision strategy
-
setTargetInstanceCount
public void setTargetInstanceCount(int targetInstanceCount) The number of instances to be provisioned to meet this compute requirement.- Parameters:
targetInstanceCount
- the number of instances to be provisioned.
-
setExpectedInstanceCount
public void setExpectedInstanceCount(int expectedInstanceCount) The number of alive instances expected based on existing instances and the most recent provision action.- Parameters:
expectedInstanceCount
- This should not be set outside of the YellowDog Compute service.
-
setMaintainInstanceCount
public void setMaintainInstanceCount(boolean maintainInstanceCount) Indicates if the Compute Service should automatically attempt to provision new instances if the number of RUNNING instances is below the specified targetInstanceCount- Parameters:
maintainInstanceCount
- if the Compute Service should automatically maintain the number of instances
-
setStatus
The status of this compute requirement.- Parameters:
status
- This should not be set outside of the YellowDog Compute service.
-
setNextStatus
The next status of this compute requirement when a status transition is being requested.- Parameters:
nextStatus
- the next status of this compute requirement
-
equals
-
canEqual
-
hashCode
-
toString
-