切换深色模式
用户 API
本页列出当前版本的完整方法及字段。方法通过 gRPC / gRPC-Web 调用;REST 注解不表示已部署 REST Gateway。
“必填:按业务校验”表示 proto3 未声明 required,不代表留空一定可用。UUID、EUI、权限、资源存在性与字段组合由服务端校验。嵌套结构详见页末消息结构。
UserService
Create
接口名称: api.UserService/Create
功能: 创建 对应资源。Create a new user.
请求: api.CreateUserRequest;返回: api.CreateUserResponse(单次响应)。
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
user | api.User | 按业务校验 | 用户对象。 User object to create. |
password | string | 按业务校验 | 密码。 Password to set for the user. |
tenants | repeated api.UserTenant | 按业务校验 | 关联租户列表。 Add the user to the following tenants. |
返回值
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 按业务校验 | 资源 ID。 User ID. |
错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。
Get
接口名称: api.UserService/Get
功能: 查询 对应资源。Get the user for the given ID.
请求: api.GetUserRequest;返回: api.GetUserResponse(单次响应)。
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 按业务校验 | 资源 ID。 User ID. |
返回值
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
user | api.User | 按业务校验 | 用户对象。 User object. |
created_at | google.protobuf.Timestamp | 按业务校验 | 创建时间。 Created at timestamp. |
updated_at | google.protobuf.Timestamp | 按业务校验 | 最后更新时间。 Last update timestamp. |
错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。
Update
接口名称: api.UserService/Update
功能: 更新 对应资源。Update the given user.
请求: api.UpdateUserRequest;返回: google.protobuf.Empty(单次响应)。
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
user | api.User | 按业务校验 | 用户对象。 User object. |
返回值
无字段。
错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。
Delete
接口名称: api.UserService/Delete
功能: 删除 对应资源。Delete the user with the given ID.
请求: api.DeleteUserRequest;返回: google.protobuf.Empty(单次响应)。
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 按业务校验 | 资源 ID。 User ID. |
返回值
无字段。
操作影响
此方法会删除、清空或重置对应资源/状态。调用前核对目标 ID;请勿通过重试重复执行有副作用的操作。
错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。
List
接口名称: api.UserService/List
功能: 列出 对应资源。Get the list of users.
请求: api.ListUsersRequest;返回: api.ListUsersResponse(单次响应)。
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
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 users. |
result | repeated api.UserListItem | 按业务校验 | 结果列表或结果内容。 Result-set. |
错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。
UpdatePassword
接口名称: api.UserService/UpdatePassword
功能: 更新 Password。Update the password for the given user.
请求: api.UpdateUserPasswordRequest;返回: google.protobuf.Empty(单次响应)。
请求参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
user_id | string | 按业务校验 | 用户 UUID。 User ID. |
password | string | 按业务校验 | 密码。 Password to set. |
返回值
无字段。
错误处理:按 统一错误说明 检查 gRPC 状态;本页不将通用状态码冒充每个方法的固定错误集合。
嵌套消息结构
api.CreateUserRequest
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
user | api.User | 按业务校验 | 用户对象。 User object to create. |
password | string | 按业务校验 | 密码。 Password to set for the user. |
tenants | repeated api.UserTenant | 按业务校验 | 关联租户列表。 Add the user to the following tenants. |
api.CreateUserResponse
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 按业务校验 | 资源 ID。 User ID. |
api.DeleteUserRequest
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 按业务校验 | 资源 ID。 User ID. |
api.GetUserRequest
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 按业务校验 | 资源 ID。 User ID. |
api.GetUserResponse
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
user | api.User | 按业务校验 | 用户对象。 User object. |
created_at | google.protobuf.Timestamp | 按业务校验 | 创建时间。 Created at timestamp. |
updated_at | google.protobuf.Timestamp | 按业务校验 | 最后更新时间。 Last update timestamp. |
api.ListUsersRequest
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
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.ListUsersResponse
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
total_count | uint32 | 按业务校验 | 符合条件的总条数。 Total number of users. |
result | repeated api.UserListItem | 按业务校验 | 结果列表或结果内容。 Result-set. |
api.UpdateUserPasswordRequest
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
user_id | string | 按业务校验 | 用户 UUID。 User ID. |
password | string | 按业务校验 | 密码。 Password to set. |
api.UpdateUserRequest
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
user | api.User | 按业务校验 | 用户对象。 User object. |
api.User
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 按业务校验 | 资源 ID。 User ID (UUID). Will be set automatically on create. |
is_admin | bool | 按业务校验 | 平台或当前资源范围管理员标志。 Set to true to make the user a global administrator. |
is_active | bool | 按业务校验 | 是否启用。 Set to false to disable the user. |
email | string | 按业务校验 | 登录身份 / 邮箱。 E-mail of the user. |
note | string | 按业务校验 | 备注。 Optional note to store with the user. |
api.UserListItem
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 按业务校验 | 资源 ID。 User ID (UUID). |
created_at | google.protobuf.Timestamp | 按业务校验 | 创建时间。 Created at timestamp. |
updated_at | google.protobuf.Timestamp | 按业务校验 | 最后更新时间。 Last update timestamp. |
email | string | 按业务校验 | 登录身份 / 邮箱。 Email of the user. |
is_admin | bool | 按业务校验 | 平台或当前资源范围管理员标志。 Set to true to make the user a global administrator. |
is_active | bool | 按业务校验 | 是否启用。 Set to false to disable the user. |
api.UserTenant
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
tenant_id | string | 按业务校验 | 租户 UUID。 Tenant ID. |
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. |