中级
实现告警通知渠道路由
未完成
中级参考
代码结构已给出,请填写 ____ 处
def solve():
from pyodide.http import open_url
from io import StringIO
import pandas as pd
alerts_csv = open_url(____).read()
alerts = pd.read_csv(StringIO(____))
ROUTING = {'____':'____', '____':'____', '____':'____'}
def route_alert(____):
return ROUTING.get(____)
print(____)
for _, row in alerts.iterrows():
channel = route_alert(____)
print("____"+str(____)+"____"+row['____']+"____"+row['____']+"____"+row['____']+"____"+channel)
print(____)
for level, channel in ROUTING.items():
count = len(____)
print("____"+channel+"____"+str(____)+"____")
示例
输入
solve()
期望输出
Alert notification routing: id=1 [critical] ESP-001/vibration_rms -> sms_queue id=2 [critical] ESP-002/pressure -> sms_queue id=3 [warning] RPI-001/cpu_temp -> email_queue id=4 [warning] ARD-001/temperature -> email_queue id=5 [warning] ESP-001/vibration_rms -> email_queue Channel summary: email_queue: 3 alerts sms_queue: 2 alerts phone_queue: 0 alerts
👑
升级 VIP
解锁全部题目,畅通无阻地学习
- ✓ 解锁全部训练包所有题目
- ✓ 查看完整参考代码和提示
- ✓ 浏览器内直接运行 Python 代码
- ✓ 自动批改 + 进度追踪
30天
¥18
1年
¥99
2年
¥158
3年
¥199