// *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./utilities"; /** * 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. */ export class Schedule extends pulumi.CustomResource { /** * Get an existing Schedule resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ public static get(name: string, id: pulumi.Input, state?: ScheduleState, opts?: pulumi.CustomResourceOptions): Schedule { return new Schedule(name, state, { ...opts, id: id }); } /** @internal */ public static readonly __pulumiType = 'dokploy:index/schedule:Schedule'; /** * Returns true if the given object is an instance of Schedule. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ public static isInstance(obj: any): obj is Schedule { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Schedule.__pulumiType; } /** * Docker service name the schedule targets. Derived by Dokploy when omitted. */ declare public readonly appName: pulumi.Output; /** * Application this schedule belongs to. */ declare public readonly applicationId: pulumi.Output; /** * Command to run. */ declare public readonly command: pulumi.Output; /** * Compose stack this schedule belongs to. */ declare public readonly composeId: pulumi.Output; /** * RFC 3339 timestamp of when the schedule was created. */ declare public /*out*/ readonly createdAt: pulumi.Output; /** * Standard five-field cron expression, for example `0 3 * * *`. */ declare public readonly cronExpression: pulumi.Output; /** * Free-form description. */ declare public readonly description: pulumi.Output; /** * Whether the schedule is active. */ declare public readonly enabled: pulumi.Output; /** * Display name of the schedule. */ declare public readonly name: pulumi.Output; /** * Where the command runs. Valid values: `application`, `compose`, `server`, `dokploy-server`. Defaults to `application`. */ declare public readonly scheduleType: pulumi.Output; /** * Multi-line script to run instead of a single command. */ declare public readonly script: pulumi.Output; /** * Server this schedule runs on. */ declare public readonly serverId: pulumi.Output; /** * Service inside a Compose stack to run the command in. */ declare public readonly serviceName: pulumi.Output; /** * Shell used to interpret the command. Valid values: `bash`, `sh`. Defaults to `bash`. */ declare public readonly shellType: pulumi.Output; /** * IANA timezone the cron expression is evaluated in, for example `Europe/Berlin`. */ declare public readonly timezone: pulumi.Output; /** * Create a Schedule resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ScheduleArgs, opts?: pulumi.CustomResourceOptions) constructor(name: string, argsOrState?: ScheduleArgs | ScheduleState, opts?: pulumi.CustomResourceOptions) { let resourceInputs: pulumi.Inputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState as ScheduleState | undefined; resourceInputs["appName"] = state?.appName; resourceInputs["applicationId"] = state?.applicationId; resourceInputs["command"] = state?.command; resourceInputs["composeId"] = state?.composeId; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["cronExpression"] = state?.cronExpression; resourceInputs["description"] = state?.description; resourceInputs["enabled"] = state?.enabled; resourceInputs["name"] = state?.name; resourceInputs["scheduleType"] = state?.scheduleType; resourceInputs["script"] = state?.script; resourceInputs["serverId"] = state?.serverId; resourceInputs["serviceName"] = state?.serviceName; resourceInputs["shellType"] = state?.shellType; resourceInputs["timezone"] = state?.timezone; } else { const args = argsOrState as ScheduleArgs | undefined; if (args?.command === undefined && !opts.urn) { throw new Error("Missing required property 'command'"); } if (args?.cronExpression === undefined && !opts.urn) { throw new Error("Missing required property 'cronExpression'"); } resourceInputs["appName"] = args?.appName; resourceInputs["applicationId"] = args?.applicationId; resourceInputs["command"] = args?.command; resourceInputs["composeId"] = args?.composeId; resourceInputs["cronExpression"] = args?.cronExpression; resourceInputs["description"] = args?.description; resourceInputs["enabled"] = args?.enabled; resourceInputs["name"] = args?.name; resourceInputs["scheduleType"] = args?.scheduleType; resourceInputs["script"] = args?.script; resourceInputs["serverId"] = args?.serverId; resourceInputs["serviceName"] = args?.serviceName; resourceInputs["shellType"] = args?.shellType; resourceInputs["timezone"] = args?.timezone; resourceInputs["createdAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Schedule.__pulumiType, name, resourceInputs, opts); } } /** * Input properties used for looking up and filtering Schedule resources. */ export interface ScheduleState { /** * Docker service name the schedule targets. Derived by Dokploy when omitted. */ appName?: pulumi.Input; /** * Application this schedule belongs to. */ applicationId?: pulumi.Input; /** * Command to run. */ command?: pulumi.Input; /** * Compose stack this schedule belongs to. */ composeId?: pulumi.Input; /** * RFC 3339 timestamp of when the schedule was created. */ createdAt?: pulumi.Input; /** * Standard five-field cron expression, for example `0 3 * * *`. */ cronExpression?: pulumi.Input; /** * Free-form description. */ description?: pulumi.Input; /** * Whether the schedule is active. */ enabled?: pulumi.Input; /** * Display name of the schedule. */ name?: pulumi.Input; /** * Where the command runs. Valid values: `application`, `compose`, `server`, `dokploy-server`. Defaults to `application`. */ scheduleType?: pulumi.Input; /** * Multi-line script to run instead of a single command. */ script?: pulumi.Input; /** * Server this schedule runs on. */ serverId?: pulumi.Input; /** * Service inside a Compose stack to run the command in. */ serviceName?: pulumi.Input; /** * Shell used to interpret the command. Valid values: `bash`, `sh`. Defaults to `bash`. */ shellType?: pulumi.Input; /** * IANA timezone the cron expression is evaluated in, for example `Europe/Berlin`. */ timezone?: pulumi.Input; } /** * The set of arguments for constructing a Schedule resource. */ export interface ScheduleArgs { /** * Docker service name the schedule targets. Derived by Dokploy when omitted. */ appName?: pulumi.Input; /** * Application this schedule belongs to. */ applicationId?: pulumi.Input; /** * Command to run. */ command: pulumi.Input; /** * Compose stack this schedule belongs to. */ composeId?: pulumi.Input; /** * Standard five-field cron expression, for example `0 3 * * *`. */ cronExpression: pulumi.Input; /** * Free-form description. */ description?: pulumi.Input; /** * Whether the schedule is active. */ enabled?: pulumi.Input; /** * Display name of the schedule. */ name?: pulumi.Input; /** * Where the command runs. Valid values: `application`, `compose`, `server`, `dokploy-server`. Defaults to `application`. */ scheduleType?: pulumi.Input; /** * Multi-line script to run instead of a single command. */ script?: pulumi.Input; /** * Server this schedule runs on. */ serverId?: pulumi.Input; /** * Service inside a Compose stack to run the command in. */ serviceName?: pulumi.Input; /** * Shell used to interpret the command. Valid values: `bash`, `sh`. Defaults to `bash`. */ shellType?: pulumi.Input; /** * IANA timezone the cron expression is evaluated in, for example `Europe/Berlin`. */ timezone?: pulumi.Input; }