2017-01-31 62 views
1

我想只是執行的15分鐘之後,安排事件:Boto3的cron:參數ScheduleExpression無效

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. 

任何想法,爲什麼?

回答