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
      See Also:
  • Constructor Details

  • Method Details

    • 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

      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
      Returns:
      the custom instance tags
    • 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
    • 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<@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
    • 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
    • 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