列出 Environments

更新时间:
复制为 MD 格式

列出当前账户下所有未归档的环境,支持分页。

请求头

头部

必选

说明

Authorization

Bearer <PAT>

查询参数

参数

类型

必选

说明

limit

integer

每页返回数量(默认 20)

after_id

string

游标分页:返回此 ID 之后的记录

before_id

string

游标分页:返回此 ID 之前的记录

完整分页规范详见 分页

示例请求

curl -s -X GET "https://api.qoder.com.cn/api/v1/cloud/environments" \
  -H "Authorization: Bearer $QODER_PAT"

示例响应

HTTP 200 OK

{
  "data": [
    {
      "id": "env_019e3bb39b6774d8878cd0b9d237574b",
      "type": "environment",
      "name": "doc-test-env",
      "description": "",
      "status": "ready",
      "config": {
        "type": "cloud",
        "networking": {
          "type": "limited"
        },
        "packages": {
          "apt": ["curl"]
        }
      },
      "archived": false,
      "archived_at": null,
      "created_at": "2026-05-18T15:28:07.017808Z",
      "updated_at": "2026-05-18T15:28:07.017808Z"
    },
    {
      "id": "env_019e2590d33f711fabf42f2857cecd8a",
      "type": "environment",
      "name": "default",
      "description": "",
      "status": "ready",
      "config": {
        "type": "cloud",
        "networking": {
          "allow_package_managers": true,
          "type": "limited"
        },
        "packages": {}
      },
      "archived": false,
      "archived_at": null,
      "created_at": "2026-05-14T08:18:28.800813Z",
      "updated_at": "2026-05-14T08:18:28.800813Z"
    }
  ],
  "first_id": "env_019e3bb39b6774d8878cd0b9d237574b",
  "has_more": false,
  "last_id": "env_019e2590d33f711fabf42f2857cecd8a"
}

响应字段

字段

类型

说明

data

array

环境对象数组

first_id

string

当前页第一条记录的 ID

last_id

string

当前页最后一条记录的 ID

has_more

boolean

是否还有更多数据可供翻页

错误码

HTTP

type

说明

401

authentication_error

认证失败,PAT 无效或过期

403

permission_error

无权访问此资源