REST API ignores timezone objects in v21 but not in v12.3
search cancel

REST API ignores timezone objects in v21 but not in v12.3

book

Article ID: 265762

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine CA Automic One Automation

Issue/Introduction

When submitting a process for execution through AWI's REST API the earliest start time AE uses UTC.

Example:

"execution_date_time": "2023-04-13T10:30:00Z"

Came into the queue with the earliest start time of 6:30:00am and since it was about 10 am when submitted, it ran immediately.

Object name: JOBP.WORKFLOW
RunID:333698271
User:automic
Start type:<ONCE>
Activation:4/13/2023 10:00:52
Start:4/13/2023 10:01:09
End:4/13/2023 10:01:10
Runtime:0:00:01
Status: ENDED_OK - ended normally
 
This can also result in a configuration like:
The timezone of Automic client is CET. But the below Rest API displays the end_time value in the UTC instead of CET and does not take into account time zone objects:
http://<hostname>:<port>/ae/api/v1/<client>/executions/<runid>/reports

Environment

Release : 21.0.5

Resolution

The previous behavior in v12.3 is wrong.
When sending an execute once rest request, the time must also be specified.
From the examples, a sample JSON would look like this:

{
    "execution_date_time": "2018-02-27T10:00:00Z",
    "wait_for_manual_release": "false",
    "use_logical_time": "2018-02-27T10:00:00Z"
  },

The time is specified as "2018-02-27T10:00:00Z".
Notice the Z at the end.
According to the ISO 8601 standard, a Z at the end would explicitly mean UTC time.

The 12.3 version mistakenly converted it to local client time, whereas version 21 takes the input time as UTC.
The REST endpoint in v21 only supports time in specified in UTC, it is by design.

Nevertheless, if you want to execute an object with a specific Timezone, then you should pass it in via the property timezone to the REST API, example:

{
  "object_name": "OBJECT_NAME",
  "alias": "ALIAS_OBJECT",
  "timezone":"TZ.CET",
  "execution_option": "once",
  "once": 
  {
    "execution_date_time": "2024-02-27T08:36:57Z",
    "wait_for_manual_release": "false",
    "use_logical_time": "2024-02-27T08:36:57Z"
  },

Additional Information

The REST API documentation will be improved in the future via AE-36385 to add more complete examples with all accepted parameters and how to use correctly the time parameters.