Skip to content

租户与成员 API ​

本页列出当前版本的完整方法及字段。方法通过 gRPC / gRPC-Web 调用;REST 注解不表示已部署 REST Gateway。

“必填:按业务校验”表示 proto3 未声明 required,不代表留空一定可用。UUID、EUI、权限、资源存在性与字段组合由服务端校验。嵌套结构详见页末消息结构。

调用方式、鉴权与错误处理

TenantService ​

Create ​

接口名称: api.TenantService/Create

功能: 创建 对应资源。Create a new tenant.

请求: api.CreateTenantRequest;返回: api.CreateTenantResponse(单次响应)。

请求参数 ​

名称类型必填说明
tenantapi.Tenant按业务校验Tenant object to create.

返回值 ​

名称类型必填说明
idstring按业务校验资源 ID。 Tenant ID.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

Get ​

接口名称: api.TenantService/Get

功能: 查询 对应资源。Get the tenant for the given ID.

请求: api.GetTenantRequest;返回: api.GetTenantResponse(单次响应)。

请求参数 ​

名称类型必填说明
idstring按业务校验资源 ID。 Tenant ID.

返回值 ​

名称类型必填说明
tenantapi.Tenant按业务校验Tenant object.
created_atgoogle.protobuf.Timestamp按业务校验创建时间。 Created at timestamp.
updated_atgoogle.protobuf.Timestamp按业务校验最后更新时间。 Last update timestamp.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

Update ​

接口名称: api.TenantService/Update

功能: 更新 对应资源。Update the given tenant.

请求: api.UpdateTenantRequest;返回: google.protobuf.Empty(单次响应)。

请求参数 ​

名称类型必填说明
tenantapi.Tenant按业务校验Tenant object.

返回值 ​

无字段。

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

Delete ​

接口名称: api.TenantService/Delete

功能: 删除 对应资源。Delete the tenant with the given ID.

请求: api.DeleteTenantRequest;返回: google.protobuf.Empty(单次响应)。

请求参数 ​

名称类型必填说明
idstring按业务校验资源 ID。 Tenant ID.

返回值 ​

无字段。

操作影响

此方法会删除、清空或重置对应资源/状态。调用前核对目标 ID;请勿通过重试重复执行有副作用的操作。

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

List ​

接口名称: api.TenantService/List

功能: 列出 对应资源。Get the list of tenants.

请求: api.ListTenantsRequest;返回: api.ListTenantsResponse(单次响应)。

请求参数 ​

名称类型必填说明
limituint32按业务校验本次最多返回条数。 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.
offsetuint32按业务校验分页起始偏移。 Offset in the result-set (for pagination).
searchstring按业务校验搜索关键字。 If set, the given string will be used to search on name.
user_idstring按业务校验用户 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_countuint32按业务校验符合条件的总条数。 Total number of tenants.
resultrepeated 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_userapi.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_idstring按业务校验租户 UUID。 Tenant ID (UUID).
user_idstring按业务校验用户 UUID。 User ID (UUID).

返回值 ​

名称类型必填说明
tenant_userapi.TenantUser按业务校验Tenant user object.
created_atgoogle.protobuf.Timestamp按业务校验创建时间。 Created at timestamp.
updated_atgoogle.protobuf.Timestamp按业务校验最后更新时间。 Last update timestamp.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

UpdateUser ​

接口名称: api.TenantService/UpdateUser

功能: 更新 User。Update the given tenant user.

请求: api.UpdateTenantUserRequest;返回: google.protobuf.Empty(单次响应)。

请求参数 ​

名称类型必填说明
tenant_userapi.TenantUser按业务校验Tenant user object.

返回值 ​

无字段。

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

DeleteUser ​

接口名称: api.TenantService/DeleteUser

功能: 删除 User。Delete the given tenant user.

请求: api.DeleteTenantUserRequest;返回: google.protobuf.Empty(单次响应)。

请求参数 ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID).
user_idstring按业务校验用户 UUID。 User ID (UUID).

返回值 ​

无字段。

操作影响

此方法会删除、清空或重置对应资源/状态。调用前核对目标 ID;请勿通过重试重复执行有副作用的操作。

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

ListUsers ​

接口名称: api.TenantService/ListUsers

功能: 列出 Users。Get the list of tenant users.

请求: api.ListTenantUsersRequest;返回: api.ListTenantUsersResponse(单次响应)。

请求参数 ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID).
limituint32按业务校验本次最多返回条数。 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.
offsetuint32按业务校验分页起始偏移。 Offset in the result-set (for pagination).

返回值 ​

名称类型必填说明
total_countuint32按业务校验符合条件的总条数。 Total number of tenants.
resultrepeated api.TenantUserListItem按业务校验结果列表或结果内容。 Result-set.

错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。

嵌套消息结构 ​

api.AddTenantUserRequest ​

名称类型必填说明
tenant_userapi.TenantUser按业务校验Tenant user object.

api.CreateTenantRequest ​

名称类型必填说明
tenantapi.Tenant按业务校验Tenant object to create.

