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

com.pulumi.kubernetes.batch.v1.inputs.PodFailurePolicyRuleArgs Maven / Gradle / Ivy

There is a newer version: 4.19.0-alpha.1730750641
Show 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.batch.v1.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import com.pulumi.kubernetes.batch.v1.inputs.PodFailurePolicyOnExitCodesRequirementArgs;
import com.pulumi.kubernetes.batch.v1.inputs.PodFailurePolicyOnPodConditionsPatternArgs;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * PodFailurePolicyRule describes how a pod failure is handled when the requirements are met. One of onExitCodes and onPodConditions, but not both, can be used in each rule.
 * 
 */
public final class PodFailurePolicyRuleArgs extends com.pulumi.resources.ResourceArgs {

    public static final PodFailurePolicyRuleArgs Empty = new PodFailurePolicyRuleArgs();

    /**
     * Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are:
     * 
     * - FailJob: indicates that the pod's job is marked as Failed and all
     *   running pods are terminated.
     * - FailIndex: indicates that the pod's index is marked as Failed and will
     *   not be restarted.
     *   This value is beta-level. It can be used when the
     *   `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).
     * - Ignore: indicates that the counter towards the .backoffLimit is not
     *   incremented and a replacement pod is created.
     * - Count: indicates that the pod is handled in the default way - the
     *   counter towards the .backoffLimit is incremented.
     *   Additional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule.
     * 
     */
    @Import(name="action", required=true)
    private Output action;

    /**
     * @return Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are:
     * 
     * - FailJob: indicates that the pod's job is marked as Failed and all
     *   running pods are terminated.
     * - FailIndex: indicates that the pod's index is marked as Failed and will
     *   not be restarted.
     *   This value is beta-level. It can be used when the
     *   `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).
     * - Ignore: indicates that the counter towards the .backoffLimit is not
     *   incremented and a replacement pod is created.
     * - Count: indicates that the pod is handled in the default way - the
     *   counter towards the .backoffLimit is incremented.
     *   Additional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule.
     * 
     */
    public Output action() {
        return this.action;
    }

    /**
     * Represents the requirement on the container exit codes.
     * 
     */
    @Import(name="onExitCodes")
    private @Nullable Output onExitCodes;

    /**
     * @return Represents the requirement on the container exit codes.
     * 
     */
    public Optional> onExitCodes() {
        return Optional.ofNullable(this.onExitCodes);
    }

    /**
     * Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.
     * 
     */
    @Import(name="onPodConditions")
    private @Nullable Output> onPodConditions;

    /**
     * @return Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.
     * 
     */
    public Optional>> onPodConditions() {
        return Optional.ofNullable(this.onPodConditions);
    }

    private PodFailurePolicyRuleArgs() {}

    private PodFailurePolicyRuleArgs(PodFailurePolicyRuleArgs $) {
        this.action = $.action;
        this.onExitCodes = $.onExitCodes;
        this.onPodConditions = $.onPodConditions;
    }

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

    public static final class Builder {
        private PodFailurePolicyRuleArgs $;

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

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

        /**
         * @param action Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are:
         * 
         * - FailJob: indicates that the pod's job is marked as Failed and all
         *   running pods are terminated.
         * - FailIndex: indicates that the pod's index is marked as Failed and will
         *   not be restarted.
         *   This value is beta-level. It can be used when the
         *   `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).
         * - Ignore: indicates that the counter towards the .backoffLimit is not
         *   incremented and a replacement pod is created.
         * - Count: indicates that the pod is handled in the default way - the
         *   counter towards the .backoffLimit is incremented.
         *   Additional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule.
         * 
         * @return builder
         * 
         */
        public Builder action(Output action) {
            $.action = action;
            return this;
        }

        /**
         * @param action Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are:
         * 
         * - FailJob: indicates that the pod's job is marked as Failed and all
         *   running pods are terminated.
         * - FailIndex: indicates that the pod's index is marked as Failed and will
         *   not be restarted.
         *   This value is beta-level. It can be used when the
         *   `JobBackoffLimitPerIndex` feature gate is enabled (enabled by default).
         * - Ignore: indicates that the counter towards the .backoffLimit is not
         *   incremented and a replacement pod is created.
         * - Count: indicates that the pod is handled in the default way - the
         *   counter towards the .backoffLimit is incremented.
         *   Additional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule.
         * 
         * @return builder
         * 
         */
        public Builder action(String action) {
            return action(Output.of(action));
        }

        /**
         * @param onExitCodes Represents the requirement on the container exit codes.
         * 
         * @return builder
         * 
         */
        public Builder onExitCodes(@Nullable Output onExitCodes) {
            $.onExitCodes = onExitCodes;
            return this;
        }

        /**
         * @param onExitCodes Represents the requirement on the container exit codes.
         * 
         * @return builder
         * 
         */
        public Builder onExitCodes(PodFailurePolicyOnExitCodesRequirementArgs onExitCodes) {
            return onExitCodes(Output.of(onExitCodes));
        }

        /**
         * @param onPodConditions Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.
         * 
         * @return builder
         * 
         */
        public Builder onPodConditions(@Nullable Output> onPodConditions) {
            $.onPodConditions = onPodConditions;
            return this;
        }

        /**
         * @param onPodConditions Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.
         * 
         * @return builder
         * 
         */
        public Builder onPodConditions(List onPodConditions) {
            return onPodConditions(Output.of(onPodConditions));
        }

        /**
         * @param onPodConditions Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed.
         * 
         * @return builder
         * 
         */
        public Builder onPodConditions(PodFailurePolicyOnPodConditionsPatternArgs... onPodConditions) {
            return onPodConditions(List.of(onPodConditions));
        }

        public PodFailurePolicyRuleArgs build() {
            if ($.action == null) {
                throw new MissingRequiredPropertyException("PodFailurePolicyRuleArgs", "action");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy