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 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
page | query | integer | 否 | — |
|---|
limit | query | integer | 否 | — |
|---|
search | query | string | 否 | Case-insensitive substring matched against tenant name, stable short tenant ID, tenant UUID, and scope UUID. |
|---|
parent | query | string | 否 | Reseller filter: "none" = platform customers only; a reseller scope UUID (canonical lower case) = its customers; omitted = all. |
|---|
响应
listTenantScopes 响应| 状态码 | 说明 |
|---|
200 | Stable 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_id | path | string(uuid) | 是 | — |
|---|
请求体
application/json · 必填:是
setTenantParent 请求体| 名称 | 类型 | 必填 | 说明 |
|---|
parent_scope_id | string(uuid) | null(uuid) | 是 | — |
|---|
响应
setTenantParent 响应| 状态码 | 说明 |
|---|
200 | The tenant's reseller. 字段:tenant_scope_id: string(uuid) parent_scope_id: string(uuid) | null(uuid) |
|---|
400 | 请求体或参数不合法。 |
|---|
401 | 认证失败或会话已失效。 |
|---|
403 | 当前身份没有执行该操作的权限。 |
|---|
404 | 请求的资源不存在。 |
|---|
422 | The request is well formed but breaks a business rule (error.code names it). |
|---|
500 | 服务内部故障,请求未完成。 |
|---|
失败时怎么办
400 按字段说明修正参数或请求体再发;不要原样重试。401 检查凭据格式、是否过期或被轮换。403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。404 资源不存在或不属于当前租户。500 结果未知:先按资源 ID 或列表回读确认,再决定是否用原 Idempotency-Key 重试。
↑ 回到列表