开放接口

/v1/l2-configs

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

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

方法路径摘要认证
GET/v1/l2-configs查询 L2 配置列表API Key 可调登录会话
POST/v1/l2-configs创建 L2 配置API Key 可调登录会话
GET/v1/l2-configs/{id}查询 L2 配置API Key 可调登录会话
PUT/v1/l2-configs/{id}替换 L2 配置API Key 可调登录会话
DELETE/v1/l2-configs/{id}删除 L2 配置API Key 可调登录会话

契约文件:api/control-node-scheduling.openapi.yaml

接口详情

GET /v1/l2-configs

查询 L2 配置列表

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

全部需要:node_scheduling.read

说明(契约原文)

返回当前作用域未删除的全部配置,按 display_id 排序,不分页。

参数

listL2Configs 参数
名称位置类型必填说明
target_scope_idquerystring(uuid)否Tenant credentials may omit this value or repeat their own scope. Platform Bearer credentials omit it to target the platform scope; an explicit tenant scope is allowed only on read or decision operations.

响应

listL2Configs 响应
状态码说明
200L2 配置列表;无数据时 items 为空数组。

字段:items: array<L2Config>

400Stable error envelope; messages are not localization keys.
401Stable error envelope; messages are not localization keys.
403Stable error envelope; messages are not localization keys.
503Stable error envelope; messages are not localization keys.

失败时怎么办

  • 400 按字段说明修正参数或请求体再发;不要原样重试。
  • 401 检查凭据格式、是否过期或被轮换。
  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 503 依赖暂不可用:稍后用原 Idempotency-Key 重试。

↑ 回到列表

POST /v1/l2-configs

创建 L2 配置

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

全部需要:node_scheduling.manage

说明(契约原文)

写入自身作用域,平台会话不能写入其他租户作用域;相同幂等键与规范化请求重放原结果。请求体限 128 KiB,须为单个 UTF-8 JSON 对象,拒绝未知字段。

参数

createL2Config 参数
名称位置类型必填说明
target_scope_idquerystring(uuid)否Tenant credentials may omit this value or repeat their own scope. Platform Bearer credentials omit it to target the platform scope; an explicit tenant scope is allowed only on read or decision operations.
If-Matchheaderstring是Must be the single exact quoted value "0".
Idempotency-Keyheaderstring是—
X-Request-IDheaderstring是—

请求体

application/json · 必填:是

createL2Config 请求体
名称类型必填说明
namestring是名称;写入时去除首尾空白后按 Unicode 字符数校验,禁止控制字符。
regionstring是必填区域名称;显式空字符串表示默认区域,与线路组默认区域相同,不是区域 UUID。仅含空白的非空字符串非法;其余名称写入时去除首尾空白后按 Unicode 字符数校验,禁止控制字符。已有非空名称(包括“默认”)保持原值,不等同于空字符串。
remarkstring否备注;写入时去除首尾空白后按 Unicode 字符数校验,禁止控制字符。省略时为空字符串。
modestring: cache / global是—
load_methodstring: rr / url_hash是—

响应

createL2Config 响应
状态码说明
201返回修订 1 的配置对象;名称或幂等键冲突返回 409。

字段:id: string(uuid) display_id: string tenant_scope_id: string(uuid) revision: integer(int64) name: string region: string remark: string mode: string: cache / global load_method: string: rr / url_hash created_at: string(date-time) updated_at: string(date-time)

400Stable error envelope; messages are not localization keys.
401Stable error envelope; messages are not localization keys.
403Stable error envelope; messages are not localization keys.
409Stable error envelope; messages are not localization keys.
503Stable error envelope; messages are not localization keys.

失败时怎么办

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

↑ 回到列表

GET /v1/l2-configs/{id}

查询 L2 配置

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

全部需要:node_scheduling.read

参数

getL2Config 参数
名称位置类型必填说明
idpathstring(uuid)是非零 L2 配置 UUID。
target_scope_idquerystring(uuid)否Tenant credentials may omit this value or repeat their own scope. Platform Bearer credentials omit it to target the platform scope; an explicit tenant scope is allowed only on read or decision operations.

响应

getL2Config 响应
状态码说明
200返回当前配置对象及其修订。

字段:id: string(uuid) display_id: string tenant_scope_id: string(uuid) revision: integer(int64) name: string region: string remark: string mode: string: cache / global load_method: string: rr / url_hash created_at: string(date-time) updated_at: string(date-time)

