Skip to content

网关 API ​

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

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

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

GatewayService ​

Create ​

接口名称: api.GatewayService/Create

功能: 创建 对应资源。Create creates the given gateway.

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

请求参数 ​

名称类型必填说明
gatewayapi.Gateway按业务校验网关对象。 Gateway object.

返回值 ​

无字段。

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

Get ​

接口名称: api.GatewayService/Get

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

请求: api.GetGatewayRequest;返回: api.GetGatewayResponse(单次响应)。

请求参数 ​

名称类型必填说明
gateway_idstring按业务校验网关 EUI。 Gateway ID (EUI64).

返回值 ​

名称类型必填说明
gatewayapi.Gateway按业务校验网关对象。 Gateway object.
created_atgoogle.protobuf.Timestamp按业务校验创建时间。 Created at timestamp.
updated_atgoogle.protobuf.Timestamp按业务校验最后更新时间。 Last update timestamp.
last_seen_atgoogle.protobuf.Timestamp按业务校验最后上报时间。 Last seen at timestamp.

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

Update ​

接口名称: api.GatewayService/Update

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

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

请求参数 ​

名称类型必填说明
gatewayapi.Gateway按业务校验网关对象。 Gateway object.

返回值 ​

无字段。

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

Delete ​

接口名称: api.GatewayService/Delete

功能: 删除 对应资源。Delete deletes the gateway matching the given Gateway ID.

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

请求参数 ​

名称类型必填说明
gateway_idstring按业务校验网关 EUI。 Gateway ID (EUI64).

返回值 ​

无字段。

操作影响

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

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

List ​

接口名称: api.GatewayService/List

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

请求: api.ListGatewaysRequest;返回: api.ListGatewaysResponse(单次响应)。

请求参数 ​

名称类型必填说明
limituint32按业务校验本次最多返回条数。 Max number of gateways 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 (optional).
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID) to filter gateways on. To list all gateways as a global admin user, this field can be left blank.
multicast_group_idstring按业务校验组播组 UUID。 Multicast-group ID (UUID) to filter gateways on.
order_byapi.ListGatewaysRequest.OrderBy {NAME=0, GATEWAY_ID=1, LAST_SEEN_AT=2}按业务校验If set, the given value will be used to sort by (optional).
order_by_descbool按业务校验If set, the sorting direction will be decending (default = ascending) (optional).

返回值 ​

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

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

GenerateClientCertificate ​

接口名称: api.GatewayService/GenerateClientCertificate

功能: 生成 ClientCertificate。Generate client-certificate for the gateway.

请求: api.GenerateGatewayClientCertificateRequest;返回: api.GenerateGatewayClientCertificateResponse(单次响应)。

请求参数 ​

名称类型必填说明
gateway_idstring按业务校验网关 EUI。 Gateway ID (EUI64).

返回值 ​

名称类型必填说明
tls_certstring按业务校验TLS 证书。 TLS certificate.
tls_keystring按业务校验TLS 私钥。 TLS key.
ca_certstring按业务校验CA 证书。 CA certificate.
expires_atgoogle.protobuf.Timestamp按业务校验过期时间。 Expires at defines the expiration date of the certificate.

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

GetMetrics ​

接口名称: api.GatewayService/GetMetrics

功能: 查询 Metrics。GetMetrics returns the gateway metrics.

请求: api.GetGatewayMetricsRequest;返回: api.GetGatewayMetricsResponse(单次响应)。

请求参数 ​

名称类型必填说明
gateway_idstring按业务校验网关 EUI。 Gateway ID (EUI64).
startgoogle.protobuf.Timestamp按业务校验起始时间。 Interval start timestamp.
endgoogle.protobuf.Timestamp按业务校验结束时间。 Interval end timestamp.
aggregationcommon.Aggregation {HOUR=0, DAY=1, MONTH=2, MINUTE=3}按业务校验聚合粒度。 Aggregation.

返回值 ​

