Schedule Details
post
/api/v2/schedules/
================ The following lists the expected format and details of our rrules:
- DTSTART is required and must follow the following format: DTSTART:YYYYMMDDTHHMMSSZ
- DTSTART is expected to be in UTC
- INTERVAL is required
- SECONDLY is not supported
- RRULE must precede the rule statements
- BYDAY is supported but not BYDAY with a numerical prefix
- BYYEARDAY and BYWEEKNO are not supported
- Only one rrule statement per schedule is supported
- COUNT must be < 1000
Here are some example rrules:
"DTSTART:20500331T055000Z RRULE:FREQ=MINUTELY;INTERVAL=10;COUNT=5"
"DTSTART:20240331T075000Z RRULE:FREQ=DAILY;INTERVAL=1;COUNT=1"
"DTSTART:20140331T075000Z RRULE:FREQ=MINUTELY;INTERVAL=1;UNTIL=20230401T075000Z"
"DTSTART:20140331T075000Z RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,FR"
"DTSTART:20140331T075000Z RRULE:FREQ=WEEKLY;INTERVAL=5;BYDAY=MO"
"DTSTART:20140331T075000Z RRULE:FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=6"
"DTSTART:20140331T075000Z RRULE:FREQ=MONTHLY;INTERVAL=1;BYSETPOS=4;BYDAY=SU"
"DTSTART:20140331T075000Z RRULE:FREQ=MONTHLY;INTERVAL=1;BYSETPOS=-1;BYDAY=MO,TU,WE,TH,FR"
"DTSTART:20140331T075000Z RRULE:FREQ=MONTHLY;INTERVAL=1;BYSETPOS=-1;BYDAY=MO,TU,WE,TH,FR,SA,SU"
"DTSTART:20140331T075000Z RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=4;BYMONTHDAY=1"
"DTSTART:20140331T075000Z RRULE:FREQ=YEARLY;INTERVAL=1;BYSETPOS=-1;BYMONTH=8;BYDAY=SU"
"DTSTART:20140331T075000Z RRULE:FREQ=WEEKLY;INTERVAL=1;UNTIL=20230401T075000Z;BYDAY=MO,WE,FR"
"DTSTART:20140331T075000Z RRULE:FREQ=HOURLY;INTERVAL=1;UNTIL=20230610T075000Z"
Request
Supported Media Types
- application/json
Root Schema : schema
Example:
{
"name":"My Example Schedule",
"rrule":"DTSTART:20151117T050000Z RRULE:FREQ=DAILY;INTERVAL=1;COUNT=1",
"unified_job_template":"1"
}
Response
Supported Media Types
- application/json
201 Response
Example Response (application/json)
{
"created":"2018-02-01T08:00:00.000000Z",
"description":"",
"diff_mode":null,
"dtend":"2015-11-17T05:00:00Z",
"dtstart":"2015-11-17T05:00:00Z",
"enabled":true,
"extra_data":{
},
"id":"1",
"inventory":null,
"job_tags":null,
"job_type":null,
"limit":null,
"modified":"2018-02-01T08:00:00.000000Z",
"name":"My Example Schedule",
"next_run":null,
"related":{
"credentials":"/api/v2/schedules/1/credentials/",
"inventory":"/api/v2/inventories/1/",
"unified_job_template":"/api/v2/inventory_sources/1/",
"unified_jobs":"/api/v2/schedules/1/jobs/"
},
"rrule":"DTSTART:20151117T050000Z RRULE:FREQ=DAILY;INTERVAL=1;COUNT=1",
"scm_branch":null,
"skip_tags":null,
"summary_fields":{
"inventory":{
"description":"",
"has_active_failures":false,
"has_inventory_sources":true,
"hosts_with_active_failures":"0",
"id":"1",
"inventory_sources_with_failures":"0",
"kind":"",
"name":"test-inv",
"organization_id":"1",
"total_groups":"0",
"total_hosts":"0",
"total_inventory_sources":"1"
},
"unified_job_template":{
"description":"",
"id":"1",
"name":"single-inv-src",
"unified_job_type":"inventory_update"
},
"user_capabilities":{
"delete":false,
"edit":false
}
},
"timezone":"UTC",
"type":"schedule",
"unified_job_template":"1",
"until":"",
"url":"/api/v2/schedules/1/",
"verbosity":null
}
403 Response
Example Response (application/json)
{
"detail":"You do not have permission to perform this action."
}