方法路径摘要认证
GET/v1/admin/tenant-scopesList tenant scope targets for platform administration登录会话
PUT/v1/admin/tenant-scopes/{scope_id}/parentPut a tenant under a reseller, or back to the platform登录会话

契约文件:api/openapi/v1/control.yaml

接口详情

GET /v1/admin/tenant-scopes

List tenant scope targets for platform administration

operationId
listTenantScopes
认证
  • 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
所需权限

全部需要:identity.users.manage

说明(契约原文)

Returns a small read-only tenant directory for platform identities. Requires identity.users.manage (or platform.admin) in a platform scope. Billing and other tenant data are intentionally excluded; suspended and closed tenants remain visible with their status.

参数

listTenantScopes 参数
名称位置类型必填说明
pagequeryinteger否—
limitqueryinteger否—
searchquerystring否Case-insensitive substring matched against tenant name, stable short tenant ID, tenant UUID, and scope UUID.
parentquerystring否Reseller filter: "none" = platform customers only; a reseller scope UUID (canonical lower case) = its customers; omitted = all.

响应

listTenantScopes 响应
状态码说明
200Stable tenant scope page ordered newest first.

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

400请求体或参数不合法。
401认证失败或会话已失效。
403当前身份没有执行该操作的权限。
500服务内部故障,请求未完成。

失败时怎么办

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

↑ 回到列表

PUT /v1/admin/tenant-scopes/{scope_id}/parent

Put a tenant under a reseller, or back to the platform

operationId
setTenantParent
认证
  • 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
所需权限

全部需要:identity.users.manage

说明(契约原文)

parent_scope_id null makes the tenant a platform customer again. The parent must be an active reseller, not the tenant itself; a reseller cannot have a parent (one level); a reseller at its customer_limit refuses new customers. Existing subscriptions are kept until they expire. Requires identity.users.manage in the platform scope.

参数

setTenantParent 参数
名称位置类型必填说明
scope_idpathstring(uuid)是—

请求体

application/json · 必填:是

setTenantParent 请求体
名称类型必填说明
parent_scope_idstring(uuid) | null(uuid)是—

响应

setTenantParent 响应
状态码说明
200The tenant's reseller.

字段:tenant_scope_id: string(uuid) parent_scope_id: string(uuid) | null(uuid)

400请求体或参数不合法。
401认证失败或会话已失效。
403当前身份没有执行该操作的权限。
404请求的资源不存在。
422The request is well formed but breaks a business rule (error.code names it).
500服务内部故障,请求未完成。

失败时怎么办

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

↑ 回到列表