名称类型必填说明
rx_packetscommon.Metric按业务校验RX packets.
tx_packetscommon.Metric按业务校验TX packets.
tx_packets_per_freqcommon.Metric按业务校验TX packets / frequency.
rx_packets_per_freqcommon.Metric按业务校验RX packets / frequency.
tx_packets_per_drcommon.Metric按业务校验TX packets / DR.
rx_packets_per_drcommon.Metric按业务校验RX packets / DR.
tx_packets_per_statuscommon.Metric按业务校验TX packets per status.

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

GetDutyCycleMetrics ​

接口名称: api.GatewayService/GetDutyCycleMetrics

功能: 查询 DutyCycleMetrics。GetDutyCycleMetrics returns the duty-cycle metrics. Note that only the last 2 hours of data are stored. Currently only per minute aggregation is available.

请求: api.GetGatewayDutyCycleMetricsRequest;返回: api.GetGatewayDutyCycleMetricsResponse(单次响应)。

请求参数 ​

名称类型必填说明
gateway_idstring按业务校验网关 EUI。 Gateway ID (EUI64).
startgoogle.protobuf.Timestamp按业务校验起始时间。 Interval start timestamp.
endgoogle.protobuf.Timestamp按业务校验结束时间。 Interval end timestamp.

返回值 ​

名称类型必填说明
max_load_percentagecommon.Metric按业务校验Percentage relative to max load.
window_percentagecommon.Metric按业务校验Percentage relative to tracking window.

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

GetRelayGateway ​

接口名称: api.GatewayService/GetRelayGateway

功能: 查询 RelayGateway。Get the given Relay Gateway.

请求: api.GetRelayGatewayRequest;返回: api.GetRelayGatewayResponse(单次响应)。

请求参数 ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID).
relay_idstring按业务校验Relay ID (4 byte HEX).

返回值 ​

名称类型必填说明
relay_gatewayapi.RelayGateway按业务校验Relay Gateway object.
created_atgoogle.protobuf.Timestamp按业务校验创建时间。 Created at timestamp.
updated_atgoogle.protobuf.Timestamp按业务校验最后更新时间。 Last update timestamp.
last_seen_atgoogle.protobuf.Timestamp按业务校验最后上报时间。 Last seen at timestamp.

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

ListRelayGateways ​

接口名称: api.GatewayService/ListRelayGateways

功能: 列出 RelayGateways。List the detected Relay Gateways.

请求: api.ListRelayGatewaysRequest;返回: api.ListRelayGatewaysResponse(单次响应)。

请求参数 ​

名称类型必填说明
limituint32按业务校验本次最多返回条数。 Max number of relay-gateways 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).
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID) to filter relay-gateways on. To list all relay-gateways as a global admin user, this field can be left blank.

返回值 ​

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

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

UpdateRelayGateway ​

接口名称: api.GatewayService/UpdateRelayGateway

功能: 更新 RelayGateway。Update the given Relay Gateway.

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

请求参数 ​

名称类型必填说明
relay_gatewayapi.RelayGateway按业务校验Relay Gateway object.

返回值 ​

无字段。

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

DeleteRelayGateway ​

接口名称: api.GatewayService/DeleteRelayGateway

功能: 删除 RelayGateway。Delete the given Relay Gateway.

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

请求参数 ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID.
relay_idstring按业务校验Relay ID (4 byte HEX).

返回值 ​

无字段。

操作影响

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

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

嵌套消息结构 ​

api.CreateGatewayRequest ​

名称类型必填说明
gatewayapi.Gateway按业务校验网关对象。 Gateway object.

api.DeleteGatewayRequest ​

名称类型必填说明
gateway_idstring按业务校验网关 EUI。 Gateway ID (EUI64).

api.DeleteRelayGatewayRequest ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID.
relay_idstring按业务校验Relay ID (4 byte HEX).

api.Gateway ​

名称类型必填说明
gateway_idstring按业务校验网关 EUI。 Gateway ID (EUI64).
namestring按业务校验名称。 Name.
descriptionstring按业务校验描述。 Description.
locationcommon.Location按业务校验位置。 Gateway location.
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID).
tagsmap<string, string>按业务校验自定义字符串标签。 Tags.
metadatamap<string, string>按业务校验Metadata (provided by the gateway).
stats_intervaluint32按业务校验状态上报周期。 Stats interval (seconds). This defines the expected interval in which the gateway sends its statistics.

