All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.kubernetes.coordination.v1alpha1.inputs.LeaseCandidateSpecArgs Maven / Gradle / Ivy

The newest version!
// *** 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.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * LeaseCandidateSpec is a specification of a Lease.
 * 
 */
public final class LeaseCandidateSpecArgs extends com.pulumi.resources.ResourceArgs {

    public static final LeaseCandidateSpecArgs Empty = new LeaseCandidateSpecArgs();

    /**
     * BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required when strategy is "OldestEmulationVersion"
     * 
     */
    @Import(name="binaryVersion")
    private @Nullable Output binaryVersion;

    /**
     * @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);
    }

    /**
     * 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"
     * 
     */
    @Import(name="emulationVersion")
    private @Nullable Output emulationVersion;

    /**
     * @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);
    }

    /**
     * LeaseName is the name of the lease for which this candidate is contending. This field is immutable.
     * 
     */
    @Import(name="leaseName", required=true)
    private Output leaseName;

    /**
     * @return LeaseName is the name of the lease for which this candidate is contending. This field is immutable.
     * 
     */
    public Output leaseName() {
        return this.leaseName;
    }

    /**
     * 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.
     * 
     */
    @Import(name="pingTime")
    private @Nullable Output pingTime;

    /**
     * @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);
    }

    /**
     * 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.
     * 
     */
    @Import(name="preferredStrategies", required=true)
    private Output> preferredStrategies;

    /**
     * @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 Output> preferredStrategies() {
        return this.preferredStrategies;
    }

    /**
     * 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.
     * 
     */
    @Import(name="renewTime")
    private @Nullable Output renewTime;

    /**
     * @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);
    }

    private LeaseCandidateSpecArgs() {}

    private LeaseCandidateSpecArgs(LeaseCandidateSpecArgs $) {
        this.binaryVersion = $.binaryVersion;
        this.emulationVersion = $.emulationVersion;
        this.leaseName = $.leaseName;
        this.pingTime = $.pingTime;
        this.preferredStrategies = $.preferredStrategies;
        this.renewTime = $.renewTime;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(LeaseCandidateSpecArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private LeaseCandidateSpecArgs $;

        public Builder() {
            $ = new LeaseCandidateSpecArgs();
        }

        public Builder(LeaseCandidateSpecArgs defaults) {
            $ = new LeaseCandidateSpecArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param binaryVersion BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required when strategy is "OldestEmulationVersion"
         * 
         * @return builder
         * 
         */
        public Builder binaryVersion(@Nullable Output binaryVersion) {
            $.binaryVersion = binaryVersion;
            return this;
        }

        /**
         * @param binaryVersion BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required when strategy is "OldestEmulationVersion"
         * 
         * @return builder
         * 
         */
        public Builder binaryVersion(String binaryVersion) {
            return binaryVersion(Output.of(binaryVersion));
        }

        /**
         * @param emulationVersion 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"
         * 
         * @return builder
         * 
         */
        public Builder emulationVersion(@Nullable Output emulationVersion) {
            $.emulationVersion = emulationVersion;
            return this;
        }

        /**
         * @param emulationVersion 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"
         * 
         * @return builder
         * 
         */
        public Builder emulationVersion(String emulationVersion) {
            return emulationVersion(Output.of(emulationVersion));
        }

        /**
         * @param leaseName LeaseName is the name of the lease for which this candidate is contending. This field is immutable.
         * 
         * @return builder
         * 
         */
        public Builder leaseName(Output leaseName) {
            $.leaseName = leaseName;
            return this;
        }

        /**
         * @param leaseName LeaseName is the name of the lease for which this candidate is contending. This field is immutable.
         * 
         * @return builder
         * 
         */
        public Builder leaseName(String leaseName) {
            return leaseName(Output.of(leaseName));
        }

        /**
         * @param pingTime 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.
         * 
         * @return builder
         * 
         */
        public Builder pingTime(@Nullable Output pingTime) {
            $.pingTime = pingTime;
            return this;
        }

        /**
         * @param pingTime 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.
         * 
         * @return builder
         * 
         */
        public Builder pingTime(String pingTime) {
            return pingTime(Output.of(pingTime));
        }

        /**
         * @param preferredStrategies 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.
         * 
         * @return builder
         * 
         */
        public Builder preferredStrategies(Output> preferredStrategies) {
            $.preferredStrategies = preferredStrategies;
            return this;
        }

        /**
         * @param preferredStrategies 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.
         * 
         * @return builder
         * 
         */
        public Builder preferredStrategies(List preferredStrategies) {
            return preferredStrategies(Output.of(preferredStrategies));
        }

        /**
         * @param preferredStrategies 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.
         * 
         * @return builder
         * 
         */
        public Builder preferredStrategies(String... preferredStrategies) {
            return preferredStrategies(List.of(preferredStrategies));
        }

        /**
         * @param renewTime 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.
         * 
         * @return builder
         * 
         */
        public Builder renewTime(@Nullable Output renewTime) {
            $.renewTime = renewTime;
            return this;
        }

        /**
         * @param renewTime 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.
         * 
         * @return builder
         * 
         */
        public Builder renewTime(String renewTime) {
            return renewTime(Output.of(renewTime));
        }

        public LeaseCandidateSpecArgs build() {
            if ($.leaseName == null) {
                throw new MissingRequiredPropertyException("LeaseCandidateSpecArgs", "leaseName");
            }
            if ($.preferredStrategies == null) {
                throw new MissingRequiredPropertyException("LeaseCandidateSpecArgs", "preferredStrategies");
            }
            return $;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy