16
16
17
17
from contentctl .output .json_writer import JsonWriter
18
18
19
-
20
-
21
19
JSON_API_VERSION = 2
22
20
21
+
23
22
class ApiJsonOutput :
24
23
output_path : pathlib .Path
25
24
app_label : str
@@ -73,7 +72,9 @@ def writeDetections(
73
72
# del()
74
73
75
74
JsonWriter .writeJsonObject (
76
- os .path .join (self .output_path , f"detections_v{ JSON_API_VERSION } .json" ), "detections" , detections
75
+ os .path .join (self .output_path , f"detections_v{ JSON_API_VERSION } .json" ),
76
+ "detections" ,
77
+ detections ,
77
78
)
78
79
79
80
def writeMacros (
@@ -89,7 +90,9 @@ def writeMacros(
89
90
if k in macro :
90
91
del macro [k ]
91
92
JsonWriter .writeJsonObject (
92
- os .path .join (self .output_path , f"macros_v{ JSON_API_VERSION } .json" ), "macros" , macros
93
+ os .path .join (self .output_path , f"macros_v{ JSON_API_VERSION } .json" ),
94
+ "macros" ,
95
+ macros ,
93
96
)
94
97
95
98
def writeStories (
@@ -135,7 +138,9 @@ def writeStories(
135
138
]
136
139
137
140
JsonWriter .writeJsonObject (
138
- os .path .join (self .output_path , f"stories_v{ JSON_API_VERSION } .json" ), "stories" , stories
141
+ os .path .join (self .output_path , f"stories_v{ JSON_API_VERSION } .json" ),
142
+ "stories" ,
143
+ stories ,
139
144
)
140
145
141
146
def writeBaselines (
@@ -166,7 +171,9 @@ def writeBaselines(
166
171
]
167
172
168
173
JsonWriter .writeJsonObject (
169
- os .path .join (self .output_path , f"baselines_v{ JSON_API_VERSION } .json" ), "baselines" , baselines
174
+ os .path .join (self .output_path , f"baselines_v{ JSON_API_VERSION } .json" ),
175
+ "baselines" ,
176
+ baselines ,
170
177
)
171
178
172
179
def writeInvestigations (
@@ -230,7 +237,9 @@ def writeLookups(
230
237
if k in lookup :
231
238
del lookup [k ]
232
239
JsonWriter .writeJsonObject (
233
- os .path .join (self .output_path , f"lookups_v{ JSON_API_VERSION } .json" ), "lookups" , lookups
240
+ os .path .join (self .output_path , f"lookups_v{ JSON_API_VERSION } .json" ),
241
+ "lookups" ,
242
+ lookups ,
234
243
)
235
244
236
245
def writeDeployments (
0 commit comments