com.pulumi.kubernetes.coordination.v1alpha1.outputs.LeaseCandidateSpecPatch Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kubernetes Show documentation
Show all versions of kubernetes Show documentation
A Pulumi package for creating and managing Kubernetes resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.kubernetes.coordination.v1alpha1.outputs;
import com.pulumi.core.annotations.CustomType;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
@CustomType
public final class LeaseCandidateSpecPatch {
/**
* @return BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required when strategy is "OldestEmulationVersion"
*
*/
private @Nullable String binaryVersion;
/**
* @return 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"
*
*/
private @Nullable String emulationVersion;
/**
* @return LeaseName is the name of the lease for which this candidate is contending. This field is immutable.
*
*/
private @Nullable String leaseName;
/**
* @return 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.
*
*/
private @Nullable String pingTime;
/**
* @return 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.
*
*/
private @Nullable List preferredStrategies;
/**
* @return 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.
*
*/
private @Nullable String renewTime;
private LeaseCandidateSpecPatch() {}
/**
* @return BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required when strategy is "OldestEmulationVersion"
*
*/
public Optional binaryVersion() {
return Optional.ofNullable(this.binaryVersion);
}
/**
* @return 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"
*
*/
public Optional emulationVersion() {
return Optional.ofNullable(this.emulationVersion);
}
/**
* @return LeaseName is the name of the lease for which this candidate is contending. This field is immutable.
*
*/
public Optional leaseName() {
return Optional.ofNullable(this.leaseName);
}
/**
* @return 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.
*
*/
public Optional pingTime() {
return Optional.ofNullable(this.pingTime);
}
/**
* @return 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.
*
*/
public List preferredStrategies() {
return this.preferredStrategies == null ? List.of() : this.preferredStrategies;
}
/**
* @return 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.
*
*/
public Optional renewTime() {
return Optional.ofNullable(this.renewTime);
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(LeaseCandidateSpecPatch defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private @Nullable String binaryVersion;
private @Nullable String emulationVersion;
private @Nullable String leaseName;
private @Nullable String pingTime;
private @Nullable List preferredStrategies;
private @Nullable String renewTime;
public Builder() {}
public Builder(LeaseCandidateSpecPatch defaults) {
Objects.requireNonNull(defaults);
this.binaryVersion = defaults.binaryVersion;
this.emulationVersion = defaults.emulationVersion;
this.leaseName = defaults.leaseName;
this.pingTime = defaults.pingTime;
this.preferredStrategies = defaults.preferredStrategies;
this.renewTime = defaults.renewTime;
}
@CustomType.Setter
public Builder binaryVersion(@Nullable String binaryVersion) {
this.binaryVersion = binaryVersion;
return this;
}
@CustomType.Setter
public Builder emulationVersion(@Nullable String emulationVersion) {
this.emulationVersion = emulationVersion;
return this;
}
@CustomType.Setter
public Builder leaseName(@Nullable String leaseName) {
this.leaseName = leaseName;
return this;
}
@CustomType.Setter
public Builder pingTime(@Nullable String pingTime) {
this.pingTime = pingTime;
return this;
}
@CustomType.Setter
public Builder preferredStrategies(@Nullable List preferredStrategies) {
this.preferredStrategies = preferredStrategies;
return this;
}
public Builder preferredStrategies(String... preferredStrategies) {
return preferredStrategies(List.of(preferredStrategies));
}
@CustomType.Setter
public Builder renewTime(@Nullable String renewTime) {
this.renewTime = renewTime;
return this;
}
public LeaseCandidateSpecPatch build() {
final var _resultValue = new LeaseCandidateSpecPatch();
_resultValue.binaryVersion = binaryVersion;
_resultValue.emulationVersion = emulationVersion;
_resultValue.leaseName = leaseName;
_resultValue.pingTime = pingTime;
_resultValue.preferredStrategies = preferredStrategies;
_resultValue.renewTime = renewTime;
return _resultValue;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy