获取故障时间线
curl --request POST \
--url 'https://api.flashcat.cloud/incident/feed?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"incident_id": "69da451ef77b1b51f40e83ee",
"p": 1,
"limit": 20
}
'import requests
url = "https://api.flashcat.cloud/incident/feed?app_key="
payload = {
"incident_id": "69da451ef77b1b51f40e83ee",
"p": 1,
"limit": 20
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({incident_id: '69da451ef77b1b51f40e83ee', p: 1, limit: 20})
};
fetch('https://api.flashcat.cloud/incident/feed?app_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flashcat.cloud/incident/feed?app_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'incident_id' => '69da451ef77b1b51f40e83ee',
'p' => 1,
'limit' => 20
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flashcat.cloud/incident/feed?app_key="
payload := strings.NewReader("{\n \"incident_id\": \"69da451ef77b1b51f40e83ee\",\n \"p\": 1,\n \"limit\": 20\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flashcat.cloud/incident/feed?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"incident_id\": \"69da451ef77b1b51f40e83ee\",\n \"p\": 1,\n \"limit\": 20\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/incident/feed?app_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"incident_id\": \"69da451ef77b1b51f40e83ee\",\n \"p\": 1,\n \"limit\": 20\n}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"has_next_page": true,
"items": [
{
"ref_id": "69da451ef77b1b51f40e83ee",
"type": "i_new",
"detail": {
"severity": "Critical",
"title": "CPU usage high - web-server-01"
},
"account_id": 2451002751131,
"creator_id": 0,
"created_at": 1775912222661,
"updated_at": 1775912222661
},
{
"ref_id": "69da451ef77b1b51f40e83ee",
"type": "i_notify",
"detail": {
"rid": "5e9ccfabcd154b41a0005fd0f52b674b",
"msg_id": "naFudJYCawBWsChdV6ErPH",
"fire_type": "fire",
"escalate_rule_id": "000000000000000000000000",
"layer_idx": 0,
"by": "email",
"persons": [
{
"person_id": 2476444212131
}
]
},
"account_id": 2451002751131,
"creator_id": 0,
"created_at": 1775972130174,
"updated_at": 1775972130174
}
]
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InvalidParameter",
"message": "The specified parameter is not valid."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "Unauthorized",
"message": "You are unauthorized."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "RequestTooFrequently",
"message": "Request too frequently."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InternalError",
"message": "We encountered an internal error, and it has been reported. Please try again later."
}
}故障信息
获取故障时间线
获取指定故障的时间线动态,包括状态变更、评论和系统事件。
POST
/
incident
/
feed
获取故障时间线
curl --request POST \
--url 'https://api.flashcat.cloud/incident/feed?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"incident_id": "69da451ef77b1b51f40e83ee",
"p": 1,
"limit": 20
}
'import requests
url = "https://api.flashcat.cloud/incident/feed?app_key="
payload = {
"incident_id": "69da451ef77b1b51f40e83ee",
"p": 1,
"limit": 20
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({incident_id: '69da451ef77b1b51f40e83ee', p: 1, limit: 20})
};
fetch('https://api.flashcat.cloud/incident/feed?app_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flashcat.cloud/incident/feed?app_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'incident_id' => '69da451ef77b1b51f40e83ee',
'p' => 1,
'limit' => 20
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flashcat.cloud/incident/feed?app_key="
payload := strings.NewReader("{\n \"incident_id\": \"69da451ef77b1b51f40e83ee\",\n \"p\": 1,\n \"limit\": 20\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flashcat.cloud/incident/feed?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"incident_id\": \"69da451ef77b1b51f40e83ee\",\n \"p\": 1,\n \"limit\": 20\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/incident/feed?app_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"incident_id\": \"69da451ef77b1b51f40e83ee\",\n \"p\": 1,\n \"limit\": 20\n}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"has_next_page": true,
"items": [
{
"ref_id": "69da451ef77b1b51f40e83ee",
"type": "i_new",
"detail": {
"severity": "Critical",
"title": "CPU usage high - web-server-01"
},
"account_id": 2451002751131,
"creator_id": 0,
"created_at": 1775912222661,
"updated_at": 1775912222661
},
{
"ref_id": "69da451ef77b1b51f40e83ee",
"type": "i_notify",
"detail": {
"rid": "5e9ccfabcd154b41a0005fd0f52b674b",
"msg_id": "naFudJYCawBWsChdV6ErPH",
"fire_type": "fire",
"escalate_rule_id": "000000000000000000000000",
"layer_idx": 0,
"by": "email",
"persons": [
{
"person_id": 2476444212131
}
]
},
"account_id": 2451002751131,
"creator_id": 0,
"created_at": 1775972130174,
"updated_at": 1775972130174
}
]
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InvalidParameter",
"message": "The specified parameter is not valid."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "Unauthorized",
"message": "You are unauthorized."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "RequestTooFrequently",
"message": "Request too frequently."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InternalError",
"message": "We encountered an internal error, and it has been reported. Please try again later."
}
}限制说明
| 项目 | 说明 |
|---|---|
| 速率限制 | 每个账户 1,000 次/分钟;50 次/秒 |
| 权限要求 | 故障查看(on-call) |
授权
在 Flashduty 控制台 账户 → APP Key 中签发的 app_key。调用任何公开 API 时都必须携带。它等同于所属账户的身份凭证,请妥善保管。
请求体
application/json
获取故障时间线的参数。
故障 ID(MongoDB ObjectID)。
Pattern:
^[0-9a-fA-F]{24}$页码,从 1 开始。
必填范围:
x >= 1分页大小,最大 100。
必填范围:
1 <= x <= 100true 为按时间升序。
可选类型过滤,仅返回指定类型的时间线条目。
故障时间线条目类型。每个值对应一个生命周期事件,其 detail 载荷结构由该字段决定。故障级事件前缀为 i_;向上冒泡到故障时间线的告警级事件前缀为 a_。
| 类型 | 含义 |
|---|---|
i_new | 故障创建:系统自动或人工创建了新故障。 |
i_assign | 分派响应人:故障被分派给指定人员处理。 |
i_a_rspd | 添加响应人:有新的响应人被加入处理。 |
i_notify | 通过某个渠道在指定环节发送通知。 |
i_storm | 故障触发告警风暴阈值。 |
i_snooze | 暂停通知指定时长。 |
i_wake | 取消暂停并恢复通知。 |
i_ack | 确认故障:响应人确认已开始处理故障。 |
i_unack | 取消认领。 |
i_comm | 添加评论:响应人记录了处理进展或关键信息。 |
i_rslv | 解决故障:故障被标记为已解决。 |
i_reopen | 重新打开:已解决的故障被重新打开,可能问题复发。 |
i_merge | 合并故障:多个相关故障被合并为一个。 |
i_r_title | 标题更新。 |
i_r_desc | 描述更新。 |
i_r_impact | 影响范围更新。 |
i_r_rc | 根因更新。 |
i_r_rsltn | 解决方案更新。 |
i_r_severity | 严重等级变更:故障的严重程度被调整。 |
i_r_field | 自定义字段值更新。 |
i_m_flapping | 因抖动检测被静默。 |
i_m_reply | 评论静音回复标记。 |
i_custom | 执行动作:触发了自动化操作或脚本。 |
i_wr_create | 创建作战室:建立了即时通讯群组用于协作处理。 |
i_wr_delete | 删除作战室群组。 |
i_auto_refresh | 卡片自动刷新事件。 |
可用选项:
i_new, i_assign, i_a_rspd, i_notify, i_storm, i_snooze, i_wake, i_ack, i_unack, i_comm, i_rslv, i_reopen, i_merge, i_r_title, i_r_desc, i_r_impact, i_r_rc, i_r_rsltn, i_r_severity, i_r_field, i_m_flapping, i_m_reply, i_custom, i_wr_create, i_wr_delete, i_auto_refresh, a_merge 此页面对您有帮助吗?
⌘I