@@ -20,18 +20,18 @@ class InjectExpectationManager(ListMixin, UpdateMixin, RESTManager):
2020 _obj_cls = InjectExpectation
2121 _update_attrs = RequiredOptional (required = ("collector_id" , "result" , "is_success" ))
2222
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-
2923 @exc .on_http_error (exc .OpenBASUpdateError )
3024 def expectations_assets_for_source (
31- self , source_id : str , ** kwargs : Any
25+ self , source_id : str , expiration_time : int = None , ** kwargs : Any
3226 ) -> Dict [str , Any ]:
3327 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+ )
3535 return result
3636
3737 def expectations_models_for_source (self , source_id : str , ** kwargs : Any ):
@@ -83,10 +83,16 @@ def prevention_expectations_for_source(
8383
8484 @exc .on_http_error (exc .OpenBASUpdateError )
8585 def detection_expectations_for_source (
86- self , source_id : str , ** kwargs : Any
86+ self , source_id : str , expiration_time : int = None , ** kwargs : Any
8787 ) -> Dict [str , Any ]:
8888 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+ )
9096 return result
9197
9298 @exc .on_http_error (exc .OpenBASUpdateError )
0 commit comments