查询仓库触发器可选项
curl --request POST \
--url 'https://api.flashcat.cloud/safari/automation/scm/options?app_key=' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.flashcat.cloud/safari/automation/scm/options?app_key="
payload = {}
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({})
};
fetch('https://api.flashcat.cloud/safari/automation/scm/options?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/safari/automation/scm/options?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([
]),
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/safari/automation/scm/options?app_key="
payload := strings.NewReader("{}")
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/safari/automation/scm/options?app_key=")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/safari/automation/scm/options?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 = "{}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"schema_version": 1,
"max_filters_per_event": 10,
"max_filter_value_bytes": 256,
"max_filter_values": 20,
"providers": [
{
"provider": "github",
"events": [
{
"event": "pull_request",
"actions": [
"open",
"close",
"merge"
],
"fields": [
{
"field": "author",
"value_type": "text",
"operators": [
"eq",
"contains",
"regex"
]
},
{
"field": "labels",
"value_type": "labels",
"operators": [
"contains",
"in",
"not_in",
"regex"
]
},
{
"field": "draft",
"value_type": "bool",
"operators": [
"eq"
]
}
]
}
],
"default_event": "pull_request",
"default_actions": {
"pull_request": [
"open"
]
}
}
]
}
}自动化
查询仓库触发器可选项
查询 GitHub、GitLab 或 Gitee 仓库触发器可用的事件、动作与可过滤字段。
POST
/
safari
/
automation
/
scm
/
options
查询仓库触发器可选项
curl --request POST \
--url 'https://api.flashcat.cloud/safari/automation/scm/options?app_key=' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.flashcat.cloud/safari/automation/scm/options?app_key="
payload = {}
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({})
};
fetch('https://api.flashcat.cloud/safari/automation/scm/options?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/safari/automation/scm/options?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([
]),
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/safari/automation/scm/options?app_key="
payload := strings.NewReader("{}")
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/safari/automation/scm/options?app_key=")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/safari/automation/scm/options?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 = "{}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"schema_version": 1,
"max_filters_per_event": 10,
"max_filter_value_bytes": 256,
"max_filter_values": 20,
"providers": [
{
"provider": "github",
"events": [
{
"event": "pull_request",
"actions": [
"open",
"close",
"merge"
],
"fields": [
{
"field": "author",
"value_type": "text",
"operators": [
"eq",
"contains",
"regex"
]
},
{
"field": "labels",
"value_type": "labels",
"operators": [
"contains",
"in",
"not_in",
"regex"
]
},
{
"field": "draft",
"value_type": "bool",
"operators": [
"eq"
]
}
]
}
],
"default_event": "pull_request",
"default_actions": {
"pull_request": [
"open"
]
}
}
]
}
}限制说明
| 项目 | 说明 |
|---|---|
| 速率限制 | 每个账户 1,000 次/分钟;50 次/秒 |
| 权限要求 | Automation 查看(ai-sre) |
使用说明
- 该响应对同一部署是静态的:平台目录来自触发器 schema 版本,与账号现有的连接无关。
- 用它构造触发器表单:先选
provider,再选event,然后订阅actions,并用每个字段列出的操作符在fields上过滤。
授权
请求体
application/json
该接口没有参数,传一个空的 JSON 对象即可。
响应
Success
所有 Flashduty 公开 API 共用的标准响应结构。成功时 data 为接口专属载荷且不含 error;失败时 error 存在而 data 缺失。request_id 始终存在,并会同步写入 Flashcat-Request-Id 响应头。
此页面对您有帮助吗?