Skip to content

Commit 1818d5e

Browse files
committed
[client] Add prevention / detection helpers
1 parent 61e4421 commit 1818d5e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pyobas/apis/inject_expectation.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ def expectations_for_source(self, source_id: str, **kwargs: Any) -> Dict[str, An
2121
result = self.openbas.http_get(path, **kwargs)
2222
return result
2323

24+
@exc.on_http_error(exc.OpenBASUpdateError)
25+
def prevention_expectations_for_source(
26+
self, source_id: str, **kwargs: Any
27+
) -> Dict[str, Any]:
28+
path = f"{self.path}/prevention" + source_id
29+
result = self.openbas.http_get(path, **kwargs)
30+
return result
31+
32+
@exc.on_http_error(exc.OpenBASUpdateError)
33+
def detection_expectations_for_source(
34+
self, source_id: str, **kwargs: Any
35+
) -> Dict[str, Any]:
36+
path = f"{self.path}/detection/" + source_id
37+
result = self.openbas.http_get(path, **kwargs)
38+
return result
39+
2440
@exc.on_http_error(exc.OpenBASUpdateError)
2541
def update(
2642
self,

0 commit comments

Comments
 (0)