Product SiteDocumentation Site

8.2. Espressioni basate su Ora/Data

As the name suggests, date_expressions are used to control a resource or cluster option based on the current date/time. They can contain an optional date_spec and/or duration object depending on the context.

Tabella 8.3. Proprietà di un'espressione basata sulla data

Campo Descrizione
start
A date/time conforming to the ISO8601 specification.
end
A date/time conforming to the ISO8601 specification. Can be inferred by supplying a value for start and a duration.
operation
Confronta la data/ora attuale con la data/ora indicata nei parametri start ed end, dipendentemente dal contesto. Valori permessi:
* gt - True if the current date/time is after start
* lt - True if the current date/time is before end
* in-range - True if the current date/time is after start and before end
* date-spec - performs a cron-like comparison to the current date/time

Nota

As these comparisons (except for date_spec) include the time, the eq, neq, gte and lte operators have not been implemented since they would only be valid for a single second.

8.2.1. Dichiarare date

gli oggetti di tipo date_spec sono utilizzati per creare espressioni simili a quelle cron. Ogi campo contiene un singolo numero ed un singolo range Anziché impostare per default zero, ogni campo non difinito viene ignorato.
For example, monthdays="1" matches the first day of every month and hours="09-17" matches the hours between 9am and 5pm (inclusive). However, at this time one cannot specify weekdays="1,2" or weekdays="1-2,5-6" since they contain multiple ranges. Depending on demand, this may be implemented in a future release.

Tabella 8.4. Prorpietà di una specifica data

Campo Descrizione
id
A unique name for the date
hours
Allowed values: 0-23
monthdays
Allowed values: 0-31 (depending on month and year)
weekdays
Allowed values: 1-7 (1=Monday, 7=Sunday)
yeardays
Allowed values: 1-366 (depending on the year)
months
Allowed values: 1-12
weeks
Allowed values: 1-53 (depending on weekyear)
years
Year according the Gregorian calendar
weekyears
May differ from Gregorian years; Eg. 2005-001 Ordinal is also 2005-01-01 Gregorian is also 2004-W53-6 Weekly
moon
Allowed values: 0-7 (0 is new, 4 is full moon). Seriously, you can use this. This was implemented to demonstrate the ease with which new comparisons could be added.