我对python非常陌生,我用PowerShell编写了一个脚本,我想在python中重新创建它。
在powershell中,我创建了一个哈希表:
$epBody = @{
"escalation_policy" = @{
"type" = "escalation_policy"
"name" = $epName
"escalation_rules" = @(
@{
"escalation_delay_in_minutes" = 30
"targets" = @(
@{
"id" = $userid
"type" = "user_reference"
}
)
}
)
}
}并试图找出用python编写这篇文章的最佳方法。
这就是我所拥有的(我知道这是错误的!):
ep_payload = {
"escalation_policy": {
"type": "escalation_policy",
"name": epName,
"escalation_rules": [
{
"escalation_delay_in_minutes": 30,
"targets": [
{
"id": userid
"type": "user_reference"
}
]
}
]
}
}我只是找不出这个正确的语法
干杯,
发布于 2022-02-12 20:43:36
“让我们吃奶奶”,“让我们吃,奶奶”逗号拯救生命!
https://stackoverflow.com/questions/71095583
复制相似问题