2019-09-10 13:32:51 -04:00
|
|
|
[role="xpack"]
|
2017-03-28 17:23:01 -04:00
|
|
|
[[schedule-yearly]]
|
2019-09-30 13:18:50 -04:00
|
|
|
==== Yearly schedule
|
2017-03-28 17:23:01 -04:00
|
|
|
|
2019-09-30 13:18:50 -04:00
|
|
|
A <<trigger-schedule,`schedule`>> that triggers at a specific day and time
|
2017-03-28 17:23:01 -04:00
|
|
|
every year. To use the `yearly` schedule, you specify the month, day, and time
|
|
|
|
(or months, days, and times) when you want the scheduler to start the watch
|
|
|
|
execution with the `in`, `on`, and `at` attributes.
|
|
|
|
|
|
|
|
You can specify the month by name, abbreviation, or number:
|
|
|
|
|
|
|
|
* `january`, `february`, `march`, `april`, `may`, `june`, `july`,
|
|
|
|
`august`, `september`, `october`, `november` and `december`
|
|
|
|
|
|
|
|
* `jan`, `feb`, `mar`, `apr`, `may`, `jun`, `jul`, `aug`,
|
|
|
|
`sep`, `oct`, `nov` and `dec`
|
|
|
|
|
|
|
|
* `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11` and `12`
|
|
|
|
|
|
|
|
You specify the day of month as a numeric value between `1` and `31` (inclusive).
|
|
|
|
The Times are specified in the form `HH:mm` on a 24-hour clock. You can also use
|
|
|
|
the reserved values `midnight` and `noon` for `00:00` and `12:00`.
|
|
|
|
|
2019-09-30 13:18:50 -04:00
|
|
|
===== Configuring a yearly schedule
|
2017-03-28 17:23:01 -04:00
|
|
|
|
|
|
|
To configure a once a year schedule, you specify the month with the `in` attribute,
|
|
|
|
the day with the `on` attribute, and the time with the `at` attribute. For
|
|
|
|
example, the following `yearly` schedule triggers once a year at noon on January
|
|
|
|
10th:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"trigger" : {
|
|
|
|
"schedule" : {
|
|
|
|
"yearly" : { "in" : "january", "on" : 10, "at" : "noon" }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2018-06-22 21:09:37 -04:00
|
|
|
// NOTCONSOLE
|
2017-03-28 17:23:01 -04:00
|
|
|
|
|
|
|
NOTE: You can also specify the month, day, and time with the `month`, `day`, and
|
|
|
|
`time` attributes, they are interchangeable with `in`, `on`, and `at`.
|
|
|
|
|
2019-09-30 13:18:50 -04:00
|
|
|
===== Configuring a multiple times yearly schedule
|
2017-03-28 17:23:01 -04:00
|
|
|
|
|
|
|
To configure a `yearly` schedule that triggers multiple times a year, you can
|
|
|
|
specify an array of month, day, and time values. For example, the following
|
|
|
|
`yearly` schedule triggers twice a year: at noon on January 10th, and at 5:00 PM
|
|
|
|
on July 20th.
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"trigger" : {
|
|
|
|
"schedule" : {
|
|
|
|
"yearly" : [
|
|
|
|
{ "in" : "january", "on" : 10, "at" : "noon" },
|
|
|
|
{ "in" : "july", "on" : 20, "at" : "17:00" }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2018-06-22 21:09:37 -04:00
|
|
|
// NOTCONSOLE
|
2017-03-28 17:23:01 -04:00
|
|
|
|
|
|
|
Alternatively, you can specify the months, days, and times in an object that has
|
|
|
|
`in`, `on`, and `minute` attributes that contain an array of values. For example,
|
|
|
|
the following `yearly` schedule triggers at 12:00 AM and 12:00 PM on January 10th,
|
|
|
|
January 20th, December 10th, and December 20th.
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"trigger" : {
|
|
|
|
"schedule" : {
|
|
|
|
"yearly" : {
|
|
|
|
"in" : [ "jan", "dec" ],
|
|
|
|
"on" : [ 10, 20 ],
|
|
|
|
"at" : [ "midnight", "noon" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2018-06-22 21:09:37 -04:00
|
|
|
// NOTCONSOLE
|