Forward Environments API 接口说明。
描述
通过 POST 修改 Environment 的配置和展示信息。
路径
POST /api/v1/forward/environments/{id}
请求头
| 头部 | 必选 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <PAT 或 SAT> |
Content-Type | 是 | application/json |
路径参数
| 参数 | 类型 | 必选 | 说明 |
|---|---|---|---|
id | string | 是 | Environment ID。 |
请求体
| 字段 | 类型 | 必选 | 说明 |
|---|---|---|---|
name | string | 否 | 新名称。 |
description | string | 否 | 新描述。 |
config | Environment config | 否 | 新配置;传入时不能为 null,显式 null 返回 400。字段详见 schemas。 |
metadata | object | 否 | 要合并的 Environment metadata;传入时不能为 null,显式 null 返回 400。 |
示例请求
示例响应
HTTP 200 OK
响应字段
响应为 Environment 对象。
错误码
| HTTP | type | 触发条件 |
|---|---|---|
| 400 | invalid_request_error | 请求体、路径参数或查询参数非法。 |
| 400 | invalid_request_error | 传入保留键 created_by 时,message 为 metadata key "created_by" is reserved,可据此定位到具体字段。 |
| 401 | authentication_error | 缺少或无效的认证令牌。 |
| 403 | permission_error | 当前调用方无权访问该资源。 |
| 404 | not_found_error | 资源不存在或不可见。 |
| 500/502/503 | api_error | Forward 或依赖服务失败。 |