Preview a scheduling rule in Dynatrace with the AutomationEngine API to validate how the rule evaluates before you save or use it.
| POST | SaaS | https://{your-environment-id}.apps.dynatrace.com/platform/automation/v1/scheduling-rules/preview |
You send the scheduling rule data in the request body to preview how Dynatrace evaluates it. The operation returns a 200 response with the preview result, helping you check the rule before you apply it.
To execute this request, you need a platform token or OAuth access token with automation:workflows:read scope. To learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| body | R | - | body | Required |
RRulePreviewRequest object| Element | Type | Description | Required |
|---|---|---|---|
| id | string | - | Optional |
| count | integer | - | Optional |
| businessCalendar | string | - | Optional |
| dateFrom | string | Start date for the preview range (yyyy-mm-dd). Defaults to UTC today. | Optional |
| dateTo | string | End date for the preview range (yyyy-mm-dd). If provided, returns all executions in the range and count is ignored. Must not exceed 182 days from date_from. | Optional |
| ruleType | R | -The element can hold these values
| Required |
| rrule | R | - | Required |
RRulePreviewRuleType objectRRule object| Element | Type | Description | Required |
|---|---|---|---|
| freq | Freq | -The element can hold these values
| Required |
| datestart | string | The recurrence start. | Required |
| interval | integer | The interval between each freq iteration. | Optional |
| wkst | Wkst | The week start day. | Optional |
| until | string | Specifying the upper-bound limit of the recurrence. | Optional |
| bysetpos | integer[] | Each given integer will specify an occurrence number, corresponding to the nth occurrence of the rule inside the frequency period | Optional |
| bymonth | integer[] | The months to apply the recurrence to. | Optional |
| bymonthday | integer[] | The month days to apply the recurrence to. | Optional |
| byyearday | integer[] | The year days to apply the recurrence to. | Optional |
| byweekno | integer[] | The week numbers to apply the recurrence to. | Optional |
| byday | Byday[] | Define the weekdays where the recurrence will be applied. | Optional |
| byworkday | Byworkday | The type of days on which the recurrence will be applied. | Optional |
Freq objectWkst objectThe week start day.
Byday objectByworkday objectThe type of days on which the recurrence will be applied.
GroupingRulePreviewRequest object| Element | Type | Description | Required |
|---|---|---|---|
| id | string | - | Optional |
| count | integer | - | Optional |
| businessCalendar | string | - | Optional |
| dateFrom | string | Start date for the preview range (yyyy-mm-dd). Defaults to UTC today. | Optional |
| dateTo | string | End date for the preview range (yyyy-mm-dd). If provided, returns all executions in the range and count is ignored. Must not exceed 182 days from date_from. | Optional |
| ruleType | Grouping | -The element can hold these values
| Required |
| groupingRule | Grouping | - | Required |
GroupingRulePreviewRuleType objectGroupingRule object| Element | Type | Description | Required |
|---|---|---|---|
| combine | string[] | - | Optional |
| intersect | string[] | - | Optional |
| subtract | string[] | - | Optional |
FixedOffsetRulePreviewRequest object| Element | Type | Description | Required |
|---|---|---|---|
| id | string | - | Optional |
| count | integer | - | Optional |
| businessCalendar | string | - | Optional |
| dateFrom | string | Start date for the preview range (yyyy-mm-dd). Defaults to UTC today. | Optional |
| dateTo | string | End date for the preview range (yyyy-mm-dd). If provided, returns all executions in the range and count is ignored. Must not exceed 182 days from date_from. | Optional |
| ruleType | Fixed | -The element can hold these values
| Required |
| fixedOffsetRule | Fixed | - | Required |
FixedOffsetRulePreviewRuleType objectFixedOffsetRule object| Element | Type | Description | Required |
|---|---|---|---|
| rule | string | - | Required |
| offset | number | Offset days | Required |
RelativeOffsetRulePreviewRequest object| Element | Type | Description | Required |
|---|---|---|---|
| id | string | - | Optional |
| count | integer | - | Optional |
| businessCalendar | string | - | Optional |
| dateFrom | string | Start date for the preview range (yyyy-mm-dd). Defaults to UTC today. | Optional |
| dateTo | string | End date for the preview range (yyyy-mm-dd). If provided, returns all executions in the range and count is ignored. Must not exceed 182 days from date_from. | Optional |
| ruleType | Relative | -The element can hold these values
| Required |
| relativeOffsetRule | Relative | - | Required |
RelativeOffsetRulePreviewRuleType objectRelativeOffsetRule object| Element | Type | Description | Required |
|---|---|---|---|
| direction | Direction | -The element can hold these values
| Required |
| sourceRule | string | - | Required |
| targetRule | string | - | Required |
Direction objectThis is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"id": "string","count": 10,"businessCalendar": "string","dateFrom": "string","dateTo": "string","ruleType": "rrule","rrule": {"freq": "YEARLY","datestart": "string","interval": 1,"wkst": "MO","until": "string","bysetpos": [1],"bymonth": [1],"bymonthday": [1],"byyearday": [1],"byweekno": [1],"byday": ["MO"],"byworkday": "WORKING"}}
| Code | Type | Description |
|---|---|---|
| 200 | Rule | - |
| 4XX | Error | - |
RulePreviewResponse object| Element | Type | Description |
|---|---|---|
| nextExecutions | string[] | - |
| valid | boolean | - |
| error | string | - |
ErrorEnvelope object| Element | Type | Description |
|---|---|---|
| error | Error | - |
Error object| Element | Type | Description |
|---|---|---|
| message | string | - |
| code | integer | - |
| details | Error | - |
ErrorDetails object| Element | Type | Description |
|---|---|---|
| errorCode | string | - |
| errorRef | string | - |
{"nextExecutions": ["string"],"valid": true,"error": "string"}
{"error": {"message": "string","code": 1,"details": {"errorCode": "string","errorRef": "string"}}}