查询自托管 Runner 列表
curl --request POST \
--url 'https://api.flashcat.cloud/safari/environment/self-hosted/list?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"p": 1,
"limit": 20,
"query": "prod"
}
'import requests
url = "https://api.flashcat.cloud/safari/environment/self-hosted/list?app_key="
payload = {
"p": 1,
"limit": 20,
"query": "prod"
}
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({p: 1, limit: 20, query: 'prod'})
};
fetch('https://api.flashcat.cloud/safari/environment/self-hosted/list?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/environment/self-hosted/list?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([
'p' => 1,
'limit' => 20,
'query' => 'prod'
]),
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/environment/self-hosted/list?app_key="
payload := strings.NewReader("{\n \"p\": 1,\n \"limit\": 20,\n \"query\": \"prod\"\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/safari/environment/self-hosted/list?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"p\": 1,\n \"limit\": 20,\n \"query\": \"prod\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/safari/environment/self-hosted/list?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 \"p\": 1,\n \"limit\": 20,\n \"query\": \"prod\"\n}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"environments": [
{
"environment_id": "env_9pL3xQ7mN2vK8wR4tY6hJ1",
"name": "prod-k8s-bj",
"labels": [
"prod",
"k8s",
"region=cn-beijing"
],
"status": "online",
"team_id": 2586851485973,
"can_edit": true,
"version": "0.1.40",
"os": "linux",
"arch": "amd64",
"hostname": "ops-jump-01",
"ip_address": "10.20.3.17",
"created_at": 1788000000000
}
],
"total": 1,
"latest_version": "0.1.40"
}
}自托管 Runner
查询自托管 Runner 列表
查询账户下的自托管 Runner,包括标签、状态和主机信息。
POST
/
safari
/
environment
/
self-hosted
/
list
查询自托管 Runner 列表
curl --request POST \
--url 'https://api.flashcat.cloud/safari/environment/self-hosted/list?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"p": 1,
"limit": 20,
"query": "prod"
}
'import requests
url = "https://api.flashcat.cloud/safari/environment/self-hosted/list?app_key="
payload = {
"p": 1,
"limit": 20,
"query": "prod"
}
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({p: 1, limit: 20, query: 'prod'})
};
fetch('https://api.flashcat.cloud/safari/environment/self-hosted/list?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/environment/self-hosted/list?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([
'p' => 1,
'limit' => 20,
'query' => 'prod'
]),
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/environment/self-hosted/list?app_key="
payload := strings.NewReader("{\n \"p\": 1,\n \"limit\": 20,\n \"query\": \"prod\"\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/safari/environment/self-hosted/list?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"p\": 1,\n \"limit\": 20,\n \"query\": \"prod\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/safari/environment/self-hosted/list?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 \"p\": 1,\n \"limit\": 20,\n \"query\": \"prod\"\n}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"environments": [
{
"environment_id": "env_9pL3xQ7mN2vK8wR4tY6hJ1",
"name": "prod-k8s-bj",
"labels": [
"prod",
"k8s",
"region=cn-beijing"
],
"status": "online",
"team_id": 2586851485973,
"can_edit": true,
"version": "0.1.40",
"os": "linux",
"arch": "amd64",
"hostname": "ops-jump-01",
"ip_address": "10.20.3.17",
"created_at": 1788000000000
}
],
"total": 1,
"latest_version": "0.1.40"
}
}限制说明
| 项目 | 说明 |
|---|---|
| 速率限制 | 每个账户 1,000 次/分钟;50 次/秒 |
| 权限要求 | 无 —— 持有有效的 app_key 即可调用 |
使用说明
- 返回账户级 Runner 和调用者所在团队的 Runner;
team_ids中调用者不在的团队会被忽略。 scope优先于include_account:account只返回账户级 Runner,team只返回团队 Runner,all(或不传)两者都返回。query按子串匹配名称、ID、标签、状态、版本、操作系统、架构、主机名和 IP 地址,不区分大小写,因此用标签值可以找到带该标签的 Runner。p、limit、query、orderby都不传时,一次返回全部可见 Runner;传了任意一个就分页(limit默认 20)。默认按created_at倒序。status是实时状态:degraded表示 Runner 已连接但执行器不健康。不会返回连接 token。
授权
请求体
application/json
自托管 Runner 列表的过滤与分页条件。
响应
Success
所有 Flashduty 公开 API 共用的标准响应结构。成功时 data 为接口专属载荷且不含 error;失败时 error 存在而 data 缺失。request_id 始终存在,并会同步写入 Flashcat-Request-Id 响应头。
此页面对您有帮助吗?