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