Documentation Index
Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
Use this file to discover all available pages before exploring further.
GET /v1/environments/{environment_id}
根据 ID 获取单个环境的详细信息。
请求头
| 头部 | 必选 | 说明 |
|---|
Authorization | 是 | Bearer <PAT> |
路径参数
| 参数 | 类型 | 必选 | 说明 |
|---|
environment_id | string | 是 | 环境的唯一标识(前缀为 env_) |
示例请求
curl -s -X GET "https://openapi.qoder.sh/api/v1/cloud/environments/env_019e3bb39b6774d8878cd0b9d237574b" \
-H "Authorization: Bearer $QODER_PAT"
示例响应
HTTP 200 OK
{
"id": "env_019e3bb39b6774d8878cd0b9d237574b",
"type": "environment",
"name": "doc-test-env",
"description": "",
"status": "ready",
"config": {
"type": "cloud",
"networking": {
"type": "limited"
},
"packages": {
"apt": ["curl"]
}
},
"created_at": "2026-05-18T15:28:07.017808Z",
"updated_at": "2026-05-18T15:28:07.017808Z"
}
响应字段
| 字段 | 类型 | 说明 |
|---|
id | string | 环境唯一标识,前缀为 env_ |
type | string | 资源类型,固定值 "environment" |
name | string | 环境名称 |
description | string | 环境描述 |
status | string | 环境状态("ready" 或 "archived") |
config | object | 环境配置对象 |
config.type | string | 固定值 "cloud" |
config.networking | object | 网络配置 |
config.packages | object | 预装软件包配置 |
created_at | string | 创建时间(ISO 8601 格式) |
updated_at | string | 最后更新时间(ISO 8601 格式) |
错误码
| HTTP | type | 说明 |
|---|
| 401 | authentication_error | 认证失败,PAT 无效或过期 |
| 403 | permission_error | 无权访问此资源 |
| 404 | not_found_error | 指定 ID 的环境不存在 |