CronTrigger Class
Cron Trigger for a job schedule.
- Inheritance
-
azure.ai.ml.entities._schedule.trigger.TriggerBaseCronTrigger
Constructor
CronTrigger(*, expression: str, start_time: str | datetime | None = None, end_time: str | datetime | None = None, time_zone: str | TimeZone = TimeZone.UTC)
Keyword-Only Parameters
Name | Description |
---|---|
expression
|
The cron expression of schedule, following NCronTab format. |
start_time
|
The start time for the trigger. If using a datetime object, leave the tzinfo as None and use
the |
end_time
|
The start time for the trigger. If using a datetime object, leave the tzinfo as None and use
the |
time_zone
|
The time zone where the schedule will run. Defaults to UTC(+00:00). Note that this applies to the start_time and end_time. Default value: TimeZone.UTC
|
Examples
Configuring a CronTrigger.
from datetime import datetime
from azure.ai.ml.constants import TimeZone
from azure.ai.ml.entities import CronTrigger
trigger = CronTrigger(
expression="15 10 * * 1",
start_time=datetime(year=2022, month=3, day=10, hour=10, minute=15),
end_time=datetime(year=2022, month=6, day=10, hour=10, minute=15),
time_zone=TimeZone.PACIFIC_STANDARD_TIME,
)
Azure SDK for Python