Class Instance

java.lang.Object
co.yellowdog.platform.model.Instance
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AlibabaInstance, AwsInstance, AzureInstance, GceInstance, OciInstance, SimulatorInstance

public abstract class Instance extends Object implements Serializable
Describes an instance provisioned for a compute requirement.

This class provides common fields shared across all compute provisioners. It is generally specialised for each provisioner to add extra fields specific to that provisioner.

See Also:
  • Constructor Details

    • Instance

      public Instance()
  • Method Details

    • getCreatedTimeAccuracy

      public ChronoUnit getCreatedTimeAccuracy()
    • getId

      public InstanceId getId()
      The unique identifier for this instance formed from the YellowDog Compute Source ID and the provider supplied instance ID
    • getCreatedTime

      public Instant getCreatedTime()
      The date and time when this instance was first created.
      Returns:
      the date and time when this instance was first created
    • getProvider

      public CloudProvider getProvider()
      The cloud provider that supplies this instance.
      Returns:
      the cloud provider that supplies this instance
    • getInstanceType

      public String getInstanceType()
      The machine type of this instance.
      Returns:
      the machine type of this instance
    • getRegion

      public String getRegion()
      The region where this instance is provisioned.
      Returns:
      the region where this instance is provisioned
    • getSubregion

      public String getSubregion()
      The subregion where this instance is provisioned.
      Returns:
      the subregion where this instance is provisioned
    • getImageId

      public String getImageId()
      The machine image ID used for this instance.
      Returns:
      the machine image ID used for this instance
    • getHostname

      public String getHostname()
      The hostname of this instance.
      Returns:
      the hostname of this instance
    • getPrivateIpAddress

      public String getPrivateIpAddress()
      The private IP address of this instance.
      Returns:
      the private IP adress of this instance
    • getPublicIpAddress

      public String getPublicIpAddress()
      The public IP address of this instance.
      Returns:
      the public IP address of this instance
    • isSpot

      public boolean isSpot()
      Indicates if this instance was provisioned via spot pricing vs on-demand.
      Returns:
      if this instance was provisioned via spot pricing
    • getStatus

      public InstanceStatus getStatus()
      The status of this instance.
      Returns:
      the status of this instance
    • getStatusChangedTime

      public Instant getStatusChangedTime()
      The date and time when the status last changed
      Returns:
      the date and time when the status last changed
    • setId

      public void setId(InstanceId id)
      The unique identifier for this instance formed from the YellowDog Compute Source ID and the provider supplied instance ID
    • setCreatedTime

      public void setCreatedTime(Instant createdTime)
      The date and time when this instance was first created.
      Parameters:
      createdTime - This should not be set outside of the YellowDog Compute service.
    • setProvider

      public void setProvider(CloudProvider provider)
      The cloud provider that supplies this instance.
      Parameters:
      provider - This should not be set outside of the YellowDog Compute service.
    • setInstanceType

      public void setInstanceType(String instanceType)
      The machine type of this instance.
      Parameters:
      instanceType - This should not be set outside of the YellowDog Compute service.
    • setRegion

      public void setRegion(String region)
      The region where this instance is provisioned.
      Parameters:
      region - This should not be set outside of the YellowDog Compute service.
    • setSubregion

      public void setSubregion(String subregion)
      The subregion where this instance is provisioned.
      Parameters:
      subregion - This should not be set outside of the YellowDog Compute service.
    • setImageId

      public void setImageId(String imageId)
      The machine image ID used for this instance.
      Parameters:
      imageId - This should not be set outside of the YellowDog Compute service.
    • setHostname

      public void setHostname(String hostname)
      The hostname of this instance.
      Parameters:
      hostname - This should not be set outside of the YellowDog Compute service.
    • setPrivateIpAddress

      public void setPrivateIpAddress(String privateIpAddress)
      The private IP address of this instance.
      Parameters:
      privateIpAddress - This should not be set outside of the YellowDog Compute service.
    • setPublicIpAddress

      public void setPublicIpAddress(String publicIpAddress)
      The public IP address of this instance.
      Parameters:
      publicIpAddress - This should not be set outside of the YellowDog Compute service.
    • setSpot

      public void setSpot(boolean spot)
      Indicates if this instance was provisioned via spot pricing vs on-demand.
      Parameters:
      spot - This should not be set outside of the YellowDog Compute service.
    • setStatus

      public void setStatus(InstanceStatus status)
      The status of this instance.
      Parameters:
      status - This should not be set outside of the YellowDog Compute service.
    • setStatusChangedTime

      public void setStatusChangedTime(Instant statusChangedTime)
      The date and time when the status last changed
      Parameters:
      statusChangedTime - This should not be set outside of the YellowDog Compute service.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object