const json args prefix instances fields fields sort sort offset offset

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const json args = {
{"prefix", "instances:"},
{"fields", fields},
{"sort", sort},
{"offset", offset},
{"limit", limit},
{"select", json::array({
"collaboration_id",
"created_at",
"created_by",
"finished_at AS completed_at",
"definition_id",
"from_mosaic",
"is_simulation",
"instance_id AS id",
"name",
"type",
"version",
"file",
"OBJECT_VALUES(resources_executed) as resources_executed",
REMOVE_EXTRA_SPACES(R"(
CASE
WHEN status.failed THEN "failed"
WHEN status.terminated THEN "terminated"
WHEN status.completed THEN "completed"
WHEN status.suspended THEN "suspended"
ELSE "running"
END
AS status
)"),
"status AS status_raw",
"terminated", // Not ready yet
"OBJECT_LENGTH(tokens) as tokens",
"updated_at", // Not ready yet
"updated_by", // Not ready yet
"OBJECT_VALUES(activities) as activities",
"tenant"
})}
};