api.Gateway.MetadataEntry ​

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

api.Gateway.TagsEntry ​

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

api.GatewayListItem ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID.
gateway_idstring按业务校验网关 EUI。 Gateway ID (EUI64).
namestring按业务校验名称。 Name.
descriptionstring按业务校验描述。 Description.
locationcommon.Location按业务校验位置。 Location.
propertiesmap<string, string>按业务校验Gateway properties.
created_atgoogle.protobuf.Timestamp按业务校验创建时间。 Created at timestamp.
updated_atgoogle.protobuf.Timestamp按业务校验最后更新时间。 Last update timestamp.
last_seen_atgoogle.protobuf.Timestamp按业务校验最后上报时间。 Last seen at timestamp.
stateapi.GatewayState {NEVER_SEEN=0, ONLINE=1, OFFLINE=2}按业务校验Gateway state. Please note that the state of the gateway is driven by the stats packages that are sent by the gateway.

api.GatewayListItem.PropertiesEntry ​

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

api.GenerateGatewayClientCertificateRequest ​

名称类型必填说明
gateway_idstring按业务校验网关 EUI。 Gateway ID (EUI64).

api.GenerateGatewayClientCertificateResponse ​

名称类型必填说明
tls_certstring按业务校验TLS 证书。 TLS certificate.
tls_keystring按业务校验TLS 私钥。 TLS key.
ca_certstring按业务校验CA 证书。 CA certificate.
expires_atgoogle.protobuf.Timestamp按业务校验过期时间。 Expires at defines the expiration date of the certificate.

api.GetGatewayDutyCycleMetricsRequest ​

名称类型必填说明
gateway_idstring按业务校验网关 EUI。 Gateway ID (EUI64).
startgoogle.protobuf.Timestamp按业务校验起始时间。 Interval start timestamp.
endgoogle.protobuf.Timestamp按业务校验结束时间。 Interval end timestamp.

api.GetGatewayDutyCycleMetricsResponse ​

名称类型必填说明
max_load_percentagecommon.Metric按业务校验Percentage relative to max load.
window_percentagecommon.Metric按业务校验Percentage relative to tracking window.

api.GetGatewayMetricsRequest ​

名称类型必填说明
gateway_idstring按业务校验网关 EUI。 Gateway ID (EUI64).
startgoogle.protobuf.Timestamp按业务校验起始时间。 Interval start timestamp.
endgoogle.protobuf.Timestamp按业务校验结束时间。 Interval end timestamp.
aggregationcommon.Aggregation {HOUR=0, DAY=1, MONTH=2, MINUTE=3}按业务校验聚合粒度。 Aggregation.

api.GetGatewayMetricsResponse ​

名称类型必填说明
rx_packetscommon.Metric按业务校验RX packets.
tx_packetscommon.Metric按业务校验TX packets.
tx_packets_per_freqcommon.Metric按业务校验TX packets / frequency.
rx_packets_per_freqcommon.Metric按业务校验RX packets / frequency.
tx_packets_per_drcommon.Metric按业务校验TX packets / DR.
rx_packets_per_drcommon.Metric按业务校验RX packets / DR.
tx_packets_per_statuscommon.Metric按业务校验TX packets per status.

api.GetGatewayRequest ​

名称类型必填说明
gateway_idstring按业务校验网关 EUI。 Gateway ID (EUI64).

api.GetGatewayResponse ​

名称类型必填说明
gatewayapi.Gateway按业务校验网关对象。 Gateway object.
created_atgoogle.protobuf.Timestamp按业务校验创建时间。 Created at timestamp.
updated_atgoogle.protobuf.Timestamp按业务校验最后更新时间。 Last update timestamp.
last_seen_atgoogle.protobuf.Timestamp按业务校验最后上报时间。 Last seen at timestamp.

api.GetRelayGatewayRequest ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID).
relay_idstring按业务校验Relay ID (4 byte HEX).

api.GetRelayGatewayResponse ​