400Stable error envelope; messages are not localization keys.
401Stable error envelope; messages are not localization keys.
403Stable error envelope; messages are not localization keys.
404Stable error envelope; messages are not localization keys.
503Stable error envelope; messages are not localization keys.

失败时怎么办

  • 400 按字段说明修正参数或请求体再发;不要原样重试。
  • 401 检查凭据格式、是否过期或被轮换。
  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 404 资源不存在或不属于当前租户。
  • 503 依赖暂不可用:稍后用原 Idempotency-Key 重试。

↑ 回到列表

PUT /v1/l2-configs/{id}

替换 L2 配置

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

全部需要:node_scheduling.manage

说明(契约原文)

完整替换可编辑字段并递增修订;省略 remark 将清空备注。写入受自身作用域、实时管理权限、修订和幂等键约束。当前实现的已知限制:资源不存在与陈旧修订均返回 404/node_scheduling_not_found,不能区分;不同于节点更新及删除接口的 412 修订冲突。

参数

updateL2Config 参数
名称位置类型必填说明
idpathstring(uuid)是非零 L2 配置 UUID。
target_scope_idquerystring(uuid)否Tenant credentials may omit this value or repeat their own scope. Platform Bearer credentials omit it to target the platform scope; an explicit tenant scope is allowed only on read or decision operations.
If-Matchheaderstring是Single quoted positive decimal current revision, for example "3".
Idempotency-Keyheaderstring是—
X-Request-IDheaderstring是—

请求体

application/json · 必填:是

updateL2Config 请求体
名称类型必填说明
namestring是名称;写入时去除首尾空白后按 Unicode 字符数校验,禁止控制字符。
regionstring是必填区域名称;显式空字符串表示默认区域,与线路组默认区域相同,不是区域 UUID。仅含空白的非空字符串非法;其余名称写入时去除首尾空白后按 Unicode 字符数校验,禁止控制字符。已有非空名称(包括“默认”)保持原值,不等同于空字符串。
remarkstring否备注;写入时去除首尾空白后按 Unicode 字符数校验,禁止控制字符。省略时为空字符串。
modestring: cache / global是—
load_methodstring: rr / url_hash是—

响应

updateL2Config 响应
状态码说明
200返回更新后的配置对象或已完成请求的原结果。

字段:id: string(uuid) display_id: string tenant_scope_id: string(uuid) revision: integer(int64) name: string region: string remark: string mode: string: cache / global load_method: string: rr / url_hash created_at: string(date-time) updated_at: string(date-time)

400Stable error envelope; messages are not localization keys.
401Stable error envelope; messages are not localization keys.
403Stable error envelope; messages are not localization keys.
404Stable error envelope; messages are not localization keys.
409Stable error envelope; messages are not localization keys.
503Stable error envelope; messages are not localization keys.

失败时怎么办

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

↑ 回到列表

DELETE /v1/l2-configs/{id}

删除 L2 配置

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

全部需要:node_scheduling.manage

说明(契约原文)

存在未删除的 L2 节点成员引用时返回 409,不级联删除。成功或幂等重放返回 204,无响应体;ETag 保留删除时修订。不存在返回 404,修订冲突返回 412。

参数

deleteL2Config 参数
名称位置类型必填说明
idpathstring(uuid)是非零 L2 配置 UUID。
target_scope_idquerystring(uuid)否Tenant credentials may omit this value or repeat their own scope. Platform Bearer credentials omit it to target the platform scope; an explicit tenant scope is allowed only on read or decision operations.
If-Matchheaderstring是Single quoted positive decimal current revision, for example "3".
Idempotency-Keyheaderstring是—
X-Request-IDheaderstring是—

响应

deleteL2Config 响应
状态码说明
204软删除完成或已完成请求的结果被重放。
400Stable error envelope; messages are not localization keys.
401Stable error envelope; messages are not localization keys.
403Stable error envelope; messages are not localization keys.
404Stable error envelope; messages are not localization keys.
409Stable error envelope; messages are not localization keys.
412Stable error envelope; messages are not localization keys.
503Stable error envelope; messages are not localization keys.

失败时怎么办

  • 400 按字段说明修正参数或请求体再发;不要原样重试。
  • 401 检查凭据格式、是否过期或被轮换。
  • 403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。
  • 404 资源不存在或不属于当前租户。
  • 409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。
  • 412 版本已变:回读最新 ETag 后重新判断,再带新的 If-Match 提交。
  • 503 依赖暂不可用:稍后用原 Idempotency-Key 重试。

↑ 回到列表