// *** WARNING: this file was generated by pulumi-language-dotnet. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;
namespace Maxvojtkov.Dokploy
{
///
/// A cron job Dokploy runs on a schedule.
///
/// `ScheduleType` selects where the command runs:
///
/// * `Application` — inside a running application container; set `ApplicationId`.
/// * `Compose` — inside one service of a Compose stack; set `ComposeId` and `ServiceName`.
/// * `Server` — on a remote server; set `ServerId`.
/// * `dokploy-server` — on the Dokploy host itself.
///
/// > A schedule targeting an application runs inside its container, so the container has to be running when the cron fires.
///
[DokployResourceType("dokploy:index/schedule:Schedule")]
public partial class Schedule : global::Pulumi.CustomResource
{
///
/// Docker service name the schedule targets. Derived by Dokploy when omitted.
///
[Output("appName")]
public Output AppName { get; private set; } = null!;
///
/// Application this schedule belongs to.
///
[Output("applicationId")]
public Output ApplicationId { get; private set; } = null!;
///
/// Command to run.
///
[Output("command")]
public Output Command { get; private set; } = null!;
///
/// Compose stack this schedule belongs to.
///
[Output("composeId")]
public Output ComposeId { get; private set; } = null!;
///
/// RFC 3339 timestamp of when the schedule was created.
///
[Output("createdAt")]
public Output CreatedAt { get; private set; } = null!;
///
/// Standard five-field cron expression, for example `0 3 * * *`.
///
[Output("cronExpression")]
public Output CronExpression { get; private set; } = null!;
///
/// Free-form description.
///
[Output("description")]
public Output Description { get; private set; } = null!;
///
/// Whether the schedule is active.
///
[Output("enabled")]
public Output Enabled { get; private set; } = null!;
///
/// Display name of the schedule.
///
[Output("name")]
public Output Name { get; private set; } = null!;
///
/// Where the command runs. Valid values: `Application`, `Compose`, `Server`, `dokploy-server`. Defaults to `Application`.
///
[Output("scheduleType")]
public Output ScheduleType { get; private set; } = null!;
///
/// Multi-line script to run instead of a single command.
///
[Output("script")]
public Output Script { get; private set; } = null!;
///
/// Server this schedule runs on.
///
[Output("serverId")]
public Output ServerId { get; private set; } = null!;
///
/// Service inside a Compose stack to run the command in.
///
[Output("serviceName")]
public Output ServiceName { get; private set; } = null!;
///
/// Shell used to interpret the command. Valid values: `Bash`, `Sh`. Defaults to `Bash`.
///
[Output("shellType")]
public Output ShellType { get; private set; } = null!;
///
/// IANA timezone the cron expression is evaluated in, for example `Europe/Berlin`.
///
[Output("timezone")]
public Output Timezone { get; private set; } = null!;
///
/// Create a Schedule resource with the given unique name, arguments, and options.
///
///
/// The unique name of the resource
/// The arguments used to populate this resource's properties
/// A bag of options that control this resource's behavior
public Schedule(string name, ScheduleArgs args, CustomResourceOptions? options = null)
: base("dokploy:index/schedule:Schedule", name, args ?? new ScheduleArgs(), MakeResourceOptions(options, ""))
{
}
private Schedule(string name, Input id, ScheduleState? state = null, CustomResourceOptions? options = null)
: base("dokploy:index/schedule:Schedule", name, state, MakeResourceOptions(options, id))
{
}
private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id)
{
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "https://gitea.coolify.vojtkov.dev/usr_unknown/pulumi-dokploy/releases/download/v${VERSION}",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
merged.Id = id ?? merged.Id;
return merged;
}
///
/// Get an existing Schedule resource's state with the given name, ID, and optional extra
/// properties used to qualify the lookup.
///
///
/// The unique name of the resulting resource.
/// The unique provider ID of the resource to lookup.
/// Any extra arguments used during the lookup.
/// A bag of options that control this resource's behavior
public static Schedule Get(string name, Input id, ScheduleState? state = null, CustomResourceOptions? options = null)
{
return new Schedule(name, id, state, options);
}
}
public sealed class ScheduleArgs : global::Pulumi.ResourceArgs
{
///
/// Docker service name the schedule targets. Derived by Dokploy when omitted.
///
[Input("appName")]
public Input? AppName { get; set; }
///
/// Application this schedule belongs to.
///
[Input("applicationId")]
public Input? ApplicationId { get; set; }
///
/// Command to run.
///
[Input("command", required: true)]
public Input Command { get; set; } = null!;
///
/// Compose stack this schedule belongs to.
///
[Input("composeId")]
public Input? ComposeId { get; set; }
///
/// Standard five-field cron expression, for example `0 3 * * *`.
///
[Input("cronExpression", required: true)]
public Input CronExpression { get; set; } = null!;
///
/// Free-form description.
///
[Input("description")]
public Input? Description { get; set; }
///
/// Whether the schedule is active.
///
[Input("enabled")]
public Input? Enabled { get; set; }
///
/// Display name of the schedule.
///
[Input("name")]
public Input? Name { get; set; }
///
/// Where the command runs. Valid values: `Application`, `Compose`, `Server`, `dokploy-server`. Defaults to `Application`.
///
[Input("scheduleType")]
public Input? ScheduleType { get; set; }
///
/// Multi-line script to run instead of a single command.
///
[Input("script")]
public Input? Script { get; set; }
///
/// Server this schedule runs on.
///
[Input("serverId")]
public Input? ServerId { get; set; }
///
/// Service inside a Compose stack to run the command in.
///
[Input("serviceName")]
public Input? ServiceName { get; set; }
///
/// Shell used to interpret the command. Valid values: `Bash`, `Sh`. Defaults to `Bash`.
///
[Input("shellType")]
public Input? ShellType { get; set; }
///
/// IANA timezone the cron expression is evaluated in, for example `Europe/Berlin`.
///
[Input("timezone")]
public Input? Timezone { get; set; }
public ScheduleArgs()
{
}
public static new ScheduleArgs Empty => new ScheduleArgs();
}
public sealed class ScheduleState : global::Pulumi.ResourceArgs
{
///
/// Docker service name the schedule targets. Derived by Dokploy when omitted.
///
[Input("appName")]
public Input? AppName { get; set; }
///
/// Application this schedule belongs to.
///
[Input("applicationId")]
public Input? ApplicationId { get; set; }
///
/// Command to run.
///
[Input("command")]
public Input? Command { get; set; }
///
/// Compose stack this schedule belongs to.
///
[Input("composeId")]
public Input? ComposeId { get; set; }
///
/// RFC 3339 timestamp of when the schedule was created.
///
[Input("createdAt")]
public Input? CreatedAt { get; set; }
///
/// Standard five-field cron expression, for example `0 3 * * *`.
///
[Input("cronExpression")]
public Input? CronExpression { get; set; }
///
/// Free-form description.
///
[Input("description")]
public Input? Description { get; set; }
///
/// Whether the schedule is active.
///
[Input("enabled")]
public Input? Enabled { get; set; }
///
/// Display name of the schedule.
///
[Input("name")]
public Input? Name { get; set; }
///
/// Where the command runs. Valid values: `Application`, `Compose`, `Server`, `dokploy-server`. Defaults to `Application`.
///
[Input("scheduleType")]
public Input? ScheduleType { get; set; }
///
/// Multi-line script to run instead of a single command.
///
[Input("script")]
public Input? Script { get; set; }
///
/// Server this schedule runs on.
///
[Input("serverId")]
public Input? ServerId { get; set; }
///
/// Service inside a Compose stack to run the command in.
///
[Input("serviceName")]
public Input? ServiceName { get; set; }
///
/// Shell used to interpret the command. Valid values: `Bash`, `Sh`. Defaults to `Bash`.
///
[Input("shellType")]
public Input? ShellType { get; set; }
///
/// IANA timezone the cron expression is evaluated in, for example `Europe/Berlin`.
///
[Input("timezone")]
public Input? Timezone { get; set; }
public ScheduleState()
{
}
public static new ScheduleState Empty => new ScheduleState();
}
}