diff --git a/flowsint-api/app/api/schemas/scan.py b/flowsint-api/app/api/schemas/scan.py index b39d4aa1..f1e70f9b 100644 --- a/flowsint-api/app/api/schemas/scan.py +++ b/flowsint-api/app/api/schemas/scan.py @@ -8,7 +8,7 @@ class ScanCreate(BaseModel): values: Optional[List[str]] = None sketch_id: Optional[UUID4] = None status: Optional[str] = None - results: Optional[Any] = None + details: Optional[Any] = None class ScanRead(ORMBase): diff --git a/flowsint-core/src/flowsint_core/tasks/enricher.py b/flowsint-core/src/flowsint_core/tasks/enricher.py index f08ede65..1238f057 100644 --- a/flowsint-core/src/flowsint_core/tasks/enricher.py +++ b/flowsint-core/src/flowsint_core/tasks/enricher.py @@ -69,10 +69,10 @@ def run_enricher( results = asyncio.run(enricher.execute(values=serialized_objects)) scan.status = EventLevel.COMPLETED - scan.results = to_json_serializable(results) + scan.details = to_json_serializable(results) session.commit() - return {"result": scan.results} + return {"result": scan.details} except Exception as ex: session.rollback() @@ -82,7 +82,7 @@ def run_enricher( scan = session.query(Scan).filter(Scan.id == uuid.UUID(self.request.id)).first() if scan: scan.status = EventLevel.FAILED - scan.results = {"error": error_logs} + scan.error = error_logs session.commit() self.update_state(state=states.FAILURE) @@ -145,10 +145,10 @@ def run_template_enricher( results = asyncio.run(enricher.execute(values=serialized_objects)) scan.status = EventLevel.COMPLETED - scan.results = to_json_serializable(results) + scan.details = to_json_serializable(results) session.commit() - return {"result": scan.results} + return {"result": scan.details} except Exception as ex: session.rollback() @@ -162,7 +162,7 @@ def run_template_enricher( ) if scan: scan.status = EventLevel.FAILED - scan.results = {"error": error_logs} + scan.error = error_logs session.commit() self.update_state(state=states.FAILURE) diff --git a/flowsint-core/src/flowsint_core/tasks/flow.py b/flowsint-core/src/flowsint_core/tasks/flow.py index ebce0256..25cc2c46 100644 --- a/flowsint-core/src/flowsint_core/tasks/flow.py +++ b/flowsint-core/src/flowsint_core/tasks/flow.py @@ -65,10 +65,10 @@ def run_flow( results = enricher.scan(values=serialized_objects) scan.status = EventLevel.COMPLETED - scan.results = to_json_serializable(results) + scan.details = to_json_serializable(results) session.commit() - return {"result": scan.results} + return {"result": scan.details} except Exception as ex: session.rollback() @@ -78,7 +78,7 @@ def run_flow( scan = session.query(Scan).filter(Scan.id == uuid.UUID(self.request.id)).first() if scan: scan.status = EventLevel.FAILED - scan.results = {"error": error_logs} + scan.error = error_logs session.commit() self.update_state(state=states.FAILURE)