-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdelete.py
More file actions
26 lines (18 loc) · 852 Bytes
/
delete.py
File metadata and controls
26 lines (18 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import asyncio
import os
from dotenv import load_dotenv
from livekit.api import DeleteIngressRequest, ListIngressRequest, LiveKitAPI
load_dotenv()
API_KEY = os.getenv("LIVEKIT_API_KEY", "")
API_SECRET = os.getenv("LIVEKIT_API_SECRET", "")
SERVER_URL = os.getenv("LIVEKIT_SERVER_URL", "wss://your-project.livekit.cloud")
async def main():
async with LiveKitAPI(SERVER_URL, API_KEY, API_SECRET) as lk:
# 列出所有 Ingress
resp = await lk.ingress.list_ingress(ListIngressRequest())
for info in resp.items:
print(info.ingress_id, info.name, info.input_type, info.state.status)
# 刪掉不需要的(把 ID 換成你要刪的)
# await lk.ingress.delete_ingress(DeleteIngressRequest(ingress_id="IN_bBGaasLgTbqf"))
# print("deleted:", "<INGRESS_ID_TO_DELETE>")
asyncio.run(main())