-
Notifications
You must be signed in to change notification settings - Fork 1
/
alohaJob2FileIds.jq
51 lines (44 loc) · 1.36 KB
/
alohaJob2FileIds.jq
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
40
41
42
43
44
45
46
47
48
49
50
51
include "alohaLib";
alohaFlagName2FlagArg($AlohaArgFlagName) as $AlohaArgFlag
| ._id as $JobId
| .created as $JobCreated
|
[
(
.config.inputs[]
| .location.name as $FileName
| .object
| (if (.classification) then .classification.Measurement|join(":") else "" end ) as $FileClassificationMeasurement
| (if (.classification) then .classification.Intent|join(":") else "" end ) as $FileClassificationIntent
| {
"FileName": $FileName
, "FileId": .file_id
, "FileType": .type
, "FileTags": ( .tags | sort )
, "FileModality": .modality
, "FileClassificationMeasurement": $FileClassificationMeasurement
, "FileClassificationIntent": $FileClassificationIntent
, "JobId": $JobId
, "JobCreated": $JobCreated
, "AlohaArgFlag": $AlohaArgFlag
}
)] as $Inputs
| [
(
.outputs[]
|
{
"FileName": .name
, "FileId": .file_id
, "FileType": .type
, "FileTags": ( .tags | sort )
, "FileModality": .modality
, "FileTimestamp": .created
, "JobId": $JobId
, "JobCreated": $JobCreated
, "AlohaArgFlag": $AlohaArgFlag
, "AlohaArgFlagName": $AlohaArgFlagName
}
)
] as $Outputs
| { "Inputs": $Inputs, "Outputs": $Outputs }