查询指定组织下的所有 Runner Group¶
GET /api/v8/orgs/{org}/actions/runner-groups
查询指定组织下的所有 Runner Group。
访问令牌支持说明¶
- AtomGit 用户访问令牌(AtomGit user access tokens)
是否允许匿名访问¶
此接口不允许匿名访问
请求参数¶
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
org |
path | string | 是 | 组织path |
access_token |
query | string | 是 | 用户授权码 |
keyword |
query | string | 否 | 关键字过滤 |
page |
query | integer | 否 | 当前页码 |
per_page |
query | integer | 否 | 每页的项目数 |
响应参数¶
| 字段 | 类型 | 必返 | 可为空 | 说明 |
|---|---|---|---|---|
total_count |
integer | 是 | 否 | Runner Group 总数 |
runner_groups |
object[] | 是 | 是 | Runner Group 列表 |
runner_groups 对象¶
| 字段 | 类型 | 必返 | 可为空 | 说明 |
|---|---|---|---|---|
runner_groups.id |
string | 是 | 否 | Runner Group ID |
runner_groups.name |
string | 是 | 否 | 名称 |
runner_groups.runner_group_name |
string | 是 | 否 | Runner Group 名称 |
runner_groups.namespace_id |
string | 是 | 否 | 命名空间 ID |
runner_groups.creator |
string | 是 | 否 | 创建人 |
runner_groups.create_time |
integer | 是 | 否 | 创建时间 |
runner_groups.runner_count |
integer | 是 | 否 | Runner 数量 |
runner_groups.namespace_type |
string | 是 | 否 | 命名空间类型 |
runner_groups.share_all |
boolean | 是 | 否 | 是否分享给全部仓库 |
失败响应¶
400 参数错误
401 未认证
HTTP 响应状态码¶
| 状态码 | 说明 |
|---|---|
200 |
成功(OK) |
400 |
参数错误(Bad request) |
401 |
需要认证(Requires authentication) |
403 |
禁止访问(Forbidden) |
404 |
资源不存在(Not found) |
500 |
系统内部错误(Internal server error) |
请求示例¶
参数说明¶
<org>替换为组织路径名(企业、组织或个人的地址 path);<token>替换为你的 AtomGit 用户访问令牌。
cURL¶
curl -X GET 'https://api.atomgit.com/api/v8/orgs/<org>/actions/runner-groups?access_token=<token>' \
-H 'Accept: application/json'
JavaScript¶
// 原生 fetch (Node.js 18+ / 浏览器)
const response = await fetch("https://api.atomgit.com/api/v8/orgs/<org>/actions/runner-groups?access_token=<YOUR-TOKEN>", {
headers: {
"Accept": "application/json",
},
});
if (!response.ok) {
throw new Error(`请求失败: ${response.status}`);
}
const data = await response.json();
console.log(data);
Python¶
import requests
resp = requests.get(
"https://api.atomgit.com/api/v8/orgs/<org>/actions/runner-groups",
params={"access_token": "<YOUR-TOKEN>"},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
响应示例¶
状态码: 200
{
"total_count": 2,
"runner_groups": [
{
"id": "g1",
"name": "Default",
"runner_group_name": "Default",
"namespace_id": "1001",
"creator": "octocat",
"create_time": 1600000000,
"runner_count": 3,
"namespace_type": "organization",
"share_all": false
},
{
"id": "g2",
"name": "Linux Builders",
"runner_group_name": "Linux Builders",
"namespace_id": "1001",
"creator": "octocat",
"create_time": 1600000100,
"runner_count": 5,
"namespace_type": "organization",
"share_all": true
}
]
}
错误码¶
| 错误码 | 说明 |
|---|---|
401 |
未认证或凭证无效(缺少/无效的访问凭证) |
400 |
参数错误或请求无法解析 |
404 |
请求路径不存在 |
405 |
请求方法不支持 |
429 |
请求过于频繁,触发限流 |
500 |
系统内部错误 |
本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 gitcode-dev/atomgit-api-doc