名称类型必填说明
relay_gatewayapi.RelayGateway按业务校验Relay Gateway object.
created_atgoogle.protobuf.Timestamp按业务校验创建时间。 Created at timestamp.
updated_atgoogle.protobuf.Timestamp按业务校验最后更新时间。 Last update timestamp.
last_seen_atgoogle.protobuf.Timestamp按业务校验最后上报时间。 Last seen at timestamp.

api.ListGatewaysRequest ​

名称类型必填说明
limituint32按业务校验本次最多返回条数。 Max number of gateways 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 (optional).
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID) to filter gateways on. To list all gateways as a global admin user, this field can be left blank.
multicast_group_idstring按业务校验组播组 UUID。 Multicast-group ID (UUID) to filter gateways on.
order_byapi.ListGatewaysRequest.OrderBy {NAME=0, GATEWAY_ID=1, LAST_SEEN_AT=2}按业务校验If set, the given value will be used to sort by (optional).
order_by_descbool按业务校验If set, the sorting direction will be decending (default = ascending) (optional).

api.ListGatewaysResponse ​

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

api.ListRelayGatewaysRequest ​

名称类型必填说明
limituint32按业务校验本次最多返回条数。 Max number of relay-gateways 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).
tenant_idstring按业务校验租户 UUID。 Tenant ID (UUID) to filter relay-gateways on. To list all relay-gateways as a global admin user, this field can be left blank.

api.ListRelayGatewaysResponse ​

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

api.RelayGateway ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID.
relay_idstring按业务校验Relay ID (4 byte HEX).
namestring按业务校验名称。 Name.
descriptionstring按业务校验描述。 Description.
stats_intervaluint32按业务校验状态上报周期。 Stats interval (seconds). This defines the expected interval in which the gateway sends its statistics.
region_config_idstring按业务校验区域配置 ID。 Region configuration ID.

api.RelayGatewayListItem ​

名称类型必填说明
tenant_idstring按业务校验租户 UUID。 Tenant ID.
relay_idstring按业务校验Relay ID (4 byte HEX).
namestring按业务校验名称。 Name.
descriptionstring按业务校验描述。 Description.
created_atgoogle.protobuf.Timestamp按业务校验创建时间。 Created at timestamp.
updated_atgoogle.protobuf.Timestamp按业务校验最后更新时间。 Last update timestamp.
last_seen_atgoogle.protobuf.Timestamp按业务校验最后上报时间。 Last seen at timestamp.
stateapi.GatewayState {NEVER_SEEN=0, ONLINE=1, OFFLINE=2}按业务校验Gateway state. Please note that the state of the relay is driven by the last received stats packet sent by the relay-gateway.
region_config_idstring按业务校验区域配置 ID。 Region configuration ID.

api.UpdateGatewayRequest ​

名称类型必填说明
gatewayapi.Gateway按业务校验网关对象。 Gateway object.

api.UpdateRelayGatewayRequest ​

名称类型必填说明
relay_gatewayapi.RelayGateway按业务校验Relay Gateway object.

common.Location ​

名称类型必填说明
latitudedouble按业务校验纬度。 Latitude.
longitudedouble按业务校验经度。 Longitude.
altitudedouble按业务校验海拔。 Altitude.
sourcecommon.LocationSource {UNKNOWN=0, GPS=1, CONFIG=2, GEO_RESOLVER_TDOA=3, GEO_RESOLVER_RSSI=4, GEO_RESOLVER_GNSS=5, GEO_RESOLVER_WIFI=6}按业务校验Location source.
accuracyfloat按业务校验Accuracy.

common.Metric ​

名称类型必填说明
namestring按业务校验名称。 Name.
timestampsrepeated google.protobuf.Timestamp按业务校验Timestamps.
datasetsrepeated common.MetricDataset按业务校验Datasets.
kindcommon.MetricKind {COUNTER=0, ABSOLUTE=1, GAUGE=2}按业务校验Kind.

common.MetricDataset ​

名称类型必填说明
labelstring按业务校验Label.
datarepeated float按业务校验数据序列。 Data. Each value index corresponds with the same timestamp index of the Metric.

设备使用指南