main
py 19 lines 696 Bytes
Raw
1 from loguru import logger
2
3 from app.data_store.data_store_session import create_session
4
5
6 async def create_bucket_if_not_exists(bucket_name: str) -> None:
7 client = await create_session()
8 if not await client.bucket_exists(bucket_name):
9 await client.make_bucket(bucket_name)
10 logger.info(f"Created bucket {bucket_name}")
11 else:
12 logger.info(f"Bucket {bucket_name} already exists")
13
14
15 async def create_buckets() -> None:
16 await create_bucket_if_not_exists("copilot-cases")
17 await create_bucket_if_not_exists("copilot-case-report-templates")
18 await create_bucket_if_not_exists("sysmon-configs")
19 await create_bucket_if_not_exists("velociraptor-artifacts")