prelude-sdk 2.6.39__py3-none-any.whl → 2.6.40__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- prelude_sdk/controllers/build_controller.py +16 -84
- prelude_sdk/controllers/detect_controller.py +33 -102
- prelude_sdk/controllers/export_controller.py +3 -7
- prelude_sdk/controllers/generate_controller.py +3 -6
- prelude_sdk/controllers/http_controller.py +28 -12
- prelude_sdk/controllers/iam_controller.py +20 -99
- prelude_sdk/controllers/jobs_controller.py +2 -8
- prelude_sdk/controllers/partner_controller.py +13 -30
- prelude_sdk/controllers/probe_controller.py +1 -3
- prelude_sdk/controllers/scm_controller.py +67 -183
- prelude_sdk/models/codes.py +1 -0
- {prelude_sdk-2.6.39.dist-info → prelude_sdk-2.6.40.dist-info}/METADATA +1 -1
- prelude_sdk-2.6.40.dist-info/RECORD +20 -0
- prelude_sdk-2.6.39.dist-info/RECORD +0 -20
- {prelude_sdk-2.6.39.dist-info → prelude_sdk-2.6.40.dist-info}/WHEEL +0 -0
- {prelude_sdk-2.6.39.dist-info → prelude_sdk-2.6.40.dist-info}/licenses/LICENSE +0 -0
- {prelude_sdk-2.6.39.dist-info → prelude_sdk-2.6.40.dist-info}/top_level.txt +0 -0
|
@@ -21,12 +21,8 @@ class ScmController(HttpController):
|
|
|
21
21
|
def endpoints(self, filter: str = None, orderby: str = None, top: int = None):
|
|
22
22
|
"""List endpoints with SCM analysis"""
|
|
23
23
|
params = {"$filter": filter, "$orderby": orderby, "$top": top}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
headers=self.account.headers,
|
|
27
|
-
params=params,
|
|
28
|
-
timeout=30,
|
|
29
|
-
)
|
|
24
|
+
|
|
25
|
+
res = self.get(f"{self.account.hq}/scm/endpoints", params=params, timeout=30)
|
|
30
26
|
data = res.json()
|
|
31
27
|
if self.account.resolve_enums:
|
|
32
28
|
self.resolve_enums(
|
|
@@ -44,12 +40,8 @@ class ScmController(HttpController):
|
|
|
44
40
|
def inboxes(self, filter: str = None, orderby: str = None, top: int = None):
|
|
45
41
|
"""List inboxes with SCM analysis"""
|
|
46
42
|
params = {"$filter": filter, "$orderby": orderby, "$top": top}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
headers=self.account.headers,
|
|
50
|
-
params=params,
|
|
51
|
-
timeout=30,
|
|
52
|
-
)
|
|
43
|
+
|
|
44
|
+
res = self.get(f"{self.account.hq}/scm/inboxes", params=params, timeout=30)
|
|
53
45
|
data = res.json()
|
|
54
46
|
if self.account.resolve_enums:
|
|
55
47
|
self.resolve_enums(
|
|
@@ -67,11 +59,9 @@ class ScmController(HttpController):
|
|
|
67
59
|
def network_devices(self, filter: str = None, orderby: str = None, top: int = None):
|
|
68
60
|
"""List network_devices with SCM analysis"""
|
|
69
61
|
params = {"$filter": filter, "$orderby": orderby, "$top": top}
|
|
62
|
+
|
|
70
63
|
res = self.get(
|
|
71
|
-
f"{self.account.hq}/scm/network_devices",
|
|
72
|
-
headers=self.account.headers,
|
|
73
|
-
params=params,
|
|
74
|
-
timeout=30,
|
|
64
|
+
f"{self.account.hq}/scm/network_devices", params=params, timeout=30
|
|
75
65
|
)
|
|
76
66
|
data = res.json()
|
|
77
67
|
if self.account.resolve_enums:
|
|
@@ -90,12 +80,8 @@ class ScmController(HttpController):
|
|
|
90
80
|
def users(self, filter: str = None, orderby: str = None, top: int = None):
|
|
91
81
|
"""List users with SCM analysis"""
|
|
92
82
|
params = {"$filter": filter, "$orderby": orderby, "$top": top}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
headers=self.account.headers,
|
|
96
|
-
params=params,
|
|
97
|
-
timeout=30,
|
|
98
|
-
)
|
|
83
|
+
|
|
84
|
+
res = self.get(f"{self.account.hq}/scm/users", params=params, timeout=30)
|
|
99
85
|
data = res.json()
|
|
100
86
|
if self.account.resolve_enums:
|
|
101
87
|
self.resolve_enums(
|
|
@@ -115,7 +101,6 @@ class ScmController(HttpController):
|
|
|
115
101
|
res = self.get(
|
|
116
102
|
f"{self.account.hq}/scm/technique_summary",
|
|
117
103
|
params=dict(techniques=techniques),
|
|
118
|
-
headers=self.account.headers,
|
|
119
104
|
timeout=30,
|
|
120
105
|
)
|
|
121
106
|
return res.json()
|
|
@@ -136,11 +121,9 @@ class ScmController(HttpController):
|
|
|
136
121
|
)
|
|
137
122
|
if techniques:
|
|
138
123
|
params["techniques"] = techniques
|
|
124
|
+
|
|
139
125
|
res = self.get(
|
|
140
|
-
f"{self.account.hq}/scm/evaluation_summary",
|
|
141
|
-
params=params,
|
|
142
|
-
headers=self.account.headers,
|
|
143
|
-
timeout=30,
|
|
126
|
+
f"{self.account.hq}/scm/evaluation_summary", params=params, timeout=30
|
|
144
127
|
)
|
|
145
128
|
data = res.json()
|
|
146
129
|
if self.account.resolve_enums:
|
|
@@ -164,10 +147,10 @@ class ScmController(HttpController):
|
|
|
164
147
|
params["policy_types"] = policy_types
|
|
165
148
|
if techniques:
|
|
166
149
|
params["techniques"] = techniques
|
|
150
|
+
|
|
167
151
|
res = self.get(
|
|
168
152
|
f"{self.account.hq}/scm/evaluations/{partner.name}/{instance_id}",
|
|
169
153
|
params=params,
|
|
170
|
-
headers=self.account.headers,
|
|
171
154
|
timeout=30,
|
|
172
155
|
)
|
|
173
156
|
data = res.json()
|
|
@@ -179,9 +162,7 @@ class ScmController(HttpController):
|
|
|
179
162
|
def update_evaluation(self, partner: Control, instance_id: str):
|
|
180
163
|
"""Update policy evaluations for given partner"""
|
|
181
164
|
res = self.post(
|
|
182
|
-
f"{self.account.hq}/scm/evaluations/{partner.name}/{instance_id}"
|
|
183
|
-
headers=self.account.headers,
|
|
184
|
-
timeout=60,
|
|
165
|
+
f"{self.account.hq}/scm/evaluations/{partner.name}/{instance_id}"
|
|
185
166
|
)
|
|
186
167
|
return res.json()
|
|
187
168
|
|
|
@@ -189,12 +170,8 @@ class ScmController(HttpController):
|
|
|
189
170
|
def list_partner_groups(self, filter: str = None, orderby: str = None):
|
|
190
171
|
"""List groups"""
|
|
191
172
|
params = {"$filter": filter, "$orderby": orderby}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
headers=self.account.headers,
|
|
195
|
-
params=params,
|
|
196
|
-
timeout=10,
|
|
197
|
-
)
|
|
173
|
+
|
|
174
|
+
res = self.get(f"{self.account.hq}/scm/groups", params=params)
|
|
198
175
|
groups = res.json()
|
|
199
176
|
if self.account.resolve_enums:
|
|
200
177
|
self.resolve_enums(groups, [(Control, "control")])
|
|
@@ -206,22 +183,16 @@ class ScmController(HttpController):
|
|
|
206
183
|
):
|
|
207
184
|
"""Update groups"""
|
|
208
185
|
body = dict(group_ids=group_ids)
|
|
186
|
+
|
|
209
187
|
res = self.post(
|
|
210
|
-
f"{self.account.hq}/scm/groups/{partner.name}/{instance_id}",
|
|
211
|
-
headers=self.account.headers,
|
|
212
|
-
json=body,
|
|
213
|
-
timeout=10,
|
|
188
|
+
f"{self.account.hq}/scm/groups/{partner.name}/{instance_id}", json=body
|
|
214
189
|
)
|
|
215
190
|
return res.json()
|
|
216
191
|
|
|
217
192
|
@verify_credentials
|
|
218
193
|
def list_object_exceptions(self):
|
|
219
194
|
"""List object exceptions"""
|
|
220
|
-
res = self.get(
|
|
221
|
-
f"{self.account.hq}/scm/exceptions/objects",
|
|
222
|
-
headers=self.account.headers,
|
|
223
|
-
timeout=10,
|
|
224
|
-
)
|
|
195
|
+
res = self.get(f"{self.account.hq}/scm/exceptions/objects")
|
|
225
196
|
exceptions = res.json()
|
|
226
197
|
if self.account.resolve_enums:
|
|
227
198
|
self.resolve_enums(exceptions, [(ControlCategory, "category")])
|
|
@@ -229,60 +200,50 @@ class ScmController(HttpController):
|
|
|
229
200
|
|
|
230
201
|
@verify_credentials
|
|
231
202
|
def create_object_exception(
|
|
232
|
-
self, category: ControlCategory, filter, name=None, expires: str = None
|
|
203
|
+
self, category: ControlCategory, filter, comment=None, name=None, expires: str = None
|
|
233
204
|
):
|
|
234
205
|
"""Create an object exception"""
|
|
235
206
|
body = dict(category=category.name, filter=filter)
|
|
207
|
+
if comment:
|
|
208
|
+
body["comment"] = comment
|
|
236
209
|
if name:
|
|
237
210
|
body["name"] = name
|
|
238
211
|
if expires:
|
|
239
212
|
body["expires"] = expires
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
json=body,
|
|
243
|
-
headers=self.account.headers,
|
|
244
|
-
timeout=10,
|
|
245
|
-
)
|
|
213
|
+
|
|
214
|
+
res = self.post(f"{self.account.hq}/scm/exceptions/objects", json=body)
|
|
246
215
|
return res.json()
|
|
247
216
|
|
|
248
217
|
@verify_credentials
|
|
249
218
|
def update_object_exception(
|
|
250
|
-
self, exception_id, expires=default, filter=None, name=None
|
|
219
|
+
self, exception_id, comment=None, expires=default, filter=None, name=None
|
|
251
220
|
):
|
|
252
221
|
"""Update an object exception"""
|
|
253
222
|
body = dict()
|
|
223
|
+
if comment:
|
|
224
|
+
body["comment"] = comment
|
|
254
225
|
if expires != self.default:
|
|
255
226
|
body["expires"] = expires
|
|
256
227
|
if filter:
|
|
257
228
|
body["filter"] = filter
|
|
258
229
|
if name:
|
|
259
230
|
body["name"] = name
|
|
231
|
+
|
|
260
232
|
res = self.post(
|
|
261
|
-
f"{self.account.hq}/scm/exceptions/objects/{exception_id}",
|
|
262
|
-
json=body,
|
|
263
|
-
headers=self.account.headers,
|
|
264
|
-
timeout=10,
|
|
233
|
+
f"{self.account.hq}/scm/exceptions/objects/{exception_id}", json=body
|
|
265
234
|
)
|
|
266
235
|
return res.json()
|
|
267
236
|
|
|
268
237
|
@verify_credentials
|
|
269
238
|
def delete_object_exception(self, exception_id):
|
|
270
239
|
"""Delete an object exception"""
|
|
271
|
-
res = self.delete(
|
|
272
|
-
f"{self.account.hq}/scm/exceptions/objects/{exception_id}",
|
|
273
|
-
headers=self.account.headers,
|
|
274
|
-
timeout=10,
|
|
275
|
-
)
|
|
240
|
+
res = self.delete(f"{self.account.hq}/scm/exceptions/objects/{exception_id}")
|
|
276
241
|
return res.json()
|
|
277
242
|
|
|
278
243
|
@verify_credentials
|
|
279
244
|
def list_policy_exceptions(self):
|
|
280
245
|
"""List policy exceptions"""
|
|
281
|
-
res = self.get(
|
|
282
|
-
f"{self.account.hq}/scm/exceptions/policies",
|
|
283
|
-
headers=self.account.headers,
|
|
284
|
-
timeout=10,
|
|
285
|
-
)
|
|
246
|
+
res = self.get(f"{self.account.hq}/scm/exceptions/policies")
|
|
286
247
|
exceptions = res.json()
|
|
287
248
|
if self.account.resolve_enums:
|
|
288
249
|
self.resolve_enums(
|
|
@@ -292,22 +253,19 @@ class ScmController(HttpController):
|
|
|
292
253
|
|
|
293
254
|
@verify_credentials
|
|
294
255
|
def create_policy_exception(
|
|
295
|
-
self, partner: Control, instance_id: str, policy_id, setting_names, expires=None
|
|
256
|
+
self, partner: Control, instance_id: str, policy_id, setting_names, comment=None, expires=None
|
|
296
257
|
):
|
|
297
258
|
"""Create policy exceptions"""
|
|
298
259
|
body = dict(
|
|
299
260
|
control=partner.name,
|
|
261
|
+
comment=comment,
|
|
300
262
|
expires=expires,
|
|
301
263
|
instance_id=instance_id,
|
|
302
264
|
policy_id=policy_id,
|
|
303
265
|
setting_names=setting_names,
|
|
304
266
|
)
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
json=body,
|
|
308
|
-
headers=self.account.headers,
|
|
309
|
-
timeout=10,
|
|
310
|
-
)
|
|
267
|
+
|
|
268
|
+
res = self.post(f"{self.account.hq}/scm/exceptions/policies", json=body)
|
|
311
269
|
return res.json()
|
|
312
270
|
|
|
313
271
|
@verify_credentials
|
|
@@ -316,43 +274,34 @@ class ScmController(HttpController):
|
|
|
316
274
|
partner: Control,
|
|
317
275
|
instance_id: str,
|
|
318
276
|
policy_id,
|
|
277
|
+
comment=None,
|
|
319
278
|
expires=default,
|
|
320
279
|
setting_names=None,
|
|
321
280
|
):
|
|
322
281
|
"""Update policy exceptions"""
|
|
323
282
|
body = dict(control=partner.name, instance_id=instance_id, policy_id=policy_id)
|
|
283
|
+
if comment:
|
|
284
|
+
body["comment"] = comment
|
|
324
285
|
if expires != self.default:
|
|
325
286
|
body["expires"] = expires
|
|
326
287
|
if setting_names:
|
|
327
288
|
body["setting_names"] = setting_names
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
json=body,
|
|
331
|
-
headers=self.account.headers,
|
|
332
|
-
timeout=10,
|
|
333
|
-
)
|
|
289
|
+
|
|
290
|
+
res = self.put(f"{self.account.hq}/scm/exceptions/policies", json=body)
|
|
334
291
|
return res.json()
|
|
335
292
|
|
|
336
293
|
@verify_credentials
|
|
337
294
|
def delete_policy_exception(self, instance_id: str, policy_id: str):
|
|
338
295
|
"""Delete policy exceptions"""
|
|
339
296
|
body = dict(instance_id=instance_id, policy_id=policy_id)
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
json=body,
|
|
343
|
-
headers=self.account.headers,
|
|
344
|
-
timeout=10,
|
|
345
|
-
)
|
|
297
|
+
|
|
298
|
+
res = self.delete(f"{self.account.hq}/scm/exceptions/policies", json=body)
|
|
346
299
|
return res.json()
|
|
347
300
|
|
|
348
301
|
@verify_credentials
|
|
349
302
|
def list_views(self):
|
|
350
303
|
"""List views"""
|
|
351
|
-
res = self.get(
|
|
352
|
-
f"{self.account.hq}/scm/views",
|
|
353
|
-
headers=self.account.headers,
|
|
354
|
-
timeout=10,
|
|
355
|
-
)
|
|
304
|
+
res = self.get(f"{self.account.hq}/scm/views")
|
|
356
305
|
views = res.json()
|
|
357
306
|
if self.account.resolve_enums:
|
|
358
307
|
self.resolve_enums(views, [(ControlCategory, "category")])
|
|
@@ -362,12 +311,8 @@ class ScmController(HttpController):
|
|
|
362
311
|
def create_view(self, category: ControlCategory, filter: str, name: str):
|
|
363
312
|
"""Create a view"""
|
|
364
313
|
body = dict(category=category.name, filter=filter, name=name)
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
json=body,
|
|
368
|
-
headers=self.account.headers,
|
|
369
|
-
timeout=10,
|
|
370
|
-
)
|
|
314
|
+
|
|
315
|
+
res = self.post(f"{self.account.hq}/scm/views", json=body)
|
|
371
316
|
return res.json()
|
|
372
317
|
|
|
373
318
|
@verify_credentials
|
|
@@ -382,22 +327,14 @@ class ScmController(HttpController):
|
|
|
382
327
|
body["filter"] = filter
|
|
383
328
|
if name:
|
|
384
329
|
body["name"] = name
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
json=body,
|
|
388
|
-
headers=self.account.headers,
|
|
389
|
-
timeout=10,
|
|
390
|
-
)
|
|
330
|
+
|
|
331
|
+
res = self.post(f"{self.account.hq}/scm/views/{view_id}", json=body)
|
|
391
332
|
return res.json()
|
|
392
333
|
|
|
393
334
|
@verify_credentials
|
|
394
335
|
def delete_view(self, view_id):
|
|
395
336
|
"""Delete a view"""
|
|
396
|
-
res = self.delete(
|
|
397
|
-
f"{self.account.hq}/scm/views/{view_id}",
|
|
398
|
-
headers=self.account.headers,
|
|
399
|
-
timeout=10,
|
|
400
|
-
)
|
|
337
|
+
res = self.delete(f"{self.account.hq}/scm/views/{view_id}")
|
|
401
338
|
return res.json()
|
|
402
339
|
|
|
403
340
|
@verify_credentials
|
|
@@ -429,46 +366,32 @@ class ScmController(HttpController):
|
|
|
429
366
|
if techniques:
|
|
430
367
|
body["techniques"] = techniques
|
|
431
368
|
|
|
432
|
-
res = self.post(
|
|
433
|
-
f"{self.account.hq}/scm/threats",
|
|
434
|
-
json=body,
|
|
435
|
-
headers=self.account.headers,
|
|
436
|
-
timeout=10,
|
|
437
|
-
)
|
|
369
|
+
res = self.post(f"{self.account.hq}/scm/threats", json=body)
|
|
438
370
|
return res.json()
|
|
439
371
|
|
|
440
372
|
@verify_credentials
|
|
441
373
|
def delete_threat(self, id):
|
|
442
374
|
"""Delete an existing scm threat"""
|
|
443
|
-
res = self.delete(
|
|
444
|
-
f"{self.account.hq}/scm/threats/{id}",
|
|
445
|
-
headers=self.account.headers,
|
|
446
|
-
timeout=10,
|
|
447
|
-
)
|
|
375
|
+
res = self.delete(f"{self.account.hq}/scm/threats/{id}")
|
|
448
376
|
return res.json()
|
|
449
377
|
|
|
450
378
|
@verify_credentials
|
|
451
379
|
def get_threat(self, id):
|
|
452
380
|
"""Get specific scm threat"""
|
|
453
|
-
res = self.get(
|
|
454
|
-
f"{self.account.hq}/scm/threats/{id}",
|
|
455
|
-
headers=self.account.headers,
|
|
456
|
-
timeout=10,
|
|
457
|
-
)
|
|
381
|
+
res = self.get(f"{self.account.hq}/scm/threats/{id}")
|
|
458
382
|
return res.json()
|
|
459
383
|
|
|
460
384
|
@verify_credentials
|
|
461
385
|
def list_threats(self):
|
|
462
386
|
"""List all scm threats"""
|
|
463
|
-
res = self.get(
|
|
464
|
-
f"{self.account.hq}/scm/threats", headers=self.account.headers, timeout=10
|
|
465
|
-
)
|
|
387
|
+
res = self.get(f"{self.account.hq}/scm/threats")
|
|
466
388
|
return res.json()
|
|
467
389
|
|
|
468
390
|
@verify_credentials
|
|
469
391
|
def parse_threat_intel(self, file: str):
|
|
470
392
|
with open(file, "rb") as f:
|
|
471
393
|
body = f.read()
|
|
394
|
+
|
|
472
395
|
res = self.post(
|
|
473
396
|
f"{self.account.hq}/scm/threat-intel",
|
|
474
397
|
data=body,
|
|
@@ -480,9 +403,9 @@ class ScmController(HttpController):
|
|
|
480
403
|
@verify_credentials
|
|
481
404
|
def parse_from_partner_advisory(self, partner: Control, advisory_id: str):
|
|
482
405
|
params = dict(advisory_id=advisory_id)
|
|
406
|
+
|
|
483
407
|
res = self.post(
|
|
484
408
|
f"{self.account.hq}/scm/partner-advisories/{partner.name}",
|
|
485
|
-
headers=self.account.headers,
|
|
486
409
|
json=params,
|
|
487
410
|
timeout=30,
|
|
488
411
|
)
|
|
@@ -490,11 +413,7 @@ class ScmController(HttpController):
|
|
|
490
413
|
|
|
491
414
|
@verify_credentials
|
|
492
415
|
def list_notifications(self):
|
|
493
|
-
res = self.get(
|
|
494
|
-
f"{self.account.hq}/scm/notifications",
|
|
495
|
-
headers=self.account.headers,
|
|
496
|
-
timeout=10,
|
|
497
|
-
)
|
|
416
|
+
res = self.get(f"{self.account.hq}/scm/notifications")
|
|
498
417
|
notifications = res.json()
|
|
499
418
|
if self.account.resolve_enums:
|
|
500
419
|
self.resolve_enums(
|
|
@@ -509,11 +428,7 @@ class ScmController(HttpController):
|
|
|
509
428
|
|
|
510
429
|
@verify_credentials
|
|
511
430
|
def delete_notification(self, notification_id: str):
|
|
512
|
-
res = self.delete(
|
|
513
|
-
f"{self.account.hq}/scm/notifications/{notification_id}",
|
|
514
|
-
headers=self.account.headers,
|
|
515
|
-
timeout=10,
|
|
516
|
-
)
|
|
431
|
+
res = self.delete(f"{self.account.hq}/scm/notifications/{notification_id}")
|
|
517
432
|
return res.json()
|
|
518
433
|
|
|
519
434
|
@verify_credentials
|
|
@@ -551,22 +466,14 @@ class ScmController(HttpController):
|
|
|
551
466
|
body["slack"] = dict(hook_urls=slack_urls, message=message)
|
|
552
467
|
if teams_urls:
|
|
553
468
|
body["teams"] = dict(hook_urls=teams_urls, message=message)
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
json=body,
|
|
557
|
-
headers=self.account.headers,
|
|
558
|
-
timeout=10,
|
|
559
|
-
)
|
|
469
|
+
|
|
470
|
+
res = self.put(f"{self.account.hq}/scm/notifications", json=body)
|
|
560
471
|
return res.json()
|
|
561
472
|
|
|
562
473
|
@verify_credentials
|
|
563
474
|
def list_notations(self):
|
|
564
475
|
"""List notations"""
|
|
565
|
-
res = self.get(
|
|
566
|
-
f"{self.account.hq}/scm/notations",
|
|
567
|
-
headers=self.account.headers,
|
|
568
|
-
timeout=10,
|
|
569
|
-
)
|
|
476
|
+
res = self.get(f"{self.account.hq}/scm/notations")
|
|
570
477
|
notations = res.json()
|
|
571
478
|
if self.account.resolve_enums:
|
|
572
479
|
self.resolve_enums(notations, [(NotationType, "event")])
|
|
@@ -578,12 +485,8 @@ class ScmController(HttpController):
|
|
|
578
485
|
):
|
|
579
486
|
"""List history"""
|
|
580
487
|
params = {"start_date": start_date, "end_date": end_date, "$filter": filter}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
headers=self.account.headers,
|
|
584
|
-
params=params,
|
|
585
|
-
timeout=10,
|
|
586
|
-
)
|
|
488
|
+
|
|
489
|
+
res = self.get(f"{self.account.hq}/scm/history", params=params)
|
|
587
490
|
history = res.json()
|
|
588
491
|
if self.account.resolve_enums:
|
|
589
492
|
self.resolve_enums(
|
|
@@ -599,42 +502,27 @@ class ScmController(HttpController):
|
|
|
599
502
|
@verify_credentials
|
|
600
503
|
def get_report(self, report_id: str):
|
|
601
504
|
"""Get SCM report by ID"""
|
|
602
|
-
res = self.get(
|
|
603
|
-
f"{self.account.hq}/scm/reports/{report_id}",
|
|
604
|
-
headers=self.account.headers,
|
|
605
|
-
timeout=10,
|
|
606
|
-
)
|
|
505
|
+
res = self.get(f"{self.account.hq}/scm/reports/{report_id}")
|
|
607
506
|
return res.json()
|
|
608
507
|
|
|
609
508
|
@verify_credentials
|
|
610
509
|
def list_reports(self):
|
|
611
510
|
"""List SCM reports"""
|
|
612
|
-
res = self.get(
|
|
613
|
-
f"{self.account.hq}/scm/reports",
|
|
614
|
-
headers=self.account.headers,
|
|
615
|
-
timeout=10,
|
|
616
|
-
)
|
|
511
|
+
res = self.get(f"{self.account.hq}/scm/reports")
|
|
617
512
|
return res.json()
|
|
618
513
|
|
|
619
514
|
@verify_credentials
|
|
620
515
|
def delete_report(self, report_id: str):
|
|
621
516
|
"""Delete SCM report by ID"""
|
|
622
|
-
res = self.delete(
|
|
623
|
-
f"{self.account.hq}/scm/reports/{report_id}",
|
|
624
|
-
headers=self.account.headers,
|
|
625
|
-
timeout=10,
|
|
626
|
-
)
|
|
517
|
+
res = self.delete(f"{self.account.hq}/scm/reports/{report_id}")
|
|
627
518
|
return res.json()
|
|
628
519
|
|
|
629
520
|
@verify_credentials
|
|
630
521
|
def put_report(self, report_data: dict, report_id: str = None):
|
|
631
522
|
"""Put SCM report by ID"""
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
json=dict(report=report_data, id=report_id),
|
|
636
|
-
timeout=10,
|
|
637
|
-
)
|
|
523
|
+
body = dict(report=report_data, id=report_id)
|
|
524
|
+
|
|
525
|
+
res = self.put(f"{self.account.hq}/scm/reports", json=body)
|
|
638
526
|
return res.json()
|
|
639
527
|
|
|
640
528
|
@verify_credentials
|
|
@@ -659,10 +547,6 @@ class ScmController(HttpController):
|
|
|
659
547
|
}
|
|
660
548
|
if odata_filter:
|
|
661
549
|
body["$filter"] = odata_filter
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
headers=self.account.headers,
|
|
665
|
-
json=body,
|
|
666
|
-
timeout=30,
|
|
667
|
-
)
|
|
550
|
+
|
|
551
|
+
res = self.post(f"{self.account.hq}/scm/reports/data", json=body, timeout=30)
|
|
668
552
|
return res.json()
|
prelude_sdk/models/codes.py
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
prelude_sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
prelude_sdk/controllers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
prelude_sdk/controllers/build_controller.py,sha256=CGVhQG0Pjp8FTkWnYvT0G9TmzurgODyDshhKg-WiY9U,7540
|
|
4
|
+
prelude_sdk/controllers/detect_controller.py,sha256=SQO2cHHQFeqnFpdk68x_ctazKWYj5ttnzxUFX9af-bM,6409
|
|
5
|
+
prelude_sdk/controllers/export_controller.py,sha256=rITSEId7OE3xik5WK2W7BQlPyzoDt8zZ3fKY1vMaLys,741
|
|
6
|
+
prelude_sdk/controllers/generate_controller.py,sha256=LJm0XAsz_JqGQSNWxCKk3NXv_HnCWutb19-CxSh4bng,1175
|
|
7
|
+
prelude_sdk/controllers/http_controller.py,sha256=TN9FrcTrY31znIumFu73oOEuyd5E5I-oD42ewpLQv84,3840
|
|
8
|
+
prelude_sdk/controllers/iam_controller.py,sha256=PNifSPdrrOvBx_CZ65vL-9dUfM2Pqk-JGj0ixPNRuTE,6673
|
|
9
|
+
prelude_sdk/controllers/jobs_controller.py,sha256=2INTCETApEGJTD6wJuJcG6-WO71Qm9_ofa-rn32bckw,1021
|
|
10
|
+
prelude_sdk/controllers/partner_controller.py,sha256=z4Z36vHctD5k3AOWi9xQOKR2on3RUyciQR4oyjQrHq0,4185
|
|
11
|
+
prelude_sdk/controllers/probe_controller.py,sha256=Skdj3joA7C_H72LyIiAQYIX9D9-KgxzMdbYOeEA9G7I,372
|
|
12
|
+
prelude_sdk/controllers/scm_controller.py,sha256=_uRiJgdXgD7Px5dwAXBspCRPjwznzAGuPwlORS92uy0,17541
|
|
13
|
+
prelude_sdk/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
prelude_sdk/models/account.py,sha256=dRKhX6_mrqDTyqyfIsvHFVavcedgZ5hZAIDYVF7YlZI,8962
|
|
15
|
+
prelude_sdk/models/codes.py,sha256=UcaPL1aQJJN3ehHIL4AvIlYtni5ssINtusixp76f0CI,19345
|
|
16
|
+
prelude_sdk-2.6.40.dist-info/licenses/LICENSE,sha256=ttdT5omfN6LNmtQoIjUhkkFhz6i44SDMRNwKrbfyTf8,1069
|
|
17
|
+
prelude_sdk-2.6.40.dist-info/METADATA,sha256=pnWpI1dapymSAZVji8OG_ynjZEqU8K1o5jmiV5Fc8W8,1187
|
|
18
|
+
prelude_sdk-2.6.40.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
19
|
+
prelude_sdk-2.6.40.dist-info/top_level.txt,sha256=6O7C8nl-yK7FsVpsPaka_GV8PYy2uvAJtus8Tlzw4dE,12
|
|
20
|
+
prelude_sdk-2.6.40.dist-info/RECORD,,
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
prelude_sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
prelude_sdk/controllers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
prelude_sdk/controllers/build_controller.py,sha256=PUBBPzMCq78tF_0DUiryZwDCW4lPlVAAZcAcJtheWTs,9084
|
|
4
|
-
prelude_sdk/controllers/detect_controller.py,sha256=zQvdhAi0KoFHUrxYNn8Moi0t_zkFjCD8sp4h-BnDuS8,8106
|
|
5
|
-
prelude_sdk/controllers/export_controller.py,sha256=lIRmO7b2sMLyA8WAsGFqtXuCp79r25zgopJGM5KnxvA,847
|
|
6
|
-
prelude_sdk/controllers/generate_controller.py,sha256=JUYlBdMh8alSMvin32qb3hB1JNGbT-BarEgxhMhg9PI,1304
|
|
7
|
-
prelude_sdk/controllers/http_controller.py,sha256=zomZo8OCWcJ-8zQIlBtukXbnJeqM9PkQn303APojLSA,3160
|
|
8
|
-
prelude_sdk/controllers/iam_controller.py,sha256=QLPo_5AqFU2a_gA9KBFS51xtbn_WolyaXQXEpvF8RKs,8370
|
|
9
|
-
prelude_sdk/controllers/jobs_controller.py,sha256=TECogrNcbW4uY5uDIDndAwxGHSA7RLnFZWmeXhvAHSM,1150
|
|
10
|
-
prelude_sdk/controllers/partner_controller.py,sha256=63P7d7fwVc1iWIUMxQv5PQOQ-e-VIpDql9HYNtLOZNo,4742
|
|
11
|
-
prelude_sdk/controllers/probe_controller.py,sha256=rwBnqkFJa1KuVwZMluM-pfo8bhQFB6JKSRSeK7s-kew,406
|
|
12
|
-
prelude_sdk/controllers/scm_controller.py,sha256=STGwaE8uD3GGbPL6PU0a66cpasrXc3Ige_Td_lTAf1w,20406
|
|
13
|
-
prelude_sdk/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
-
prelude_sdk/models/account.py,sha256=dRKhX6_mrqDTyqyfIsvHFVavcedgZ5hZAIDYVF7YlZI,8962
|
|
15
|
-
prelude_sdk/models/codes.py,sha256=WKb8dKElp-X2QqVDATowngWNSFSmpGcFVooyXzGaulE,19327
|
|
16
|
-
prelude_sdk-2.6.39.dist-info/licenses/LICENSE,sha256=ttdT5omfN6LNmtQoIjUhkkFhz6i44SDMRNwKrbfyTf8,1069
|
|
17
|
-
prelude_sdk-2.6.39.dist-info/METADATA,sha256=2RRk7ugWtM122Amx71S6AbfWEg51Hg-CWaTuAyYCeag,1187
|
|
18
|
-
prelude_sdk-2.6.39.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
19
|
-
prelude_sdk-2.6.39.dist-info/top_level.txt,sha256=6O7C8nl-yK7FsVpsPaka_GV8PYy2uvAJtus8Tlzw4dE,12
|
|
20
|
-
prelude_sdk-2.6.39.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|