ScheduleRecurrence 类
定义管道 Schedule 的频率、间隔和开始时间。
ScheduleRecurrence 还允许指定时区以及重复周期的小时数、分钟数或周数。
- 继承
-
builtins.objectScheduleRecurrence
构造函数
ScheduleRecurrence(frequency, interval, start_time=None, time_zone=None, hours=None, minutes=None, week_days=None, time_of_day=None)
参数
描述开始日期和时间的日期/时间对象。 日期/时间对象的 tzinfo 应为 none,使用 time_zone 属性指定时区(如果需要)。 还可以将此参数指定为以下格式的字符串:YYYY-MM-DDThh:mm:ss。 如果提供了 None,则第一个工作负载会即时运行,将来的工作负载将按计划运行。
如果开始时间是过去的时间,则第一个工作负荷将在下一个计算的运行时间运行。
如果 start_time 匹配 week_days 和 time_of_day、(或 hours 和 minutes),则第一个工作负载不会在 start_time 运行,而是在下一个计算的运行时运行。
如果为频率指定“天”或“周”,可以从 0 到 23 范围内指定一个或多个整数(用逗号分隔),作为一天中要运行工作流的时间点。
例如,如果指定“10”、“12”和“14”,则会将上午 10 点、中午 12 点和下午 2 点作为小时标记。 注意:只能使用 time_of_day 或 hours 和 minutes。
如果为频率指定“天”或“周”,可以从 0 到 59 范围内指定一个或多个整数(用逗号分隔),作为要运行工作流的分钟。 例如,可以指定“30”作为分钟标记并使用前面示例中的当天小时时间,这样,便可以指定10:30 AM、12:30 PM 和 2:30 PM 作为开始时间。 注意:只能使用 time_of_day 或 hours 和 minutes。
如果为频率指定“周”,则可以指定一天或多天(用逗号分隔)作为运行工作流的时间:“周一”、“周二”、“周三”、“周四”、“周五”、“周六”和“周日”。
- time_of_day
- str
如果为频率指定“天”或“周”,则可以将计划的时间指定为以 hh:mm 形式表示的字符串。 例如,如果指定“15:30”,则计划将在下午 3:30 运行。 注意:可以使用 only time_of_day 或 hours 和 minutes。
注解
为管道创建计划时,将使用 ScheduleRecurrence,如下所示:
from azureml.pipeline.core import Schedule, ScheduleRecurrence
recurrence = ScheduleRecurrence(frequency="Hour", interval=12)
schedule = Schedule.create(workspace, name="TestSchedule", pipeline_id=pipeline.id,
experiment_name="experiment_name", recurrence=recurrence)
下面是有效 ScheduleRecurrences 的一些示例:
from azureml.pipeline.core import ScheduleRecurrence
# Submit the Pipeline every 15 minutes
recurrence = ScheduleRecurrence(frequency="Minute", interval=15)
# Submit the Pipeline every 2 weeks on Monday and Wednesday at 6:30pm UTC
recurrence = ScheduleRecurrence(frequency="Week", interval=2, week_days=["Monday", "Wednesday"],
time_of_day="18:30")
# Submit the Pipeline on the first day of every month starting November 1, 2019 at 9AM
recurrence = ScheduleRecurrence(frequency="Month", interval=1, start_time="2019-11-01T09:00:00")
# Submit the Pipeline every hour on the 55th minute starting on January 13th, 2020 at 12:55pm
# if the specified start time is in the past, the first workload is run at the next future 55th minute
# of the hour.
recurrence = ScheduleRecurrence(frequency="Hour", interval=1, start_time="2020-01-13T12:55:00")
方法
| validate |
验证计划重复周期。 |
validate
验证计划重复周期。
validate()
反馈
提交和查看相关反馈