开放接口

/v1/user-configs

4 个接口 · 4 个接口支持 API Key

← 全部分组 · 第一次调用?先看教程:认证、权限、请求与响应、常见失败

方法路径摘要认证
GET/v1/user-configsList per-user stream defaultsAPI Key 可调登录会话
POST/v1/user-configsCreate a per-user stream defaultAPI Key 可调登录会话
GET/v1/user-configs/effectiveResolve the stream defaults a new forward draft is prefilled withAPI Key 可调登录会话
DELETE/v1/user-configs/{id}Delete a per-user stream defaultAPI Key 可调登录会话

契约文件:api/control-l4-forward.openapi.yaml

接口详情

GET /v1/user-configs

List per-user stream defaults

operationId
listUserConfigs
认证
  • API Key:请求头 Authorization: CdncaKey <key_id>.<secret>。有效权限是 Key 的范围与所有者当前权限的交集。
  • 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
所需权限

全部需要:streams.read

说明(契约原文)

type must be stream. Tenant principals see only their own rows; platform principals see all rows in the selected scope.

参数

listUserConfigs 参数
名称位置类型必填说明
X-Request-IDheaderstring否Caller-stable request identity; invalid or absent values are replaced by middleware.
typequerystring是—
pagequeryinteger否—
limitqueryinteger否—
searchquerystring否—

响应

listUserConfigs 响应
状态码说明
200Stable page ordered oldest first; display_id is the row ordinal.

字段:items: array<StreamUserConfig> total: integer(int64) page: integer limit: integer

400Stable invalid request or validation error.
401Authentication is missing or invalid.
403The authenticated principal lacks the required permission or owner scope.
500Internal operation failure without publication or activation claims.

失败时怎么办

  • 400 按字段说明修正参数或请求体再发;不要原样重试。
  • 401 检查凭据格式、是否过期或被轮换。
  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。

↑ 回到列表

POST /v1/user-configs

Create a per-user stream default

operationId
createUserConfig
认证
  • API Key:请求头 Authorization: CdncaKey <key_id>.<secret>。有效权限是 Key 的范围与所有者当前权限的交集。
  • 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
所需权限

全部需要:streams.manage

说明(契约原文)

The scope is global, or a forwarding group that must exist in the same scope. New forwards resolve these defaults when the field is omitted.

参数

createUserConfig 参数
名称位置类型必填说明
X-Request-IDheaderstring否Caller-stable request identity; invalid or absent values are replaced by middleware.
Idempotency-Keyheaderstring是Reuse is accepted only for the exact same actor, operation, and normalized input.

请求体

application/json · 必填:是

createUserConfig 请求体
名称类型必填说明
target_scope_idstring(uuid)否Required for platform principals; tenant principals may omit it or use their current scope.
owner_idstring(uuid)否Required for platform principals; tenant principals may omit it or use their current user.
setting_namestring: proxy_protocol / listen_protocol / balance_way是—
setting_valuestring是—
scope_namestring: global / group是—
group_idstring(uuid)否Required exactly when scope_name is group, and must exist in the same scope.

响应

createUserConfig 响应
状态码说明
201Default committed, or an exact idempotent replay returned.

字段:id: string(uuid) display_id: string scope_id: string(uuid) owner: StreamOwner | null setting_name: string: proxy_protocol / listen_protocol / balance_way setting_value: string scope_name: string: global / group group: StreamGroupReference | null created_at: string(date-time)

400Stable invalid request or validation error.
401Authentication is missing or invalid.
403The authenticated principal lacks the required permission or owner scope.
409Revision, idempotency, name, or listener-port conflict.
415Exactly one Content-Type field parsing as application/json is required.
500Internal operation failure without publication or activation claims.

失败时怎么办

  • 400 按字段说明修正参数或请求体再发;不要原样重试。
  • 401 检查凭据格式、是否过期或被轮换。
  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。
  • 500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。

↑ 回到列表

GET /v1/user-configs/effective

Resolve the stream defaults a new forward draft is prefilled with

operationId
getEffectiveUserConfigs
认证
  • API Key:请求头 Authorization: CdncaKey <key_id>.<secret>。有效权限是 Key 的范围与所有者当前权限的交集。
  • 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
所需权限

全部需要:streams.read

说明(契约原文)

type must be stream. The same resolution as creating a forward: the owner's global defaults, overridden by those of the given groups. Tenant principals resolve their own; platform principals must give target_scope_id and owner_id of a tenant member.

参数

getEffectiveUserConfigs 参数
名称位置类型必填说明
X-Request-IDheaderstring否Caller-stable request identity; invalid or absent values are replaced by middleware.
typequerystring是—
target_scope_idquerystring(uuid)否—
owner_idquerystring(uuid)否—
group_idqueryarray<string(uuid)>否—

响应

getEffectiveUserConfigs 响应
状态码说明
200Effective defaults.

字段:protocol: string: tcp / udp / null | null: tcp / udp / null proxy_protocol_inbound: boolean | null balance_way: string: rr / ip_hash / null | null: rr / ip_hash / null

400Stable invalid request or validation error.
401Authentication is missing or invalid.
403The authenticated principal lacks the required permission or owner scope.
500Internal operation failure without publication or activation claims.

失败时怎么办

  • 400 按字段说明修正参数或请求体再发;不要原样重试。
  • 401 检查凭据格式、是否过期或被轮换。
  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。

↑ 回到列表

DELETE /v1/user-configs/{id}

Delete a per-user stream default

operationId
deleteUserConfig
认证
  • API Key:请求头 Authorization: CdncaKey <key_id>.<secret>。有效权限是 Key 的范围与所有者当前权限的交集。
  • 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
所需权限

全部需要:streams.manage

参数

deleteUserConfig 参数
名称位置类型必填说明
idpathstring(uuid)是Exact per-user stream default identity.
X-Request-IDheaderstring否Caller-stable request identity; invalid or absent values are replaced by middleware.
Idempotency-Keyheaderstring是Reuse is accepted only for the exact same actor, operation, and normalized input.

响应

deleteUserConfig 响应
状态码说明
204Default deleted.
400Stable invalid request or validation error.
401Authentication is missing or invalid.
403The authenticated principal lacks the required permission or owner scope.
404No visible stream matches the exact immutable stream identity.
409Revision, idempotency, name, or listener-port conflict.
500Internal operation failure without publication or activation claims.

失败时怎么办

  • 400 按字段说明修正参数或请求体再发;不要原样重试。
  • 401 检查凭据格式、是否过期或被轮换。
  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 404 资源不存在或不属于当前租户。
  • 409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。
  • 500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。

↑ 回到列表