api.CreateTenantResponse ​

名称类型必填说明
idstring按业务校验资源 ID。 Tenant ID.

api.DeleteTenantRequest ​

名称类型必填说明
idstring按业务校验资源 ID。 Tenant ID.

api.DeleteTenantUserRequest ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID).
user_idstring按业务校验用户 UUID。 User ID (UUID).

api.GetTenantRequest ​

名称类型必填说明
idstring按业务校验资源 ID。 Tenant ID.

api.GetTenantResponse ​

名称类型必填说明
tenantapi.Tenant按业务校验Tenant object.
created_atgoogle.protobuf.Timestamp按业务校验创建时间。 Created at timestamp.
updated_atgoogle.protobuf.Timestamp按业务校验最后更新时间。 Last update timestamp.

api.GetTenantUserRequest ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID).
user_idstring按业务校验用户 UUID。 User ID (UUID).

api.GetTenantUserResponse ​

名称类型必填说明
tenant_userapi.TenantUser按业务校验Tenant user object.
created_atgoogle.protobuf.Timestamp按业务校验创建时间。 Created at timestamp.
updated_atgoogle.protobuf.Timestamp按业务校验最后更新时间。 Last update timestamp.

api.ListTenantUsersRequest ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID).
limituint32按业务校验本次最多返回条数。 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.
offsetuint32按业务校验分页起始偏移。 Offset in the result-set (for pagination).

api.ListTenantUsersResponse ​

名称类型必填说明
total_countuint32按业务校验符合条件的总条数。 Total number of tenants.
resultrepeated api.TenantUserListItem按业务校验结果列表或结果内容。 Result-set.

api.ListTenantsRequest ​

名称类型必填说明
limituint32按业务校验本次最多返回条数。 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.
offsetuint32按业务校验分页起始偏移。 Offset in the result-set (for pagination).
searchstring按业务校验搜索关键字。 If set, the given string will be used to search on name.
user_idstring按业务校验用户 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_countuint32按业务校验符合条件的总条数。 Total number of tenants.
resultrepeated api.TenantListItem按业务校验结果列表或结果内容。 Result-set.

api.Tenant ​

名称类型必填说明
idstring按业务校验资源 ID。 Tenant ID (UUID). Note: this value will be automatically generated on create.
namestring按业务校验名称。 Tenant name,
descriptionstring按业务校验描述。 Tenant description.
can_have_gatewaysbool按业务校验Can the tenant create and "own" Gateways?
max_gateway_countuint32按业务校验Max. gateway count for tenant. When set to 0, the tenant can have unlimited gateways.
max_device_countuint32按业务校验Max. device count for tenant. When set to 0, the tenant can have unlimited devices.
private_gateways_upbool按业务校验Private gateways (uplink). If enabled, then uplink messages will not be shared with other tenants.
private_gateways_downbool按业务校验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.
tagsmap<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 ​

名称类型必填说明
keystring按业务校验消息定义未补充字段说明。
valuestring按业务校验消息定义未补充字段说明。

api.TenantListItem ​

名称类型必填说明
idstring按业务校验资源 ID。 Tenant ID (UUID).
created_atgoogle.protobuf.Timestamp按业务校验创建时间。 Created at timestamp.
updated_atgoogle.protobuf.Timestamp按业务校验最后更新时间。 Last update timestamp.
namestring按业务校验名称。 Tenant name.
can_have_gatewaysbool按业务校验Can the tenant create and "own" Gateways?
private_gateways_upbool按业务校验Private gateways (uplink).
private_gateways_downbool按业务校验Private gateways (downlink).
max_gateway_countuint32按业务校验Max gateway count. 0 = unlimited.
max_device_countuint32按业务校验Max device count. 0 = unlimited.

api.TenantUser ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID).
user_idstring按业务校验用户 UUID。 User ID (UUID).
is_adminbool按业务校验平台或当前资源范围管理员标志。 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_adminbool按业务校验User is able to modify device related resources (applications, device-profiles, devices, multicast-groups).
is_gateway_adminbool按业务校验User is able to modify gateways.
emailstring按业务校验登录身份 / 邮箱。 Email (only used on get and when adding a user to a tenant).

api.TenantUserListItem ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID).
user_idstring按业务校验用户 UUID。 User ID (UUID).
created_atgoogle.protobuf.Timestamp按业务校验创建时间。 Created at timestamp.
updated_atgoogle.protobuf.Timestamp按业务校验最后更新时间。 Last update timestamp.
emailstring按业务校验登录身份 / 邮箱。 Email.
is_adminbool按业务校验平台或当前资源范围管理员标志。 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_adminbool按业务校验User is able to modify device related resources (applications, device-profiles, devices, multicast-groups).
is_gateway_adminbool按业务校验User is able to modify gateways.

api.UpdateTenantRequest ​

名称类型必填说明
tenantapi.Tenant按业务校验Tenant object.

api.UpdateTenantUserRequest ​

名称类型必填说明
tenant_userapi.TenantUser按业务校验Tenant user object.

设备使用指南