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:
  • Field Details

    • BULK_INSERT_SINGLE_REQUEST_MAX

      public static final int BULK_INSERT_SINGLE_REQUEST_MAX
      The maximum number of instances that can be requested in a single API call to GCE The validation message in @GceInstancesComputeSourceValidator should be aligned if changed
      See Also:
  • Constructor Details

    • GceInstancesComputeSource

      public GceInstancesComputeSource(String name, String credential, int limit, Boolean assignPublicIp, String userData, Map<String,String> instanceTags, String sshKeys, String serviceAccountEmail, String reservation, boolean reservationBound, String project, String region, String zone, String machineType, String image, String network, String subnetwork, boolean preemptible, boolean spot, boolean confidential, String acceleratorType, int acceleratorCount, Integer bootVolumeSizeGb)
    • GceInstancesComputeSource

      public GceInstancesComputeSource()
  • Method Details

    • traitsFor

      public static ComputeSourceTraits traitsFor()
    • getTraits

      public ComputeSourceTraits getTraits()
      Description copied from interface: ComputeSource
      Returns an object describing behavioural traits specific to this compute source.
      Specified by:
      getTraits in interface ComputeSource
      Returns:
      an object describing behavioural traits specific to this compute source
    • getCredentials

      public Set<String> getCredentials()
      Description copied from interface: Credentialed
      Return the names of the credentials to be used for this Credentialed entity.
      Specified by:
      getCredentials in interface Credentialed
      Returns:
      the names of the credentials to be used
    • builder

      public static GceInstancesComputeSource.Builder builder()
    • toBuilder

    • getId

      public String getId()
      Description copied from interface: Identified
      Returns the ID
      Specified by:
      getId in interface ComputeSource
      Specified by:
      getId in interface Identified
      Returns:
      the ID
    • getCreatedFromId

      public String 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 interface ComputeSource
      Returns:
      the ID of the source template if this source was created from a template
    • getName

      public String 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 interface ComputeSource
      Specified by:
      getName in interface Named
      Returns:
      the name of this compute source
    • getCredential

      public String getCredential()
      Specified by:
      getCredential in interface ComputeSource
      Specified by:
      getCredential in interface GceComputeSource
    • 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 interface ComputeSource
      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 interface GceComputeSource
      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

      public Boolean 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

      public String getUserData()
      Description copied from interface: ComputeSource
      Gets the user-data script to be passed to the provisioned instance at startup.
      Specified by:
      getUserData in interface ComputeSource
      Returns:
      the user-data script
    • getInstanceTags

      public Map<@NotBlank @GceInstanceTagKey String, @GceInstanceTagValue String> getInstanceTags()
      Description copied from interface: ComputeSource
      Gets the custom instance tags to be set on the provisioned instance at startup.
      Specified by:
      getInstanceTags in interface ComputeSource
      Specified by:
      getInstanceTags in interface GceComputeSource
      Returns:
      the custom instance tags
    • getBootVolumeSizeGb

      public Integer getBootVolumeSizeGb()
      Description copied from interface: ComputeSource
      Gets the size of the boot volume in GB
      Specified by:
      getBootVolumeSizeGb in interface ComputeSource
      Returns:
      the size of the boot volume in GB, or null to use the image default
    • getSshKeys

      public String getSshKeys()
      A list of public SSH keys. If provided, instances will be accessible with the matching private keys through SSH.
      Specified by:
      getSshKeys in interface GceComputeSource
      Returns:
      the public SSH keys
    • getServiceAccountEmail

      public String getServiceAccountEmail()
      The email of the service account to attach to provisioned instances, granting them access to other Google Cloud resources.
      Specified by:
      getServiceAccountEmail in interface GceComputeSource
      Returns:
      the email of the service account to attach
    • getReservation

      public String getReservation()
      The reservation to provision instances from: its name, or projects/PROJECT/reservations/NAME for one shared from another project.
      Specified by:
      getReservation in interface GceComputeSource
      Returns:
      the reservation to provision instances from
    • isReservationBound

      public boolean isReservationBound()
      Indicates if instances should be reservation-bound, as a capacity block or calendar-mode future reservation requires. Requires reservation. Reservation-bound instances are deleted when the reservation ends.
      Specified by:
      isReservationBound in interface GceComputeSource
      Returns:
      true, if instances should be reservation-bound; otherwise, false
    • getProject

      public String getProject()
      Specified by:
      getProject in interface GceComputeSource
    • getRegion

      public String getRegion()
      Description copied from interface: ComputeSource
      Gets the provider-specific region where instances will be provisioned.
      Specified by:
      getRegion in interface ComputeSource
      Specified by:
      getRegion in interface GceComputeSource
      Returns:
      the provider-specific region where instances will be provisioned
    • getZone

      public String getZone()
      Specified by:
      getZone in interface GceComputeSource
    • getMachineType

      public String getMachineType()
      Specified by:
      getMachineType in interface GceComputeSource
    • getImage

      public String getImage()
      Specified by:
      getImage in interface GceComputeSource
    • getNetwork

      public String getNetwork()
      Specified by:
      getNetwork in interface GceComputeSource
    • getSubnetwork

      public String getSubnetwork()
      Specified by:
      getSubnetwork in interface GceComputeSource
    • isPreemptible

      public boolean isPreemptible()
      Specified by:
      isPreemptible in interface GceComputeSource
    • isSpot

      public boolean isSpot()
      Specified by:
      isSpot in interface GceComputeSource
    • isConfidential

      public boolean isConfidential()
      Specified by:
      isConfidential in interface GceComputeSource
    • getAcceleratorType

      public String getAcceleratorType()
      Specified by:
      getAcceleratorType in interface GceComputeSource
    • getAcceleratorCount

      public int getAcceleratorCount()
      Specified by:
      getAcceleratorCount in interface GceComputeSource
    • getHostMaintenanceBehaviour

      public GceHostMaintenanceBehaviour getHostMaintenanceBehaviour()
      Specified by:
      getHostMaintenanceBehaviour in interface GceComputeSource
    • getInstanceSummary

      public InstanceSummary getInstanceSummary()
      Description copied from interface: ComputeSource
      A summary of instance counts according to instance status
      Specified by:
      getInstanceSummary in interface ComputeSource
      Returns:
      a summary of instance counts according to instance status
    • getStatus

      public ComputeSourceStatus getStatus()
      Description copied from interface: ComputeSource
      Gets the current provisioning status of this source.
      Specified by:
      getStatus in interface ComputeSource
      Returns:
      the current provisioning status of this source
    • getStatusMessage

      public String 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 interface ComputeSource
      Returns:
      the message associated with the current provisioning status of this source
    • getExhaustion

      public ComputeSourceExhaustion getExhaustion()
      Description copied from interface: ComputeSource
      If this source is associated with an exhausted allowance, gets the exhaustion state.
      Specified by:
      getExhaustion in interface ComputeSource
      Returns:
      the exhaustion state, if the source is associated with an exhausted allowance; otherwise, null
    • getSupportingResourceCreated

      public Boolean getSupportingResourceCreated()
      Description copied from interface: ComputeSource
      Indicates if supporting resources have been created for this source.
      Specified by:
      getSupportingResourceCreated in interface ComputeSource
      Specified by:
      getSupportingResourceCreated in interface GceComputeSource
      Returns:
      true, if supporting resources have been created for this source; false, if no supporting resources have been created; null, if unknown
    • setId

      public void setId(String id)
      Description copied from interface: ComputeSource
      Sets the ID
      Specified by:
      setId in interface ComputeSource
      Parameters:
      id - This should only be set by the YellowDog Platform
    • setCreatedFromId

      public void setCreatedFromId(String createdFromId)
      Description copied from interface: ComputeSource
      Sets the source template ID
      Specified by:
      setCreatedFromId in interface ComputeSource
      Parameters:
      createdFromId - This should only be set by the YellowDog Platform
    • setName

      public void setName(String name)
      Description copied from interface: ComputeSource
      Sets the name of this compute source (which must be unique within the containing ComputeRequirement).
      Specified by:
      setName in interface ComputeSource
      Parameters:
      name - the name of this compute source
    • setCredential

      public void setCredential(String credential)
    • 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 interface ComputeSource
      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

      public void setCreateCompactPlacementPolicy(Boolean createCompactPlacementPolicy)
      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

      public void setUserData(String userData)
      Description copied from interface: ComputeSource
      Sets the user-data script to be passed to the provisioned instance at startup.
      Specified by:
      setUserData in interface ComputeSource
      Parameters:
      userData - the user-data script
    • setInstanceTags

      public void setInstanceTags(Map<@NotBlank @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 interface ComputeSource
      Parameters:
      instanceTags - the custom instance tags
    • setBootVolumeSizeGb

      public void setBootVolumeSizeGb(Integer bootVolumeSizeGb)
      Description copied from interface: ComputeSource
      Sets the size of the boot volume (in GB) for the instances that will be provisioned.
      Specified by:
      setBootVolumeSizeGb in interface ComputeSource
      Parameters:
      bootVolumeSizeGb - the size of the boot volume in GB, or null to use the image default
    • setSshKeys

      public void setSshKeys(String sshKeys)
      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
    • setServiceAccountEmail

      public void setServiceAccountEmail(String serviceAccountEmail)
      The email of the service account to attach to provisioned instances, granting them access to other Google Cloud resources.
      Parameters:
      serviceAccountEmail - the email of the service account to attach
    • setReservation

      public void setReservation(String reservation)
      The reservation to provision instances from: its name, or projects/PROJECT/reservations/NAME for one shared from another project.
      Parameters:
      reservation - the reservation to provision instances from
    • setReservationBound

      public void setReservationBound(boolean reservationBound)
      Indicates if instances should be reservation-bound, as a capacity block or calendar-mode future reservation requires. Requires reservation. Reservation-bound instances are deleted when the reservation ends.
      Parameters:
      reservationBound - true, if instances should be reservation-bound; otherwise, false
    • setProject

      public void setProject(String project)
    • setRegion

      public void setRegion(String region)
    • setZone

      public void setZone(String zone)
    • setMachineType

      public void setMachineType(String machineType)
      Specified by:
      setMachineType in interface GceComputeSource
    • setImage

      public void setImage(String image)
      Specified by:
      setImage in interface GceComputeSource
    • setNetwork

      public void setNetwork(String network)
    • setSubnetwork

      public void setSubnetwork(String subnetwork)
    • setPreemptible

      public void setPreemptible(boolean preemptible)
    • setSpot

      public void setSpot(boolean spot)
    • setConfidential

      public void setConfidential(boolean confidential)
    • setAcceleratorType

      public void setAcceleratorType(String acceleratorType)
    • setAcceleratorCount

      public void setAcceleratorCount(int acceleratorCount)
    • setHostMaintenanceBehaviour

      public void setHostMaintenanceBehaviour(GceHostMaintenanceBehaviour hostMaintenanceBehaviour)
    • setInstanceSummary

      public void setInstanceSummary(InstanceSummary instanceSummary)
      Specified by:
      setInstanceSummary in interface ComputeSource
    • setStatus

      public void setStatus(ComputeSourceStatus status)
      Description copied from interface: ComputeSource
      Sets the current provisioning status of this source.
      Specified by:
      setStatus in interface ComputeSource
      Parameters:
      status - This should only be set by the YellowDog Platform
    • setStatusMessage

      public void setStatusMessage(String statusMessage)
      Description copied from interface: ComputeSource
      Sets the message associated with the current provisioning status of this source.
      Specified by:
      setStatusMessage in interface ComputeSource
      Parameters:
      statusMessage - This should only be set by the YellowDog Platform
    • setExhaustion

      public void setExhaustion(ComputeSourceExhaustion exhaustion)
      Specified by:
      setExhaustion in interface ComputeSource
    • setSupportingResourceCreated

      public void setSupportingResourceCreated(Boolean supportingResourceCreated)
      Specified by:
      setSupportingResourceCreated in interface GceComputeSource
    • 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