Class V1alpha1LeaseCandidateSpec

java.lang.Object
io.kubernetes.client.openapi.models.V1alpha1LeaseCandidateSpec

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2024-10-04T19:37:38.574271Z[Etc/UTC]", comments="Generator version: 7.6.0") public class V1alpha1LeaseCandidateSpec extends Object
LeaseCandidateSpec is a specification of a Lease.
  • Field Details

  • Constructor Details

    • V1alpha1LeaseCandidateSpec

      public V1alpha1LeaseCandidateSpec()
  • Method Details

    • binaryVersion

      public V1alpha1LeaseCandidateSpec binaryVersion(String binaryVersion)
    • getBinaryVersion

      @Nullable public String getBinaryVersion()
      BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required when strategy is \"OldestEmulationVersion\"
      Returns:
      binaryVersion
    • setBinaryVersion

      public void setBinaryVersion(String binaryVersion)
    • emulationVersion

      public V1alpha1LeaseCandidateSpec emulationVersion(String emulationVersion)
    • getEmulationVersion

      @Nullable public String getEmulationVersion()
      EmulationVersion is the emulation version. It must be in a semver format without leading `v`. EmulationVersion must be less than or equal to BinaryVersion. This field is required when strategy is \"OldestEmulationVersion\"
      Returns:
      emulationVersion
    • setEmulationVersion

      public void setEmulationVersion(String emulationVersion)
    • leaseName

      public V1alpha1LeaseCandidateSpec leaseName(String leaseName)
    • getLeaseName

      @Nonnull public String getLeaseName()
      LeaseName is the name of the lease for which this candidate is contending. This field is immutable.
      Returns:
      leaseName
    • setLeaseName

      public void setLeaseName(String leaseName)
    • pingTime

      public V1alpha1LeaseCandidateSpec pingTime(OffsetDateTime pingTime)
    • getPingTime

      @Nullable public OffsetDateTime getPingTime()
      PingTime is the last time that the server has requested the LeaseCandidate to renew. It is only done during leader election to check if any LeaseCandidates have become ineligible. When PingTime is updated, the LeaseCandidate will respond by updating RenewTime.
      Returns:
      pingTime
    • setPingTime

      public void setPingTime(OffsetDateTime pingTime)
    • preferredStrategies

      public V1alpha1LeaseCandidateSpec preferredStrategies(List<String> preferredStrategies)
    • addPreferredStrategiesItem

      public V1alpha1LeaseCandidateSpec addPreferredStrategiesItem(String preferredStrategiesItem)
    • getPreferredStrategies

      @Nonnull public List<String> getPreferredStrategies()
      PreferredStrategies indicates the list of strategies for picking the leader for coordinated leader election. The list is ordered, and the first strategy supersedes all other strategies. The list is used by coordinated leader election to make a decision about the final election strategy. This follows as - If all clients have strategy X as the first element in this list, strategy X will be used. - If a candidate has strategy [X] and another candidate has strategy [Y, X], Y supersedes X and strategy Y will be used. - If a candidate has strategy [X, Y] and another candidate has strategy [Y, X], this is a user error and leader election will not operate the Lease until resolved. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.
      Returns:
      preferredStrategies
    • setPreferredStrategies

      public void setPreferredStrategies(List<String> preferredStrategies)
    • renewTime

      public V1alpha1LeaseCandidateSpec renewTime(OffsetDateTime renewTime)
    • getRenewTime

      @Nullable public OffsetDateTime getRenewTime()
      RenewTime is the time that the LeaseCandidate was last updated. Any time a Lease needs to do leader election, the PingTime field is updated to signal to the LeaseCandidate that they should update the RenewTime. Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew. The PingTime field is updated regularly to prevent garbage collection for still active LeaseCandidates.
      Returns:
      renewTime
    • setRenewTime

      public void setRenewTime(OffsetDateTime renewTime)
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      Validates the JSON Element and throws an exception if issues found
      Parameters:
      jsonElement - JSON Element
      Throws:
      IOException - if the JSON Element is invalid with respect to V1alpha1LeaseCandidateSpec
    • fromJson

      public static V1alpha1LeaseCandidateSpec fromJson(String jsonString) throws IOException
      Create an instance of V1alpha1LeaseCandidateSpec given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of V1alpha1LeaseCandidateSpec
      Throws:
      IOException - if the JSON string is invalid with respect to V1alpha1LeaseCandidateSpec
    • toJson

      public String toJson()
      Convert an instance of V1alpha1LeaseCandidateSpec to an JSON string
      Returns:
      JSON string