main
py 21 lines 714 Bytes
Raw
1 import httpx
2 from loguru import logger
3
4 from app.integrations.modules.schema.darktrace import CollectDarktrace
5
6
7 async def post_to_copilot_darktrace_module(data: CollectDarktrace):
8 """
9 Send a POST request to the copilot-darktrace-module Docker container.
10
11 Args:
12 data (CollectDarktrace): The data to send to the copilot-darktrace-module Docker container.
13 """
14 logger.info(f"Sending POST request to http://copilot-darktrace-module/all_logs with data: {data.model_dump()}")
15 async with httpx.AsyncClient() as client:
16 await client.post(
17 "http://copilot-darktrace-module/all_logs",
18 json=data.model_dump(),
19 timeout=120,
20 )
21 return None