开放接口

/v1/l2-conds

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

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

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

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

接口详情

GET /v1/l2-conds

查询 L2 匹配条件列表

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

全部需要:node_scheduling.read

说明(契约原文)

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

参数

listL2Conditions 参数
名称位置类型必填说明
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.

响应

listL2Conditions 响应
状态码说明
200L2 匹配条件列表;无数据时 items 为空数组。

字段:items: array<L2Condition>

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-conds

创建 L2 匹配条件

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

全部需要:node_scheduling.manage

说明(契约原文)

写入自身作用域,平台会话不能写入其他租户作用域;相同幂等键与规范化请求重放原结果。请求体限 128 KiB,拒绝非 JSON、无效 UTF-8、未知字段及额外 JSON 值。

参数

createL2Condition 参数
名称位置类型必填说明
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 · 必填:是

createL2Condition 请求体
名称类型必填说明
namestring是名称;写入时去除首尾空白后按 Unicode 字符数校验,禁止控制字符。
remarkstring否备注;写入时去除首尾空白后按 Unicode 字符数校验,禁止控制字符。省略时为空字符串。
rulesarray<L2Rule>是—

响应

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

字段:id: string(uuid) display_id: string tenant_scope_id: string(uuid) revision: integer(int64) name: string remark: string rules: array<L2Rule> 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 重试。

↑ 回到列表

PUT /v1/l2-conds/{id}

替换 L2 匹配条件

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

全部需要:node_scheduling.manage

说明(契约原文)

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

参数

updateL2Condition 参数
名称位置类型必填说明
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 · 必填:是

updateL2Condition 请求体
名称类型必填说明
namestring是名称;写入时去除首尾空白后按 Unicode 字符数校验,禁止控制字符。
remarkstring否备注;写入时去除首尾空白后按 Unicode 字符数校验,禁止控制字符。省略时为空字符串。
rulesarray<L2Rule>是—

响应

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

字段:id: string(uuid) display_id: string tenant_scope_id: string(uuid) revision: integer(int64) name: string remark: string rules: array<L2Rule> 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-conds/{id}

删除 L2 匹配条件

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

全部需要:node_scheduling.manage

说明(契约原文)

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

参数

deleteL2Condition 参数
名称位置类型必填说明
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是—

响应

deleteL2Condition 响应
状态码说明
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 重试。

↑ 回到列表