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