Class JobSchedule
Specifies the enhanced cron schedule for a cluster job as well as an indication of whether the job is enabled or disabled.
Namespace: Neon.Kube.ClusterDef
Assembly: Neon.Kube.dll
Syntax
public class JobSchedule
Constructors
JobSchedule()
Default constructor.
Declaration
public JobSchedule()
JobSchedule(bool, string)
Parameterized constructor.
Declaration
public JobSchedule(bool enabled, string schedule)
Parameters
Type | Name | Description |
---|---|---|
bool | enabled | Indicates whether the job is enabled. |
string | schedule | Specifies the enhanced Quartz job schedule. |
Properties
Enabled
Indicates whether this job is enabled or disabled. This defaults to false
.
Declaration
public bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
bool |
Schedule
The update schedule. This is enxtended Quartz cron expression. This defaults to "R R 0 ? * *" which fires every day at a random minute and second between 12:00am and 1:00am.
Declaration
public string Schedule { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
Cron expressions consist of seven sub-expressions that describe the details of the schedule. The sub expressions are:
- Seconds (0..59)
- Minutes (0..59)
- Hours (0..23)
- Day-of-Month (1..31)
- Month (1..12) or MON-DEC
- Day-of-Week (1..7) or SUN-SAT
- Year (optional) (1970..2099)
An example of a complete cron expression is
0 0 15 ? * MON
which means
every Monday at 3pm.
/// For the full documentation which describes special characters, see: https://www.quartz-scheduler.net/documentation/quartz-3.x/tutorial/crontriggers.html#cron-expressions
note
In addition to the standard Quartz defined special characters, we also support the R character which picks a random value within the allow range for a field. For example:
0 0 R R * *
schedules the job for a random hour and minute during the day. This is useful for situations like uploading telemetry to a global service where you don't want a potentially large number of clients being scheduled to hit the service at the same time.
Operators
implicit operator JobSchedule(JobSchedule)
Casts a JobSchedule into a V1NeonClusterJobs.JobSchedule.
Declaration
public static implicit operator V1NeonClusterJobs.JobSchedule(JobSchedule jobSchedule)
Parameters
Type | Name | Description |
---|---|---|
JobSchedule | jobSchedule | Specifies the schedule being converted. |
Returns
Type | Description |
---|---|
V1NeonClusterJobs.JobSchedule | The converted schedule. |