切换深色模式
租户与成员 API
本页列出当前版本的完整方法及字段。方法通过 gRPC / gRPC-Web 调用;REST 注解不表示已部署 REST Gateway。
“必填:按业务校验”表示 proto3 未声明 required,不代表留空一定可用。UUID、EUI、权限、资源存在性与字段组合由服务端校验。嵌套结构详见页末消息结构。
TenantService
Create
接口名称: api.TenantService/Create
功能: 创建 对应资源。Create a new tenant.
请求: api.CreateTenantRequest;返回: api.CreateTenantResponse(单次响应)。
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant | api.Tenant | 按业务校验 | Tenant object to create. |
返回值
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 按业务校验 | 资源 ID。 Tenant ID. |
错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。
Get
接口名称: api.TenantService/Get
功能: 查询 对应资源。Get the tenant for the given ID.
请求: api.GetTenantRequest;返回: api.GetTenantResponse(单次响应)。
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 按业务校验 | 资源 ID。 Tenant ID. |
返回值
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant | api.Tenant | 按业务校验 | Tenant object. |
created_at | google.protobuf.Timestamp | 按业务校验 | 创建时间。 Created at timestamp. |
updated_at | google.protobuf.Timestamp | 按业务校验 | 最后更新时间。 Last update timestamp. |
错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。
Update
接口名称: api.TenantService/Update
功能: 更新 对应资源。Update the given tenant.
请求: api.UpdateTenantRequest;返回: google.protobuf.Empty(单次响应)。
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant | api.Tenant | 按业务校验 | Tenant object. |
返回值
无字段。
错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。
Delete
接口名称: api.TenantService/Delete
功能: 删除 对应资源。Delete the tenant with the given ID.
请求: api.DeleteTenantRequest;返回: google.protobuf.Empty(单次响应)。
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 按业务校验 | 资源 ID。 Tenant ID. |
返回值
无字段。
操作影响
此方法会删除、清空或重置对应资源/状态。调用前核对目标 ID;请勿通过重试重复执行有副作用的操作。
错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。
List
接口名称: api.TenantService/List
功能: 列出 对应资源。Get the list of tenants.
请求: api.ListTenantsRequest;返回: api.ListTenantsResponse(单次响应)。
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
limit | uint32 | 按业务校验 | 本次最多返回条数。 Max number of tenants to return in the result-set. If not set, it will be treated as 0, and the response will only return the total_count. |
offset | uint32 | 按业务校验 | 分页起始偏移。 Offset in the result-set (for pagination). |
search | string | 按业务校验 | 搜索关键字。 If set, the given string will be used to search on name. |
user_id | string | 按业务校验 | 用户 UUID。 If set, filters the result set to the tenants of the user. Only global API keys are able to filter by this field. |
返回值
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
total_count | uint32 | 按业务校验 | 符合条件的总条数。 Total number of tenants. |
result | repeated api.TenantListItem | 按业务校验 | 结果列表或结果内容。 Result-set. |
错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。
AddUser
接口名称: api.TenantService/AddUser
功能: 添加 User。Add an user to the tenant. Note: the user must already exist.
请求: api.AddTenantUserRequest;返回: google.protobuf.Empty(单次响应)。
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant_user | api.TenantUser | 按业务校验 | Tenant user object. |
返回值
无字段。
错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。
GetUser
接口名称: api.TenantService/GetUser
功能: 查询 User。Get the the tenant user for the given tenant and user IDs.
请求: api.GetTenantUserRequest;返回: api.GetTenantUserResponse(单次响应)。
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant_id | string | 按业务校验 | 租户 UUID。 Tenant ID (UUID). |
user_id | string | 按业务校验 | 用户 UUID。 User ID (UUID). |
返回值
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant_user | api.TenantUser | 按业务校验 | Tenant user object. |
created_at | google.protobuf.Timestamp | 按业务校验 | 创建时间。 Created at timestamp. |
updated_at | google.protobuf.Timestamp | 按业务校验 | 最后更新时间。 Last update timestamp. |
错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。
UpdateUser
接口名称: api.TenantService/UpdateUser
功能: 更新 User。Update the given tenant user.
请求: api.UpdateTenantUserRequest;返回: google.protobuf.Empty(单次响应)。
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant_user | api.TenantUser | 按业务校验 | Tenant user object. |
返回值
无字段。
错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。
DeleteUser
接口名称: api.TenantService/DeleteUser
功能: 删除 User。Delete the given tenant user.
请求: api.DeleteTenantUserRequest;返回: google.protobuf.Empty(单次响应)。
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant_id | string | 按业务校验 | 租户 UUID。 Tenant ID (UUID). |
user_id | string | 按业务校验 | 用户 UUID。 User ID (UUID). |
返回值
无字段。
操作影响
此方法会删除、清空或重置对应资源/状态。调用前核对目标 ID;请勿通过重试重复执行有副作用的操作。
错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。
ListUsers
接口名称: api.TenantService/ListUsers
功能: 列出 Users。Get the list of tenant users.
请求: api.ListTenantUsersRequest;返回: api.ListTenantUsersResponse(单次响应)。
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant_id | string | 按业务校验 | 租户 UUID。 Tenant ID (UUID). |
limit | uint32 | 按业务校验 | 本次最多返回条数。 Max number of tenants to return in the result-set. If not set, it will be treated as 0, and the response will only return the total_count. |
offset | uint32 | 按业务校验 | 分页起始偏移。 Offset in the result-set (for pagination). |
返回值
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
total_count | uint32 | 按业务校验 | 符合条件的总条数。 Total number of tenants. |
result | repeated api.TenantUserListItem | 按业务校验 | 结果列表或结果内容。 Result-set. |
错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。
嵌套消息结构
api.AddTenantUserRequest
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant_user | api.TenantUser | 按业务校验 | Tenant user object. |
api.CreateTenantRequest
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant | api.Tenant | 按业务校验 | Tenant object to create. |
api.CreateTenantResponse
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 按业务校验 | 资源 ID。 Tenant ID. |
api.DeleteTenantRequest
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 按业务校验 | 资源 ID。 Tenant ID. |
api.DeleteTenantUserRequest
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant_id | string | 按业务校验 | 租户 UUID。 Tenant ID (UUID). |
user_id | string | 按业务校验 | 用户 UUID。 User ID (UUID). |
api.GetTenantRequest
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 按业务校验 | 资源 ID。 Tenant ID. |
api.GetTenantResponse
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant | api.Tenant | 按业务校验 | Tenant object. |
created_at | google.protobuf.Timestamp | 按业务校验 | 创建时间。 Created at timestamp. |
updated_at | google.protobuf.Timestamp | 按业务校验 | 最后更新时间。 Last update timestamp. |
api.GetTenantUserRequest
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant_id | string | 按业务校验 | 租户 UUID。 Tenant ID (UUID). |
user_id | string | 按业务校验 | 用户 UUID。 User ID (UUID). |
api.GetTenantUserResponse
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant_user | api.TenantUser | 按业务校验 | Tenant user object. |
created_at | google.protobuf.Timestamp | 按业务校验 | 创建时间。 Created at timestamp. |
updated_at | google.protobuf.Timestamp | 按业务校验 | 最后更新时间。 Last update timestamp. |
api.ListTenantUsersRequest
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant_id | string | 按业务校验 | 租户 UUID。 Tenant ID (UUID). |
limit | uint32 | 按业务校验 | 本次最多返回条数。 Max number of tenants to return in the result-set. If not set, it will be treated as 0, and the response will only return the total_count. |
offset | uint32 | 按业务校验 | 分页起始偏移。 Offset in the result-set (for pagination). |
api.ListTenantUsersResponse
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
total_count | uint32 | 按业务校验 | 符合条件的总条数。 Total number of tenants. |
result | repeated api.TenantUserListItem | 按业务校验 | 结果列表或结果内容。 Result-set. |
api.ListTenantsRequest
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
limit | uint32 | 按业务校验 | 本次最多返回条数。 Max number of tenants to return in the result-set. If not set, it will be treated as 0, and the response will only return the total_count. |
offset | uint32 | 按业务校验 | 分页起始偏移。 Offset in the result-set (for pagination). |
search | string | 按业务校验 | 搜索关键字。 If set, the given string will be used to search on name. |
user_id | string | 按业务校验 | 用户 UUID。 If set, filters the result set to the tenants of the user. Only global API keys are able to filter by this field. |
api.ListTenantsResponse
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
total_count | uint32 | 按业务校验 | 符合条件的总条数。 Total number of tenants. |
result | repeated api.TenantListItem | 按业务校验 | 结果列表或结果内容。 Result-set. |
api.Tenant
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 按业务校验 | 资源 ID。 Tenant ID (UUID). Note: this value will be automatically generated on create. |
name | string | 按业务校验 | 名称。 Tenant name, |
description | string | 按业务校验 | 描述。 Tenant description. |
can_have_gateways | bool | 按业务校验 | Can the tenant create and "own" Gateways? |
max_gateway_count | uint32 | 按业务校验 | Max. gateway count for tenant. When set to 0, the tenant can have unlimited gateways. |
max_device_count | uint32 | 按业务校验 | Max. device count for tenant. When set to 0, the tenant can have unlimited devices. |
private_gateways_up | bool | 按业务校验 | Private gateways (uplink). If enabled, then uplink messages will not be shared with other tenants. |
private_gateways_down | bool | 按业务校验 | Private gateways (downlink). If enabled, then other tenants will not be able to schedule downlink messages through the gateways of this tenant. For example, in case you do want to share uplinks with other tenants (private_gateways_up=false), but you want to prevent other tenants from using gateway airtime. |
tags | map<string, string> | 按业务校验 | 自定义字符串标签。 Tags (user defined). These tags can be used to add additional information to the tenant. These tags are NOT exposed in the integration events. |
api.Tenant.TagsEntry
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
key | string | 按业务校验 | 消息定义未补充字段说明。 |
value | string | 按业务校验 | 消息定义未补充字段说明。 |
api.TenantListItem
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 按业务校验 | 资源 ID。 Tenant ID (UUID). |
created_at | google.protobuf.Timestamp | 按业务校验 | 创建时间。 Created at timestamp. |
updated_at | google.protobuf.Timestamp | 按业务校验 | 最后更新时间。 Last update timestamp. |
name | string | 按业务校验 | 名称。 Tenant name. |
can_have_gateways | bool | 按业务校验 | Can the tenant create and "own" Gateways? |
private_gateways_up | bool | 按业务校验 | Private gateways (uplink). |
private_gateways_down | bool | 按业务校验 | Private gateways (downlink). |
max_gateway_count | uint32 | 按业务校验 | Max gateway count. 0 = unlimited. |
max_device_count | uint32 | 按业务校验 | Max device count. 0 = unlimited. |
api.TenantUser
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant_id | string | 按业务校验 | 租户 UUID。 Tenant ID (UUID). |
user_id | string | 按业务校验 | 用户 UUID。 User ID (UUID). |
is_admin | bool | 按业务校验 | 平台或当前资源范围管理员标志。 User is admin within the context of the tenant. There is no need to set the is_device_admin and is_gateway_admin flags. |
is_device_admin | bool | 按业务校验 | User is able to modify device related resources (applications, device-profiles, devices, multicast-groups). |
is_gateway_admin | bool | 按业务校验 | User is able to modify gateways. |
email | string | 按业务校验 | 登录身份 / 邮箱。 Email (only used on get and when adding a user to a tenant). |
api.TenantUserListItem
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant_id | string | 按业务校验 | 租户 UUID。 Tenant ID (UUID). |
user_id | string | 按业务校验 | 用户 UUID。 User ID (UUID). |
created_at | google.protobuf.Timestamp | 按业务校验 | 创建时间。 Created at timestamp. |
updated_at | google.protobuf.Timestamp | 按业务校验 | 最后更新时间。 Last update timestamp. |
email | string | 按业务校验 | 登录身份 / 邮箱。 Email. |
is_admin | bool | 按业务校验 | 平台或当前资源范围管理员标志。 User is admin within the context of the tenant. There is no need to set the is_device_admin and is_gateway_admin flags. |
is_device_admin | bool | 按业务校验 | User is able to modify device related resources (applications, device-profiles, devices, multicast-groups). |
is_gateway_admin | bool | 按业务校验 | User is able to modify gateways. |
api.UpdateTenantRequest
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant | api.Tenant | 按业务校验 | Tenant object. |
api.UpdateTenantUserRequest
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant_user | api.TenantUser | 按业务校验 | Tenant user object. |