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

com.pulumi.kubernetes.batch.v1beta1.inputs.CronJobSpecArgs 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.v1beta1.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import com.pulumi.kubernetes.batch.v1beta1.inputs.JobTemplateSpecArgs;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * CronJobSpec describes how the job execution will look like and when it will actually run.
 * 
 */
public final class CronJobSpecArgs extends com.pulumi.resources.ResourceArgs {

    public static final CronJobSpecArgs Empty = new CronJobSpecArgs();

    /**
     * Specifies how to treat concurrent executions of a Job. Valid values are: - "Allow" (default): allows CronJobs to run concurrently; - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - "Replace": cancels currently running job and replaces it with a new one
     * 
     */
    @Import(name="concurrencyPolicy")
    private @Nullable Output concurrencyPolicy;

    /**
     * @return Specifies how to treat concurrent executions of a Job. Valid values are: - "Allow" (default): allows CronJobs to run concurrently; - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - "Replace": cancels currently running job and replaces it with a new one
     * 
     */
    public Optional> concurrencyPolicy() {
        return Optional.ofNullable(this.concurrencyPolicy);
    }

    /**
     * The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.
     * 
     */
    @Import(name="failedJobsHistoryLimit")
    private @Nullable Output failedJobsHistoryLimit;

    /**
     * @return The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.
     * 
     */
    public Optional> failedJobsHistoryLimit() {
        return Optional.ofNullable(this.failedJobsHistoryLimit);
    }

    /**
     * Specifies the job that will be created when executing a CronJob.
     * 
     */
    @Import(name="jobTemplate", required=true)
    private Output jobTemplate;

    /**
     * @return Specifies the job that will be created when executing a CronJob.
     * 
     */
    public Output jobTemplate() {
        return this.jobTemplate;
    }

    /**
     * The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
     * 
     */
    @Import(name="schedule", required=true)
    private Output schedule;

    /**
     * @return The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
     * 
     */
    public Output schedule() {
        return this.schedule;
    }

    /**
     * Optional deadline in seconds for starting the job if it misses scheduled time for any reason.  Missed jobs executions will be counted as failed ones.
     * 
     */
    @Import(name="startingDeadlineSeconds")
    private @Nullable Output startingDeadlineSeconds;

    /**
     * @return Optional deadline in seconds for starting the job if it misses scheduled time for any reason.  Missed jobs executions will be counted as failed ones.
     * 
     */
    public Optional> startingDeadlineSeconds() {
        return Optional.ofNullable(this.startingDeadlineSeconds);
    }

    /**
     * The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 3.
     * 
     */
    @Import(name="successfulJobsHistoryLimit")
    private @Nullable Output successfulJobsHistoryLimit;

    /**
     * @return The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 3.
     * 
     */
    public Optional> successfulJobsHistoryLimit() {
        return Optional.ofNullable(this.successfulJobsHistoryLimit);
    }

    /**
     * This flag tells the controller to suspend subsequent executions, it does not apply to already started executions.  Defaults to false.
     * 
     */
    @Import(name="suspend")
    private @Nullable Output suspend;

    /**
     * @return This flag tells the controller to suspend subsequent executions, it does not apply to already started executions.  Defaults to false.
     * 
     */
    public Optional> suspend() {
        return Optional.ofNullable(this.suspend);
    }

    private CronJobSpecArgs() {}

    private CronJobSpecArgs(CronJobSpecArgs $) {
        this.concurrencyPolicy = $.concurrencyPolicy;
        this.failedJobsHistoryLimit = $.failedJobsHistoryLimit;
        this.jobTemplate = $.jobTemplate;
        this.schedule = $.schedule;
        this.startingDeadlineSeconds = $.startingDeadlineSeconds;
        this.successfulJobsHistoryLimit = $.successfulJobsHistoryLimit;
        this.suspend = $.suspend;
    }

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

    public static final class Builder {
        private CronJobSpecArgs $;

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

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

        /**
         * @param concurrencyPolicy Specifies how to treat concurrent executions of a Job. Valid values are: - "Allow" (default): allows CronJobs to run concurrently; - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - "Replace": cancels currently running job and replaces it with a new one
         * 
         * @return builder
         * 
         */
        public Builder concurrencyPolicy(@Nullable Output concurrencyPolicy) {
            $.concurrencyPolicy = concurrencyPolicy;
            return this;
        }

