@@ -20,18 +20,18 @@ class InjectExpectationManager(ListMixin, UpdateMixin, RESTManager):
20
20
_obj_cls = InjectExpectation
21
21
_update_attrs = RequiredOptional (required = ("collector_id" , "result" , "is_success" ))
22
22
23
- @exc .on_http_error (exc .OpenBASUpdateError )
24
- def expectations_for_source (self , source_id : str , ** kwargs : Any ) -> Dict [str , Any ]:
25
- path = f"{ self .path } /" + source_id
26
- result = self .openbas .http_get (path , ** kwargs )
27
- return result
28
-
29
23
@exc .on_http_error (exc .OpenBASUpdateError )
30
24
def expectations_assets_for_source (
31
- self , source_id : str , ** kwargs : Any
25
+ self , source_id : str , expiration_time : int = None , ** kwargs : Any
32
26
) -> Dict [str , Any ]:
33
27
path = f"{ self .path } /assets/" + source_id
34
- result = self .openbas .http_get (path , ** kwargs )
28
+ result = self .openbas .http_get (
29
+ path ,
30
+ query_data = (
31
+ {"expiration_time" : expiration_time } if expiration_time else None
32
+ ),
33
+ ** kwargs ,
34
+ )
35
35
return result
36
36
37
37
def expectations_models_for_source (self , source_id : str , ** kwargs : Any ):
@@ -83,10 +83,16 @@ def prevention_expectations_for_source(
83
83
84
84
@exc .on_http_error (exc .OpenBASUpdateError )
85
85
def detection_expectations_for_source (
86
- self , source_id : str , ** kwargs : Any
86
+ self , source_id : str , expiration_time : int = None , ** kwargs : Any
87
87
) -> Dict [str , Any ]:
88
88
path = f"{ self .path } /detection/" + source_id
89
- result = self .openbas .http_get (path , ** kwargs )
89
+ result = self .openbas .http_get (
90
+ path ,
91
+ query_data = (
92
+ {"expiration_time" : expiration_time } if expiration_time else None
93
+ ),
94
+ ** kwargs ,
95
+ )
90
96
return result
91
97
92
98
@exc .on_http_error (exc .OpenBASUpdateError )
0 commit comments