Skip to main content
POST
更新自动化规则

限制说明

使用说明

  • 省略或传 null 的字段保持不变;team_id 不能修改为与当前值不同的值。
  • cron_exprtimezone 可以分别更新——只传其中一个时,另一个保持当前已存储的值。
  • rotate_http_post_trigger_token=true 会签发新的 webhook token,且仅在本次响应中返回。
  • 如需由 On-call 故障触发,传入 oncall_incident_trigger_enabledoncall_incident_channel_idsoncall_incident_severities;匹配事件会以 trigger_kind=oncall_incident 运行。
  • 每次调用都会记录到账户审计日志。

授权

app_key
string
query
必填

App key issued from the Flashduty console. Required on every public API call. Keep it secret — it grants the same access as the owning account.

请求体

application/json

更新自动化规则。字段省略或传 null 表示不修改。

rule_id
string
必填

目标规则 ID。

name
string | null

新规则名称。

Maximum string length: 255
team_id
integer<int64> | null

只允许传当前值;创建后 personal / team scope 不可修改。

必填范围: x >= 0
enabled
boolean | null

是否启用规则。

cron_expr
string | null

运行周期。支持 4 段 hour day month weekday,会补 minute=0;也支持 5 段 minute hour day month weekday。分钟必须是固定整数,秒级 6 段不支持。

示例:

"15 9 * * *"

timezone
string | null

更新 cron_expr 所用的 IANA 时区。省略或传 null 表示保持当前时区不变。

schedule_trigger_enabled
boolean | null

是否启用 schedule trigger。

prompt
string | null

新的任务提示词。

environment_kind
enum<string> | null

运行环境类型。省略或空字符串表示自动选择。

可用选项:
,
cloud,
byoc
environment_id
string | null

BYOC Runner ID。

http_post_trigger_enabled
boolean | null

是否启用 HTTP POST trigger。不存在时设为 true 会创建。

oncall_incident_trigger_enabled
boolean | null

是否启用 On-call 故障触发器。

oncall_incident_channel_ids
integer<int64>[]

监听的 On-call 集成 ID 列表;创建或启用该触发器时至少需要一个有效 ID。

必填范围: x >= 1
oncall_incident_severities
enum<string>[]

监听的故障严重程度,支持 Critical、Warning 和 Info;创建或启用该触发器时至少需要一个值。

可用选项:
Critical,
Warning,
Info
rotate_http_post_trigger_token
boolean

是否轮换 HTTP POST trigger token。新 token 只会在本次响应中返回。

响应

Success

Standard response envelope used by every Flashduty public API. On success data contains the endpoint-specific payload and error is absent. On failure error is present and data is absent. request_id is always present and is also mirrored in the Flashcat-Request-Id response header.

request_id
string
必填

Unique ID for this request. Mirrored in the Flashcat-Request-Id header. Include it when reporting issues.

示例:

"01HK8XQE3Z7JM2NTFQ5YJ8P9R4"

error
object

Error payload inside the response envelope. Present only on non-2xx responses.

data
object

自动化规则。