        /**
         * @param concurrencyPolicy Specifies how to treat concurrent executions of a Job. Valid values are: - "Allow" (default): allows CronJobs to run concurrently; - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - "Replace": cancels currently running job and replaces it with a new one
         * 
         * @return builder
         * 
         */
        public Builder concurrencyPolicy(String concurrencyPolicy) {
            return concurrencyPolicy(Output.of(concurrencyPolicy));
        }

        /**
         * @param failedJobsHistoryLimit The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.
         * 
         * @return builder
         * 
         */
        public Builder failedJobsHistoryLimit(@Nullable Output failedJobsHistoryLimit) {
            $.failedJobsHistoryLimit = failedJobsHistoryLimit;
            return this;
        }

        /**
         * @param failedJobsHistoryLimit The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.
         * 
         * @return builder
         * 
         */
        public Builder failedJobsHistoryLimit(Integer failedJobsHistoryLimit) {
            return failedJobsHistoryLimit(Output.of(failedJobsHistoryLimit));
        }

        /**
         * @param jobTemplate Specifies the job that will be created when executing a CronJob.
         * 
         * @return builder
         * 
         */
        public Builder jobTemplate(Output jobTemplate) {
            $.jobTemplate = jobTemplate;
            return this;
        }

        /**
         * @param jobTemplate Specifies the job that will be created when executing a CronJob.
         * 
         * @return builder
         * 
         */
        public Builder jobTemplate(JobTemplateSpecArgs jobTemplate) {
            return jobTemplate(Output.of(jobTemplate));
        }

        /**
         * @param schedule The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
         * 
         * @return builder
         * 
         */
        public Builder schedule(Output schedule) {
            $.schedule = schedule;
            return this;
        }

        /**
         * @param schedule The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
         * 
         * @return builder
         * 
         */
        public Builder schedule(String schedule) {
            return schedule(Output.of(schedule));
        }

        /**
         * @param startingDeadlineSeconds Optional deadline in seconds for starting the job if it misses scheduled time for any reason.  Missed jobs executions will be counted as failed ones.
         * 
         * @return builder
         * 
         */
        public Builder startingDeadlineSeconds(@Nullable Output startingDeadlineSeconds) {
            $.startingDeadlineSeconds = startingDeadlineSeconds;
            return this;
        }

        /**
         * @param startingDeadlineSeconds Optional deadline in seconds for starting the job if it misses scheduled time for any reason.  Missed jobs executions will be counted as failed ones.
         * 
         * @return builder
         * 
         */
        public Builder startingDeadlineSeconds(Integer startingDeadlineSeconds) {
            return startingDeadlineSeconds(Output.of(startingDeadlineSeconds));
        }

        /**
         * @param successfulJobsHistoryLimit The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 3.
         * 
         * @return builder
         * 
         */
        public Builder successfulJobsHistoryLimit(@Nullable Output successfulJobsHistoryLimit) {
            $.successfulJobsHistoryLimit = successfulJobsHistoryLimit;
            return this;
        }

        /**
         * @param successfulJobsHistoryLimit The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 3.
         * 
         * @return builder
         * 
         */
        public Builder successfulJobsHistoryLimit(Integer successfulJobsHistoryLimit) {
            return successfulJobsHistoryLimit(Output.of(successfulJobsHistoryLimit));
        }

        /**
         * @param suspend This flag tells the controller to suspend subsequent executions, it does not apply to already started executions.  Defaults to false.
         * 
         * @return builder
         * 
         */
        public Builder suspend(@Nullable Output suspend) {
            $.suspend = suspend;
            return this;
        }

        /**
         * @param suspend This flag tells the controller to suspend subsequent executions, it does not apply to already started executions.  Defaults to false.
         * 
         * @return builder
         * 
         */
        public Builder suspend(Boolean suspend) {
            return suspend(Output.of(suspend));
        }

        public CronJobSpecArgs build() {
            if ($.jobTemplate == null) {
                throw new MissingRequiredPropertyException("CronJobSpecArgs", "jobTemplate");
            }
            if ($.schedule == null) {
                throw new MissingRequiredPropertyException("CronJobSpecArgs", "schedule");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy