【发布时间】:2017-06-16 17:47:09
【问题描述】:
我正在尝试在执行 15 分钟后将事件安排为:
client = boto3.client('events')
d = datetime.now() + timedelta(minutes=40)
cronJob = "cron(" + str(d.hour) + " " + str(d.minute) + " * * ? *)"
client.put_rule(Name='extractData', ScheduleExpression=cronJob, State='ENABLED', Description='This is rule extracting flurry data')
try:
client.put_targets( Rule='extractData', Targets=[ { 'Id': '1', 'Arn': 'arn:aws:lambda:ap-southeast-1:381409677897:function:flurry_extractReportOnDemand' }])
except:
print("\n###################\n")
print ("Could not schedule")
print("\n###################\n")
这给了我错误
Parameter ScheduleExpression is not valid.
知道为什么吗?
【问题讨论】:
标签: python amazon-web-services cron boto3