diff --git a/api/go/api/device.pb.go b/api/go/api/device.pb.go index cb3237e2..d57f34d0 100644 --- a/api/go/api/device.pb.go +++ b/api/go/api/device.pb.go @@ -7,6 +7,7 @@ package api import ( + common "github.com/chirpstack/chirpstack/api/go/v4/common" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" @@ -1487,7 +1488,7 @@ func (x *GetRandomDevAddrResponse) GetDevAddr() string { return "" } -type GetDeviceStatsRequest struct { +type GetDeviceMetricsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1498,10 +1499,12 @@ type GetDeviceStatsRequest struct { Start *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start,proto3" json:"start,omitempty"` // Interval end timestamp. End *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=end,proto3" json:"end,omitempty"` + // Aggregation. + Aggregation common.Aggregation `protobuf:"varint,4,opt,name=aggregation,proto3,enum=common.Aggregation" json:"aggregation,omitempty"` } -func (x *GetDeviceStatsRequest) Reset() { - *x = GetDeviceStatsRequest{} +func (x *GetDeviceMetricsRequest) Reset() { + *x = GetDeviceMetricsRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_device_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1509,13 +1512,13 @@ func (x *GetDeviceStatsRequest) Reset() { } } -func (x *GetDeviceStatsRequest) String() string { +func (x *GetDeviceMetricsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetDeviceStatsRequest) ProtoMessage() {} +func (*GetDeviceMetricsRequest) ProtoMessage() {} -func (x *GetDeviceStatsRequest) ProtoReflect() protoreflect.Message { +func (x *GetDeviceMetricsRequest) ProtoReflect() protoreflect.Message { mi := &file_api_device_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1527,42 +1530,50 @@ func (x *GetDeviceStatsRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetDeviceStatsRequest.ProtoReflect.Descriptor instead. -func (*GetDeviceStatsRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GetDeviceMetricsRequest.ProtoReflect.Descriptor instead. +func (*GetDeviceMetricsRequest) Descriptor() ([]byte, []int) { return file_api_device_proto_rawDescGZIP(), []int{23} } -func (x *GetDeviceStatsRequest) GetDevEui() string { +func (x *GetDeviceMetricsRequest) GetDevEui() string { if x != nil { return x.DevEui } return "" } -func (x *GetDeviceStatsRequest) GetStart() *timestamppb.Timestamp { +func (x *GetDeviceMetricsRequest) GetStart() *timestamppb.Timestamp { if x != nil { return x.Start } return nil } -func (x *GetDeviceStatsRequest) GetEnd() *timestamppb.Timestamp { +func (x *GetDeviceMetricsRequest) GetEnd() *timestamppb.Timestamp { if x != nil { return x.End } return nil } -type GetDeviceStatsResponse struct { +func (x *GetDeviceMetricsRequest) GetAggregation() common.Aggregation { + if x != nil { + return x.Aggregation + } + return common.Aggregation(0) +} + +type GetDeviceMetricsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Result []*DeviceStats `protobuf:"bytes,1,rep,name=result,proto3" json:"result,omitempty"` + Metrics map[string]*common.Metric `protobuf:"bytes,1,rep,name=metrics,proto3" json:"metrics,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + States map[string]*DeviceState `protobuf:"bytes,2,rep,name=states,proto3" json:"states,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (x *GetDeviceStatsResponse) Reset() { - *x = GetDeviceStatsResponse{} +func (x *GetDeviceMetricsResponse) Reset() { + *x = GetDeviceMetricsResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_device_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1570,13 +1581,13 @@ func (x *GetDeviceStatsResponse) Reset() { } } -func (x *GetDeviceStatsResponse) String() string { +func (x *GetDeviceMetricsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetDeviceStatsResponse) ProtoMessage() {} +func (*GetDeviceMetricsResponse) ProtoMessage() {} -func (x *GetDeviceStatsResponse) ProtoReflect() protoreflect.Message { +func (x *GetDeviceMetricsResponse) ProtoReflect() protoreflect.Message { mi := &file_api_device_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1588,41 +1599,38 @@ func (x *GetDeviceStatsResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetDeviceStatsResponse.ProtoReflect.Descriptor instead. -func (*GetDeviceStatsResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GetDeviceMetricsResponse.ProtoReflect.Descriptor instead. +func (*GetDeviceMetricsResponse) Descriptor() ([]byte, []int) { return file_api_device_proto_rawDescGZIP(), []int{24} } -func (x *GetDeviceStatsResponse) GetResult() []*DeviceStats { +func (x *GetDeviceMetricsResponse) GetMetrics() map[string]*common.Metric { if x != nil { - return x.Result + return x.Metrics } return nil } -type DeviceStats struct { +func (x *GetDeviceMetricsResponse) GetStates() map[string]*DeviceState { + if x != nil { + return x.States + } + return nil +} + +type DeviceState struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Timestamp of the (aggregated) measurement. - Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` - // Packets received from the device. - RxPackets uint32 `protobuf:"varint,2,opt,name=rx_packets,json=rxPackets,proto3" json:"rx_packets,omitempty"` - // Average RSSI (as reported by the gateway(s)). - GwRssi float32 `protobuf:"fixed32,3,opt,name=gw_rssi,json=gwRssi,proto3" json:"gw_rssi,omitempty"` - // Average SNR (as reported by the gateway(s)). - GwSnr float32 `protobuf:"fixed32,4,opt,name=gw_snr,json=gwSnr,proto3" json:"gw_snr,omitempty"` - // Packets received by frequency. - RxPacketsPerFrequency map[uint32]uint32 `protobuf:"bytes,5,rep,name=rx_packets_per_frequency,json=rxPacketsPerFrequency,proto3" json:"rx_packets_per_frequency,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // Packets received by DR. - RxPacketsPerDr map[uint32]uint32 `protobuf:"bytes,6,rep,name=rx_packets_per_dr,json=rxPacketsPerDr,proto3" json:"rx_packets_per_dr,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // Error count. - Errors map[string]uint32 `protobuf:"bytes,7,rep,name=errors,proto3" json:"errors,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + // Name. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Value. + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` } -func (x *DeviceStats) Reset() { - *x = DeviceStats{} +func (x *DeviceState) Reset() { + *x = DeviceState{} if protoimpl.UnsafeEnabled { mi := &file_api_device_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1630,13 +1638,13 @@ func (x *DeviceStats) Reset() { } } -func (x *DeviceStats) String() string { +func (x *DeviceState) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeviceStats) ProtoMessage() {} +func (*DeviceState) ProtoMessage() {} -func (x *DeviceStats) ProtoReflect() protoreflect.Message { +func (x *DeviceState) ProtoReflect() protoreflect.Message { mi := &file_api_device_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1648,54 +1656,187 @@ func (x *DeviceStats) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeviceStats.ProtoReflect.Descriptor instead. -func (*DeviceStats) Descriptor() ([]byte, []int) { +// Deprecated: Use DeviceState.ProtoReflect.Descriptor instead. +func (*DeviceState) Descriptor() ([]byte, []int) { return file_api_device_proto_rawDescGZIP(), []int{25} } -func (x *DeviceStats) GetTime() *timestamppb.Timestamp { +func (x *DeviceState) GetName() string { if x != nil { - return x.Time + return x.Name + } + return "" +} + +func (x *DeviceState) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type GetDeviceLinkMetricsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // DevEUI (EUI64). + DevEui string `protobuf:"bytes,1,opt,name=dev_eui,json=devEui,proto3" json:"dev_eui,omitempty"` + // Interval start timestamp. + Start *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start,proto3" json:"start,omitempty"` + // Interval end timestamp. + End *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=end,proto3" json:"end,omitempty"` + // Aggregation. + Aggregation common.Aggregation `protobuf:"varint,4,opt,name=aggregation,proto3,enum=common.Aggregation" json:"aggregation,omitempty"` +} + +func (x *GetDeviceLinkMetricsRequest) Reset() { + *x = GetDeviceLinkMetricsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_device_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDeviceLinkMetricsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDeviceLinkMetricsRequest) ProtoMessage() {} + +func (x *GetDeviceLinkMetricsRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_device_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDeviceLinkMetricsRequest.ProtoReflect.Descriptor instead. +func (*GetDeviceLinkMetricsRequest) Descriptor() ([]byte, []int) { + return file_api_device_proto_rawDescGZIP(), []int{26} +} + +func (x *GetDeviceLinkMetricsRequest) GetDevEui() string { + if x != nil { + return x.DevEui + } + return "" +} + +func (x *GetDeviceLinkMetricsRequest) GetStart() *timestamppb.Timestamp { + if x != nil { + return x.Start } return nil } -func (x *DeviceStats) GetRxPackets() uint32 { +func (x *GetDeviceLinkMetricsRequest) GetEnd() *timestamppb.Timestamp { + if x != nil { + return x.End + } + return nil +} + +func (x *GetDeviceLinkMetricsRequest) GetAggregation() common.Aggregation { + if x != nil { + return x.Aggregation + } + return common.Aggregation(0) +} + +type GetDeviceLinkMetricsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Packets received from the device. + RxPackets *common.Metric `protobuf:"bytes,1,opt,name=rx_packets,json=rxPackets,proto3" json:"rx_packets,omitempty"` + // RSSI (as reported by the gateway(s)). + GwRssi *common.Metric `protobuf:"bytes,2,opt,name=gw_rssi,json=gwRssi,proto3" json:"gw_rssi,omitempty"` + // SNR (as reported by the gateway(s)). + GwSnr *common.Metric `protobuf:"bytes,3,opt,name=gw_snr,json=gwSnr,proto3" json:"gw_snr,omitempty"` + // Packets received by frequency. + RxPacketsPerFreq *common.Metric `protobuf:"bytes,4,opt,name=rx_packets_per_freq,json=rxPacketsPerFreq,proto3" json:"rx_packets_per_freq,omitempty"` + // Packets received by DR. + RxPacketsPerDr *common.Metric `protobuf:"bytes,5,opt,name=rx_packets_per_dr,json=rxPacketsPerDr,proto3" json:"rx_packets_per_dr,omitempty"` + // Errors. + Errors *common.Metric `protobuf:"bytes,6,opt,name=errors,proto3" json:"errors,omitempty"` +} + +func (x *GetDeviceLinkMetricsResponse) Reset() { + *x = GetDeviceLinkMetricsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_device_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDeviceLinkMetricsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDeviceLinkMetricsResponse) ProtoMessage() {} + +func (x *GetDeviceLinkMetricsResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_device_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDeviceLinkMetricsResponse.ProtoReflect.Descriptor instead. +func (*GetDeviceLinkMetricsResponse) Descriptor() ([]byte, []int) { + return file_api_device_proto_rawDescGZIP(), []int{27} +} + +func (x *GetDeviceLinkMetricsResponse) GetRxPackets() *common.Metric { if x != nil { return x.RxPackets } - return 0 + return nil } -func (x *DeviceStats) GetGwRssi() float32 { +func (x *GetDeviceLinkMetricsResponse) GetGwRssi() *common.Metric { if x != nil { return x.GwRssi } - return 0 -} - -func (x *DeviceStats) GetGwSnr() float32 { - if x != nil { - return x.GwSnr - } - return 0 -} - -func (x *DeviceStats) GetRxPacketsPerFrequency() map[uint32]uint32 { - if x != nil { - return x.RxPacketsPerFrequency - } return nil } -func (x *DeviceStats) GetRxPacketsPerDr() map[uint32]uint32 { +func (x *GetDeviceLinkMetricsResponse) GetGwSnr() *common.Metric { + if x != nil { + return x.GwSnr + } + return nil +} + +func (x *GetDeviceLinkMetricsResponse) GetRxPacketsPerFreq() *common.Metric { + if x != nil { + return x.RxPacketsPerFreq + } + return nil +} + +func (x *GetDeviceLinkMetricsResponse) GetRxPacketsPerDr() *common.Metric { if x != nil { return x.RxPacketsPerDr } return nil } -func (x *DeviceStats) GetErrors() map[string]uint32 { +func (x *GetDeviceLinkMetricsResponse) GetErrors() *common.Metric { if x != nil { return x.Errors } @@ -1733,7 +1874,7 @@ type DeviceQueueItem struct { func (x *DeviceQueueItem) Reset() { *x = DeviceQueueItem{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_proto_msgTypes[26] + mi := &file_api_device_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1746,7 +1887,7 @@ func (x *DeviceQueueItem) String() string { func (*DeviceQueueItem) ProtoMessage() {} func (x *DeviceQueueItem) ProtoReflect() protoreflect.Message { - mi := &file_api_device_proto_msgTypes[26] + mi := &file_api_device_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1759,7 +1900,7 @@ func (x *DeviceQueueItem) ProtoReflect() protoreflect.Message { // Deprecated: Use DeviceQueueItem.ProtoReflect.Descriptor instead. func (*DeviceQueueItem) Descriptor() ([]byte, []int) { - return file_api_device_proto_rawDescGZIP(), []int{26} + return file_api_device_proto_rawDescGZIP(), []int{28} } func (x *DeviceQueueItem) GetId() string { @@ -1829,7 +1970,7 @@ type EnqueueDeviceQueueItemRequest struct { func (x *EnqueueDeviceQueueItemRequest) Reset() { *x = EnqueueDeviceQueueItemRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_proto_msgTypes[27] + mi := &file_api_device_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1842,7 +1983,7 @@ func (x *EnqueueDeviceQueueItemRequest) String() string { func (*EnqueueDeviceQueueItemRequest) ProtoMessage() {} func (x *EnqueueDeviceQueueItemRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_device_proto_msgTypes[27] + mi := &file_api_device_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1855,7 +1996,7 @@ func (x *EnqueueDeviceQueueItemRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EnqueueDeviceQueueItemRequest.ProtoReflect.Descriptor instead. func (*EnqueueDeviceQueueItemRequest) Descriptor() ([]byte, []int) { - return file_api_device_proto_rawDescGZIP(), []int{27} + return file_api_device_proto_rawDescGZIP(), []int{29} } func (x *EnqueueDeviceQueueItemRequest) GetItem() *DeviceQueueItem { @@ -1877,7 +2018,7 @@ type EnqueueDeviceQueueItemResponse struct { func (x *EnqueueDeviceQueueItemResponse) Reset() { *x = EnqueueDeviceQueueItemResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_proto_msgTypes[28] + mi := &file_api_device_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1890,7 +2031,7 @@ func (x *EnqueueDeviceQueueItemResponse) String() string { func (*EnqueueDeviceQueueItemResponse) ProtoMessage() {} func (x *EnqueueDeviceQueueItemResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_device_proto_msgTypes[28] + mi := &file_api_device_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1903,7 +2044,7 @@ func (x *EnqueueDeviceQueueItemResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EnqueueDeviceQueueItemResponse.ProtoReflect.Descriptor instead. func (*EnqueueDeviceQueueItemResponse) Descriptor() ([]byte, []int) { - return file_api_device_proto_rawDescGZIP(), []int{28} + return file_api_device_proto_rawDescGZIP(), []int{30} } func (x *EnqueueDeviceQueueItemResponse) GetId() string { @@ -1925,7 +2066,7 @@ type FlushDeviceQueueRequest struct { func (x *FlushDeviceQueueRequest) Reset() { *x = FlushDeviceQueueRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_proto_msgTypes[29] + mi := &file_api_device_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1938,7 +2079,7 @@ func (x *FlushDeviceQueueRequest) String() string { func (*FlushDeviceQueueRequest) ProtoMessage() {} func (x *FlushDeviceQueueRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_device_proto_msgTypes[29] + mi := &file_api_device_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1951,7 +2092,7 @@ func (x *FlushDeviceQueueRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FlushDeviceQueueRequest.ProtoReflect.Descriptor instead. func (*FlushDeviceQueueRequest) Descriptor() ([]byte, []int) { - return file_api_device_proto_rawDescGZIP(), []int{29} + return file_api_device_proto_rawDescGZIP(), []int{31} } func (x *FlushDeviceQueueRequest) GetDevEui() string { @@ -1975,7 +2116,7 @@ type GetDeviceQueueItemsRequest struct { func (x *GetDeviceQueueItemsRequest) Reset() { *x = GetDeviceQueueItemsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_proto_msgTypes[30] + mi := &file_api_device_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1988,7 +2129,7 @@ func (x *GetDeviceQueueItemsRequest) String() string { func (*GetDeviceQueueItemsRequest) ProtoMessage() {} func (x *GetDeviceQueueItemsRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_device_proto_msgTypes[30] + mi := &file_api_device_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2001,7 +2142,7 @@ func (x *GetDeviceQueueItemsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDeviceQueueItemsRequest.ProtoReflect.Descriptor instead. func (*GetDeviceQueueItemsRequest) Descriptor() ([]byte, []int) { - return file_api_device_proto_rawDescGZIP(), []int{30} + return file_api_device_proto_rawDescGZIP(), []int{32} } func (x *GetDeviceQueueItemsRequest) GetDevEui() string { @@ -2032,7 +2173,7 @@ type GetDeviceQueueItemsResponse struct { func (x *GetDeviceQueueItemsResponse) Reset() { *x = GetDeviceQueueItemsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_proto_msgTypes[31] + mi := &file_api_device_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2045,7 +2186,7 @@ func (x *GetDeviceQueueItemsResponse) String() string { func (*GetDeviceQueueItemsResponse) ProtoMessage() {} func (x *GetDeviceQueueItemsResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_device_proto_msgTypes[31] + mi := &file_api_device_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2058,7 +2199,7 @@ func (x *GetDeviceQueueItemsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDeviceQueueItemsResponse.ProtoReflect.Descriptor instead. func (*GetDeviceQueueItemsResponse) Descriptor() ([]byte, []int) { - return file_api_device_proto_rawDescGZIP(), []int{31} + return file_api_device_proto_rawDescGZIP(), []int{33} } func (x *GetDeviceQueueItemsResponse) GetTotalCount() uint32 { @@ -2087,7 +2228,7 @@ type FlushDevNoncesRequest struct { func (x *FlushDevNoncesRequest) Reset() { *x = FlushDevNoncesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_proto_msgTypes[32] + mi := &file_api_device_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2100,7 +2241,7 @@ func (x *FlushDevNoncesRequest) String() string { func (*FlushDevNoncesRequest) ProtoMessage() {} func (x *FlushDevNoncesRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_device_proto_msgTypes[32] + mi := &file_api_device_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2113,7 +2254,7 @@ func (x *FlushDevNoncesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FlushDevNoncesRequest.ProtoReflect.Descriptor instead. func (*FlushDevNoncesRequest) Descriptor() ([]byte, []int) { - return file_api_device_proto_rawDescGZIP(), []int{32} + return file_api_device_proto_rawDescGZIP(), []int{34} } func (x *FlushDevNoncesRequest) GetDevEui() string { @@ -2127,53 +2268,94 @@ var File_api_device_proto protoreflect.FileDescriptor var file_api_device_proto_rawDesc = []byte{ 0x0a, 0x10, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x03, 0x61, 0x70, 0x69, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xcf, 0x03, 0x0a, 0x06, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x17, + 0x74, 0x6f, 0x12, 0x03, 0x61, 0x70, 0x69, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, + 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcf, 0x03, 0x0a, 0x06, 0x44, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x64, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x66, 0x63, + 0x6e, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, + 0x73, 0x6b, 0x69, 0x70, 0x46, 0x63, 0x6e, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1f, 0x0a, + 0x0b, 0x69, 0x73, 0x5f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x38, + 0x0a, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, + 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x76, + 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, + 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x74, + 0x61, 0x67, 0x73, 0x1a, 0x3c, 0x0a, 0x0e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x37, 0x0a, 0x09, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x7f, 0x0a, 0x0c, 0x44, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x61, + 0x72, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x61, 0x72, 0x67, + 0x69, 0x6e, 0x12, 0x32, 0x0a, 0x15, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x70, + 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x13, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x6f, 0x77, 0x65, 0x72, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, + 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x62, + 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xa7, 0x03, 0x0a, 0x0e, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, - 0x0e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, - 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, - 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x66, 0x63, 0x6e, 0x74, 0x5f, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x73, 0x6b, 0x69, 0x70, 0x46, - 0x63, 0x6e, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x64, - 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, - 0x73, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x09, 0x76, 0x61, 0x72, - 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, - 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, - 0x6c, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, - 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x1a, 0x3c, - 0x0a, 0x0e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x37, 0x0a, 0x09, - 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x7f, 0x0a, 0x0c, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x12, 0x32, 0x0a, - 0x15, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x5f, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x78, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x53, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x5f, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, - 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xa7, 0x03, 0x0a, 0x0e, 0x44, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, - 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, - 0x75, 0x69, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3c, 0x0a, + 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x65, 0x6e, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x2a, 0x0a, 0x11, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x2e, 0x0a, + 0x13, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, + 0x0d, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0c, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x57, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, + 0x65, 0x79, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x12, 0x17, 0x0a, 0x07, + 0x6e, 0x77, 0x6b, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, + 0x77, 0x6b, 0x4b, 0x65, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x70, 0x70, 0x4b, 0x65, 0x79, 0x22, 0x3a, + 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x2b, 0x0a, 0x10, 0x47, 0x65, + 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, + 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x22, 0xa4, 0x02, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, + 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, @@ -2184,196 +2366,176 @@ var file_api_device_proto_rawDesc = []byte{ 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, - 0x53, 0x65, 0x65, 0x6e, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x11, - 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, - 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, - 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x0d, 0x64, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x0c, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x22, 0x57, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x17, - 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x77, 0x6b, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x77, 0x6b, 0x4b, 0x65, 0x79, - 0x12, 0x17, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x61, 0x70, 0x70, 0x4b, 0x65, 0x79, 0x22, 0x3a, 0x0a, 0x13, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x23, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x2b, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, - 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, - 0x75, 0x69, 0x22, 0xa4, 0x02, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x39, 0x0a, - 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x41, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x65, 0x6e, - 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x65, 0x6e, 0x41, - 0x74, 0x12, 0x36, 0x0a, 0x0d, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0c, 0x64, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3a, 0x0a, 0x13, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x23, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x2e, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, - 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, - 0x65, 0x76, 0x45, 0x75, 0x69, 0x22, 0xaf, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x6d, 0x75, 0x6c, - 0x74, 0x69, 0x63, 0x61, 0x73, 0x74, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x61, 0x73, 0x74, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x63, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x44, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, - 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x2b, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, - 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x4b, 0x0a, 0x17, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x0a, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x2f, 0x0a, 0x14, 0x47, 0x65, 0x74, - 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x53, 0x65, 0x65, 0x6e, 0x41, 0x74, 0x12, 0x36, 0x0a, 0x0d, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x0c, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3a, + 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x2e, 0x0a, 0x13, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x22, 0xbf, 0x01, 0x0a, 0x15, 0x47, - 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6b, - 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x22, 0xaf, 0x01, 0x0a, 0x12, 0x4c, + 0x69, 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2c, + 0x0a, 0x12, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x61, 0x73, 0x74, 0x5f, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6d, 0x75, 0x6c, 0x74, + 0x69, 0x63, 0x61, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x63, 0x0a, 0x13, + 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x22, 0x4b, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x0b, + 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, + 0x79, 0x73, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x2f, + 0x0a, 0x14, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, + 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x22, + 0xbf, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x0b, 0x64, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, + 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, - 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x4b, 0x0a, 0x17, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x0a, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x32, 0x0a, 0x17, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x22, 0x4b, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x0b, + 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, + 0x79, 0x73, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x32, + 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, + 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, + 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, + 0x75, 0x69, 0x22, 0xad, 0x02, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, + 0x75, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, + 0x12, 0x19, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x76, 0x41, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x09, 0x61, + 0x70, 0x70, 0x5f, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x70, 0x70, 0x53, 0x4b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x0d, 0x6e, 0x77, 0x6b, 0x5f, 0x73, + 0x5f, 0x65, 0x6e, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x6e, 0x77, 0x6b, 0x53, 0x45, 0x6e, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x0f, 0x73, 0x5f, + 0x6e, 0x77, 0x6b, 0x5f, 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x4e, 0x77, 0x6b, 0x53, 0x49, 0x6e, 0x74, 0x4b, 0x65, 0x79, + 0x12, 0x24, 0x0a, 0x0f, 0x66, 0x5f, 0x6e, 0x77, 0x6b, 0x5f, 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x4e, 0x77, 0x6b, 0x53, + 0x49, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x08, 0x66, 0x5f, 0x63, 0x6e, 0x74, 0x5f, + 0x75, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x66, 0x43, 0x6e, 0x74, 0x55, 0x70, + 0x12, 0x1f, 0x0a, 0x0c, 0x6e, 0x5f, 0x66, 0x5f, 0x63, 0x6e, 0x74, 0x5f, 0x64, 0x6f, 0x77, 0x6e, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x46, 0x43, 0x6e, 0x74, 0x44, 0x6f, 0x77, + 0x6e, 0x12, 0x1f, 0x0a, 0x0c, 0x61, 0x5f, 0x66, 0x5f, 0x63, 0x6e, 0x74, 0x5f, 0x64, 0x6f, 0x77, + 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x61, 0x46, 0x43, 0x6e, 0x74, 0x44, 0x6f, + 0x77, 0x6e, 0x22, 0x5b, 0x0a, 0x15, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x11, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x32, 0x0a, 0x17, 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, + 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, + 0x45, 0x75, 0x69, 0x22, 0x35, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x22, 0x61, 0x0a, 0x1b, 0x47, 0x65, + 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x11, 0x64, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x64, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x32, 0x0a, + 0x17, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x44, 0x65, 0x76, 0x41, 0x64, 0x64, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, + 0x65, 0x75, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, + 0x69, 0x22, 0x35, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x44, 0x65, + 0x76, 0x41, 0x64, 0x64, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x64, 0x65, 0x76, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x64, 0x65, 0x76, 0x41, 0x64, 0x64, 0x72, 0x22, 0xc9, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x22, 0xad, 0x02, - 0x0a, 0x10, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x12, 0x19, 0x0a, 0x08, 0x64, - 0x65, 0x76, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, - 0x65, 0x76, 0x41, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x73, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x53, 0x4b, - 0x65, 0x79, 0x12, 0x21, 0x0a, 0x0d, 0x6e, 0x77, 0x6b, 0x5f, 0x73, 0x5f, 0x65, 0x6e, 0x63, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x77, 0x6b, 0x53, 0x45, - 0x6e, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x0f, 0x73, 0x5f, 0x6e, 0x77, 0x6b, 0x5f, 0x73, - 0x5f, 0x69, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x73, 0x4e, 0x77, 0x6b, 0x53, 0x49, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x0f, 0x66, - 0x5f, 0x6e, 0x77, 0x6b, 0x5f, 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x4e, 0x77, 0x6b, 0x53, 0x49, 0x6e, 0x74, 0x4b, 0x65, - 0x79, 0x12, 0x18, 0x0a, 0x08, 0x66, 0x5f, 0x63, 0x6e, 0x74, 0x5f, 0x75, 0x70, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x06, 0x66, 0x43, 0x6e, 0x74, 0x55, 0x70, 0x12, 0x1f, 0x0a, 0x0c, 0x6e, - 0x5f, 0x66, 0x5f, 0x63, 0x6e, 0x74, 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x09, 0x6e, 0x46, 0x43, 0x6e, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x12, 0x1f, 0x0a, 0x0c, - 0x61, 0x5f, 0x66, 0x5f, 0x63, 0x6e, 0x74, 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x09, 0x61, 0x46, 0x43, 0x6e, 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x22, 0x5b, 0x0a, - 0x15, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x11, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, - 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x32, 0x0a, 0x17, 0x44, 0x65, - 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x22, 0x35, - 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x12, 0x30, 0x0a, + 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, + 0x2c, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x35, 0x0a, + 0x0b, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xbc, 0x02, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x44, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x41, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, + 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x65, 0x73, 0x1a, 0x4a, 0x0a, 0x0c, 0x4d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4b, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x37, 0x0a, 0x0b, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xcd, 0x01, 0x0a, + 0x1b, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, - 0x65, 0x76, 0x45, 0x75, 0x69, 0x22, 0x61, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x11, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, - 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x74, 0x69, - 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, - 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x32, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x52, - 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x44, 0x65, 0x76, 0x41, 0x64, 0x64, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x22, 0x35, 0x0a, 0x18, - 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x44, 0x65, 0x76, 0x41, 0x64, 0x64, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x76, 0x41, - 0x64, 0x64, 0x72, 0x22, 0x90, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, - 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x12, 0x30, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0x42, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x28, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x73, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xc1, 0x04, 0x0a, 0x0b, 0x44, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x78, - 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, - 0x72, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x77, 0x5f, - 0x72, 0x73, 0x73, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x67, 0x77, 0x52, 0x73, - 0x73, 0x69, 0x12, 0x15, 0x0a, 0x06, 0x67, 0x77, 0x5f, 0x73, 0x6e, 0x72, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x02, 0x52, 0x05, 0x67, 0x77, 0x53, 0x6e, 0x72, 0x12, 0x64, 0x0a, 0x18, 0x72, 0x78, 0x5f, - 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x66, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x52, 0x78, - 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x46, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x6e, 0x63, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x15, 0x72, 0x78, 0x50, 0x61, 0x63, 0x6b, - 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x46, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x12, - 0x4f, 0x0a, 0x11, 0x72, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x5f, 0x70, 0x65, - 0x72, 0x5f, 0x64, 0x72, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x52, 0x78, 0x50, - 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x44, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x0e, 0x72, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x44, 0x72, - 0x12, 0x34, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x1a, 0x48, 0x0a, 0x1a, 0x52, 0x78, 0x50, 0x61, 0x63, 0x6b, - 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x46, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x1a, 0x41, 0x0a, 0x13, 0x52, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, - 0x44, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xf1, + 0x65, 0x76, 0x45, 0x75, 0x69, 0x12, 0x30, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x35, 0x0a, 0x0b, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0b, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xbf, 0x02, 0x0a, + 0x1c, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, + 0x0a, 0x72, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x52, 0x09, 0x72, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x27, 0x0a, 0x07, + 0x67, 0x77, 0x5f, 0x72, 0x73, 0x73, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x06, 0x67, + 0x77, 0x52, 0x73, 0x73, 0x69, 0x12, 0x25, 0x0a, 0x06, 0x67, 0x77, 0x5f, 0x73, 0x6e, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x05, 0x67, 0x77, 0x53, 0x6e, 0x72, 0x12, 0x3d, 0x0a, 0x13, + 0x72, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x66, + 0x72, 0x65, 0x71, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x10, 0x72, 0x78, 0x50, 0x61, 0x63, + 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x46, 0x72, 0x65, 0x71, 0x12, 0x39, 0x0a, 0x11, 0x72, + 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x64, 0x72, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x0e, 0x72, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, + 0x73, 0x50, 0x65, 0x72, 0x44, 0x72, 0x12, 0x26, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x22, 0xf1, 0x01, 0x0a, 0x0f, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x51, 0x75, 0x65, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, 0x02, 0x20, @@ -2415,7 +2577,7 @@ var file_api_device_proto_rawDesc = []byte{ 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x30, 0x0a, 0x15, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x44, 0x65, 0x76, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x32, 0x81, 0x0a, 0x0a, 0x0d, 0x44, 0x65, + 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x32, 0xe0, 0x0a, 0x0a, 0x0d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, @@ -2476,32 +2638,38 @@ var file_api_device_proto_rawDesc = []byte{ 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x44, 0x65, 0x76, 0x41, 0x64, 0x64, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x44, 0x65, 0x76, 0x41, 0x64, 0x64, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x08, 0x47, 0x65, 0x74, - 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x44, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x54, 0x0a, 0x07, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x12, 0x22, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x51, - 0x75, 0x65, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x44, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x51, 0x75, 0x65, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0a, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x51, - 0x75, 0x65, 0x75, 0x65, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x6c, 0x75, 0x73, 0x68, - 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x51, 0x75, 0x65, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x08, - 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0a, 0x47, 0x65, 0x74, + 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, + 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, + 0x6b, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, + 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x54, 0x0a, 0x07, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x12, 0x22, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x51, 0x75, + 0x65, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x51, 0x75, 0x65, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0a, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x51, 0x75, + 0x65, 0x75, 0x65, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x51, 0x75, 0x65, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x08, 0x47, + 0x65, 0x74, 0x51, 0x75, 0x65, 0x75, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, + 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x51, 0x75, 0x65, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x51, 0x75, 0x65, 0x75, 0x65, 0x49, 0x74, 0x65, - 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x51, 0x75, 0x65, 0x75, 0x65, 0x49, 0x74, - 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x52, 0x0a, - 0x11, 0x69, 0x6f, 0x2e, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x61, - 0x70, 0x69, 0x42, 0x0b, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, - 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, - 0x61, 0x63, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x34, 0x2f, 0x61, 0x70, - 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x52, 0x0a, 0x11, + 0x69, 0x6f, 0x2e, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x61, 0x70, + 0x69, 0x42, 0x0b, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x69, + 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, + 0x63, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x34, 0x2f, 0x61, 0x70, 0x69, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2516,7 +2684,7 @@ func file_api_device_proto_rawDescGZIP() []byte { return file_api_device_proto_rawDescData } -var file_api_device_proto_msgTypes = make([]protoimpl.MessageInfo, 38) +var file_api_device_proto_msgTypes = make([]protoimpl.MessageInfo, 39) var file_api_device_proto_goTypes = []interface{}{ (*Device)(nil), // 0: api.Device (*DeviceStatus)(nil), // 1: api.DeviceStatus @@ -2541,98 +2709,112 @@ var file_api_device_proto_goTypes = []interface{}{ (*GetDeviceActivationResponse)(nil), // 20: api.GetDeviceActivationResponse (*GetRandomDevAddrRequest)(nil), // 21: api.GetRandomDevAddrRequest (*GetRandomDevAddrResponse)(nil), // 22: api.GetRandomDevAddrResponse - (*GetDeviceStatsRequest)(nil), // 23: api.GetDeviceStatsRequest - (*GetDeviceStatsResponse)(nil), // 24: api.GetDeviceStatsResponse - (*DeviceStats)(nil), // 25: api.DeviceStats - (*DeviceQueueItem)(nil), // 26: api.DeviceQueueItem - (*EnqueueDeviceQueueItemRequest)(nil), // 27: api.EnqueueDeviceQueueItemRequest - (*EnqueueDeviceQueueItemResponse)(nil), // 28: api.EnqueueDeviceQueueItemResponse - (*FlushDeviceQueueRequest)(nil), // 29: api.FlushDeviceQueueRequest - (*GetDeviceQueueItemsRequest)(nil), // 30: api.GetDeviceQueueItemsRequest - (*GetDeviceQueueItemsResponse)(nil), // 31: api.GetDeviceQueueItemsResponse - (*FlushDevNoncesRequest)(nil), // 32: api.FlushDevNoncesRequest - nil, // 33: api.Device.VariablesEntry - nil, // 34: api.Device.TagsEntry - nil, // 35: api.DeviceStats.RxPacketsPerFrequencyEntry - nil, // 36: api.DeviceStats.RxPacketsPerDrEntry - nil, // 37: api.DeviceStats.ErrorsEntry - (*timestamppb.Timestamp)(nil), // 38: google.protobuf.Timestamp - (*structpb.Struct)(nil), // 39: google.protobuf.Struct - (*emptypb.Empty)(nil), // 40: google.protobuf.Empty + (*GetDeviceMetricsRequest)(nil), // 23: api.GetDeviceMetricsRequest + (*GetDeviceMetricsResponse)(nil), // 24: api.GetDeviceMetricsResponse + (*DeviceState)(nil), // 25: api.DeviceState + (*GetDeviceLinkMetricsRequest)(nil), // 26: api.GetDeviceLinkMetricsRequest + (*GetDeviceLinkMetricsResponse)(nil), // 27: api.GetDeviceLinkMetricsResponse + (*DeviceQueueItem)(nil), // 28: api.DeviceQueueItem + (*EnqueueDeviceQueueItemRequest)(nil), // 29: api.EnqueueDeviceQueueItemRequest + (*EnqueueDeviceQueueItemResponse)(nil), // 30: api.EnqueueDeviceQueueItemResponse + (*FlushDeviceQueueRequest)(nil), // 31: api.FlushDeviceQueueRequest + (*GetDeviceQueueItemsRequest)(nil), // 32: api.GetDeviceQueueItemsRequest + (*GetDeviceQueueItemsResponse)(nil), // 33: api.GetDeviceQueueItemsResponse + (*FlushDevNoncesRequest)(nil), // 34: api.FlushDevNoncesRequest + nil, // 35: api.Device.VariablesEntry + nil, // 36: api.Device.TagsEntry + nil, // 37: api.GetDeviceMetricsResponse.MetricsEntry + nil, // 38: api.GetDeviceMetricsResponse.StatesEntry + (*timestamppb.Timestamp)(nil), // 39: google.protobuf.Timestamp + (common.Aggregation)(0), // 40: common.Aggregation + (*common.Metric)(nil), // 41: common.Metric + (*structpb.Struct)(nil), // 42: google.protobuf.Struct + (*emptypb.Empty)(nil), // 43: google.protobuf.Empty } var file_api_device_proto_depIdxs = []int32{ - 33, // 0: api.Device.variables:type_name -> api.Device.VariablesEntry - 34, // 1: api.Device.tags:type_name -> api.Device.TagsEntry - 38, // 2: api.DeviceListItem.created_at:type_name -> google.protobuf.Timestamp - 38, // 3: api.DeviceListItem.updated_at:type_name -> google.protobuf.Timestamp - 38, // 4: api.DeviceListItem.last_seen_at:type_name -> google.protobuf.Timestamp + 35, // 0: api.Device.variables:type_name -> api.Device.VariablesEntry + 36, // 1: api.Device.tags:type_name -> api.Device.TagsEntry + 39, // 2: api.DeviceListItem.created_at:type_name -> google.protobuf.Timestamp + 39, // 3: api.DeviceListItem.updated_at:type_name -> google.protobuf.Timestamp + 39, // 4: api.DeviceListItem.last_seen_at:type_name -> google.protobuf.Timestamp 1, // 5: api.DeviceListItem.device_status:type_name -> api.DeviceStatus 0, // 6: api.CreateDeviceRequest.device:type_name -> api.Device 0, // 7: api.GetDeviceResponse.device:type_name -> api.Device - 38, // 8: api.GetDeviceResponse.created_at:type_name -> google.protobuf.Timestamp - 38, // 9: api.GetDeviceResponse.updated_at:type_name -> google.protobuf.Timestamp - 38, // 10: api.GetDeviceResponse.last_seen_at:type_name -> google.protobuf.Timestamp + 39, // 8: api.GetDeviceResponse.created_at:type_name -> google.protobuf.Timestamp + 39, // 9: api.GetDeviceResponse.updated_at:type_name -> google.protobuf.Timestamp + 39, // 10: api.GetDeviceResponse.last_seen_at:type_name -> google.protobuf.Timestamp 1, // 11: api.GetDeviceResponse.device_status:type_name -> api.DeviceStatus 0, // 12: api.UpdateDeviceRequest.device:type_name -> api.Device 2, // 13: api.ListDevicesResponse.result:type_name -> api.DeviceListItem 3, // 14: api.CreateDeviceKeysRequest.device_keys:type_name -> api.DeviceKeys 3, // 15: api.GetDeviceKeysResponse.device_keys:type_name -> api.DeviceKeys - 38, // 16: api.GetDeviceKeysResponse.created_at:type_name -> google.protobuf.Timestamp - 38, // 17: api.GetDeviceKeysResponse.updated_at:type_name -> google.protobuf.Timestamp + 39, // 16: api.GetDeviceKeysResponse.created_at:type_name -> google.protobuf.Timestamp + 39, // 17: api.GetDeviceKeysResponse.updated_at:type_name -> google.protobuf.Timestamp 3, // 18: api.UpdateDeviceKeysRequest.device_keys:type_name -> api.DeviceKeys 16, // 19: api.ActivateDeviceRequest.device_activation:type_name -> api.DeviceActivation 16, // 20: api.GetDeviceActivationResponse.device_activation:type_name -> api.DeviceActivation - 38, // 21: api.GetDeviceStatsRequest.start:type_name -> google.protobuf.Timestamp - 38, // 22: api.GetDeviceStatsRequest.end:type_name -> google.protobuf.Timestamp - 25, // 23: api.GetDeviceStatsResponse.result:type_name -> api.DeviceStats - 38, // 24: api.DeviceStats.time:type_name -> google.protobuf.Timestamp - 35, // 25: api.DeviceStats.rx_packets_per_frequency:type_name -> api.DeviceStats.RxPacketsPerFrequencyEntry - 36, // 26: api.DeviceStats.rx_packets_per_dr:type_name -> api.DeviceStats.RxPacketsPerDrEntry - 37, // 27: api.DeviceStats.errors:type_name -> api.DeviceStats.ErrorsEntry - 39, // 28: api.DeviceQueueItem.object:type_name -> google.protobuf.Struct - 26, // 29: api.EnqueueDeviceQueueItemRequest.item:type_name -> api.DeviceQueueItem - 26, // 30: api.GetDeviceQueueItemsResponse.result:type_name -> api.DeviceQueueItem - 4, // 31: api.DeviceService.Create:input_type -> api.CreateDeviceRequest - 5, // 32: api.DeviceService.Get:input_type -> api.GetDeviceRequest - 7, // 33: api.DeviceService.Update:input_type -> api.UpdateDeviceRequest - 8, // 34: api.DeviceService.Delete:input_type -> api.DeleteDeviceRequest - 9, // 35: api.DeviceService.List:input_type -> api.ListDevicesRequest - 11, // 36: api.DeviceService.CreateKeys:input_type -> api.CreateDeviceKeysRequest - 12, // 37: api.DeviceService.GetKeys:input_type -> api.GetDeviceKeysRequest - 14, // 38: api.DeviceService.UpdateKeys:input_type -> api.UpdateDeviceKeysRequest - 15, // 39: api.DeviceService.DeleteKeys:input_type -> api.DeleteDeviceKeysRequest - 32, // 40: api.DeviceService.FlushDevNonces:input_type -> api.FlushDevNoncesRequest - 17, // 41: api.DeviceService.Activate:input_type -> api.ActivateDeviceRequest - 18, // 42: api.DeviceService.Deactivate:input_type -> api.DeactivateDeviceRequest - 19, // 43: api.DeviceService.GetActivation:input_type -> api.GetDeviceActivationRequest - 21, // 44: api.DeviceService.GetRandomDevAddr:input_type -> api.GetRandomDevAddrRequest - 23, // 45: api.DeviceService.GetStats:input_type -> api.GetDeviceStatsRequest - 27, // 46: api.DeviceService.Enqueue:input_type -> api.EnqueueDeviceQueueItemRequest - 29, // 47: api.DeviceService.FlushQueue:input_type -> api.FlushDeviceQueueRequest - 30, // 48: api.DeviceService.GetQueue:input_type -> api.GetDeviceQueueItemsRequest - 40, // 49: api.DeviceService.Create:output_type -> google.protobuf.Empty - 6, // 50: api.DeviceService.Get:output_type -> api.GetDeviceResponse - 40, // 51: api.DeviceService.Update:output_type -> google.protobuf.Empty - 40, // 52: api.DeviceService.Delete:output_type -> google.protobuf.Empty - 10, // 53: api.DeviceService.List:output_type -> api.ListDevicesResponse - 40, // 54: api.DeviceService.CreateKeys:output_type -> google.protobuf.Empty - 13, // 55: api.DeviceService.GetKeys:output_type -> api.GetDeviceKeysResponse - 40, // 56: api.DeviceService.UpdateKeys:output_type -> google.protobuf.Empty - 40, // 57: api.DeviceService.DeleteKeys:output_type -> google.protobuf.Empty - 40, // 58: api.DeviceService.FlushDevNonces:output_type -> google.protobuf.Empty - 40, // 59: api.DeviceService.Activate:output_type -> google.protobuf.Empty - 40, // 60: api.DeviceService.Deactivate:output_type -> google.protobuf.Empty - 20, // 61: api.DeviceService.GetActivation:output_type -> api.GetDeviceActivationResponse - 22, // 62: api.DeviceService.GetRandomDevAddr:output_type -> api.GetRandomDevAddrResponse - 24, // 63: api.DeviceService.GetStats:output_type -> api.GetDeviceStatsResponse - 28, // 64: api.DeviceService.Enqueue:output_type -> api.EnqueueDeviceQueueItemResponse - 40, // 65: api.DeviceService.FlushQueue:output_type -> google.protobuf.Empty - 31, // 66: api.DeviceService.GetQueue:output_type -> api.GetDeviceQueueItemsResponse - 49, // [49:67] is the sub-list for method output_type - 31, // [31:49] is the sub-list for method input_type - 31, // [31:31] is the sub-list for extension type_name - 31, // [31:31] is the sub-list for extension extendee - 0, // [0:31] is the sub-list for field type_name + 39, // 21: api.GetDeviceMetricsRequest.start:type_name -> google.protobuf.Timestamp + 39, // 22: api.GetDeviceMetricsRequest.end:type_name -> google.protobuf.Timestamp + 40, // 23: api.GetDeviceMetricsRequest.aggregation:type_name -> common.Aggregation + 37, // 24: api.GetDeviceMetricsResponse.metrics:type_name -> api.GetDeviceMetricsResponse.MetricsEntry + 38, // 25: api.GetDeviceMetricsResponse.states:type_name -> api.GetDeviceMetricsResponse.StatesEntry + 39, // 26: api.GetDeviceLinkMetricsRequest.start:type_name -> google.protobuf.Timestamp + 39, // 27: api.GetDeviceLinkMetricsRequest.end:type_name -> google.protobuf.Timestamp + 40, // 28: api.GetDeviceLinkMetricsRequest.aggregation:type_name -> common.Aggregation + 41, // 29: api.GetDeviceLinkMetricsResponse.rx_packets:type_name -> common.Metric + 41, // 30: api.GetDeviceLinkMetricsResponse.gw_rssi:type_name -> common.Metric + 41, // 31: api.GetDeviceLinkMetricsResponse.gw_snr:type_name -> common.Metric + 41, // 32: api.GetDeviceLinkMetricsResponse.rx_packets_per_freq:type_name -> common.Metric + 41, // 33: api.GetDeviceLinkMetricsResponse.rx_packets_per_dr:type_name -> common.Metric + 41, // 34: api.GetDeviceLinkMetricsResponse.errors:type_name -> common.Metric + 42, // 35: api.DeviceQueueItem.object:type_name -> google.protobuf.Struct + 28, // 36: api.EnqueueDeviceQueueItemRequest.item:type_name -> api.DeviceQueueItem + 28, // 37: api.GetDeviceQueueItemsResponse.result:type_name -> api.DeviceQueueItem + 41, // 38: api.GetDeviceMetricsResponse.MetricsEntry.value:type_name -> common.Metric + 25, // 39: api.GetDeviceMetricsResponse.StatesEntry.value:type_name -> api.DeviceState + 4, // 40: api.DeviceService.Create:input_type -> api.CreateDeviceRequest + 5, // 41: api.DeviceService.Get:input_type -> api.GetDeviceRequest + 7, // 42: api.DeviceService.Update:input_type -> api.UpdateDeviceRequest + 8, // 43: api.DeviceService.Delete:input_type -> api.DeleteDeviceRequest + 9, // 44: api.DeviceService.List:input_type -> api.ListDevicesRequest + 11, // 45: api.DeviceService.CreateKeys:input_type -> api.CreateDeviceKeysRequest + 12, // 46: api.DeviceService.GetKeys:input_type -> api.GetDeviceKeysRequest + 14, // 47: api.DeviceService.UpdateKeys:input_type -> api.UpdateDeviceKeysRequest + 15, // 48: api.DeviceService.DeleteKeys:input_type -> api.DeleteDeviceKeysRequest + 34, // 49: api.DeviceService.FlushDevNonces:input_type -> api.FlushDevNoncesRequest + 17, // 50: api.DeviceService.Activate:input_type -> api.ActivateDeviceRequest + 18, // 51: api.DeviceService.Deactivate:input_type -> api.DeactivateDeviceRequest + 19, // 52: api.DeviceService.GetActivation:input_type -> api.GetDeviceActivationRequest + 21, // 53: api.DeviceService.GetRandomDevAddr:input_type -> api.GetRandomDevAddrRequest + 23, // 54: api.DeviceService.GetMetrics:input_type -> api.GetDeviceMetricsRequest + 26, // 55: api.DeviceService.GetLinkMetrics:input_type -> api.GetDeviceLinkMetricsRequest + 29, // 56: api.DeviceService.Enqueue:input_type -> api.EnqueueDeviceQueueItemRequest + 31, // 57: api.DeviceService.FlushQueue:input_type -> api.FlushDeviceQueueRequest + 32, // 58: api.DeviceService.GetQueue:input_type -> api.GetDeviceQueueItemsRequest + 43, // 59: api.DeviceService.Create:output_type -> google.protobuf.Empty + 6, // 60: api.DeviceService.Get:output_type -> api.GetDeviceResponse + 43, // 61: api.DeviceService.Update:output_type -> google.protobuf.Empty + 43, // 62: api.DeviceService.Delete:output_type -> google.protobuf.Empty + 10, // 63: api.DeviceService.List:output_type -> api.ListDevicesResponse + 43, // 64: api.DeviceService.CreateKeys:output_type -> google.protobuf.Empty + 13, // 65: api.DeviceService.GetKeys:output_type -> api.GetDeviceKeysResponse + 43, // 66: api.DeviceService.UpdateKeys:output_type -> google.protobuf.Empty + 43, // 67: api.DeviceService.DeleteKeys:output_type -> google.protobuf.Empty + 43, // 68: api.DeviceService.FlushDevNonces:output_type -> google.protobuf.Empty + 43, // 69: api.DeviceService.Activate:output_type -> google.protobuf.Empty + 43, // 70: api.DeviceService.Deactivate:output_type -> google.protobuf.Empty + 20, // 71: api.DeviceService.GetActivation:output_type -> api.GetDeviceActivationResponse + 22, // 72: api.DeviceService.GetRandomDevAddr:output_type -> api.GetRandomDevAddrResponse + 24, // 73: api.DeviceService.GetMetrics:output_type -> api.GetDeviceMetricsResponse + 27, // 74: api.DeviceService.GetLinkMetrics:output_type -> api.GetDeviceLinkMetricsResponse + 30, // 75: api.DeviceService.Enqueue:output_type -> api.EnqueueDeviceQueueItemResponse + 43, // 76: api.DeviceService.FlushQueue:output_type -> google.protobuf.Empty + 33, // 77: api.DeviceService.GetQueue:output_type -> api.GetDeviceQueueItemsResponse + 59, // [59:78] is the sub-list for method output_type + 40, // [40:59] is the sub-list for method input_type + 40, // [40:40] is the sub-list for extension type_name + 40, // [40:40] is the sub-list for extension extendee + 0, // [0:40] is the sub-list for field type_name } func init() { file_api_device_proto_init() } @@ -2918,7 +3100,7 @@ func file_api_device_proto_init() { } } file_api_device_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDeviceStatsRequest); i { + switch v := v.(*GetDeviceMetricsRequest); i { case 0: return &v.state case 1: @@ -2930,7 +3112,7 @@ func file_api_device_proto_init() { } } file_api_device_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDeviceStatsResponse); i { + switch v := v.(*GetDeviceMetricsResponse); i { case 0: return &v.state case 1: @@ -2942,7 +3124,7 @@ func file_api_device_proto_init() { } } file_api_device_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeviceStats); i { + switch v := v.(*DeviceState); i { case 0: return &v.state case 1: @@ -2954,7 +3136,7 @@ func file_api_device_proto_init() { } } file_api_device_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeviceQueueItem); i { + switch v := v.(*GetDeviceLinkMetricsRequest); i { case 0: return &v.state case 1: @@ -2966,7 +3148,7 @@ func file_api_device_proto_init() { } } file_api_device_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EnqueueDeviceQueueItemRequest); i { + switch v := v.(*GetDeviceLinkMetricsResponse); i { case 0: return &v.state case 1: @@ -2978,7 +3160,7 @@ func file_api_device_proto_init() { } } file_api_device_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EnqueueDeviceQueueItemResponse); i { + switch v := v.(*DeviceQueueItem); i { case 0: return &v.state case 1: @@ -2990,7 +3172,7 @@ func file_api_device_proto_init() { } } file_api_device_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FlushDeviceQueueRequest); i { + switch v := v.(*EnqueueDeviceQueueItemRequest); i { case 0: return &v.state case 1: @@ -3002,7 +3184,7 @@ func file_api_device_proto_init() { } } file_api_device_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDeviceQueueItemsRequest); i { + switch v := v.(*EnqueueDeviceQueueItemResponse); i { case 0: return &v.state case 1: @@ -3014,7 +3196,7 @@ func file_api_device_proto_init() { } } file_api_device_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDeviceQueueItemsResponse); i { + switch v := v.(*FlushDeviceQueueRequest); i { case 0: return &v.state case 1: @@ -3026,6 +3208,30 @@ func file_api_device_proto_init() { } } file_api_device_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDeviceQueueItemsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_device_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDeviceQueueItemsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_device_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FlushDevNoncesRequest); i { case 0: return &v.state @@ -3044,7 +3250,7 @@ func file_api_device_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_device_proto_rawDesc, NumEnums: 0, - NumMessages: 38, + NumMessages: 39, NumExtensions: 0, NumServices: 1, }, diff --git a/api/go/api/device_grpc.pb.go b/api/go/api/device_grpc.pb.go index cd4ae4fb..b42fade8 100644 --- a/api/go/api/device_grpc.pb.go +++ b/api/go/api/device_grpc.pb.go @@ -51,8 +51,12 @@ type DeviceServiceClient interface { GetActivation(ctx context.Context, in *GetDeviceActivationRequest, opts ...grpc.CallOption) (*GetDeviceActivationResponse, error) // GetRandomDevAddr returns a random DevAddr taking the NwkID prefix into account. GetRandomDevAddr(ctx context.Context, in *GetRandomDevAddrRequest, opts ...grpc.CallOption) (*GetRandomDevAddrResponse, error) - // GetStats returns the device stats. - GetStats(ctx context.Context, in *GetDeviceStatsRequest, opts ...grpc.CallOption) (*GetDeviceStatsResponse, error) + // GetMetrics returns the device metrics. + // Note that this requires a device-profile with codec and measurements configured. + GetMetrics(ctx context.Context, in *GetDeviceMetricsRequest, opts ...grpc.CallOption) (*GetDeviceMetricsResponse, error) + // GetLinkMetrics returns the device link metrics. + // This includes uplinks, downlinks, RSSI, SNR, etc... + GetLinkMetrics(ctx context.Context, in *GetDeviceLinkMetricsRequest, opts ...grpc.CallOption) (*GetDeviceLinkMetricsResponse, error) // Enqueue adds the given item to the downlink queue. Enqueue(ctx context.Context, in *EnqueueDeviceQueueItemRequest, opts ...grpc.CallOption) (*EnqueueDeviceQueueItemResponse, error) // FlushQueue flushes the downlink device-queue. @@ -195,9 +199,18 @@ func (c *deviceServiceClient) GetRandomDevAddr(ctx context.Context, in *GetRando return out, nil } -func (c *deviceServiceClient) GetStats(ctx context.Context, in *GetDeviceStatsRequest, opts ...grpc.CallOption) (*GetDeviceStatsResponse, error) { - out := new(GetDeviceStatsResponse) - err := c.cc.Invoke(ctx, "/api.DeviceService/GetStats", in, out, opts...) +func (c *deviceServiceClient) GetMetrics(ctx context.Context, in *GetDeviceMetricsRequest, opts ...grpc.CallOption) (*GetDeviceMetricsResponse, error) { + out := new(GetDeviceMetricsResponse) + err := c.cc.Invoke(ctx, "/api.DeviceService/GetMetrics", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetLinkMetrics(ctx context.Context, in *GetDeviceLinkMetricsRequest, opts ...grpc.CallOption) (*GetDeviceLinkMetricsResponse, error) { + out := new(GetDeviceLinkMetricsResponse) + err := c.cc.Invoke(ctx, "/api.DeviceService/GetLinkMetrics", in, out, opts...) if err != nil { return nil, err } @@ -263,8 +276,12 @@ type DeviceServiceServer interface { GetActivation(context.Context, *GetDeviceActivationRequest) (*GetDeviceActivationResponse, error) // GetRandomDevAddr returns a random DevAddr taking the NwkID prefix into account. GetRandomDevAddr(context.Context, *GetRandomDevAddrRequest) (*GetRandomDevAddrResponse, error) - // GetStats returns the device stats. - GetStats(context.Context, *GetDeviceStatsRequest) (*GetDeviceStatsResponse, error) + // GetMetrics returns the device metrics. + // Note that this requires a device-profile with codec and measurements configured. + GetMetrics(context.Context, *GetDeviceMetricsRequest) (*GetDeviceMetricsResponse, error) + // GetLinkMetrics returns the device link metrics. + // This includes uplinks, downlinks, RSSI, SNR, etc... + GetLinkMetrics(context.Context, *GetDeviceLinkMetricsRequest) (*GetDeviceLinkMetricsResponse, error) // Enqueue adds the given item to the downlink queue. Enqueue(context.Context, *EnqueueDeviceQueueItemRequest) (*EnqueueDeviceQueueItemResponse, error) // FlushQueue flushes the downlink device-queue. @@ -320,8 +337,11 @@ func (UnimplementedDeviceServiceServer) GetActivation(context.Context, *GetDevic func (UnimplementedDeviceServiceServer) GetRandomDevAddr(context.Context, *GetRandomDevAddrRequest) (*GetRandomDevAddrResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetRandomDevAddr not implemented") } -func (UnimplementedDeviceServiceServer) GetStats(context.Context, *GetDeviceStatsRequest) (*GetDeviceStatsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetStats not implemented") +func (UnimplementedDeviceServiceServer) GetMetrics(context.Context, *GetDeviceMetricsRequest) (*GetDeviceMetricsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMetrics not implemented") +} +func (UnimplementedDeviceServiceServer) GetLinkMetrics(context.Context, *GetDeviceLinkMetricsRequest) (*GetDeviceLinkMetricsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLinkMetrics not implemented") } func (UnimplementedDeviceServiceServer) Enqueue(context.Context, *EnqueueDeviceQueueItemRequest) (*EnqueueDeviceQueueItemResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Enqueue not implemented") @@ -597,20 +617,38 @@ func _DeviceService_GetRandomDevAddr_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } -func _DeviceService_GetStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDeviceStatsRequest) +func _DeviceService_GetMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDeviceMetricsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(DeviceServiceServer).GetStats(ctx, in) + return srv.(DeviceServiceServer).GetMetrics(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.DeviceService/GetStats", + FullMethod: "/api.DeviceService/GetMetrics", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DeviceServiceServer).GetStats(ctx, req.(*GetDeviceStatsRequest)) + return srv.(DeviceServiceServer).GetMetrics(ctx, req.(*GetDeviceMetricsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetLinkMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDeviceLinkMetricsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetLinkMetrics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.DeviceService/GetLinkMetrics", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetLinkMetrics(ctx, req.(*GetDeviceLinkMetricsRequest)) } return interceptor(ctx, in, info, handler) } @@ -733,8 +771,12 @@ var DeviceService_ServiceDesc = grpc.ServiceDesc{ Handler: _DeviceService_GetRandomDevAddr_Handler, }, { - MethodName: "GetStats", - Handler: _DeviceService_GetStats_Handler, + MethodName: "GetMetrics", + Handler: _DeviceService_GetMetrics_Handler, + }, + { + MethodName: "GetLinkMetrics", + Handler: _DeviceService_GetLinkMetrics_Handler, }, { MethodName: "Enqueue", diff --git a/api/go/api/device_profile.pb.go b/api/go/api/device_profile.pb.go index b7c559a0..919bdee4 100644 --- a/api/go/api/device_profile.pb.go +++ b/api/go/api/device_profile.pb.go @@ -75,6 +75,66 @@ func (CodecRuntime) EnumDescriptor() ([]byte, []int) { return file_api_device_profile_proto_rawDescGZIP(), []int{0} } +type MeasurementKind int32 + +const ( + // Unknown (in which case it is not tracked). + MeasurementKind_UNKNOWN MeasurementKind = 0 + // Incrementing counters that never decrease (these are not reset on each reading). + MeasurementKind_COUNTER MeasurementKind = 1 + // Counters that do get reset upon reading. + MeasurementKind_ABSOLUTE MeasurementKind = 2 + // E.g. a temperature value. + MeasurementKind_GAUGE MeasurementKind = 3 + // E.g. a firmware version, true / false value. + MeasurementKind_STRING MeasurementKind = 4 +) + +// Enum value maps for MeasurementKind. +var ( + MeasurementKind_name = map[int32]string{ + 0: "UNKNOWN", + 1: "COUNTER", + 2: "ABSOLUTE", + 3: "GAUGE", + 4: "STRING", + } + MeasurementKind_value = map[string]int32{ + "UNKNOWN": 0, + "COUNTER": 1, + "ABSOLUTE": 2, + "GAUGE": 3, + "STRING": 4, + } +) + +func (x MeasurementKind) Enum() *MeasurementKind { + p := new(MeasurementKind) + *p = x + return p +} + +func (x MeasurementKind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MeasurementKind) Descriptor() protoreflect.EnumDescriptor { + return file_api_device_profile_proto_enumTypes[1].Descriptor() +} + +func (MeasurementKind) Type() protoreflect.EnumType { + return &file_api_device_profile_proto_enumTypes[1] +} + +func (x MeasurementKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MeasurementKind.Descriptor instead. +func (MeasurementKind) EnumDescriptor() ([]byte, []int) { + return file_api_device_profile_proto_rawDescGZIP(), []int{1} +} + type DeviceProfile struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -140,6 +200,9 @@ type DeviceProfile struct { AbpRx2Freq uint32 `protobuf:"varint,24,opt,name=abp_rx2_freq,json=abpRx2Freq,proto3" json:"abp_rx2_freq,omitempty"` // User defined tags. Tags map[string]string `protobuf:"bytes,25,rep,name=tags,proto3" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Measurements. + // If defined, ChirpStack will visualize these metrics in the web-interface. + Measurements map[string]*Measurement `protobuf:"bytes,27,rep,name=measurements,proto3" json:"measurements,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *DeviceProfile) Reset() { @@ -356,6 +419,70 @@ func (x *DeviceProfile) GetTags() map[string]string { return nil } +func (x *DeviceProfile) GetMeasurements() map[string]*Measurement { + if x != nil { + return x.Measurements + } + return nil +} + +type Measurement struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name (user defined). + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Kind. + Kind MeasurementKind `protobuf:"varint,3,opt,name=kind,proto3,enum=api.MeasurementKind" json:"kind,omitempty"` +} + +func (x *Measurement) Reset() { + *x = Measurement{} + if protoimpl.UnsafeEnabled { + mi := &file_api_device_profile_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Measurement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Measurement) ProtoMessage() {} + +func (x *Measurement) ProtoReflect() protoreflect.Message { + mi := &file_api_device_profile_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Measurement.ProtoReflect.Descriptor instead. +func (*Measurement) Descriptor() ([]byte, []int) { + return file_api_device_profile_proto_rawDescGZIP(), []int{1} +} + +func (x *Measurement) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Measurement) GetKind() MeasurementKind { + if x != nil { + return x.Kind + } + return MeasurementKind_UNKNOWN +} + type DeviceProfileListItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -386,7 +513,7 @@ type DeviceProfileListItem struct { func (x *DeviceProfileListItem) Reset() { *x = DeviceProfileListItem{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_profile_proto_msgTypes[1] + mi := &file_api_device_profile_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -399,7 +526,7 @@ func (x *DeviceProfileListItem) String() string { func (*DeviceProfileListItem) ProtoMessage() {} func (x *DeviceProfileListItem) ProtoReflect() protoreflect.Message { - mi := &file_api_device_profile_proto_msgTypes[1] + mi := &file_api_device_profile_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -412,7 +539,7 @@ func (x *DeviceProfileListItem) ProtoReflect() protoreflect.Message { // Deprecated: Use DeviceProfileListItem.ProtoReflect.Descriptor instead. func (*DeviceProfileListItem) Descriptor() ([]byte, []int) { - return file_api_device_profile_proto_rawDescGZIP(), []int{1} + return file_api_device_profile_proto_rawDescGZIP(), []int{2} } func (x *DeviceProfileListItem) GetId() string { @@ -497,7 +624,7 @@ type CreateDeviceProfileRequest struct { func (x *CreateDeviceProfileRequest) Reset() { *x = CreateDeviceProfileRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_profile_proto_msgTypes[2] + mi := &file_api_device_profile_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -510,7 +637,7 @@ func (x *CreateDeviceProfileRequest) String() string { func (*CreateDeviceProfileRequest) ProtoMessage() {} func (x *CreateDeviceProfileRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_device_profile_proto_msgTypes[2] + mi := &file_api_device_profile_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -523,7 +650,7 @@ func (x *CreateDeviceProfileRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateDeviceProfileRequest.ProtoReflect.Descriptor instead. func (*CreateDeviceProfileRequest) Descriptor() ([]byte, []int) { - return file_api_device_profile_proto_rawDescGZIP(), []int{2} + return file_api_device_profile_proto_rawDescGZIP(), []int{3} } func (x *CreateDeviceProfileRequest) GetDeviceProfile() *DeviceProfile { @@ -545,7 +672,7 @@ type CreateDeviceProfileResponse struct { func (x *CreateDeviceProfileResponse) Reset() { *x = CreateDeviceProfileResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_profile_proto_msgTypes[3] + mi := &file_api_device_profile_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -558,7 +685,7 @@ func (x *CreateDeviceProfileResponse) String() string { func (*CreateDeviceProfileResponse) ProtoMessage() {} func (x *CreateDeviceProfileResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_device_profile_proto_msgTypes[3] + mi := &file_api_device_profile_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -571,7 +698,7 @@ func (x *CreateDeviceProfileResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateDeviceProfileResponse.ProtoReflect.Descriptor instead. func (*CreateDeviceProfileResponse) Descriptor() ([]byte, []int) { - return file_api_device_profile_proto_rawDescGZIP(), []int{3} + return file_api_device_profile_proto_rawDescGZIP(), []int{4} } func (x *CreateDeviceProfileResponse) GetId() string { @@ -593,7 +720,7 @@ type GetDeviceProfileRequest struct { func (x *GetDeviceProfileRequest) Reset() { *x = GetDeviceProfileRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_profile_proto_msgTypes[4] + mi := &file_api_device_profile_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -606,7 +733,7 @@ func (x *GetDeviceProfileRequest) String() string { func (*GetDeviceProfileRequest) ProtoMessage() {} func (x *GetDeviceProfileRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_device_profile_proto_msgTypes[4] + mi := &file_api_device_profile_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -619,7 +746,7 @@ func (x *GetDeviceProfileRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDeviceProfileRequest.ProtoReflect.Descriptor instead. func (*GetDeviceProfileRequest) Descriptor() ([]byte, []int) { - return file_api_device_profile_proto_rawDescGZIP(), []int{4} + return file_api_device_profile_proto_rawDescGZIP(), []int{5} } func (x *GetDeviceProfileRequest) GetId() string { @@ -645,7 +772,7 @@ type GetDeviceProfileResponse struct { func (x *GetDeviceProfileResponse) Reset() { *x = GetDeviceProfileResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_profile_proto_msgTypes[5] + mi := &file_api_device_profile_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -658,7 +785,7 @@ func (x *GetDeviceProfileResponse) String() string { func (*GetDeviceProfileResponse) ProtoMessage() {} func (x *GetDeviceProfileResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_device_profile_proto_msgTypes[5] + mi := &file_api_device_profile_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -671,7 +798,7 @@ func (x *GetDeviceProfileResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDeviceProfileResponse.ProtoReflect.Descriptor instead. func (*GetDeviceProfileResponse) Descriptor() ([]byte, []int) { - return file_api_device_profile_proto_rawDescGZIP(), []int{5} + return file_api_device_profile_proto_rawDescGZIP(), []int{6} } func (x *GetDeviceProfileResponse) GetDeviceProfile() *DeviceProfile { @@ -707,7 +834,7 @@ type UpdateDeviceProfileRequest struct { func (x *UpdateDeviceProfileRequest) Reset() { *x = UpdateDeviceProfileRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_profile_proto_msgTypes[6] + mi := &file_api_device_profile_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -720,7 +847,7 @@ func (x *UpdateDeviceProfileRequest) String() string { func (*UpdateDeviceProfileRequest) ProtoMessage() {} func (x *UpdateDeviceProfileRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_device_profile_proto_msgTypes[6] + mi := &file_api_device_profile_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -733,7 +860,7 @@ func (x *UpdateDeviceProfileRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateDeviceProfileRequest.ProtoReflect.Descriptor instead. func (*UpdateDeviceProfileRequest) Descriptor() ([]byte, []int) { - return file_api_device_profile_proto_rawDescGZIP(), []int{6} + return file_api_device_profile_proto_rawDescGZIP(), []int{7} } func (x *UpdateDeviceProfileRequest) GetDeviceProfile() *DeviceProfile { @@ -755,7 +882,7 @@ type DeleteDeviceProfileRequest struct { func (x *DeleteDeviceProfileRequest) Reset() { *x = DeleteDeviceProfileRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_profile_proto_msgTypes[7] + mi := &file_api_device_profile_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -768,7 +895,7 @@ func (x *DeleteDeviceProfileRequest) String() string { func (*DeleteDeviceProfileRequest) ProtoMessage() {} func (x *DeleteDeviceProfileRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_device_profile_proto_msgTypes[7] + mi := &file_api_device_profile_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -781,7 +908,7 @@ func (x *DeleteDeviceProfileRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteDeviceProfileRequest.ProtoReflect.Descriptor instead. func (*DeleteDeviceProfileRequest) Descriptor() ([]byte, []int) { - return file_api_device_profile_proto_rawDescGZIP(), []int{7} + return file_api_device_profile_proto_rawDescGZIP(), []int{8} } func (x *DeleteDeviceProfileRequest) GetId() string { @@ -809,7 +936,7 @@ type ListDeviceProfilesRequest struct { func (x *ListDeviceProfilesRequest) Reset() { *x = ListDeviceProfilesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_profile_proto_msgTypes[8] + mi := &file_api_device_profile_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -822,7 +949,7 @@ func (x *ListDeviceProfilesRequest) String() string { func (*ListDeviceProfilesRequest) ProtoMessage() {} func (x *ListDeviceProfilesRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_device_profile_proto_msgTypes[8] + mi := &file_api_device_profile_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -835,7 +962,7 @@ func (x *ListDeviceProfilesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListDeviceProfilesRequest.ProtoReflect.Descriptor instead. func (*ListDeviceProfilesRequest) Descriptor() ([]byte, []int) { - return file_api_device_profile_proto_rawDescGZIP(), []int{8} + return file_api_device_profile_proto_rawDescGZIP(), []int{9} } func (x *ListDeviceProfilesRequest) GetLimit() uint32 { @@ -880,7 +1007,7 @@ type ListDeviceProfilesResponse struct { func (x *ListDeviceProfilesResponse) Reset() { *x = ListDeviceProfilesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_profile_proto_msgTypes[9] + mi := &file_api_device_profile_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -893,7 +1020,7 @@ func (x *ListDeviceProfilesResponse) String() string { func (*ListDeviceProfilesResponse) ProtoMessage() {} func (x *ListDeviceProfilesResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_device_profile_proto_msgTypes[9] + mi := &file_api_device_profile_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -906,7 +1033,7 @@ func (x *ListDeviceProfilesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListDeviceProfilesResponse.ProtoReflect.Descriptor instead. func (*ListDeviceProfilesResponse) Descriptor() ([]byte, []int) { - return file_api_device_profile_proto_rawDescGZIP(), []int{9} + return file_api_device_profile_proto_rawDescGZIP(), []int{10} } func (x *ListDeviceProfilesResponse) GetTotalCount() uint32 { @@ -937,7 +1064,7 @@ type ListDeviceProfileAdrAlgorithmsResponse struct { func (x *ListDeviceProfileAdrAlgorithmsResponse) Reset() { *x = ListDeviceProfileAdrAlgorithmsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_profile_proto_msgTypes[10] + mi := &file_api_device_profile_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -950,7 +1077,7 @@ func (x *ListDeviceProfileAdrAlgorithmsResponse) String() string { func (*ListDeviceProfileAdrAlgorithmsResponse) ProtoMessage() {} func (x *ListDeviceProfileAdrAlgorithmsResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_device_profile_proto_msgTypes[10] + mi := &file_api_device_profile_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -963,7 +1090,7 @@ func (x *ListDeviceProfileAdrAlgorithmsResponse) ProtoReflect() protoreflect.Mes // Deprecated: Use ListDeviceProfileAdrAlgorithmsResponse.ProtoReflect.Descriptor instead. func (*ListDeviceProfileAdrAlgorithmsResponse) Descriptor() ([]byte, []int) { - return file_api_device_profile_proto_rawDescGZIP(), []int{10} + return file_api_device_profile_proto_rawDescGZIP(), []int{11} } func (x *ListDeviceProfileAdrAlgorithmsResponse) GetTotalCount() uint32 { @@ -994,7 +1121,7 @@ type AdrAlgorithmListItem struct { func (x *AdrAlgorithmListItem) Reset() { *x = AdrAlgorithmListItem{} if protoimpl.UnsafeEnabled { - mi := &file_api_device_profile_proto_msgTypes[11] + mi := &file_api_device_profile_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1007,7 +1134,7 @@ func (x *AdrAlgorithmListItem) String() string { func (*AdrAlgorithmListItem) ProtoMessage() {} func (x *AdrAlgorithmListItem) ProtoReflect() protoreflect.Message { - mi := &file_api_device_profile_proto_msgTypes[11] + mi := &file_api_device_profile_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1020,7 +1147,7 @@ func (x *AdrAlgorithmListItem) ProtoReflect() protoreflect.Message { // Deprecated: Use AdrAlgorithmListItem.ProtoReflect.Descriptor instead. func (*AdrAlgorithmListItem) Descriptor() ([]byte, []int) { - return file_api_device_profile_proto_rawDescGZIP(), []int{11} + return file_api_device_profile_proto_rawDescGZIP(), []int{12} } func (x *AdrAlgorithmListItem) GetId() string { @@ -1047,7 +1174,7 @@ var file_api_device_profile_proto_rawDesc = []byte{ 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xb9, 0x09, 0x0a, 0x0d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xd6, 0x0a, 0x0a, 0x0d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, @@ -1119,138 +1246,158 @@ var file_api_device_profile_proto_rawDesc = []byte{ 0x72, 0x65, 0x71, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x19, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x04, 0x74, 0x61, 0x67, 0x73, 0x1a, 0x37, 0x0a, 0x09, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd2, - 0x03, 0x0a, 0x15, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, + 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x48, 0x0a, 0x0c, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x1b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, + 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0c, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x1a, + 0x37, 0x0a, 0x09, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x51, 0x0a, 0x11, 0x4d, 0x65, 0x61, 0x73, + 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4b, 0x0a, 0x0b, 0x4d, + 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, + 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4b, 0x69, + 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0xd2, 0x03, 0x0a, 0x15, 0x44, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, + 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x06, + 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, + 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x0b, 0x6d, 0x61, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x4d, 0x61, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x6d, + 0x61, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x13, 0x72, 0x65, 0x67, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x52, 0x65, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x11, 0x72, 0x65, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, + 0x5f, 0x6f, 0x74, 0x61, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x73, 0x75, 0x70, + 0x70, 0x6f, 0x72, 0x74, 0x73, 0x4f, 0x74, 0x61, 0x61, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x75, 0x70, + 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x62, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x43, 0x6c, 0x61, + 0x73, 0x73, 0x42, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5f, + 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x63, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x73, + 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x43, 0x22, 0x57, 0x0a, + 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x0e, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x0d, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x2d, 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x29, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x22, 0xcb, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, + 0x0e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x0d, 0x64, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x67, 0x69, - 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x0b, 0x6d, 0x61, - 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x61, 0x63, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x6d, 0x61, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x49, 0x0a, 0x13, 0x72, 0x65, 0x67, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5f, 0x72, 0x65, - 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x72, 0x65, 0x67, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x75, - 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5f, 0x6f, 0x74, 0x61, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0c, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x4f, 0x74, 0x61, 0x61, 0x12, - 0x28, 0x0a, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5f, 0x63, 0x6c, 0x61, 0x73, - 0x73, 0x5f, 0x62, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6f, - 0x72, 0x74, 0x73, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x42, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x75, 0x70, - 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x63, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x43, 0x6c, 0x61, - 0x73, 0x73, 0x43, 0x22, 0x57, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x39, 0x0a, 0x0e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x0d, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x2d, 0x0a, 0x1b, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x29, 0x0a, 0x17, 0x47, - 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xcb, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x44, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, - 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, - 0x0d, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x39, - 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x41, 0x74, 0x22, 0x57, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x39, 0x0a, 0x0e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, - 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x0d, - 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x2c, 0x0a, - 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, - 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x7e, 0x0a, 0x19, 0x4c, - 0x69, 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x1b, - 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x71, 0x0a, 0x1a, 0x4c, - 0x69, 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x32, 0x0a, 0x06, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4c, 0x69, - 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x7c, - 0x0a, 0x26, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x41, 0x64, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x06, 0x72, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x41, 0x64, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x4c, 0x69, 0x73, 0x74, - 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x3a, 0x0a, 0x14, - 0x41, 0x64, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x4c, 0x69, 0x73, 0x74, - 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x2a, 0x31, 0x0a, 0x0c, 0x43, 0x6f, 0x64, 0x65, - 0x63, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, - 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x41, 0x59, 0x45, 0x4e, 0x4e, 0x45, 0x5f, 0x4c, 0x50, - 0x50, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x4a, 0x53, 0x10, 0x02, 0x32, 0xdc, 0x03, 0x0a, 0x14, - 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x1f, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, - 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x06, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x57, + 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x0e, + 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x0d, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x2c, 0x0a, 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x7e, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x71, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x32, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, + 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x7c, 0x0a, 0x26, 0x4c, 0x69, 0x73, 0x74, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x41, 0x64, 0x72, + 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x64, 0x72, 0x41, 0x6c, 0x67, + 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x3a, 0x0a, 0x14, 0x41, 0x64, 0x72, 0x41, 0x6c, 0x67, + 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x2a, 0x31, 0x0a, 0x0c, 0x43, 0x6f, 0x64, 0x65, 0x63, 0x52, 0x75, 0x6e, 0x74, 0x69, + 0x6d, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, + 0x43, 0x41, 0x59, 0x45, 0x4e, 0x4e, 0x45, 0x5f, 0x4c, 0x50, 0x50, 0x10, 0x01, 0x12, 0x06, 0x0a, + 0x02, 0x4a, 0x53, 0x10, 0x02, 0x2a, 0x50, 0x0a, 0x0f, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, + 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, + 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x42, 0x53, 0x4f, 0x4c, 0x55, 0x54, 0x45, 0x10, 0x02, + 0x12, 0x09, 0x0a, 0x05, 0x47, 0x41, 0x55, 0x47, 0x45, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x53, + 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x32, 0xdc, 0x03, 0x0a, 0x14, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x4d, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x44, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x43, - 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, - 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, - 0x68, 0x6d, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x2b, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x41, 0x64, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x59, 0x0a, 0x11, 0x69, 0x6f, - 0x2e, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x61, 0x70, 0x69, 0x42, - 0x12, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x63, 0x68, 0x69, - 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, - 0x34, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, + 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x06, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, + 0x49, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x11, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x64, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x73, 0x12, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x2b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x41, + 0x64, 0x72, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x59, 0x0a, 0x11, 0x69, 0x6f, 0x2e, 0x63, 0x68, 0x69, + 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x12, 0x44, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, + 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, + 0x61, 0x63, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x34, 0x2f, 0x61, 0x70, + 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1265,64 +1412,70 @@ func file_api_device_profile_proto_rawDescGZIP() []byte { return file_api_device_profile_proto_rawDescData } -var file_api_device_profile_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_api_device_profile_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_api_device_profile_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_api_device_profile_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_api_device_profile_proto_goTypes = []interface{}{ (CodecRuntime)(0), // 0: api.CodecRuntime - (*DeviceProfile)(nil), // 1: api.DeviceProfile - (*DeviceProfileListItem)(nil), // 2: api.DeviceProfileListItem - (*CreateDeviceProfileRequest)(nil), // 3: api.CreateDeviceProfileRequest - (*CreateDeviceProfileResponse)(nil), // 4: api.CreateDeviceProfileResponse - (*GetDeviceProfileRequest)(nil), // 5: api.GetDeviceProfileRequest - (*GetDeviceProfileResponse)(nil), // 6: api.GetDeviceProfileResponse - (*UpdateDeviceProfileRequest)(nil), // 7: api.UpdateDeviceProfileRequest - (*DeleteDeviceProfileRequest)(nil), // 8: api.DeleteDeviceProfileRequest - (*ListDeviceProfilesRequest)(nil), // 9: api.ListDeviceProfilesRequest - (*ListDeviceProfilesResponse)(nil), // 10: api.ListDeviceProfilesResponse - (*ListDeviceProfileAdrAlgorithmsResponse)(nil), // 11: api.ListDeviceProfileAdrAlgorithmsResponse - (*AdrAlgorithmListItem)(nil), // 12: api.AdrAlgorithmListItem - nil, // 13: api.DeviceProfile.TagsEntry - (common.Region)(0), // 14: common.Region - (common.MacVersion)(0), // 15: common.MacVersion - (common.RegParamsRevision)(0), // 16: common.RegParamsRevision - (*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp - (*emptypb.Empty)(nil), // 18: google.protobuf.Empty + (MeasurementKind)(0), // 1: api.MeasurementKind + (*DeviceProfile)(nil), // 2: api.DeviceProfile + (*Measurement)(nil), // 3: api.Measurement + (*DeviceProfileListItem)(nil), // 4: api.DeviceProfileListItem + (*CreateDeviceProfileRequest)(nil), // 5: api.CreateDeviceProfileRequest + (*CreateDeviceProfileResponse)(nil), // 6: api.CreateDeviceProfileResponse + (*GetDeviceProfileRequest)(nil), // 7: api.GetDeviceProfileRequest + (*GetDeviceProfileResponse)(nil), // 8: api.GetDeviceProfileResponse + (*UpdateDeviceProfileRequest)(nil), // 9: api.UpdateDeviceProfileRequest + (*DeleteDeviceProfileRequest)(nil), // 10: api.DeleteDeviceProfileRequest + (*ListDeviceProfilesRequest)(nil), // 11: api.ListDeviceProfilesRequest + (*ListDeviceProfilesResponse)(nil), // 12: api.ListDeviceProfilesResponse + (*ListDeviceProfileAdrAlgorithmsResponse)(nil), // 13: api.ListDeviceProfileAdrAlgorithmsResponse + (*AdrAlgorithmListItem)(nil), // 14: api.AdrAlgorithmListItem + nil, // 15: api.DeviceProfile.TagsEntry + nil, // 16: api.DeviceProfile.MeasurementsEntry + (common.Region)(0), // 17: common.Region + (common.MacVersion)(0), // 18: common.MacVersion + (common.RegParamsRevision)(0), // 19: common.RegParamsRevision + (*timestamppb.Timestamp)(nil), // 20: google.protobuf.Timestamp + (*emptypb.Empty)(nil), // 21: google.protobuf.Empty } var file_api_device_profile_proto_depIdxs = []int32{ - 14, // 0: api.DeviceProfile.region:type_name -> common.Region - 15, // 1: api.DeviceProfile.mac_version:type_name -> common.MacVersion - 16, // 2: api.DeviceProfile.reg_params_revision:type_name -> common.RegParamsRevision + 17, // 0: api.DeviceProfile.region:type_name -> common.Region + 18, // 1: api.DeviceProfile.mac_version:type_name -> common.MacVersion + 19, // 2: api.DeviceProfile.reg_params_revision:type_name -> common.RegParamsRevision 0, // 3: api.DeviceProfile.payload_codec_runtime:type_name -> api.CodecRuntime - 13, // 4: api.DeviceProfile.tags:type_name -> api.DeviceProfile.TagsEntry - 17, // 5: api.DeviceProfileListItem.created_at:type_name -> google.protobuf.Timestamp - 17, // 6: api.DeviceProfileListItem.updated_at:type_name -> google.protobuf.Timestamp - 14, // 7: api.DeviceProfileListItem.region:type_name -> common.Region - 15, // 8: api.DeviceProfileListItem.mac_version:type_name -> common.MacVersion - 16, // 9: api.DeviceProfileListItem.reg_params_revision:type_name -> common.RegParamsRevision - 1, // 10: api.CreateDeviceProfileRequest.device_profile:type_name -> api.DeviceProfile - 1, // 11: api.GetDeviceProfileResponse.device_profile:type_name -> api.DeviceProfile - 17, // 12: api.GetDeviceProfileResponse.created_at:type_name -> google.protobuf.Timestamp - 17, // 13: api.GetDeviceProfileResponse.updated_at:type_name -> google.protobuf.Timestamp - 1, // 14: api.UpdateDeviceProfileRequest.device_profile:type_name -> api.DeviceProfile - 2, // 15: api.ListDeviceProfilesResponse.result:type_name -> api.DeviceProfileListItem - 12, // 16: api.ListDeviceProfileAdrAlgorithmsResponse.result:type_name -> api.AdrAlgorithmListItem - 3, // 17: api.DeviceProfileService.Create:input_type -> api.CreateDeviceProfileRequest - 5, // 18: api.DeviceProfileService.Get:input_type -> api.GetDeviceProfileRequest - 7, // 19: api.DeviceProfileService.Update:input_type -> api.UpdateDeviceProfileRequest - 8, // 20: api.DeviceProfileService.Delete:input_type -> api.DeleteDeviceProfileRequest - 9, // 21: api.DeviceProfileService.List:input_type -> api.ListDeviceProfilesRequest - 18, // 22: api.DeviceProfileService.ListAdrAlgorithms:input_type -> google.protobuf.Empty - 4, // 23: api.DeviceProfileService.Create:output_type -> api.CreateDeviceProfileResponse - 6, // 24: api.DeviceProfileService.Get:output_type -> api.GetDeviceProfileResponse - 18, // 25: api.DeviceProfileService.Update:output_type -> google.protobuf.Empty - 18, // 26: api.DeviceProfileService.Delete:output_type -> google.protobuf.Empty - 10, // 27: api.DeviceProfileService.List:output_type -> api.ListDeviceProfilesResponse - 11, // 28: api.DeviceProfileService.ListAdrAlgorithms:output_type -> api.ListDeviceProfileAdrAlgorithmsResponse - 23, // [23:29] is the sub-list for method output_type - 17, // [17:23] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 15, // 4: api.DeviceProfile.tags:type_name -> api.DeviceProfile.TagsEntry + 16, // 5: api.DeviceProfile.measurements:type_name -> api.DeviceProfile.MeasurementsEntry + 1, // 6: api.Measurement.kind:type_name -> api.MeasurementKind + 20, // 7: api.DeviceProfileListItem.created_at:type_name -> google.protobuf.Timestamp + 20, // 8: api.DeviceProfileListItem.updated_at:type_name -> google.protobuf.Timestamp + 17, // 9: api.DeviceProfileListItem.region:type_name -> common.Region + 18, // 10: api.DeviceProfileListItem.mac_version:type_name -> common.MacVersion + 19, // 11: api.DeviceProfileListItem.reg_params_revision:type_name -> common.RegParamsRevision + 2, // 12: api.CreateDeviceProfileRequest.device_profile:type_name -> api.DeviceProfile + 2, // 13: api.GetDeviceProfileResponse.device_profile:type_name -> api.DeviceProfile + 20, // 14: api.GetDeviceProfileResponse.created_at:type_name -> google.protobuf.Timestamp + 20, // 15: api.GetDeviceProfileResponse.updated_at:type_name -> google.protobuf.Timestamp + 2, // 16: api.UpdateDeviceProfileRequest.device_profile:type_name -> api.DeviceProfile + 4, // 17: api.ListDeviceProfilesResponse.result:type_name -> api.DeviceProfileListItem + 14, // 18: api.ListDeviceProfileAdrAlgorithmsResponse.result:type_name -> api.AdrAlgorithmListItem + 3, // 19: api.DeviceProfile.MeasurementsEntry.value:type_name -> api.Measurement + 5, // 20: api.DeviceProfileService.Create:input_type -> api.CreateDeviceProfileRequest + 7, // 21: api.DeviceProfileService.Get:input_type -> api.GetDeviceProfileRequest + 9, // 22: api.DeviceProfileService.Update:input_type -> api.UpdateDeviceProfileRequest + 10, // 23: api.DeviceProfileService.Delete:input_type -> api.DeleteDeviceProfileRequest + 11, // 24: api.DeviceProfileService.List:input_type -> api.ListDeviceProfilesRequest + 21, // 25: api.DeviceProfileService.ListAdrAlgorithms:input_type -> google.protobuf.Empty + 6, // 26: api.DeviceProfileService.Create:output_type -> api.CreateDeviceProfileResponse + 8, // 27: api.DeviceProfileService.Get:output_type -> api.GetDeviceProfileResponse + 21, // 28: api.DeviceProfileService.Update:output_type -> google.protobuf.Empty + 21, // 29: api.DeviceProfileService.Delete:output_type -> google.protobuf.Empty + 12, // 30: api.DeviceProfileService.List:output_type -> api.ListDeviceProfilesResponse + 13, // 31: api.DeviceProfileService.ListAdrAlgorithms:output_type -> api.ListDeviceProfileAdrAlgorithmsResponse + 26, // [26:32] is the sub-list for method output_type + 20, // [20:26] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_api_device_profile_proto_init() } @@ -1344,7 +1497,7 @@ func file_api_device_profile_proto_init() { } } file_api_device_profile_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeviceProfileListItem); i { + switch v := v.(*Measurement); i { case 0: return &v.state case 1: @@ -1356,7 +1509,7 @@ func file_api_device_profile_proto_init() { } } file_api_device_profile_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateDeviceProfileRequest); i { + switch v := v.(*DeviceProfileListItem); i { case 0: return &v.state case 1: @@ -1368,7 +1521,7 @@ func file_api_device_profile_proto_init() { } } file_api_device_profile_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateDeviceProfileResponse); i { + switch v := v.(*CreateDeviceProfileRequest); i { case 0: return &v.state case 1: @@ -1380,7 +1533,7 @@ func file_api_device_profile_proto_init() { } } file_api_device_profile_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDeviceProfileRequest); i { + switch v := v.(*CreateDeviceProfileResponse); i { case 0: return &v.state case 1: @@ -1392,7 +1545,7 @@ func file_api_device_profile_proto_init() { } } file_api_device_profile_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDeviceProfileResponse); i { + switch v := v.(*GetDeviceProfileRequest); i { case 0: return &v.state case 1: @@ -1404,7 +1557,7 @@ func file_api_device_profile_proto_init() { } } file_api_device_profile_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateDeviceProfileRequest); i { + switch v := v.(*GetDeviceProfileResponse); i { case 0: return &v.state case 1: @@ -1416,7 +1569,7 @@ func file_api_device_profile_proto_init() { } } file_api_device_profile_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteDeviceProfileRequest); i { + switch v := v.(*UpdateDeviceProfileRequest); i { case 0: return &v.state case 1: @@ -1428,7 +1581,7 @@ func file_api_device_profile_proto_init() { } } file_api_device_profile_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDeviceProfilesRequest); i { + switch v := v.(*DeleteDeviceProfileRequest); i { case 0: return &v.state case 1: @@ -1440,7 +1593,7 @@ func file_api_device_profile_proto_init() { } } file_api_device_profile_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDeviceProfilesResponse); i { + switch v := v.(*ListDeviceProfilesRequest); i { case 0: return &v.state case 1: @@ -1452,7 +1605,7 @@ func file_api_device_profile_proto_init() { } } file_api_device_profile_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListDeviceProfileAdrAlgorithmsResponse); i { + switch v := v.(*ListDeviceProfilesResponse); i { case 0: return &v.state case 1: @@ -1464,6 +1617,18 @@ func file_api_device_profile_proto_init() { } } file_api_device_profile_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDeviceProfileAdrAlgorithmsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_device_profile_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AdrAlgorithmListItem); i { case 0: return &v.state @@ -1481,8 +1646,8 @@ func file_api_device_profile_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_device_profile_proto_rawDesc, - NumEnums: 1, - NumMessages: 13, + NumEnums: 2, + NumMessages: 15, NumExtensions: 0, NumServices: 1, }, diff --git a/api/go/api/device_profile_template.pb.go b/api/go/api/device_profile_template.pb.go index f1012b11..f01e381d 100644 --- a/api/go/api/device_profile_template.pb.go +++ b/api/go/api/device_profile_template.pb.go @@ -89,6 +89,9 @@ type DeviceProfileTemplate struct { AbpRx2Freq uint32 `protobuf:"varint,26,opt,name=abp_rx2_freq,json=abpRx2Freq,proto3" json:"abp_rx2_freq,omitempty"` // User defined tags. Tags map[string]string `protobuf:"bytes,27,rep,name=tags,proto3" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Measurements. + // If defined, ChirpStack will visualize these metrics in the web-interface. + Measurements map[string]*Measurement `protobuf:"bytes,28,rep,name=measurements,proto3" json:"measurements,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *DeviceProfileTemplate) Reset() { @@ -312,6 +315,13 @@ func (x *DeviceProfileTemplate) GetTags() map[string]string { return nil } +func (x *DeviceProfileTemplate) GetMeasurements() map[string]*Measurement { + if x != nil { + return x.Measurements + } + return nil +} + type DeviceProfileTemplateListItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -843,7 +853,7 @@ var file_api_device_profile_template_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe0, 0x09, 0x0a, 0x15, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x0b, 0x0a, 0x15, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, @@ -917,62 +927,24 @@ var file_api_device_profile_template_proto_rawDesc = []byte{ 0x32, 0x46, 0x72, 0x65, 0x71, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x1b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, - 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x1a, - 0x37, 0x0a, 0x09, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x8e, 0x04, 0x0a, 0x1d, 0x44, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x08, - 0x66, 0x69, 0x72, 0x6d, 0x77, 0x61, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x66, 0x69, 0x72, 0x6d, 0x77, 0x61, 0x72, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, - 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, - 0x12, 0x33, 0x0a, 0x0b, 0x6d, 0x61, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, - 0x61, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x6d, 0x61, 0x63, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x13, 0x72, 0x65, 0x67, 0x5f, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x67, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x72, - 0x65, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5f, 0x6f, 0x74, 0x61, - 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, - 0x73, 0x4f, 0x74, 0x61, 0x61, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, - 0x73, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x62, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x42, 0x12, - 0x28, 0x0a, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5f, 0x63, 0x6c, 0x61, 0x73, - 0x73, 0x5f, 0x63, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6f, - 0x72, 0x74, 0x73, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x43, 0x22, 0x78, 0x0a, 0x22, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x52, 0x0a, 0x17, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, - 0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, - 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x15, 0x64, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x22, 0x31, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xec, 0x01, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x44, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x17, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x15, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, + 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, + 0x50, 0x0a, 0x0c, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, + 0x1c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x2e, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x0c, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x1a, 0x37, 0x0a, 0x09, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x51, 0x0a, 0x11, 0x4d, 0x65, + 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x8e, 0x04, + 0x0a, 0x1d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, @@ -980,65 +952,114 @@ var file_api_device_profile_template_proto_rawDesc = []byte{ 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x78, 0x0a, 0x22, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x52, 0x0a, 0x17, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x15, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, - 0x34, 0x0a, 0x22, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, - 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x51, 0x0a, 0x21, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x81, 0x01, 0x0a, 0x22, 0x4c, 0x69, 0x73, - 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x3a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, - 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, - 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x32, 0xb6, 0x03, 0x0a, - 0x1c, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, - 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, - 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x03, 0x47, 0x65, - 0x74, 0x12, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, - 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x4b, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x27, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, - 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x4b, 0x0a, - 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, - 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x59, 0x0a, 0x04, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x61, 0x0a, 0x11, 0x69, 0x6f, 0x2e, 0x63, 0x68, 0x69, 0x72, - 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x1a, 0x44, 0x65, 0x76, 0x69, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x65, 0x6e, + 0x64, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x72, 0x6d, 0x77, 0x61, 0x72, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x72, 0x6d, 0x77, 0x61, 0x72, 0x65, 0x12, 0x26, 0x0a, + 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x72, + 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x0b, 0x6d, 0x61, 0x63, 0x5f, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x61, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0a, + 0x6d, 0x61, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x13, 0x72, 0x65, + 0x67, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x52, 0x65, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x11, 0x72, 0x65, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x76, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, + 0x73, 0x5f, 0x6f, 0x74, 0x61, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x73, 0x75, + 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x4f, 0x74, 0x61, 0x61, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x75, + 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x62, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x43, 0x6c, + 0x61, 0x73, 0x73, 0x42, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, + 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x63, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, + 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x43, 0x22, 0x78, + 0x0a, 0x22, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x52, 0x0a, 0x17, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, - 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, - 0x6f, 0x2f, 0x76, 0x34, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x52, 0x15, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x31, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xec, 0x01, 0x0a, 0x20, + 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x52, 0x0a, 0x17, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x15, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x78, 0x0a, 0x22, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x52, 0x0a, 0x17, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x15, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x22, 0x34, 0x0a, 0x22, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x51, 0x0a, 0x21, 0x4c, 0x69, + 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x81, 0x01, + 0x0a, 0x22, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x32, 0xb6, 0x03, 0x0a, 0x1c, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x27, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, + 0x54, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, + 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x27, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, + 0x59, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x61, 0x0a, 0x11, 0x69, 0x6f, + 0x2e, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x61, 0x70, 0x69, 0x42, + 0x1a, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, + 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x34, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1053,7 +1074,7 @@ func file_api_device_profile_template_proto_rawDescGZIP() []byte { return file_api_device_profile_template_proto_rawDescData } -var file_api_device_profile_template_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_api_device_profile_template_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_api_device_profile_template_proto_goTypes = []interface{}{ (*DeviceProfileTemplate)(nil), // 0: api.DeviceProfileTemplate (*DeviceProfileTemplateListItem)(nil), // 1: api.DeviceProfileTemplateListItem @@ -1065,45 +1086,49 @@ var file_api_device_profile_template_proto_goTypes = []interface{}{ (*ListDeviceProfileTemplatesRequest)(nil), // 7: api.ListDeviceProfileTemplatesRequest (*ListDeviceProfileTemplatesResponse)(nil), // 8: api.ListDeviceProfileTemplatesResponse nil, // 9: api.DeviceProfileTemplate.TagsEntry - (common.Region)(0), // 10: common.Region - (common.MacVersion)(0), // 11: common.MacVersion - (common.RegParamsRevision)(0), // 12: common.RegParamsRevision - (CodecRuntime)(0), // 13: api.CodecRuntime - (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp - (*emptypb.Empty)(nil), // 15: google.protobuf.Empty + nil, // 10: api.DeviceProfileTemplate.MeasurementsEntry + (common.Region)(0), // 11: common.Region + (common.MacVersion)(0), // 12: common.MacVersion + (common.RegParamsRevision)(0), // 13: common.RegParamsRevision + (CodecRuntime)(0), // 14: api.CodecRuntime + (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp + (*Measurement)(nil), // 16: api.Measurement + (*emptypb.Empty)(nil), // 17: google.protobuf.Empty } var file_api_device_profile_template_proto_depIdxs = []int32{ - 10, // 0: api.DeviceProfileTemplate.region:type_name -> common.Region - 11, // 1: api.DeviceProfileTemplate.mac_version:type_name -> common.MacVersion - 12, // 2: api.DeviceProfileTemplate.reg_params_revision:type_name -> common.RegParamsRevision - 13, // 3: api.DeviceProfileTemplate.payload_codec_runtime:type_name -> api.CodecRuntime + 11, // 0: api.DeviceProfileTemplate.region:type_name -> common.Region + 12, // 1: api.DeviceProfileTemplate.mac_version:type_name -> common.MacVersion + 13, // 2: api.DeviceProfileTemplate.reg_params_revision:type_name -> common.RegParamsRevision + 14, // 3: api.DeviceProfileTemplate.payload_codec_runtime:type_name -> api.CodecRuntime 9, // 4: api.DeviceProfileTemplate.tags:type_name -> api.DeviceProfileTemplate.TagsEntry - 14, // 5: api.DeviceProfileTemplateListItem.created_at:type_name -> google.protobuf.Timestamp - 14, // 6: api.DeviceProfileTemplateListItem.updated_at:type_name -> google.protobuf.Timestamp - 10, // 7: api.DeviceProfileTemplateListItem.region:type_name -> common.Region - 11, // 8: api.DeviceProfileTemplateListItem.mac_version:type_name -> common.MacVersion - 12, // 9: api.DeviceProfileTemplateListItem.reg_params_revision:type_name -> common.RegParamsRevision - 0, // 10: api.CreateDeviceProfileTemplateRequest.device_profile_template:type_name -> api.DeviceProfileTemplate - 0, // 11: api.GetDeviceProfileTemplateResponse.device_profile_template:type_name -> api.DeviceProfileTemplate - 14, // 12: api.GetDeviceProfileTemplateResponse.created_at:type_name -> google.protobuf.Timestamp - 14, // 13: api.GetDeviceProfileTemplateResponse.updated_at:type_name -> google.protobuf.Timestamp - 0, // 14: api.UpdateDeviceProfileTemplateRequest.device_profile_template:type_name -> api.DeviceProfileTemplate - 1, // 15: api.ListDeviceProfileTemplatesResponse.result:type_name -> api.DeviceProfileTemplateListItem - 2, // 16: api.DeviceProfileTemplateService.Create:input_type -> api.CreateDeviceProfileTemplateRequest - 3, // 17: api.DeviceProfileTemplateService.Get:input_type -> api.GetDeviceProfileTemplateRequest - 5, // 18: api.DeviceProfileTemplateService.Update:input_type -> api.UpdateDeviceProfileTemplateRequest - 6, // 19: api.DeviceProfileTemplateService.Delete:input_type -> api.DeleteDeviceProfileTemplateRequest - 7, // 20: api.DeviceProfileTemplateService.List:input_type -> api.ListDeviceProfileTemplatesRequest - 15, // 21: api.DeviceProfileTemplateService.Create:output_type -> google.protobuf.Empty - 4, // 22: api.DeviceProfileTemplateService.Get:output_type -> api.GetDeviceProfileTemplateResponse - 15, // 23: api.DeviceProfileTemplateService.Update:output_type -> google.protobuf.Empty - 15, // 24: api.DeviceProfileTemplateService.Delete:output_type -> google.protobuf.Empty - 8, // 25: api.DeviceProfileTemplateService.List:output_type -> api.ListDeviceProfileTemplatesResponse - 21, // [21:26] is the sub-list for method output_type - 16, // [16:21] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 10, // 5: api.DeviceProfileTemplate.measurements:type_name -> api.DeviceProfileTemplate.MeasurementsEntry + 15, // 6: api.DeviceProfileTemplateListItem.created_at:type_name -> google.protobuf.Timestamp + 15, // 7: api.DeviceProfileTemplateListItem.updated_at:type_name -> google.protobuf.Timestamp + 11, // 8: api.DeviceProfileTemplateListItem.region:type_name -> common.Region + 12, // 9: api.DeviceProfileTemplateListItem.mac_version:type_name -> common.MacVersion + 13, // 10: api.DeviceProfileTemplateListItem.reg_params_revision:type_name -> common.RegParamsRevision + 0, // 11: api.CreateDeviceProfileTemplateRequest.device_profile_template:type_name -> api.DeviceProfileTemplate + 0, // 12: api.GetDeviceProfileTemplateResponse.device_profile_template:type_name -> api.DeviceProfileTemplate + 15, // 13: api.GetDeviceProfileTemplateResponse.created_at:type_name -> google.protobuf.Timestamp + 15, // 14: api.GetDeviceProfileTemplateResponse.updated_at:type_name -> google.protobuf.Timestamp + 0, // 15: api.UpdateDeviceProfileTemplateRequest.device_profile_template:type_name -> api.DeviceProfileTemplate + 1, // 16: api.ListDeviceProfileTemplatesResponse.result:type_name -> api.DeviceProfileTemplateListItem + 16, // 17: api.DeviceProfileTemplate.MeasurementsEntry.value:type_name -> api.Measurement + 2, // 18: api.DeviceProfileTemplateService.Create:input_type -> api.CreateDeviceProfileTemplateRequest + 3, // 19: api.DeviceProfileTemplateService.Get:input_type -> api.GetDeviceProfileTemplateRequest + 5, // 20: api.DeviceProfileTemplateService.Update:input_type -> api.UpdateDeviceProfileTemplateRequest + 6, // 21: api.DeviceProfileTemplateService.Delete:input_type -> api.DeleteDeviceProfileTemplateRequest + 7, // 22: api.DeviceProfileTemplateService.List:input_type -> api.ListDeviceProfileTemplatesRequest + 17, // 23: api.DeviceProfileTemplateService.Create:output_type -> google.protobuf.Empty + 4, // 24: api.DeviceProfileTemplateService.Get:output_type -> api.GetDeviceProfileTemplateResponse + 17, // 25: api.DeviceProfileTemplateService.Update:output_type -> google.protobuf.Empty + 17, // 26: api.DeviceProfileTemplateService.Delete:output_type -> google.protobuf.Empty + 8, // 27: api.DeviceProfileTemplateService.List:output_type -> api.ListDeviceProfileTemplatesResponse + 23, // [23:28] is the sub-list for method output_type + 18, // [18:23] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_api_device_profile_template_proto_init() } @@ -1228,7 +1253,7 @@ func file_api_device_profile_template_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_device_profile_template_proto_rawDesc, NumEnums: 0, - NumMessages: 10, + NumMessages: 11, NumExtensions: 0, NumServices: 1, }, diff --git a/api/go/api/gateway.pb.go b/api/go/api/gateway.pb.go index 55af3717..1a834f43 100644 --- a/api/go/api/gateway.pb.go +++ b/api/go/api/gateway.pb.go @@ -768,7 +768,7 @@ func (x *GenerateGatewayClientCertificateResponse) GetExpiresAt() *timestamppb.T return nil } -type GetGatewayStatsRequest struct { +type GetGatewayMetricsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -779,10 +779,12 @@ type GetGatewayStatsRequest struct { Start *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start,proto3" json:"start,omitempty"` // Interval end timestamp. End *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=end,proto3" json:"end,omitempty"` + // Aggregation. + Aggregation common.Aggregation `protobuf:"varint,4,opt,name=aggregation,proto3,enum=common.Aggregation" json:"aggregation,omitempty"` } -func (x *GetGatewayStatsRequest) Reset() { - *x = GetGatewayStatsRequest{} +func (x *GetGatewayMetricsRequest) Reset() { + *x = GetGatewayMetricsRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_gateway_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -790,13 +792,13 @@ func (x *GetGatewayStatsRequest) Reset() { } } -func (x *GetGatewayStatsRequest) String() string { +func (x *GetGatewayMetricsRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetGatewayStatsRequest) ProtoMessage() {} +func (*GetGatewayMetricsRequest) ProtoMessage() {} -func (x *GetGatewayStatsRequest) ProtoReflect() protoreflect.Message { +func (x *GetGatewayMetricsRequest) ProtoReflect() protoreflect.Message { mi := &file_api_gateway_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -808,42 +810,62 @@ func (x *GetGatewayStatsRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetGatewayStatsRequest.ProtoReflect.Descriptor instead. -func (*GetGatewayStatsRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GetGatewayMetricsRequest.ProtoReflect.Descriptor instead. +func (*GetGatewayMetricsRequest) Descriptor() ([]byte, []int) { return file_api_gateway_proto_rawDescGZIP(), []int{11} } -func (x *GetGatewayStatsRequest) GetGatewayId() string { +func (x *GetGatewayMetricsRequest) GetGatewayId() string { if x != nil { return x.GatewayId } return "" } -func (x *GetGatewayStatsRequest) GetStart() *timestamppb.Timestamp { +func (x *GetGatewayMetricsRequest) GetStart() *timestamppb.Timestamp { if x != nil { return x.Start } return nil } -func (x *GetGatewayStatsRequest) GetEnd() *timestamppb.Timestamp { +func (x *GetGatewayMetricsRequest) GetEnd() *timestamppb.Timestamp { if x != nil { return x.End } return nil } -type GetGatewayStatsResponse struct { +func (x *GetGatewayMetricsRequest) GetAggregation() common.Aggregation { + if x != nil { + return x.Aggregation + } + return common.Aggregation(0) +} + +type GetGatewayMetricsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Result []*GatewayStats `protobuf:"bytes,1,rep,name=result,proto3" json:"result,omitempty"` + // RX packets. + RxPackets *common.Metric `protobuf:"bytes,1,opt,name=rx_packets,json=rxPackets,proto3" json:"rx_packets,omitempty"` + // TX packets. + TxPackets *common.Metric `protobuf:"bytes,2,opt,name=tx_packets,json=txPackets,proto3" json:"tx_packets,omitempty"` + // TX packets / frequency. + TxPacketsPerFreq *common.Metric `protobuf:"bytes,3,opt,name=tx_packets_per_freq,json=txPacketsPerFreq,proto3" json:"tx_packets_per_freq,omitempty"` + // RX packets / frequency. + RxPacketsPerFreq *common.Metric `protobuf:"bytes,4,opt,name=rx_packets_per_freq,json=rxPacketsPerFreq,proto3" json:"rx_packets_per_freq,omitempty"` + // TX packets / DR. + TxPacketsPerDr *common.Metric `protobuf:"bytes,5,opt,name=tx_packets_per_dr,json=txPacketsPerDr,proto3" json:"tx_packets_per_dr,omitempty"` + // RX packets / DR. + RxPacketsPerDr *common.Metric `protobuf:"bytes,6,opt,name=rx_packets_per_dr,json=rxPacketsPerDr,proto3" json:"rx_packets_per_dr,omitempty"` + // TX packets per status. + TxPacketsPerStatus *common.Metric `protobuf:"bytes,7,opt,name=tx_packets_per_status,json=txPacketsPerStatus,proto3" json:"tx_packets_per_status,omitempty"` } -func (x *GetGatewayStatsResponse) Reset() { - *x = GetGatewayStatsResponse{} +func (x *GetGatewayMetricsResponse) Reset() { + *x = GetGatewayMetricsResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_gateway_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -851,13 +873,13 @@ func (x *GetGatewayStatsResponse) Reset() { } } -func (x *GetGatewayStatsResponse) String() string { +func (x *GetGatewayMetricsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetGatewayStatsResponse) ProtoMessage() {} +func (*GetGatewayMetricsResponse) ProtoMessage() {} -func (x *GetGatewayStatsResponse) ProtoReflect() protoreflect.Message { +func (x *GetGatewayMetricsResponse) ProtoReflect() protoreflect.Message { mi := &file_api_gateway_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -869,123 +891,54 @@ func (x *GetGatewayStatsResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetGatewayStatsResponse.ProtoReflect.Descriptor instead. -func (*GetGatewayStatsResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GetGatewayMetricsResponse.ProtoReflect.Descriptor instead. +func (*GetGatewayMetricsResponse) Descriptor() ([]byte, []int) { return file_api_gateway_proto_rawDescGZIP(), []int{12} } -func (x *GetGatewayStatsResponse) GetResult() []*GatewayStats { - if x != nil { - return x.Result - } - return nil -} - -type GatewayStats struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Timestamp of the (aggregated) measurement. - Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` - // Packets received. - RxPackets uint32 `protobuf:"varint,2,opt,name=rx_packets,json=rxPackets,proto3" json:"rx_packets,omitempty"` - // Packets emitted. - TxPackets uint32 `protobuf:"varint,3,opt,name=tx_packets,json=txPackets,proto3" json:"tx_packets,omitempty"` - // Tx packets per frequency. - TxPacketsPerFrequency map[uint32]uint32 `protobuf:"bytes,4,rep,name=tx_packets_per_frequency,json=txPacketsPerFrequency,proto3" json:"tx_packets_per_frequency,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // Rx packets per frequency. - RxPacketsPerFrequency map[uint32]uint32 `protobuf:"bytes,5,rep,name=rx_packets_per_frequency,json=rxPacketsPerFrequency,proto3" json:"rx_packets_per_frequency,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // Tx packets per DR. - TxPacketsPerDr map[uint32]uint32 `protobuf:"bytes,6,rep,name=tx_packets_per_dr,json=txPacketsPerDr,proto3" json:"tx_packets_per_dr,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // Rx packets per DR. - RxPacketsPerDr map[uint32]uint32 `protobuf:"bytes,7,rep,name=rx_packets_per_dr,json=rxPacketsPerDr,proto3" json:"rx_packets_per_dr,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - // Tx packets per status. - TxPacketsPerStatus map[string]uint32 `protobuf:"bytes,8,rep,name=tx_packets_per_status,json=txPacketsPerStatus,proto3" json:"tx_packets_per_status,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` -} - -func (x *GatewayStats) Reset() { - *x = GatewayStats{} - if protoimpl.UnsafeEnabled { - mi := &file_api_gateway_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GatewayStats) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GatewayStats) ProtoMessage() {} - -func (x *GatewayStats) ProtoReflect() protoreflect.Message { - mi := &file_api_gateway_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GatewayStats.ProtoReflect.Descriptor instead. -func (*GatewayStats) Descriptor() ([]byte, []int) { - return file_api_gateway_proto_rawDescGZIP(), []int{13} -} - -func (x *GatewayStats) GetTime() *timestamppb.Timestamp { - if x != nil { - return x.Time - } - return nil -} - -func (x *GatewayStats) GetRxPackets() uint32 { +func (x *GetGatewayMetricsResponse) GetRxPackets() *common.Metric { if x != nil { return x.RxPackets } - return 0 + return nil } -func (x *GatewayStats) GetTxPackets() uint32 { +func (x *GetGatewayMetricsResponse) GetTxPackets() *common.Metric { if x != nil { return x.TxPackets } - return 0 + return nil } -func (x *GatewayStats) GetTxPacketsPerFrequency() map[uint32]uint32 { +func (x *GetGatewayMetricsResponse) GetTxPacketsPerFreq() *common.Metric { if x != nil { - return x.TxPacketsPerFrequency + return x.TxPacketsPerFreq } return nil } -func (x *GatewayStats) GetRxPacketsPerFrequency() map[uint32]uint32 { +func (x *GetGatewayMetricsResponse) GetRxPacketsPerFreq() *common.Metric { if x != nil { - return x.RxPacketsPerFrequency + return x.RxPacketsPerFreq } return nil } -func (x *GatewayStats) GetTxPacketsPerDr() map[uint32]uint32 { +func (x *GetGatewayMetricsResponse) GetTxPacketsPerDr() *common.Metric { if x != nil { return x.TxPacketsPerDr } return nil } -func (x *GatewayStats) GetRxPacketsPerDr() map[uint32]uint32 { +func (x *GetGatewayMetricsResponse) GetRxPacketsPerDr() *common.Metric { if x != nil { return x.RxPacketsPerDr } return nil } -func (x *GatewayStats) GetTxPacketsPerStatus() map[string]uint32 { +func (x *GetGatewayMetricsResponse) GetTxPacketsPerStatus() *common.Metric { if x != nil { return x.TxPacketsPerStatus } @@ -1117,118 +1070,86 @@ var file_api_gateway_proto_rawDesc = []byte{ 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, - 0x65, 0x73, 0x41, 0x74, 0x22, 0x97, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x47, 0x61, 0x74, 0x65, - 0x77, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1d, 0x0a, 0x0a, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x49, 0x64, 0x12, 0x30, - 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x12, 0x2c, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0x44, - 0x0a, 0x17, 0x47, 0x65, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x72, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x06, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x22, 0xad, 0x07, 0x0a, 0x0c, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, - 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, - 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x78, 0x50, 0x61, 0x63, - 0x6b, 0x65, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, - 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x74, 0x78, 0x50, 0x61, 0x63, 0x6b, - 0x65, 0x74, 0x73, 0x12, 0x65, 0x0a, 0x18, 0x74, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, - 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x61, 0x74, 0x65, - 0x77, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x54, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, - 0x74, 0x73, 0x50, 0x65, 0x72, 0x46, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x15, 0x74, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, - 0x72, 0x46, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x65, 0x0a, 0x18, 0x72, 0x78, - 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x66, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, - 0x52, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x46, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x6e, 0x63, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x15, 0x72, 0x78, 0x50, 0x61, - 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x46, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, - 0x79, 0x12, 0x50, 0x0a, 0x11, 0x74, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x5f, - 0x70, 0x65, 0x72, 0x5f, 0x64, 0x72, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, - 0x54, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x44, 0x72, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x0e, 0x74, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, - 0x72, 0x44, 0x72, 0x12, 0x50, 0x0a, 0x11, 0x72, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, - 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x64, 0x72, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, - 0x73, 0x2e, 0x52, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x44, 0x72, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x72, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, - 0x50, 0x65, 0x72, 0x44, 0x72, 0x12, 0x5c, 0x0a, 0x15, 0x74, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, - 0x65, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x54, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, - 0x73, 0x50, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x12, 0x74, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x1a, 0x48, 0x0a, 0x1a, 0x54, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, - 0x50, 0x65, 0x72, 0x46, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x48, 0x0a, - 0x1a, 0x52, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x46, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x54, 0x78, 0x50, 0x61, 0x63, - 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x44, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x52, 0x78, - 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x44, 0x72, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x45, 0x0a, - 0x17, 0x54, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x32, 0x8b, 0x04, 0x0a, 0x0e, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x61, - 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x16, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x47, - 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x3d, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, - 0x3d, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x3d, - 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7a, 0x0a, - 0x19, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, - 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x43, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x08, 0x47, 0x65, 0x74, - 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x47, - 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x61, 0x74, 0x65, - 0x77, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x42, 0x53, 0x0a, 0x11, 0x69, 0x6f, 0x2e, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, - 0x61, 0x63, 0x6b, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0c, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x63, - 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, - 0x2f, 0x76, 0x34, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x73, 0x41, 0x74, 0x22, 0xd0, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x47, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x49, 0x64, + 0x12, 0x30, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x03, 0x65, 0x6e, 0x64, + 0x12, 0x35, 0x0a, 0x0b, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb0, 0x03, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x47, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x0a, 0x72, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, + 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x09, 0x72, 0x78, 0x50, 0x61, 0x63, + 0x6b, 0x65, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x0a, 0x74, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, + 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x09, 0x74, 0x78, 0x50, 0x61, 0x63, 0x6b, + 0x65, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x13, 0x74, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, + 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x66, 0x72, 0x65, 0x71, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x52, 0x10, 0x74, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x46, 0x72, + 0x65, 0x71, 0x12, 0x3d, 0x0a, 0x13, 0x72, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, + 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x66, 0x72, 0x65, 0x71, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, + 0x10, 0x72, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x46, 0x72, 0x65, + 0x71, 0x12, 0x39, 0x0a, 0x11, 0x74, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x5f, + 0x70, 0x65, 0x72, 0x5f, 0x64, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x0e, 0x74, 0x78, + 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x50, 0x65, 0x72, 0x44, 0x72, 0x12, 0x39, 0x0a, 0x11, + 0x72, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x64, + 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x0e, 0x72, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, + 0x74, 0x73, 0x50, 0x65, 0x72, 0x44, 0x72, 0x12, 0x41, 0x0a, 0x15, 0x74, 0x78, 0x5f, 0x70, 0x61, + 0x63, 0x6b, 0x65, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x12, 0x74, 0x78, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, + 0x73, 0x50, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0x91, 0x04, 0x0a, 0x0e, 0x47, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, 0x0a, + 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x03, + 0x47, 0x65, 0x74, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, + 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x7a, 0x0a, 0x19, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x12, 0x2c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x47, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x47, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x4d, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x1d, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x4d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x4d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x53, + 0x0a, 0x11, 0x69, 0x6f, 0x2e, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, + 0x61, 0x70, 0x69, 0x42, 0x0c, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x63, 0x68, 0x69, 0x72, 0x70, + 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x34, 0x2f, + 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1243,7 +1164,7 @@ func file_api_gateway_proto_rawDescGZIP() []byte { return file_api_gateway_proto_rawDescData } -var file_api_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_api_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_api_gateway_proto_goTypes = []interface{}{ (*Gateway)(nil), // 0: api.Gateway (*GatewayListItem)(nil), // 1: api.GatewayListItem @@ -1256,66 +1177,63 @@ var file_api_gateway_proto_goTypes = []interface{}{ (*ListGatewaysResponse)(nil), // 8: api.ListGatewaysResponse (*GenerateGatewayClientCertificateRequest)(nil), // 9: api.GenerateGatewayClientCertificateRequest (*GenerateGatewayClientCertificateResponse)(nil), // 10: api.GenerateGatewayClientCertificateResponse - (*GetGatewayStatsRequest)(nil), // 11: api.GetGatewayStatsRequest - (*GetGatewayStatsResponse)(nil), // 12: api.GetGatewayStatsResponse - (*GatewayStats)(nil), // 13: api.GatewayStats - nil, // 14: api.Gateway.TagsEntry - nil, // 15: api.Gateway.PropertiesEntry - nil, // 16: api.GatewayListItem.PropertiesEntry - nil, // 17: api.GatewayStats.TxPacketsPerFrequencyEntry - nil, // 18: api.GatewayStats.RxPacketsPerFrequencyEntry - nil, // 19: api.GatewayStats.TxPacketsPerDrEntry - nil, // 20: api.GatewayStats.RxPacketsPerDrEntry - nil, // 21: api.GatewayStats.TxPacketsPerStatusEntry - (*common.Location)(nil), // 22: common.Location - (*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp - (*emptypb.Empty)(nil), // 24: google.protobuf.Empty + (*GetGatewayMetricsRequest)(nil), // 11: api.GetGatewayMetricsRequest + (*GetGatewayMetricsResponse)(nil), // 12: api.GetGatewayMetricsResponse + nil, // 13: api.Gateway.TagsEntry + nil, // 14: api.Gateway.PropertiesEntry + nil, // 15: api.GatewayListItem.PropertiesEntry + (*common.Location)(nil), // 16: common.Location + (*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp + (common.Aggregation)(0), // 18: common.Aggregation + (*common.Metric)(nil), // 19: common.Metric + (*emptypb.Empty)(nil), // 20: google.protobuf.Empty } var file_api_gateway_proto_depIdxs = []int32{ - 22, // 0: api.Gateway.location:type_name -> common.Location - 14, // 1: api.Gateway.tags:type_name -> api.Gateway.TagsEntry - 15, // 2: api.Gateway.properties:type_name -> api.Gateway.PropertiesEntry - 22, // 3: api.GatewayListItem.location:type_name -> common.Location - 16, // 4: api.GatewayListItem.properties:type_name -> api.GatewayListItem.PropertiesEntry - 23, // 5: api.GatewayListItem.created_at:type_name -> google.protobuf.Timestamp - 23, // 6: api.GatewayListItem.updated_at:type_name -> google.protobuf.Timestamp - 23, // 7: api.GatewayListItem.last_seen_at:type_name -> google.protobuf.Timestamp + 16, // 0: api.Gateway.location:type_name -> common.Location + 13, // 1: api.Gateway.tags:type_name -> api.Gateway.TagsEntry + 14, // 2: api.Gateway.properties:type_name -> api.Gateway.PropertiesEntry + 16, // 3: api.GatewayListItem.location:type_name -> common.Location + 15, // 4: api.GatewayListItem.properties:type_name -> api.GatewayListItem.PropertiesEntry + 17, // 5: api.GatewayListItem.created_at:type_name -> google.protobuf.Timestamp + 17, // 6: api.GatewayListItem.updated_at:type_name -> google.protobuf.Timestamp + 17, // 7: api.GatewayListItem.last_seen_at:type_name -> google.protobuf.Timestamp 0, // 8: api.CreateGatewayRequest.gateway:type_name -> api.Gateway 0, // 9: api.GetGatewayResponse.gateway:type_name -> api.Gateway - 23, // 10: api.GetGatewayResponse.created_at:type_name -> google.protobuf.Timestamp - 23, // 11: api.GetGatewayResponse.updated_at:type_name -> google.protobuf.Timestamp - 23, // 12: api.GetGatewayResponse.last_seen_at:type_name -> google.protobuf.Timestamp + 17, // 10: api.GetGatewayResponse.created_at:type_name -> google.protobuf.Timestamp + 17, // 11: api.GetGatewayResponse.updated_at:type_name -> google.protobuf.Timestamp + 17, // 12: api.GetGatewayResponse.last_seen_at:type_name -> google.protobuf.Timestamp 0, // 13: api.UpdateGatewayRequest.gateway:type_name -> api.Gateway 1, // 14: api.ListGatewaysResponse.result:type_name -> api.GatewayListItem - 23, // 15: api.GenerateGatewayClientCertificateResponse.expires_at:type_name -> google.protobuf.Timestamp - 23, // 16: api.GetGatewayStatsRequest.start:type_name -> google.protobuf.Timestamp - 23, // 17: api.GetGatewayStatsRequest.end:type_name -> google.protobuf.Timestamp - 13, // 18: api.GetGatewayStatsResponse.result:type_name -> api.GatewayStats - 23, // 19: api.GatewayStats.time:type_name -> google.protobuf.Timestamp - 17, // 20: api.GatewayStats.tx_packets_per_frequency:type_name -> api.GatewayStats.TxPacketsPerFrequencyEntry - 18, // 21: api.GatewayStats.rx_packets_per_frequency:type_name -> api.GatewayStats.RxPacketsPerFrequencyEntry - 19, // 22: api.GatewayStats.tx_packets_per_dr:type_name -> api.GatewayStats.TxPacketsPerDrEntry - 20, // 23: api.GatewayStats.rx_packets_per_dr:type_name -> api.GatewayStats.RxPacketsPerDrEntry - 21, // 24: api.GatewayStats.tx_packets_per_status:type_name -> api.GatewayStats.TxPacketsPerStatusEntry - 2, // 25: api.GatewayService.Create:input_type -> api.CreateGatewayRequest - 3, // 26: api.GatewayService.Get:input_type -> api.GetGatewayRequest - 5, // 27: api.GatewayService.Update:input_type -> api.UpdateGatewayRequest - 6, // 28: api.GatewayService.Delete:input_type -> api.DeleteGatewayRequest - 7, // 29: api.GatewayService.List:input_type -> api.ListGatewaysRequest - 9, // 30: api.GatewayService.GenerateClientCertificate:input_type -> api.GenerateGatewayClientCertificateRequest - 11, // 31: api.GatewayService.GetStats:input_type -> api.GetGatewayStatsRequest - 24, // 32: api.GatewayService.Create:output_type -> google.protobuf.Empty - 4, // 33: api.GatewayService.Get:output_type -> api.GetGatewayResponse - 24, // 34: api.GatewayService.Update:output_type -> google.protobuf.Empty - 24, // 35: api.GatewayService.Delete:output_type -> google.protobuf.Empty - 8, // 36: api.GatewayService.List:output_type -> api.ListGatewaysResponse - 10, // 37: api.GatewayService.GenerateClientCertificate:output_type -> api.GenerateGatewayClientCertificateResponse - 12, // 38: api.GatewayService.GetStats:output_type -> api.GetGatewayStatsResponse - 32, // [32:39] is the sub-list for method output_type - 25, // [25:32] is the sub-list for method input_type - 25, // [25:25] is the sub-list for extension type_name - 25, // [25:25] is the sub-list for extension extendee - 0, // [0:25] is the sub-list for field type_name + 17, // 15: api.GenerateGatewayClientCertificateResponse.expires_at:type_name -> google.protobuf.Timestamp + 17, // 16: api.GetGatewayMetricsRequest.start:type_name -> google.protobuf.Timestamp + 17, // 17: api.GetGatewayMetricsRequest.end:type_name -> google.protobuf.Timestamp + 18, // 18: api.GetGatewayMetricsRequest.aggregation:type_name -> common.Aggregation + 19, // 19: api.GetGatewayMetricsResponse.rx_packets:type_name -> common.Metric + 19, // 20: api.GetGatewayMetricsResponse.tx_packets:type_name -> common.Metric + 19, // 21: api.GetGatewayMetricsResponse.tx_packets_per_freq:type_name -> common.Metric + 19, // 22: api.GetGatewayMetricsResponse.rx_packets_per_freq:type_name -> common.Metric + 19, // 23: api.GetGatewayMetricsResponse.tx_packets_per_dr:type_name -> common.Metric + 19, // 24: api.GetGatewayMetricsResponse.rx_packets_per_dr:type_name -> common.Metric + 19, // 25: api.GetGatewayMetricsResponse.tx_packets_per_status:type_name -> common.Metric + 2, // 26: api.GatewayService.Create:input_type -> api.CreateGatewayRequest + 3, // 27: api.GatewayService.Get:input_type -> api.GetGatewayRequest + 5, // 28: api.GatewayService.Update:input_type -> api.UpdateGatewayRequest + 6, // 29: api.GatewayService.Delete:input_type -> api.DeleteGatewayRequest + 7, // 30: api.GatewayService.List:input_type -> api.ListGatewaysRequest + 9, // 31: api.GatewayService.GenerateClientCertificate:input_type -> api.GenerateGatewayClientCertificateRequest + 11, // 32: api.GatewayService.GetMetrics:input_type -> api.GetGatewayMetricsRequest + 20, // 33: api.GatewayService.Create:output_type -> google.protobuf.Empty + 4, // 34: api.GatewayService.Get:output_type -> api.GetGatewayResponse + 20, // 35: api.GatewayService.Update:output_type -> google.protobuf.Empty + 20, // 36: api.GatewayService.Delete:output_type -> google.protobuf.Empty + 8, // 37: api.GatewayService.List:output_type -> api.ListGatewaysResponse + 10, // 38: api.GatewayService.GenerateClientCertificate:output_type -> api.GenerateGatewayClientCertificateResponse + 12, // 39: api.GatewayService.GetMetrics:output_type -> api.GetGatewayMetricsResponse + 33, // [33:40] is the sub-list for method output_type + 26, // [26:33] is the sub-list for method input_type + 26, // [26:26] is the sub-list for extension type_name + 26, // [26:26] is the sub-list for extension extendee + 0, // [0:26] is the sub-list for field type_name } func init() { file_api_gateway_proto_init() } @@ -1457,7 +1375,7 @@ func file_api_gateway_proto_init() { } } file_api_gateway_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetGatewayStatsRequest); i { + switch v := v.(*GetGatewayMetricsRequest); i { case 0: return &v.state case 1: @@ -1469,19 +1387,7 @@ func file_api_gateway_proto_init() { } } file_api_gateway_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetGatewayStatsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_gateway_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GatewayStats); i { + switch v := v.(*GetGatewayMetricsResponse); i { case 0: return &v.state case 1: @@ -1499,7 +1405,7 @@ func file_api_gateway_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_gateway_proto_rawDesc, NumEnums: 0, - NumMessages: 22, + NumMessages: 16, NumExtensions: 0, NumServices: 1, }, diff --git a/api/go/api/gateway_grpc.pb.go b/api/go/api/gateway_grpc.pb.go index 171e6d04..a29d62f6 100644 --- a/api/go/api/gateway_grpc.pb.go +++ b/api/go/api/gateway_grpc.pb.go @@ -35,8 +35,8 @@ type GatewayServiceClient interface { List(ctx context.Context, in *ListGatewaysRequest, opts ...grpc.CallOption) (*ListGatewaysResponse, error) // Generate client-certificate for the gateway. GenerateClientCertificate(ctx context.Context, in *GenerateGatewayClientCertificateRequest, opts ...grpc.CallOption) (*GenerateGatewayClientCertificateResponse, error) - // GetStats returns the gateway stats. - GetStats(ctx context.Context, in *GetGatewayStatsRequest, opts ...grpc.CallOption) (*GetGatewayStatsResponse, error) + // GetMetrics returns the gateway metrics. + GetMetrics(ctx context.Context, in *GetGatewayMetricsRequest, opts ...grpc.CallOption) (*GetGatewayMetricsResponse, error) } type gatewayServiceClient struct { @@ -101,9 +101,9 @@ func (c *gatewayServiceClient) GenerateClientCertificate(ctx context.Context, in return out, nil } -func (c *gatewayServiceClient) GetStats(ctx context.Context, in *GetGatewayStatsRequest, opts ...grpc.CallOption) (*GetGatewayStatsResponse, error) { - out := new(GetGatewayStatsResponse) - err := c.cc.Invoke(ctx, "/api.GatewayService/GetStats", in, out, opts...) +func (c *gatewayServiceClient) GetMetrics(ctx context.Context, in *GetGatewayMetricsRequest, opts ...grpc.CallOption) (*GetGatewayMetricsResponse, error) { + out := new(GetGatewayMetricsResponse) + err := c.cc.Invoke(ctx, "/api.GatewayService/GetMetrics", in, out, opts...) if err != nil { return nil, err } @@ -126,8 +126,8 @@ type GatewayServiceServer interface { List(context.Context, *ListGatewaysRequest) (*ListGatewaysResponse, error) // Generate client-certificate for the gateway. GenerateClientCertificate(context.Context, *GenerateGatewayClientCertificateRequest) (*GenerateGatewayClientCertificateResponse, error) - // GetStats returns the gateway stats. - GetStats(context.Context, *GetGatewayStatsRequest) (*GetGatewayStatsResponse, error) + // GetMetrics returns the gateway metrics. + GetMetrics(context.Context, *GetGatewayMetricsRequest) (*GetGatewayMetricsResponse, error) mustEmbedUnimplementedGatewayServiceServer() } @@ -153,8 +153,8 @@ func (UnimplementedGatewayServiceServer) List(context.Context, *ListGatewaysRequ func (UnimplementedGatewayServiceServer) GenerateClientCertificate(context.Context, *GenerateGatewayClientCertificateRequest) (*GenerateGatewayClientCertificateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GenerateClientCertificate not implemented") } -func (UnimplementedGatewayServiceServer) GetStats(context.Context, *GetGatewayStatsRequest) (*GetGatewayStatsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetStats not implemented") +func (UnimplementedGatewayServiceServer) GetMetrics(context.Context, *GetGatewayMetricsRequest) (*GetGatewayMetricsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMetrics not implemented") } func (UnimplementedGatewayServiceServer) mustEmbedUnimplementedGatewayServiceServer() {} @@ -277,20 +277,20 @@ func _GatewayService_GenerateClientCertificate_Handler(srv interface{}, ctx cont return interceptor(ctx, in, info, handler) } -func _GatewayService_GetStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetGatewayStatsRequest) +func _GatewayService_GetMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGatewayMetricsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(GatewayServiceServer).GetStats(ctx, in) + return srv.(GatewayServiceServer).GetMetrics(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.GatewayService/GetStats", + FullMethod: "/api.GatewayService/GetMetrics", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GatewayServiceServer).GetStats(ctx, req.(*GetGatewayStatsRequest)) + return srv.(GatewayServiceServer).GetMetrics(ctx, req.(*GetGatewayMetricsRequest)) } return interceptor(ctx, in, info, handler) } @@ -327,8 +327,8 @@ var GatewayService_ServiceDesc = grpc.ServiceDesc{ Handler: _GatewayService_GenerateClientCertificate_Handler, }, { - MethodName: "GetStats", - Handler: _GatewayService_GetStats_Handler, + MethodName: "GetMetrics", + Handler: _GatewayService_GetMetrics_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/api/go/common/common.pb.go b/api/go/common/common.pb.go index e856ba6d..e0ac12f5 100644 --- a/api/go/common/common.pb.go +++ b/api/go/common/common.pb.go @@ -9,6 +9,7 @@ package common import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" ) @@ -424,6 +425,58 @@ func (LocationSource) EnumDescriptor() ([]byte, []int) { return file_common_common_proto_rawDescGZIP(), []int{5} } +type Aggregation int32 + +const ( + // Hour. + Aggregation_HOUR Aggregation = 0 + // Day. + Aggregation_DAY Aggregation = 1 + // Month. + Aggregation_MONTH Aggregation = 2 +) + +// Enum value maps for Aggregation. +var ( + Aggregation_name = map[int32]string{ + 0: "HOUR", + 1: "DAY", + 2: "MONTH", + } + Aggregation_value = map[string]int32{ + "HOUR": 0, + "DAY": 1, + "MONTH": 2, + } +) + +func (x Aggregation) Enum() *Aggregation { + p := new(Aggregation) + *p = x + return p +} + +func (x Aggregation) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Aggregation) Descriptor() protoreflect.EnumDescriptor { + return file_common_common_proto_enumTypes[6].Descriptor() +} + +func (Aggregation) Type() protoreflect.EnumType { + return &file_common_common_proto_enumTypes[6] +} + +func (x Aggregation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Aggregation.Descriptor instead. +func (Aggregation) EnumDescriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{6} +} + type Location struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -565,81 +618,222 @@ func (x *KeyEnvelope) GetAesKey() []byte { return nil } +type Metric struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Timestamps. + Timestamps []*timestamppb.Timestamp `protobuf:"bytes,2,rep,name=timestamps,proto3" json:"timestamps,omitempty"` + // Datasets. + Datasets []*MetricDataset `protobuf:"bytes,3,rep,name=datasets,proto3" json:"datasets,omitempty"` +} + +func (x *Metric) Reset() { + *x = Metric{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Metric) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Metric) ProtoMessage() {} + +func (x *Metric) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Metric.ProtoReflect.Descriptor instead. +func (*Metric) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{2} +} + +func (x *Metric) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Metric) GetTimestamps() []*timestamppb.Timestamp { + if x != nil { + return x.Timestamps + } + return nil +} + +func (x *Metric) GetDatasets() []*MetricDataset { + if x != nil { + return x.Datasets + } + return nil +} + +type MetricDataset struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Label. + Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"` + // Data. + // Each value index corresponds with the same timestamp index of the Metric. + Data []float32 `protobuf:"fixed32,2,rep,packed,name=data,proto3" json:"data,omitempty"` +} + +func (x *MetricDataset) Reset() { + *x = MetricDataset{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MetricDataset) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MetricDataset) ProtoMessage() {} + +func (x *MetricDataset) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MetricDataset.ProtoReflect.Descriptor instead. +func (*MetricDataset) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{3} +} + +func (x *MetricDataset) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *MetricDataset) GetData() []float32 { + if x != nil { + return x.Data + } + return nil +} + var File_common_common_proto protoreflect.FileDescriptor var file_common_common_proto_rawDesc = []byte{ 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0xac, 0x01, - 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, - 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x6c, 0x61, - 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, 0x74, - 0x75, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, - 0x74, 0x75, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x6c, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x61, 0x6c, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, - 0x12, 0x2e, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x75, 0x72, 0x61, 0x63, 0x79, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x02, 0x52, 0x08, 0x61, 0x63, 0x63, 0x75, 0x72, 0x61, 0x63, 0x79, 0x22, 0x43, 0x0a, 0x0b, - 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6b, - 0x65, 0x6b, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x6b, 0x65, 0x6b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x65, 0x73, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x61, 0x65, 0x73, 0x4b, 0x65, - 0x79, 0x2a, 0x2c, 0x0a, 0x0a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x08, 0x0a, 0x04, 0x4c, 0x4f, 0x52, 0x41, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x46, 0x53, 0x4b, - 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4c, 0x52, 0x5f, 0x46, 0x48, 0x53, 0x53, 0x10, 0x02, 0x2a, - 0xaa, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x55, - 0x38, 0x36, 0x38, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x53, 0x39, 0x31, 0x35, 0x10, 0x02, - 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4e, 0x37, 0x37, 0x39, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x45, - 0x55, 0x34, 0x33, 0x33, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x55, 0x39, 0x31, 0x35, 0x10, - 0x05, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4e, 0x34, 0x37, 0x30, 0x10, 0x06, 0x12, 0x09, 0x0a, 0x05, - 0x41, 0x53, 0x39, 0x32, 0x33, 0x10, 0x07, 0x12, 0x0b, 0x0a, 0x07, 0x41, 0x53, 0x39, 0x32, 0x33, - 0x5f, 0x32, 0x10, 0x0c, 0x12, 0x0b, 0x0a, 0x07, 0x41, 0x53, 0x39, 0x32, 0x33, 0x5f, 0x33, 0x10, - 0x0d, 0x12, 0x0b, 0x0a, 0x07, 0x41, 0x53, 0x39, 0x32, 0x33, 0x5f, 0x34, 0x10, 0x0e, 0x12, 0x09, - 0x0a, 0x05, 0x4b, 0x52, 0x39, 0x32, 0x30, 0x10, 0x08, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x38, - 0x36, 0x35, 0x10, 0x09, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x55, 0x38, 0x36, 0x34, 0x10, 0x0a, 0x12, - 0x0b, 0x0a, 0x07, 0x49, 0x53, 0x4d, 0x32, 0x34, 0x30, 0x30, 0x10, 0x0b, 0x2a, 0xb3, 0x01, 0x0a, - 0x05, 0x4d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x4a, 0x4f, 0x49, 0x4e, 0x5f, 0x52, - 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4a, 0x4f, 0x49, 0x4e, - 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x55, 0x4e, 0x43, - 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x55, 0x50, - 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x55, 0x4e, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, - 0x44, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x03, 0x12, 0x15, 0x0a, - 0x11, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, - 0x55, 0x50, 0x10, 0x04, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, - 0x44, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x05, 0x12, 0x12, 0x0a, - 0x0e, 0x52, 0x45, 0x4a, 0x4f, 0x49, 0x4e, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, - 0x06, 0x12, 0x0f, 0x0a, 0x0b, 0x50, 0x52, 0x4f, 0x50, 0x52, 0x49, 0x45, 0x54, 0x41, 0x52, 0x59, - 0x10, 0x07, 0x2a, 0x7e, 0x0a, 0x0a, 0x4d, 0x61, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x1a, 0x1f, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xac, + 0x01, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6c, + 0x61, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x6c, + 0x61, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, + 0x74, 0x75, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x6c, 0x6f, 0x6e, 0x67, + 0x69, 0x74, 0x75, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x6c, 0x74, 0x69, 0x74, 0x75, 0x64, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x61, 0x6c, 0x74, 0x69, 0x74, 0x75, 0x64, + 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x75, 0x72, 0x61, 0x63, 0x79, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x02, 0x52, 0x08, 0x61, 0x63, 0x63, 0x75, 0x72, 0x61, 0x63, 0x79, 0x22, 0x43, 0x0a, + 0x0b, 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x6b, 0x65, 0x6b, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6b, 0x65, 0x6b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x65, 0x73, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x61, 0x65, 0x73, 0x4b, + 0x65, 0x79, 0x22, 0x8b, 0x01, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x3a, 0x0a, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x73, 0x12, 0x31, 0x0a, + 0x08, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, + 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x73, + 0x22, 0x39, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x73, 0x65, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x02, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x2a, 0x2c, 0x0a, 0x0a, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x4f, 0x52, + 0x41, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x46, 0x53, 0x4b, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, + 0x4c, 0x52, 0x5f, 0x46, 0x48, 0x53, 0x53, 0x10, 0x02, 0x2a, 0xaa, 0x01, 0x0a, 0x06, 0x52, 0x65, + 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x55, 0x38, 0x36, 0x38, 0x10, 0x00, 0x12, + 0x09, 0x0a, 0x05, 0x55, 0x53, 0x39, 0x31, 0x35, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4e, + 0x37, 0x37, 0x39, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x55, 0x34, 0x33, 0x33, 0x10, 0x04, + 0x12, 0x09, 0x0a, 0x05, 0x41, 0x55, 0x39, 0x31, 0x35, 0x10, 0x05, 0x12, 0x09, 0x0a, 0x05, 0x43, + 0x4e, 0x34, 0x37, 0x30, 0x10, 0x06, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x53, 0x39, 0x32, 0x33, 0x10, + 0x07, 0x12, 0x0b, 0x0a, 0x07, 0x41, 0x53, 0x39, 0x32, 0x33, 0x5f, 0x32, 0x10, 0x0c, 0x12, 0x0b, + 0x0a, 0x07, 0x41, 0x53, 0x39, 0x32, 0x33, 0x5f, 0x33, 0x10, 0x0d, 0x12, 0x0b, 0x0a, 0x07, 0x41, + 0x53, 0x39, 0x32, 0x33, 0x5f, 0x34, 0x10, 0x0e, 0x12, 0x09, 0x0a, 0x05, 0x4b, 0x52, 0x39, 0x32, + 0x30, 0x10, 0x08, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x38, 0x36, 0x35, 0x10, 0x09, 0x12, 0x09, + 0x0a, 0x05, 0x52, 0x55, 0x38, 0x36, 0x34, 0x10, 0x0a, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x53, 0x4d, + 0x32, 0x34, 0x30, 0x30, 0x10, 0x0b, 0x2a, 0xb3, 0x01, 0x0a, 0x05, 0x4d, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x10, 0x0a, 0x0c, 0x4a, 0x4f, 0x49, 0x4e, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, + 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4a, 0x4f, 0x49, 0x4e, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, + 0x54, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x55, 0x4e, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, + 0x45, 0x44, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x55, 0x50, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, + 0x55, 0x4e, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x5f, 0x44, 0x41, 0x54, 0x41, + 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, 0x46, 0x49, + 0x52, 0x4d, 0x45, 0x44, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x55, 0x50, 0x10, 0x04, 0x12, 0x17, + 0x0a, 0x13, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x5f, 0x44, 0x41, 0x54, 0x41, + 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x05, 0x12, 0x12, 0x0a, 0x0e, 0x52, 0x45, 0x4a, 0x4f, 0x49, + 0x4e, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x06, 0x12, 0x0f, 0x0a, 0x0b, 0x50, + 0x52, 0x4f, 0x50, 0x52, 0x49, 0x45, 0x54, 0x41, 0x52, 0x59, 0x10, 0x07, 0x2a, 0x7e, 0x0a, 0x0a, + 0x4d, 0x61, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x4f, + 0x52, 0x41, 0x57, 0x41, 0x4e, 0x5f, 0x31, 0x5f, 0x30, 0x5f, 0x30, 0x10, 0x00, 0x12, 0x11, 0x0a, + 0x0d, 0x4c, 0x4f, 0x52, 0x41, 0x57, 0x41, 0x4e, 0x5f, 0x31, 0x5f, 0x30, 0x5f, 0x31, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x52, 0x41, 0x57, 0x41, 0x4e, 0x5f, 0x31, 0x5f, 0x30, 0x5f, - 0x30, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x52, 0x41, 0x57, 0x41, 0x4e, 0x5f, 0x31, - 0x5f, 0x30, 0x5f, 0x31, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x52, 0x41, 0x57, 0x41, - 0x4e, 0x5f, 0x31, 0x5f, 0x30, 0x5f, 0x32, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x52, - 0x41, 0x57, 0x41, 0x4e, 0x5f, 0x31, 0x5f, 0x30, 0x5f, 0x33, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, - 0x4c, 0x4f, 0x52, 0x41, 0x57, 0x41, 0x4e, 0x5f, 0x31, 0x5f, 0x30, 0x5f, 0x34, 0x10, 0x04, 0x12, - 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x52, 0x41, 0x57, 0x41, 0x4e, 0x5f, 0x31, 0x5f, 0x31, 0x5f, 0x30, - 0x10, 0x05, 0x2a, 0x65, 0x0a, 0x11, 0x52, 0x65, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x05, 0x0a, 0x01, 0x41, 0x10, 0x00, 0x12, 0x05, - 0x0a, 0x01, 0x42, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x50, 0x30, 0x30, 0x32, 0x5f, 0x31, - 0x5f, 0x30, 0x5f, 0x30, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x50, 0x30, 0x30, 0x32, 0x5f, - 0x31, 0x5f, 0x30, 0x5f, 0x31, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x50, 0x30, 0x30, 0x32, - 0x5f, 0x31, 0x5f, 0x30, 0x5f, 0x32, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x50, 0x30, 0x30, - 0x32, 0x5f, 0x31, 0x5f, 0x30, 0x5f, 0x33, 0x10, 0x05, 0x2a, 0x8e, 0x01, 0x0a, 0x0e, 0x4c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0b, 0x0a, 0x07, - 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x50, 0x53, - 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, 0x02, 0x12, 0x15, - 0x0a, 0x11, 0x47, 0x45, 0x4f, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x52, 0x5f, 0x54, - 0x44, 0x4f, 0x41, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x47, 0x45, 0x4f, 0x5f, 0x52, 0x45, 0x53, - 0x4f, 0x4c, 0x56, 0x45, 0x52, 0x5f, 0x52, 0x53, 0x53, 0x49, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, - 0x47, 0x45, 0x4f, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x52, 0x5f, 0x47, 0x4e, 0x53, - 0x53, 0x10, 0x05, 0x12, 0x15, 0x0a, 0x11, 0x47, 0x45, 0x4f, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x4c, - 0x56, 0x45, 0x52, 0x5f, 0x57, 0x49, 0x46, 0x49, 0x10, 0x06, 0x42, 0x55, 0x0a, 0x11, 0x69, 0x6f, - 0x2e, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x61, 0x70, 0x69, 0x42, - 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x69, 0x72, 0x70, - 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x32, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x52, 0x41, 0x57, 0x41, 0x4e, 0x5f, 0x31, + 0x5f, 0x30, 0x5f, 0x33, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x52, 0x41, 0x57, 0x41, + 0x4e, 0x5f, 0x31, 0x5f, 0x30, 0x5f, 0x34, 0x10, 0x04, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x52, + 0x41, 0x57, 0x41, 0x4e, 0x5f, 0x31, 0x5f, 0x31, 0x5f, 0x30, 0x10, 0x05, 0x2a, 0x65, 0x0a, 0x11, + 0x52, 0x65, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x05, 0x0a, 0x01, 0x41, 0x10, 0x00, 0x12, 0x05, 0x0a, 0x01, 0x42, 0x10, 0x01, 0x12, + 0x0f, 0x0a, 0x0b, 0x52, 0x50, 0x30, 0x30, 0x32, 0x5f, 0x31, 0x5f, 0x30, 0x5f, 0x30, 0x10, 0x02, + 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x50, 0x30, 0x30, 0x32, 0x5f, 0x31, 0x5f, 0x30, 0x5f, 0x31, 0x10, + 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x50, 0x30, 0x30, 0x32, 0x5f, 0x31, 0x5f, 0x30, 0x5f, 0x32, + 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x50, 0x30, 0x30, 0x32, 0x5f, 0x31, 0x5f, 0x30, 0x5f, + 0x33, 0x10, 0x05, 0x2a, 0x8e, 0x01, 0x0a, 0x0e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x50, 0x53, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, + 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x47, 0x45, 0x4f, 0x5f, + 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x52, 0x5f, 0x54, 0x44, 0x4f, 0x41, 0x10, 0x03, 0x12, + 0x15, 0x0a, 0x11, 0x47, 0x45, 0x4f, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x52, 0x5f, + 0x52, 0x53, 0x53, 0x49, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x47, 0x45, 0x4f, 0x5f, 0x52, 0x45, + 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x52, 0x5f, 0x47, 0x4e, 0x53, 0x53, 0x10, 0x05, 0x12, 0x15, 0x0a, + 0x11, 0x47, 0x45, 0x4f, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x52, 0x5f, 0x57, 0x49, + 0x46, 0x49, 0x10, 0x06, 0x2a, 0x2b, 0x0a, 0x0b, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x4f, 0x55, 0x52, 0x10, 0x00, 0x12, 0x07, 0x0a, + 0x03, 0x44, 0x41, 0x59, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x4d, 0x4f, 0x4e, 0x54, 0x48, 0x10, + 0x02, 0x42, 0x55, 0x0a, 0x11, 0x69, 0x6f, 0x2e, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, + 0x63, 0x6b, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x63, 0x68, 0x69, + 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, + 0x34, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -654,25 +848,31 @@ func file_common_common_proto_rawDescGZIP() []byte { return file_common_common_proto_rawDescData } -var file_common_common_proto_enumTypes = make([]protoimpl.EnumInfo, 6) -var file_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_common_common_proto_enumTypes = make([]protoimpl.EnumInfo, 7) +var file_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_common_common_proto_goTypes = []interface{}{ - (Modulation)(0), // 0: common.Modulation - (Region)(0), // 1: common.Region - (MType)(0), // 2: common.MType - (MacVersion)(0), // 3: common.MacVersion - (RegParamsRevision)(0), // 4: common.RegParamsRevision - (LocationSource)(0), // 5: common.LocationSource - (*Location)(nil), // 6: common.Location - (*KeyEnvelope)(nil), // 7: common.KeyEnvelope + (Modulation)(0), // 0: common.Modulation + (Region)(0), // 1: common.Region + (MType)(0), // 2: common.MType + (MacVersion)(0), // 3: common.MacVersion + (RegParamsRevision)(0), // 4: common.RegParamsRevision + (LocationSource)(0), // 5: common.LocationSource + (Aggregation)(0), // 6: common.Aggregation + (*Location)(nil), // 7: common.Location + (*KeyEnvelope)(nil), // 8: common.KeyEnvelope + (*Metric)(nil), // 9: common.Metric + (*MetricDataset)(nil), // 10: common.MetricDataset + (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp } var file_common_common_proto_depIdxs = []int32{ - 5, // 0: common.Location.source:type_name -> common.LocationSource - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 5, // 0: common.Location.source:type_name -> common.LocationSource + 11, // 1: common.Metric.timestamps:type_name -> google.protobuf.Timestamp + 10, // 2: common.Metric.datasets:type_name -> common.MetricDataset + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_common_common_proto_init() } @@ -705,14 +905,38 @@ func file_common_common_proto_init() { return nil } } + file_common_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Metric); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_common_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MetricDataset); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_common_common_proto_rawDesc, - NumEnums: 6, - NumMessages: 2, + NumEnums: 7, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/api/grpc-web/api/device_grpc_web_pb.d.ts b/api/grpc-web/api/device_grpc_web_pb.d.ts index cccfc5a4..d870d016 100644 --- a/api/grpc-web/api/device_grpc_web_pb.d.ts +++ b/api/grpc-web/api/device_grpc_web_pb.d.ts @@ -107,12 +107,19 @@ export class DeviceServiceClient { response: api_device_pb.GetRandomDevAddrResponse) => void ): grpcWeb.ClientReadableStream; - getStats( - request: api_device_pb.GetDeviceStatsRequest, + getMetrics( + request: api_device_pb.GetDeviceMetricsRequest, metadata: grpcWeb.Metadata | undefined, callback: (err: grpcWeb.Error, - response: api_device_pb.GetDeviceStatsResponse) => void - ): grpcWeb.ClientReadableStream; + response: api_device_pb.GetDeviceMetricsResponse) => void + ): grpcWeb.ClientReadableStream; + + getLinkMetrics( + request: api_device_pb.GetDeviceLinkMetricsRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.Error, + response: api_device_pb.GetDeviceLinkMetricsResponse) => void + ): grpcWeb.ClientReadableStream; enqueue( request: api_device_pb.EnqueueDeviceQueueItemRequest, @@ -212,10 +219,15 @@ export class DeviceServicePromiseClient { metadata?: grpcWeb.Metadata ): Promise; - getStats( - request: api_device_pb.GetDeviceStatsRequest, + getMetrics( + request: api_device_pb.GetDeviceMetricsRequest, metadata?: grpcWeb.Metadata - ): Promise; + ): Promise; + + getLinkMetrics( + request: api_device_pb.GetDeviceLinkMetricsRequest, + metadata?: grpcWeb.Metadata + ): Promise; enqueue( request: api_device_pb.EnqueueDeviceQueueItemRequest, diff --git a/api/grpc-web/api/device_grpc_web_pb.js b/api/grpc-web/api/device_grpc_web_pb.js index 5ec7a1e5..2fc6fb86 100644 --- a/api/grpc-web/api/device_grpc_web_pb.js +++ b/api/grpc-web/api/device_grpc_web_pb.js @@ -16,6 +16,8 @@ const grpc = {}; grpc.web = require('grpc-web'); +var common_common_pb = require('../common/common_pb.js') + var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js') var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js') @@ -1199,80 +1201,160 @@ proto.api.DeviceServicePromiseClient.prototype.getRandomDevAddr = /** * @const * @type {!grpc.web.MethodDescriptor< - * !proto.api.GetDeviceStatsRequest, - * !proto.api.GetDeviceStatsResponse>} + * !proto.api.GetDeviceMetricsRequest, + * !proto.api.GetDeviceMetricsResponse>} */ -const methodDescriptor_DeviceService_GetStats = new grpc.web.MethodDescriptor( - '/api.DeviceService/GetStats', +const methodDescriptor_DeviceService_GetMetrics = new grpc.web.MethodDescriptor( + '/api.DeviceService/GetMetrics', grpc.web.MethodType.UNARY, - proto.api.GetDeviceStatsRequest, - proto.api.GetDeviceStatsResponse, + proto.api.GetDeviceMetricsRequest, + proto.api.GetDeviceMetricsResponse, /** - * @param {!proto.api.GetDeviceStatsRequest} request + * @param {!proto.api.GetDeviceMetricsRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, - proto.api.GetDeviceStatsResponse.deserializeBinary + proto.api.GetDeviceMetricsResponse.deserializeBinary ); /** * @const * @type {!grpc.web.AbstractClientBase.MethodInfo< - * !proto.api.GetDeviceStatsRequest, - * !proto.api.GetDeviceStatsResponse>} + * !proto.api.GetDeviceMetricsRequest, + * !proto.api.GetDeviceMetricsResponse>} */ -const methodInfo_DeviceService_GetStats = new grpc.web.AbstractClientBase.MethodInfo( - proto.api.GetDeviceStatsResponse, +const methodInfo_DeviceService_GetMetrics = new grpc.web.AbstractClientBase.MethodInfo( + proto.api.GetDeviceMetricsResponse, /** - * @param {!proto.api.GetDeviceStatsRequest} request + * @param {!proto.api.GetDeviceMetricsRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, - proto.api.GetDeviceStatsResponse.deserializeBinary + proto.api.GetDeviceMetricsResponse.deserializeBinary ); /** - * @param {!proto.api.GetDeviceStatsRequest} request The + * @param {!proto.api.GetDeviceMetricsRequest} request The * request proto * @param {?Object} metadata User defined * call metadata - * @param {function(?grpc.web.Error, ?proto.api.GetDeviceStatsResponse)} + * @param {function(?grpc.web.Error, ?proto.api.GetDeviceMetricsResponse)} * callback The callback function(error, response) - * @return {!grpc.web.ClientReadableStream|undefined} + * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ -proto.api.DeviceServiceClient.prototype.getStats = +proto.api.DeviceServiceClient.prototype.getMetrics = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + - '/api.DeviceService/GetStats', + '/api.DeviceService/GetMetrics', request, metadata || {}, - methodDescriptor_DeviceService_GetStats, + methodDescriptor_DeviceService_GetMetrics, callback); }; /** - * @param {!proto.api.GetDeviceStatsRequest} request The + * @param {!proto.api.GetDeviceMetricsRequest} request The * request proto * @param {?Object} metadata User defined * call metadata - * @return {!Promise} + * @return {!Promise} * Promise that resolves to the response */ -proto.api.DeviceServicePromiseClient.prototype.getStats = +proto.api.DeviceServicePromiseClient.prototype.getMetrics = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + - '/api.DeviceService/GetStats', + '/api.DeviceService/GetMetrics', request, metadata || {}, - methodDescriptor_DeviceService_GetStats); + methodDescriptor_DeviceService_GetMetrics); +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.api.GetDeviceLinkMetricsRequest, + * !proto.api.GetDeviceLinkMetricsResponse>} + */ +const methodDescriptor_DeviceService_GetLinkMetrics = new grpc.web.MethodDescriptor( + '/api.DeviceService/GetLinkMetrics', + grpc.web.MethodType.UNARY, + proto.api.GetDeviceLinkMetricsRequest, + proto.api.GetDeviceLinkMetricsResponse, + /** + * @param {!proto.api.GetDeviceLinkMetricsRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.api.GetDeviceLinkMetricsResponse.deserializeBinary +); + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.api.GetDeviceLinkMetricsRequest, + * !proto.api.GetDeviceLinkMetricsResponse>} + */ +const methodInfo_DeviceService_GetLinkMetrics = new grpc.web.AbstractClientBase.MethodInfo( + proto.api.GetDeviceLinkMetricsResponse, + /** + * @param {!proto.api.GetDeviceLinkMetricsRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.api.GetDeviceLinkMetricsResponse.deserializeBinary +); + + +/** + * @param {!proto.api.GetDeviceLinkMetricsRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.api.GetDeviceLinkMetricsResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.api.DeviceServiceClient.prototype.getLinkMetrics = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/api.DeviceService/GetLinkMetrics', + request, + metadata || {}, + methodDescriptor_DeviceService_GetLinkMetrics, + callback); +}; + + +/** + * @param {!proto.api.GetDeviceLinkMetricsRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.api.DeviceServicePromiseClient.prototype.getLinkMetrics = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/api.DeviceService/GetLinkMetrics', + request, + metadata || {}, + methodDescriptor_DeviceService_GetLinkMetrics); }; diff --git a/api/grpc-web/api/device_pb.d.ts b/api/grpc-web/api/device_pb.d.ts index 684603fb..bb0c5365 100644 --- a/api/grpc-web/api/device_pb.d.ts +++ b/api/grpc-web/api/device_pb.d.ts @@ -1,5 +1,6 @@ import * as jspb from 'google-protobuf' +import * as common_common_pb from '../common/common_pb'; import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb'; import * as google_protobuf_struct_pb from 'google-protobuf/google/protobuf/struct_pb'; import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb'; @@ -613,97 +614,165 @@ export namespace GetRandomDevAddrResponse { } } -export class GetDeviceStatsRequest extends jspb.Message { +export class GetDeviceMetricsRequest extends jspb.Message { getDevEui(): string; - setDevEui(value: string): GetDeviceStatsRequest; + setDevEui(value: string): GetDeviceMetricsRequest; getStart(): google_protobuf_timestamp_pb.Timestamp | undefined; - setStart(value?: google_protobuf_timestamp_pb.Timestamp): GetDeviceStatsRequest; + setStart(value?: google_protobuf_timestamp_pb.Timestamp): GetDeviceMetricsRequest; hasStart(): boolean; - clearStart(): GetDeviceStatsRequest; + clearStart(): GetDeviceMetricsRequest; getEnd(): google_protobuf_timestamp_pb.Timestamp | undefined; - setEnd(value?: google_protobuf_timestamp_pb.Timestamp): GetDeviceStatsRequest; + setEnd(value?: google_protobuf_timestamp_pb.Timestamp): GetDeviceMetricsRequest; hasEnd(): boolean; - clearEnd(): GetDeviceStatsRequest; + clearEnd(): GetDeviceMetricsRequest; + + getAggregation(): common_common_pb.Aggregation; + setAggregation(value: common_common_pb.Aggregation): GetDeviceMetricsRequest; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetDeviceStatsRequest.AsObject; - static toObject(includeInstance: boolean, msg: GetDeviceStatsRequest): GetDeviceStatsRequest.AsObject; - static serializeBinaryToWriter(message: GetDeviceStatsRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetDeviceStatsRequest; - static deserializeBinaryFromReader(message: GetDeviceStatsRequest, reader: jspb.BinaryReader): GetDeviceStatsRequest; + toObject(includeInstance?: boolean): GetDeviceMetricsRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetDeviceMetricsRequest): GetDeviceMetricsRequest.AsObject; + static serializeBinaryToWriter(message: GetDeviceMetricsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetDeviceMetricsRequest; + static deserializeBinaryFromReader(message: GetDeviceMetricsRequest, reader: jspb.BinaryReader): GetDeviceMetricsRequest; } -export namespace GetDeviceStatsRequest { +export namespace GetDeviceMetricsRequest { export type AsObject = { devEui: string, start?: google_protobuf_timestamp_pb.Timestamp.AsObject, end?: google_protobuf_timestamp_pb.Timestamp.AsObject, + aggregation: common_common_pb.Aggregation, } } -export class GetDeviceStatsResponse extends jspb.Message { - getResultList(): Array; - setResultList(value: Array): GetDeviceStatsResponse; - clearResultList(): GetDeviceStatsResponse; - addResult(value?: DeviceStats, index?: number): DeviceStats; +export class GetDeviceMetricsResponse extends jspb.Message { + getMetricsMap(): jspb.Map; + clearMetricsMap(): GetDeviceMetricsResponse; + + getStatesMap(): jspb.Map; + clearStatesMap(): GetDeviceMetricsResponse; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetDeviceStatsResponse.AsObject; - static toObject(includeInstance: boolean, msg: GetDeviceStatsResponse): GetDeviceStatsResponse.AsObject; - static serializeBinaryToWriter(message: GetDeviceStatsResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetDeviceStatsResponse; - static deserializeBinaryFromReader(message: GetDeviceStatsResponse, reader: jspb.BinaryReader): GetDeviceStatsResponse; + toObject(includeInstance?: boolean): GetDeviceMetricsResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetDeviceMetricsResponse): GetDeviceMetricsResponse.AsObject; + static serializeBinaryToWriter(message: GetDeviceMetricsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetDeviceMetricsResponse; + static deserializeBinaryFromReader(message: GetDeviceMetricsResponse, reader: jspb.BinaryReader): GetDeviceMetricsResponse; } -export namespace GetDeviceStatsResponse { +export namespace GetDeviceMetricsResponse { export type AsObject = { - resultList: Array, + metricsMap: Array<[string, common_common_pb.Metric.AsObject]>, + statesMap: Array<[string, DeviceState.AsObject]>, } } -export class DeviceStats extends jspb.Message { - getTime(): google_protobuf_timestamp_pb.Timestamp | undefined; - setTime(value?: google_protobuf_timestamp_pb.Timestamp): DeviceStats; - hasTime(): boolean; - clearTime(): DeviceStats; +export class DeviceState extends jspb.Message { + getName(): string; + setName(value: string): DeviceState; - getRxPackets(): number; - setRxPackets(value: number): DeviceStats; - - getGwRssi(): number; - setGwRssi(value: number): DeviceStats; - - getGwSnr(): number; - setGwSnr(value: number): DeviceStats; - - getRxPacketsPerFrequencyMap(): jspb.Map; - clearRxPacketsPerFrequencyMap(): DeviceStats; - - getRxPacketsPerDrMap(): jspb.Map; - clearRxPacketsPerDrMap(): DeviceStats; - - getErrorsMap(): jspb.Map; - clearErrorsMap(): DeviceStats; + getValue(): string; + setValue(value: string): DeviceState; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DeviceStats.AsObject; - static toObject(includeInstance: boolean, msg: DeviceStats): DeviceStats.AsObject; - static serializeBinaryToWriter(message: DeviceStats, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DeviceStats; - static deserializeBinaryFromReader(message: DeviceStats, reader: jspb.BinaryReader): DeviceStats; + toObject(includeInstance?: boolean): DeviceState.AsObject; + static toObject(includeInstance: boolean, msg: DeviceState): DeviceState.AsObject; + static serializeBinaryToWriter(message: DeviceState, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeviceState; + static deserializeBinaryFromReader(message: DeviceState, reader: jspb.BinaryReader): DeviceState; } -export namespace DeviceStats { +export namespace DeviceState { export type AsObject = { - time?: google_protobuf_timestamp_pb.Timestamp.AsObject, - rxPackets: number, - gwRssi: number, - gwSnr: number, - rxPacketsPerFrequencyMap: Array<[number, number]>, - rxPacketsPerDrMap: Array<[number, number]>, - errorsMap: Array<[string, number]>, + name: string, + value: string, + } +} + +export class GetDeviceLinkMetricsRequest extends jspb.Message { + getDevEui(): string; + setDevEui(value: string): GetDeviceLinkMetricsRequest; + + getStart(): google_protobuf_timestamp_pb.Timestamp | undefined; + setStart(value?: google_protobuf_timestamp_pb.Timestamp): GetDeviceLinkMetricsRequest; + hasStart(): boolean; + clearStart(): GetDeviceLinkMetricsRequest; + + getEnd(): google_protobuf_timestamp_pb.Timestamp | undefined; + setEnd(value?: google_protobuf_timestamp_pb.Timestamp): GetDeviceLinkMetricsRequest; + hasEnd(): boolean; + clearEnd(): GetDeviceLinkMetricsRequest; + + getAggregation(): common_common_pb.Aggregation; + setAggregation(value: common_common_pb.Aggregation): GetDeviceLinkMetricsRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetDeviceLinkMetricsRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetDeviceLinkMetricsRequest): GetDeviceLinkMetricsRequest.AsObject; + static serializeBinaryToWriter(message: GetDeviceLinkMetricsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetDeviceLinkMetricsRequest; + static deserializeBinaryFromReader(message: GetDeviceLinkMetricsRequest, reader: jspb.BinaryReader): GetDeviceLinkMetricsRequest; +} + +export namespace GetDeviceLinkMetricsRequest { + export type AsObject = { + devEui: string, + start?: google_protobuf_timestamp_pb.Timestamp.AsObject, + end?: google_protobuf_timestamp_pb.Timestamp.AsObject, + aggregation: common_common_pb.Aggregation, + } +} + +export class GetDeviceLinkMetricsResponse extends jspb.Message { + getRxPackets(): common_common_pb.Metric | undefined; + setRxPackets(value?: common_common_pb.Metric): GetDeviceLinkMetricsResponse; + hasRxPackets(): boolean; + clearRxPackets(): GetDeviceLinkMetricsResponse; + + getGwRssi(): common_common_pb.Metric | undefined; + setGwRssi(value?: common_common_pb.Metric): GetDeviceLinkMetricsResponse; + hasGwRssi(): boolean; + clearGwRssi(): GetDeviceLinkMetricsResponse; + + getGwSnr(): common_common_pb.Metric | undefined; + setGwSnr(value?: common_common_pb.Metric): GetDeviceLinkMetricsResponse; + hasGwSnr(): boolean; + clearGwSnr(): GetDeviceLinkMetricsResponse; + + getRxPacketsPerFreq(): common_common_pb.Metric | undefined; + setRxPacketsPerFreq(value?: common_common_pb.Metric): GetDeviceLinkMetricsResponse; + hasRxPacketsPerFreq(): boolean; + clearRxPacketsPerFreq(): GetDeviceLinkMetricsResponse; + + getRxPacketsPerDr(): common_common_pb.Metric | undefined; + setRxPacketsPerDr(value?: common_common_pb.Metric): GetDeviceLinkMetricsResponse; + hasRxPacketsPerDr(): boolean; + clearRxPacketsPerDr(): GetDeviceLinkMetricsResponse; + + getErrors(): common_common_pb.Metric | undefined; + setErrors(value?: common_common_pb.Metric): GetDeviceLinkMetricsResponse; + hasErrors(): boolean; + clearErrors(): GetDeviceLinkMetricsResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetDeviceLinkMetricsResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetDeviceLinkMetricsResponse): GetDeviceLinkMetricsResponse.AsObject; + static serializeBinaryToWriter(message: GetDeviceLinkMetricsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetDeviceLinkMetricsResponse; + static deserializeBinaryFromReader(message: GetDeviceLinkMetricsResponse, reader: jspb.BinaryReader): GetDeviceLinkMetricsResponse; +} + +export namespace GetDeviceLinkMetricsResponse { + export type AsObject = { + rxPackets?: common_common_pb.Metric.AsObject, + gwRssi?: common_common_pb.Metric.AsObject, + gwSnr?: common_common_pb.Metric.AsObject, + rxPacketsPerFreq?: common_common_pb.Metric.AsObject, + rxPacketsPerDr?: common_common_pb.Metric.AsObject, + errors?: common_common_pb.Metric.AsObject, } } diff --git a/api/grpc-web/api/device_pb.js b/api/grpc-web/api/device_pb.js index 89c3fda0..ee2ad119 100644 --- a/api/grpc-web/api/device_pb.js +++ b/api/grpc-web/api/device_pb.js @@ -15,6 +15,8 @@ var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); +var common_common_pb = require('../common/common_pb.js'); +goog.object.extend(proto, common_common_pb); var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); goog.object.extend(proto, google_protobuf_timestamp_pb); var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); @@ -32,7 +34,7 @@ goog.exportSymbol('proto.api.DeviceActivation', null, global); goog.exportSymbol('proto.api.DeviceKeys', null, global); goog.exportSymbol('proto.api.DeviceListItem', null, global); goog.exportSymbol('proto.api.DeviceQueueItem', null, global); -goog.exportSymbol('proto.api.DeviceStats', null, global); +goog.exportSymbol('proto.api.DeviceState', null, global); goog.exportSymbol('proto.api.DeviceStatus', null, global); goog.exportSymbol('proto.api.EnqueueDeviceQueueItemRequest', null, global); goog.exportSymbol('proto.api.EnqueueDeviceQueueItemResponse', null, global); @@ -42,12 +44,14 @@ goog.exportSymbol('proto.api.GetDeviceActivationRequest', null, global); goog.exportSymbol('proto.api.GetDeviceActivationResponse', null, global); goog.exportSymbol('proto.api.GetDeviceKeysRequest', null, global); goog.exportSymbol('proto.api.GetDeviceKeysResponse', null, global); +goog.exportSymbol('proto.api.GetDeviceLinkMetricsRequest', null, global); +goog.exportSymbol('proto.api.GetDeviceLinkMetricsResponse', null, global); +goog.exportSymbol('proto.api.GetDeviceMetricsRequest', null, global); +goog.exportSymbol('proto.api.GetDeviceMetricsResponse', null, global); goog.exportSymbol('proto.api.GetDeviceQueueItemsRequest', null, global); goog.exportSymbol('proto.api.GetDeviceQueueItemsResponse', null, global); goog.exportSymbol('proto.api.GetDeviceRequest', null, global); goog.exportSymbol('proto.api.GetDeviceResponse', null, global); -goog.exportSymbol('proto.api.GetDeviceStatsRequest', null, global); -goog.exportSymbol('proto.api.GetDeviceStatsResponse', null, global); goog.exportSymbol('proto.api.GetRandomDevAddrRequest', null, global); goog.exportSymbol('proto.api.GetRandomDevAddrResponse', null, global); goog.exportSymbol('proto.api.ListDevicesRequest', null, global); @@ -547,16 +551,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.GetDeviceStatsRequest = function(opt_data) { +proto.api.GetDeviceMetricsRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.api.GetDeviceStatsRequest, jspb.Message); +goog.inherits(proto.api.GetDeviceMetricsRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.GetDeviceStatsRequest.displayName = 'proto.api.GetDeviceStatsRequest'; + proto.api.GetDeviceMetricsRequest.displayName = 'proto.api.GetDeviceMetricsRequest'; } /** * Generated by JsPbCodeGenerator. @@ -568,16 +572,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.GetDeviceStatsResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.api.GetDeviceStatsResponse.repeatedFields_, null); +proto.api.GetDeviceMetricsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.api.GetDeviceStatsResponse, jspb.Message); +goog.inherits(proto.api.GetDeviceMetricsResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.GetDeviceStatsResponse.displayName = 'proto.api.GetDeviceStatsResponse'; + proto.api.GetDeviceMetricsResponse.displayName = 'proto.api.GetDeviceMetricsResponse'; } /** * Generated by JsPbCodeGenerator. @@ -589,16 +593,58 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.DeviceStats = function(opt_data) { +proto.api.DeviceState = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.api.DeviceStats, jspb.Message); +goog.inherits(proto.api.DeviceState, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.DeviceStats.displayName = 'proto.api.DeviceStats'; + proto.api.DeviceState.displayName = 'proto.api.DeviceState'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.GetDeviceLinkMetricsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.GetDeviceLinkMetricsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.GetDeviceLinkMetricsRequest.displayName = 'proto.api.GetDeviceLinkMetricsRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.GetDeviceLinkMetricsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.GetDeviceLinkMetricsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.GetDeviceLinkMetricsResponse.displayName = 'proto.api.GetDeviceLinkMetricsResponse'; } /** * Generated by JsPbCodeGenerator. @@ -5337,8 +5383,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.GetDeviceStatsRequest.prototype.toObject = function(opt_includeInstance) { - return proto.api.GetDeviceStatsRequest.toObject(opt_includeInstance, this); +proto.api.GetDeviceMetricsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetDeviceMetricsRequest.toObject(opt_includeInstance, this); }; @@ -5347,15 +5393,16 @@ proto.api.GetDeviceStatsRequest.prototype.toObject = function(opt_includeInstanc * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.GetDeviceStatsRequest} msg The msg instance to transform. + * @param {!proto.api.GetDeviceMetricsRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.GetDeviceStatsRequest.toObject = function(includeInstance, msg) { +proto.api.GetDeviceMetricsRequest.toObject = function(includeInstance, msg) { var f, obj = { devEui: jspb.Message.getFieldWithDefault(msg, 1, ""), start: (f = msg.getStart()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), - end: (f = msg.getEnd()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f) + end: (f = msg.getEnd()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), + aggregation: jspb.Message.getFieldWithDefault(msg, 4, 0) }; if (includeInstance) { @@ -5369,23 +5416,23 @@ proto.api.GetDeviceStatsRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.GetDeviceStatsRequest} + * @return {!proto.api.GetDeviceMetricsRequest} */ -proto.api.GetDeviceStatsRequest.deserializeBinary = function(bytes) { +proto.api.GetDeviceMetricsRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.GetDeviceStatsRequest; - return proto.api.GetDeviceStatsRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.GetDeviceMetricsRequest; + return proto.api.GetDeviceMetricsRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.GetDeviceStatsRequest} msg The message object to deserialize into. + * @param {!proto.api.GetDeviceMetricsRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.GetDeviceStatsRequest} + * @return {!proto.api.GetDeviceMetricsRequest} */ -proto.api.GetDeviceStatsRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.api.GetDeviceMetricsRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -5406,6 +5453,10 @@ proto.api.GetDeviceStatsRequest.deserializeBinaryFromReader = function(msg, read reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); msg.setEnd(value); break; + case 4: + var value = /** @type {!proto.common.Aggregation} */ (reader.readEnum()); + msg.setAggregation(value); + break; default: reader.skipField(); break; @@ -5419,9 +5470,9 @@ proto.api.GetDeviceStatsRequest.deserializeBinaryFromReader = function(msg, read * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.GetDeviceStatsRequest.prototype.serializeBinary = function() { +proto.api.GetDeviceMetricsRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.GetDeviceStatsRequest.serializeBinaryToWriter(this, writer); + proto.api.GetDeviceMetricsRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -5429,11 +5480,11 @@ proto.api.GetDeviceStatsRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.GetDeviceStatsRequest} message + * @param {!proto.api.GetDeviceMetricsRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.GetDeviceStatsRequest.serializeBinaryToWriter = function(message, writer) { +proto.api.GetDeviceMetricsRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getDevEui(); if (f.length > 0) { @@ -5458,6 +5509,13 @@ proto.api.GetDeviceStatsRequest.serializeBinaryToWriter = function(message, writ google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter ); } + f = message.getAggregation(); + if (f !== 0.0) { + writer.writeEnum( + 4, + f + ); + } }; @@ -5465,16 +5523,16 @@ proto.api.GetDeviceStatsRequest.serializeBinaryToWriter = function(message, writ * optional string dev_eui = 1; * @return {string} */ -proto.api.GetDeviceStatsRequest.prototype.getDevEui = function() { +proto.api.GetDeviceMetricsRequest.prototype.getDevEui = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.api.GetDeviceStatsRequest} returns this + * @return {!proto.api.GetDeviceMetricsRequest} returns this */ -proto.api.GetDeviceStatsRequest.prototype.setDevEui = function(value) { +proto.api.GetDeviceMetricsRequest.prototype.setDevEui = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; @@ -5483,7 +5541,7 @@ proto.api.GetDeviceStatsRequest.prototype.setDevEui = function(value) { * optional google.protobuf.Timestamp start = 2; * @return {?proto.google.protobuf.Timestamp} */ -proto.api.GetDeviceStatsRequest.prototype.getStart = function() { +proto.api.GetDeviceMetricsRequest.prototype.getStart = function() { return /** @type{?proto.google.protobuf.Timestamp} */ ( jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2)); }; @@ -5491,18 +5549,18 @@ proto.api.GetDeviceStatsRequest.prototype.getStart = function() { /** * @param {?proto.google.protobuf.Timestamp|undefined} value - * @return {!proto.api.GetDeviceStatsRequest} returns this + * @return {!proto.api.GetDeviceMetricsRequest} returns this */ -proto.api.GetDeviceStatsRequest.prototype.setStart = function(value) { +proto.api.GetDeviceMetricsRequest.prototype.setStart = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. - * @return {!proto.api.GetDeviceStatsRequest} returns this + * @return {!proto.api.GetDeviceMetricsRequest} returns this */ -proto.api.GetDeviceStatsRequest.prototype.clearStart = function() { +proto.api.GetDeviceMetricsRequest.prototype.clearStart = function() { return this.setStart(undefined); }; @@ -5511,7 +5569,7 @@ proto.api.GetDeviceStatsRequest.prototype.clearStart = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.GetDeviceStatsRequest.prototype.hasStart = function() { +proto.api.GetDeviceMetricsRequest.prototype.hasStart = function() { return jspb.Message.getField(this, 2) != null; }; @@ -5520,7 +5578,7 @@ proto.api.GetDeviceStatsRequest.prototype.hasStart = function() { * optional google.protobuf.Timestamp end = 3; * @return {?proto.google.protobuf.Timestamp} */ -proto.api.GetDeviceStatsRequest.prototype.getEnd = function() { +proto.api.GetDeviceMetricsRequest.prototype.getEnd = function() { return /** @type{?proto.google.protobuf.Timestamp} */ ( jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3)); }; @@ -5528,18 +5586,18 @@ proto.api.GetDeviceStatsRequest.prototype.getEnd = function() { /** * @param {?proto.google.protobuf.Timestamp|undefined} value - * @return {!proto.api.GetDeviceStatsRequest} returns this + * @return {!proto.api.GetDeviceMetricsRequest} returns this */ -proto.api.GetDeviceStatsRequest.prototype.setEnd = function(value) { +proto.api.GetDeviceMetricsRequest.prototype.setEnd = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. - * @return {!proto.api.GetDeviceStatsRequest} returns this + * @return {!proto.api.GetDeviceMetricsRequest} returns this */ -proto.api.GetDeviceStatsRequest.prototype.clearEnd = function() { +proto.api.GetDeviceMetricsRequest.prototype.clearEnd = function() { return this.setEnd(undefined); }; @@ -5548,168 +5606,26 @@ proto.api.GetDeviceStatsRequest.prototype.clearEnd = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.GetDeviceStatsRequest.prototype.hasEnd = function() { +proto.api.GetDeviceMetricsRequest.prototype.hasEnd = function() { return jspb.Message.getField(this, 3) != null; }; - /** - * List of repeated fields within this message type. - * @private {!Array} - * @const + * optional common.Aggregation aggregation = 4; + * @return {!proto.common.Aggregation} */ -proto.api.GetDeviceStatsResponse.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.GetDeviceStatsResponse.prototype.toObject = function(opt_includeInstance) { - return proto.api.GetDeviceStatsResponse.toObject(opt_includeInstance, this); +proto.api.GetDeviceMetricsRequest.prototype.getAggregation = function() { + return /** @type {!proto.common.Aggregation} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.GetDeviceStatsResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * @param {!proto.common.Aggregation} value + * @return {!proto.api.GetDeviceMetricsRequest} returns this */ -proto.api.GetDeviceStatsResponse.toObject = function(includeInstance, msg) { - var f, obj = { - resultList: jspb.Message.toObjectList(msg.getResultList(), - proto.api.DeviceStats.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.GetDeviceStatsResponse} - */ -proto.api.GetDeviceStatsResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.GetDeviceStatsResponse; - return proto.api.GetDeviceStatsResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.api.GetDeviceStatsResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.GetDeviceStatsResponse} - */ -proto.api.GetDeviceStatsResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.api.DeviceStats; - reader.readMessage(value,proto.api.DeviceStats.deserializeBinaryFromReader); - msg.addResult(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.api.GetDeviceStatsResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.GetDeviceStatsResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.api.GetDeviceStatsResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.GetDeviceStatsResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getResultList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.api.DeviceStats.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated DeviceStats result = 1; - * @return {!Array} - */ -proto.api.GetDeviceStatsResponse.prototype.getResultList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.api.DeviceStats, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.api.GetDeviceStatsResponse} returns this -*/ -proto.api.GetDeviceStatsResponse.prototype.setResultList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.api.DeviceStats=} opt_value - * @param {number=} opt_index - * @return {!proto.api.DeviceStats} - */ -proto.api.GetDeviceStatsResponse.prototype.addResult = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.api.DeviceStats, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.api.GetDeviceStatsResponse} returns this - */ -proto.api.GetDeviceStatsResponse.prototype.clearResultList = function() { - return this.setResultList([]); +proto.api.GetDeviceMetricsRequest.prototype.setAggregation = function(value) { + return jspb.Message.setProto3EnumField(this, 4, value); }; @@ -5729,8 +5645,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.DeviceStats.prototype.toObject = function(opt_includeInstance) { - return proto.api.DeviceStats.toObject(opt_includeInstance, this); +proto.api.GetDeviceMetricsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetDeviceMetricsResponse.toObject(opt_includeInstance, this); }; @@ -5739,19 +5655,14 @@ proto.api.DeviceStats.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.DeviceStats} msg The msg instance to transform. + * @param {!proto.api.GetDeviceMetricsResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.DeviceStats.toObject = function(includeInstance, msg) { +proto.api.GetDeviceMetricsResponse.toObject = function(includeInstance, msg) { var f, obj = { - time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), - rxPackets: jspb.Message.getFieldWithDefault(msg, 2, 0), - gwRssi: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.0), - gwSnr: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0), - rxPacketsPerFrequencyMap: (f = msg.getRxPacketsPerFrequencyMap()) ? f.toObject(includeInstance, undefined) : [], - rxPacketsPerDrMap: (f = msg.getRxPacketsPerDrMap()) ? f.toObject(includeInstance, undefined) : [], - errorsMap: (f = msg.getErrorsMap()) ? f.toObject(includeInstance, undefined) : [] + metricsMap: (f = msg.getMetricsMap()) ? f.toObject(includeInstance, proto.common.Metric.toObject) : [], + statesMap: (f = msg.getStatesMap()) ? f.toObject(includeInstance, proto.api.DeviceState.toObject) : [] }; if (includeInstance) { @@ -5765,23 +5676,23 @@ proto.api.DeviceStats.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.DeviceStats} + * @return {!proto.api.GetDeviceMetricsResponse} */ -proto.api.DeviceStats.deserializeBinary = function(bytes) { +proto.api.GetDeviceMetricsResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.DeviceStats; - return proto.api.DeviceStats.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.GetDeviceMetricsResponse; + return proto.api.GetDeviceMetricsResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.DeviceStats} msg The message object to deserialize into. + * @param {!proto.api.GetDeviceMetricsResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.DeviceStats} + * @return {!proto.api.GetDeviceMetricsResponse} */ -proto.api.DeviceStats.deserializeBinaryFromReader = function(msg, reader) { +proto.api.GetDeviceMetricsResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -5789,38 +5700,15 @@ proto.api.DeviceStats.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new google_protobuf_timestamp_pb.Timestamp; - reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); - msg.setTime(value); + var value = msg.getMetricsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.common.Metric.deserializeBinaryFromReader, "", new proto.common.Metric()); + }); break; case 2: - var value = /** @type {number} */ (reader.readUint32()); - msg.setRxPackets(value); - break; - case 3: - var value = /** @type {number} */ (reader.readFloat()); - msg.setGwRssi(value); - break; - case 4: - var value = /** @type {number} */ (reader.readFloat()); - msg.setGwSnr(value); - break; - case 5: - var value = msg.getRxPacketsPerFrequencyMap(); + var value = msg.getStatesMap(); reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readUint32, null, 0, 0); - }); - break; - case 6: - var value = msg.getRxPacketsPerDrMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readUint32, null, 0, 0); - }); - break; - case 7: - var value = msg.getErrorsMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readUint32, null, "", 0); + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.api.DeviceState.deserializeBinaryFromReader, "", new proto.api.DeviceState()); }); break; default: @@ -5836,9 +5724,9 @@ proto.api.DeviceStats.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.DeviceStats.prototype.serializeBinary = function() { +proto.api.GetDeviceMetricsResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.DeviceStats.serializeBinaryToWriter(this, writer); + proto.api.GetDeviceMetricsResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -5846,81 +5734,422 @@ proto.api.DeviceStats.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.DeviceStats} message + * @param {!proto.api.GetDeviceMetricsResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.DeviceStats.serializeBinaryToWriter = function(message, writer) { +proto.api.GetDeviceMetricsResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getTime(); - if (f != null) { - writer.writeMessage( - 1, - f, - google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter - ); + f = message.getMetricsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.common.Metric.serializeBinaryToWriter); } - f = message.getRxPackets(); - if (f !== 0) { - writer.writeUint32( + f = message.getStatesMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.api.DeviceState.serializeBinaryToWriter); + } +}; + + +/** + * map metrics = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.api.GetDeviceMetricsResponse.prototype.getMetricsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + proto.common.Metric)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.api.GetDeviceMetricsResponse} returns this + */ +proto.api.GetDeviceMetricsResponse.prototype.clearMetricsMap = function() { + this.getMetricsMap().clear(); + return this;}; + + +/** + * map states = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.api.GetDeviceMetricsResponse.prototype.getStatesMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + proto.api.DeviceState)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.api.GetDeviceMetricsResponse} returns this + */ +proto.api.GetDeviceMetricsResponse.prototype.clearStatesMap = function() { + this.getStatesMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.DeviceState.prototype.toObject = function(opt_includeInstance) { + return proto.api.DeviceState.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.DeviceState} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.DeviceState.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + value: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.DeviceState} + */ +proto.api.DeviceState.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.DeviceState; + return proto.api.DeviceState.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.DeviceState} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.DeviceState} + */ +proto.api.DeviceState.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.DeviceState.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.DeviceState.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.DeviceState} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.DeviceState.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( 2, f ); } - f = message.getGwRssi(); - if (f !== 0.0) { - writer.writeFloat( + f = message.getValue(); + if (f.length > 0) { + writer.writeString( 3, f ); } - f = message.getGwSnr(); - if (f !== 0.0) { - writer.writeFloat( - 4, - f - ); - } - f = message.getRxPacketsPerFrequencyMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeUint32); - } - f = message.getRxPacketsPerDrMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeUint32); - } - f = message.getErrorsMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(7, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeUint32); - } }; /** - * optional google.protobuf.Timestamp time = 1; + * optional string name = 2; + * @return {string} + */ +proto.api.DeviceState.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.DeviceState} returns this + */ +proto.api.DeviceState.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string value = 3; + * @return {string} + */ +proto.api.DeviceState.prototype.getValue = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.DeviceState} returns this + */ +proto.api.DeviceState.prototype.setValue = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetDeviceLinkMetricsRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.GetDeviceLinkMetricsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.GetDeviceLinkMetricsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + devEui: jspb.Message.getFieldWithDefault(msg, 1, ""), + start: (f = msg.getStart()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), + end: (f = msg.getEnd()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), + aggregation: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.GetDeviceLinkMetricsRequest} + */ +proto.api.GetDeviceLinkMetricsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.GetDeviceLinkMetricsRequest; + return proto.api.GetDeviceLinkMetricsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.GetDeviceLinkMetricsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.GetDeviceLinkMetricsRequest} + */ +proto.api.GetDeviceLinkMetricsRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setDevEui(value); + break; + case 2: + var value = new google_protobuf_timestamp_pb.Timestamp; + reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); + msg.setStart(value); + break; + case 3: + var value = new google_protobuf_timestamp_pb.Timestamp; + reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); + msg.setEnd(value); + break; + case 4: + var value = /** @type {!proto.common.Aggregation} */ (reader.readEnum()); + msg.setAggregation(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.GetDeviceLinkMetricsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.GetDeviceLinkMetricsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.GetDeviceLinkMetricsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDevEui(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getStart(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter + ); + } + f = message.getEnd(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter + ); + } + f = message.getAggregation(); + if (f !== 0.0) { + writer.writeEnum( + 4, + f + ); + } +}; + + +/** + * optional string dev_eui = 1; + * @return {string} + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.getDevEui = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.GetDeviceLinkMetricsRequest} returns this + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.setDevEui = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional google.protobuf.Timestamp start = 2; * @return {?proto.google.protobuf.Timestamp} */ -proto.api.DeviceStats.prototype.getTime = function() { +proto.api.GetDeviceLinkMetricsRequest.prototype.getStart = function() { return /** @type{?proto.google.protobuf.Timestamp} */ ( - jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 1)); + jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2)); }; /** * @param {?proto.google.protobuf.Timestamp|undefined} value - * @return {!proto.api.DeviceStats} returns this + * @return {!proto.api.GetDeviceLinkMetricsRequest} returns this */ -proto.api.DeviceStats.prototype.setTime = function(value) { - return jspb.Message.setWrapperField(this, 1, value); +proto.api.GetDeviceLinkMetricsRequest.prototype.setStart = function(value) { + return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. - * @return {!proto.api.DeviceStats} returns this + * @return {!proto.api.GetDeviceLinkMetricsRequest} returns this */ -proto.api.DeviceStats.prototype.clearTime = function() { - return this.setTime(undefined); +proto.api.GetDeviceLinkMetricsRequest.prototype.clearStart = function() { + return this.setStart(undefined); }; @@ -5928,129 +6157,470 @@ proto.api.DeviceStats.prototype.clearTime = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.DeviceStats.prototype.hasTime = function() { +proto.api.GetDeviceLinkMetricsRequest.prototype.hasStart = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional google.protobuf.Timestamp end = 3; + * @return {?proto.google.protobuf.Timestamp} + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.getEnd = function() { + return /** @type{?proto.google.protobuf.Timestamp} */ ( + jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3)); +}; + + +/** + * @param {?proto.google.protobuf.Timestamp|undefined} value + * @return {!proto.api.GetDeviceLinkMetricsRequest} returns this +*/ +proto.api.GetDeviceLinkMetricsRequest.prototype.setEnd = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.GetDeviceLinkMetricsRequest} returns this + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.clearEnd = function() { + return this.setEnd(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.hasEnd = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional common.Aggregation aggregation = 4; + * @return {!proto.common.Aggregation} + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.getAggregation = function() { + return /** @type {!proto.common.Aggregation} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {!proto.common.Aggregation} value + * @return {!proto.api.GetDeviceLinkMetricsRequest} returns this + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.setAggregation = function(value) { + return jspb.Message.setProto3EnumField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetDeviceLinkMetricsResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.GetDeviceLinkMetricsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.GetDeviceLinkMetricsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + rxPackets: (f = msg.getRxPackets()) && common_common_pb.Metric.toObject(includeInstance, f), + gwRssi: (f = msg.getGwRssi()) && common_common_pb.Metric.toObject(includeInstance, f), + gwSnr: (f = msg.getGwSnr()) && common_common_pb.Metric.toObject(includeInstance, f), + rxPacketsPerFreq: (f = msg.getRxPacketsPerFreq()) && common_common_pb.Metric.toObject(includeInstance, f), + rxPacketsPerDr: (f = msg.getRxPacketsPerDr()) && common_common_pb.Metric.toObject(includeInstance, f), + errors: (f = msg.getErrors()) && common_common_pb.Metric.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.GetDeviceLinkMetricsResponse} + */ +proto.api.GetDeviceLinkMetricsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.GetDeviceLinkMetricsResponse; + return proto.api.GetDeviceLinkMetricsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.GetDeviceLinkMetricsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.GetDeviceLinkMetricsResponse} + */ +proto.api.GetDeviceLinkMetricsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setRxPackets(value); + break; + case 2: + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setGwRssi(value); + break; + case 3: + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setGwSnr(value); + break; + case 4: + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setRxPacketsPerFreq(value); + break; + case 5: + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setRxPacketsPerDr(value); + break; + case 6: + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setErrors(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.GetDeviceLinkMetricsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.GetDeviceLinkMetricsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.GetDeviceLinkMetricsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRxPackets(); + if (f != null) { + writer.writeMessage( + 1, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); + } + f = message.getGwRssi(); + if (f != null) { + writer.writeMessage( + 2, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); + } + f = message.getGwSnr(); + if (f != null) { + writer.writeMessage( + 3, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); + } + f = message.getRxPacketsPerFreq(); + if (f != null) { + writer.writeMessage( + 4, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); + } + f = message.getRxPacketsPerDr(); + if (f != null) { + writer.writeMessage( + 5, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); + } + f = message.getErrors(); + if (f != null) { + writer.writeMessage( + 6, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); + } +}; + + +/** + * optional common.Metric rx_packets = 1; + * @return {?proto.common.Metric} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.getRxPackets = function() { + return /** @type{?proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 1)); +}; + + +/** + * @param {?proto.common.Metric|undefined} value + * @return {!proto.api.GetDeviceLinkMetricsResponse} returns this +*/ +proto.api.GetDeviceLinkMetricsResponse.prototype.setRxPackets = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.GetDeviceLinkMetricsResponse} returns this + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.clearRxPackets = function() { + return this.setRxPackets(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.hasRxPackets = function() { return jspb.Message.getField(this, 1) != null; }; /** - * optional uint32 rx_packets = 2; - * @return {number} + * optional common.Metric gw_rssi = 2; + * @return {?proto.common.Metric} */ -proto.api.DeviceStats.prototype.getRxPackets = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +proto.api.GetDeviceLinkMetricsResponse.prototype.getGwRssi = function() { + return /** @type{?proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 2)); }; /** - * @param {number} value - * @return {!proto.api.DeviceStats} returns this - */ -proto.api.DeviceStats.prototype.setRxPackets = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); + * @param {?proto.common.Metric|undefined} value + * @return {!proto.api.GetDeviceLinkMetricsResponse} returns this +*/ +proto.api.GetDeviceLinkMetricsResponse.prototype.setGwRssi = function(value) { + return jspb.Message.setWrapperField(this, 2, value); }; /** - * optional float gw_rssi = 3; - * @return {number} + * Clears the message field making it undefined. + * @return {!proto.api.GetDeviceLinkMetricsResponse} returns this */ -proto.api.DeviceStats.prototype.getGwRssi = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0)); +proto.api.GetDeviceLinkMetricsResponse.prototype.clearGwRssi = function() { + return this.setGwRssi(undefined); }; /** - * @param {number} value - * @return {!proto.api.DeviceStats} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.api.DeviceStats.prototype.setGwRssi = function(value) { - return jspb.Message.setProto3FloatField(this, 3, value); +proto.api.GetDeviceLinkMetricsResponse.prototype.hasGwRssi = function() { + return jspb.Message.getField(this, 2) != null; }; /** - * optional float gw_snr = 4; - * @return {number} + * optional common.Metric gw_snr = 3; + * @return {?proto.common.Metric} */ -proto.api.DeviceStats.prototype.getGwSnr = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0)); +proto.api.GetDeviceLinkMetricsResponse.prototype.getGwSnr = function() { + return /** @type{?proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 3)); }; /** - * @param {number} value - * @return {!proto.api.DeviceStats} returns this - */ -proto.api.DeviceStats.prototype.setGwSnr = function(value) { - return jspb.Message.setProto3FloatField(this, 4, value); + * @param {?proto.common.Metric|undefined} value + * @return {!proto.api.GetDeviceLinkMetricsResponse} returns this +*/ +proto.api.GetDeviceLinkMetricsResponse.prototype.setGwSnr = function(value) { + return jspb.Message.setWrapperField(this, 3, value); }; /** - * map rx_packets_per_frequency = 5; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} + * Clears the message field making it undefined. + * @return {!proto.api.GetDeviceLinkMetricsResponse} returns this */ -proto.api.DeviceStats.prototype.getRxPacketsPerFrequencyMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 5, opt_noLazyCreate, - null)); +proto.api.GetDeviceLinkMetricsResponse.prototype.clearGwSnr = function() { + return this.setGwSnr(undefined); }; /** - * Clears values from the map. The map will be non-null. - * @return {!proto.api.DeviceStats} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.api.DeviceStats.prototype.clearRxPacketsPerFrequencyMap = function() { - this.getRxPacketsPerFrequencyMap().clear(); - return this;}; - - -/** - * map rx_packets_per_dr = 6; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.api.DeviceStats.prototype.getRxPacketsPerDrMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 6, opt_noLazyCreate, - null)); +proto.api.GetDeviceLinkMetricsResponse.prototype.hasGwSnr = function() { + return jspb.Message.getField(this, 3) != null; }; /** - * Clears values from the map. The map will be non-null. - * @return {!proto.api.DeviceStats} returns this + * optional common.Metric rx_packets_per_freq = 4; + * @return {?proto.common.Metric} */ -proto.api.DeviceStats.prototype.clearRxPacketsPerDrMap = function() { - this.getRxPacketsPerDrMap().clear(); - return this;}; - - -/** - * map errors = 7; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.api.DeviceStats.prototype.getErrorsMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 7, opt_noLazyCreate, - null)); +proto.api.GetDeviceLinkMetricsResponse.prototype.getRxPacketsPerFreq = function() { + return /** @type{?proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 4)); }; /** - * Clears values from the map. The map will be non-null. - * @return {!proto.api.DeviceStats} returns this + * @param {?proto.common.Metric|undefined} value + * @return {!proto.api.GetDeviceLinkMetricsResponse} returns this +*/ +proto.api.GetDeviceLinkMetricsResponse.prototype.setRxPacketsPerFreq = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.GetDeviceLinkMetricsResponse} returns this */ -proto.api.DeviceStats.prototype.clearErrorsMap = function() { - this.getErrorsMap().clear(); - return this;}; +proto.api.GetDeviceLinkMetricsResponse.prototype.clearRxPacketsPerFreq = function() { + return this.setRxPacketsPerFreq(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.hasRxPacketsPerFreq = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional common.Metric rx_packets_per_dr = 5; + * @return {?proto.common.Metric} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.getRxPacketsPerDr = function() { + return /** @type{?proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 5)); +}; + + +/** + * @param {?proto.common.Metric|undefined} value + * @return {!proto.api.GetDeviceLinkMetricsResponse} returns this +*/ +proto.api.GetDeviceLinkMetricsResponse.prototype.setRxPacketsPerDr = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.GetDeviceLinkMetricsResponse} returns this + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.clearRxPacketsPerDr = function() { + return this.setRxPacketsPerDr(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.hasRxPacketsPerDr = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional common.Metric errors = 6; + * @return {?proto.common.Metric} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.getErrors = function() { + return /** @type{?proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 6)); +}; + + +/** + * @param {?proto.common.Metric|undefined} value + * @return {!proto.api.GetDeviceLinkMetricsResponse} returns this +*/ +proto.api.GetDeviceLinkMetricsResponse.prototype.setErrors = function(value) { + return jspb.Message.setWrapperField(this, 6, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.GetDeviceLinkMetricsResponse} returns this + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.clearErrors = function() { + return this.setErrors(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.hasErrors = function() { + return jspb.Message.getField(this, 6) != null; +}; diff --git a/api/grpc-web/api/device_profile_pb.d.ts b/api/grpc-web/api/device_profile_pb.d.ts index e6dcbffd..52610340 100644 --- a/api/grpc-web/api/device_profile_pb.d.ts +++ b/api/grpc-web/api/device_profile_pb.d.ts @@ -84,6 +84,9 @@ export class DeviceProfile extends jspb.Message { getTagsMap(): jspb.Map; clearTagsMap(): DeviceProfile; + getMeasurementsMap(): jspb.Map; + clearMeasurementsMap(): DeviceProfile; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): DeviceProfile.AsObject; static toObject(includeInstance: boolean, msg: DeviceProfile): DeviceProfile.AsObject; @@ -120,6 +123,29 @@ export namespace DeviceProfile { abpRx2Dr: number, abpRx2Freq: number, tagsMap: Array<[string, string]>, + measurementsMap: Array<[string, Measurement.AsObject]>, + } +} + +export class Measurement extends jspb.Message { + getName(): string; + setName(value: string): Measurement; + + getKind(): MeasurementKind; + setKind(value: MeasurementKind): Measurement; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Measurement.AsObject; + static toObject(includeInstance: boolean, msg: Measurement): Measurement.AsObject; + static serializeBinaryToWriter(message: Measurement, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Measurement; + static deserializeBinaryFromReader(message: Measurement, reader: jspb.BinaryReader): Measurement; +} + +export namespace Measurement { + export type AsObject = { + name: string, + kind: MeasurementKind, } } @@ -412,3 +438,10 @@ export enum CodecRuntime { CAYENNE_LPP = 1, JS = 2, } +export enum MeasurementKind { + UNKNOWN = 0, + COUNTER = 1, + ABSOLUTE = 2, + GAUGE = 3, + STRING = 4, +} diff --git a/api/grpc-web/api/device_profile_pb.js b/api/grpc-web/api/device_profile_pb.js index d484e55b..67121d53 100644 --- a/api/grpc-web/api/device_profile_pb.js +++ b/api/grpc-web/api/device_profile_pb.js @@ -33,6 +33,8 @@ goog.exportSymbol('proto.api.GetDeviceProfileResponse', null, global); goog.exportSymbol('proto.api.ListDeviceProfileAdrAlgorithmsResponse', null, global); goog.exportSymbol('proto.api.ListDeviceProfilesRequest', null, global); goog.exportSymbol('proto.api.ListDeviceProfilesResponse', null, global); +goog.exportSymbol('proto.api.Measurement', null, global); +goog.exportSymbol('proto.api.MeasurementKind', null, global); goog.exportSymbol('proto.api.UpdateDeviceProfileRequest', null, global); /** * Generated by JsPbCodeGenerator. @@ -55,6 +57,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.api.DeviceProfile.displayName = 'proto.api.DeviceProfile'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.Measurement = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.Measurement, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.api.Measurement.displayName = 'proto.api.Measurement'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -343,7 +366,8 @@ proto.api.DeviceProfile.toObject = function(includeInstance, msg) { abpRx1DrOffset: jspb.Message.getFieldWithDefault(msg, 22, 0), abpRx2Dr: jspb.Message.getFieldWithDefault(msg, 23, 0), abpRx2Freq: jspb.Message.getFieldWithDefault(msg, 24, 0), - tagsMap: (f = msg.getTagsMap()) ? f.toObject(includeInstance, undefined) : [] + tagsMap: (f = msg.getTagsMap()) ? f.toObject(includeInstance, undefined) : [], + measurementsMap: (f = msg.getMeasurementsMap()) ? f.toObject(includeInstance, proto.api.Measurement.toObject) : [] }; if (includeInstance) { @@ -486,6 +510,12 @@ proto.api.DeviceProfile.deserializeBinaryFromReader = function(msg, reader) { jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); }); break; + case 27: + var value = msg.getMeasurementsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.api.Measurement.deserializeBinaryFromReader, "", new proto.api.Measurement()); + }); + break; default: reader.skipField(); break; @@ -694,6 +724,10 @@ proto.api.DeviceProfile.serializeBinaryToWriter = function(message, writer) { if (f && f.getLength() > 0) { f.serializeBinary(25, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); } + f = message.getMeasurementsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(27, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.api.Measurement.serializeBinaryToWriter); + } }; @@ -1169,6 +1203,188 @@ proto.api.DeviceProfile.prototype.clearTagsMap = function() { return this;}; +/** + * map measurements = 27; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.api.DeviceProfile.prototype.getMeasurementsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 27, opt_noLazyCreate, + proto.api.Measurement)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.api.DeviceProfile} returns this + */ +proto.api.DeviceProfile.prototype.clearMeasurementsMap = function() { + this.getMeasurementsMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.Measurement.prototype.toObject = function(opt_includeInstance) { + return proto.api.Measurement.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Measurement} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.Measurement.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + kind: jspb.Message.getFieldWithDefault(msg, 3, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.Measurement} + */ +proto.api.Measurement.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.Measurement; + return proto.api.Measurement.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.Measurement} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.Measurement} + */ +proto.api.Measurement.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = /** @type {!proto.api.MeasurementKind} */ (reader.readEnum()); + msg.setKind(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.Measurement.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.api.Measurement.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.api.Measurement} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.api.Measurement.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getKind(); + if (f !== 0.0) { + writer.writeEnum( + 3, + f + ); + } +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.api.Measurement.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.api.Measurement} returns this + */ +proto.api.Measurement.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional MeasurementKind kind = 3; + * @return {!proto.api.MeasurementKind} + */ +proto.api.Measurement.prototype.getKind = function() { + return /** @type {!proto.api.MeasurementKind} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {!proto.api.MeasurementKind} value + * @return {!proto.api.Measurement} returns this + */ +proto.api.Measurement.prototype.setKind = function(value) { + return jspb.Message.setProto3EnumField(this, 3, value); +}; + + @@ -3325,4 +3541,15 @@ proto.api.CodecRuntime = { JS: 2 }; +/** + * @enum {number} + */ +proto.api.MeasurementKind = { + UNKNOWN: 0, + COUNTER: 1, + ABSOLUTE: 2, + GAUGE: 3, + STRING: 4 +}; + goog.object.extend(exports, proto.api); diff --git a/api/grpc-web/api/device_profile_template_pb.d.ts b/api/grpc-web/api/device_profile_template_pb.d.ts index 1658c7d2..546d1820 100644 --- a/api/grpc-web/api/device_profile_template_pb.d.ts +++ b/api/grpc-web/api/device_profile_template_pb.d.ts @@ -88,6 +88,9 @@ export class DeviceProfileTemplate extends jspb.Message { getTagsMap(): jspb.Map; clearTagsMap(): DeviceProfileTemplate; + getMeasurementsMap(): jspb.Map; + clearMeasurementsMap(): DeviceProfileTemplate; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): DeviceProfileTemplate.AsObject; static toObject(includeInstance: boolean, msg: DeviceProfileTemplate): DeviceProfileTemplate.AsObject; @@ -125,6 +128,7 @@ export namespace DeviceProfileTemplate { abpRx2Dr: number, abpRx2Freq: number, tagsMap: Array<[string, string]>, + measurementsMap: Array<[string, api_device_profile_pb.Measurement.AsObject]>, } } diff --git a/api/grpc-web/api/device_profile_template_pb.js b/api/grpc-web/api/device_profile_template_pb.js index fcd8f32a..fce5ce12 100644 --- a/api/grpc-web/api/device_profile_template_pb.js +++ b/api/grpc-web/api/device_profile_template_pb.js @@ -279,7 +279,8 @@ proto.api.DeviceProfileTemplate.toObject = function(includeInstance, msg) { abpRx1DrOffset: jspb.Message.getFieldWithDefault(msg, 24, 0), abpRx2Dr: jspb.Message.getFieldWithDefault(msg, 25, 0), abpRx2Freq: jspb.Message.getFieldWithDefault(msg, 26, 0), - tagsMap: (f = msg.getTagsMap()) ? f.toObject(includeInstance, undefined) : [] + tagsMap: (f = msg.getTagsMap()) ? f.toObject(includeInstance, undefined) : [], + measurementsMap: (f = msg.getMeasurementsMap()) ? f.toObject(includeInstance, proto.api.Measurement.toObject) : [] }; if (includeInstance) { @@ -426,6 +427,12 @@ proto.api.DeviceProfileTemplate.deserializeBinaryFromReader = function(msg, read jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); }); break; + case 28: + var value = msg.getMeasurementsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.api.Measurement.deserializeBinaryFromReader, "", new proto.api.Measurement()); + }); + break; default: reader.skipField(); break; @@ -641,6 +648,10 @@ proto.api.DeviceProfileTemplate.serializeBinaryToWriter = function(message, writ if (f && f.getLength() > 0) { f.serializeBinary(27, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); } + f = message.getMeasurementsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(28, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.api.Measurement.serializeBinaryToWriter); + } }; @@ -1134,6 +1145,28 @@ proto.api.DeviceProfileTemplate.prototype.clearTagsMap = function() { return this;}; +/** + * map measurements = 28; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.api.DeviceProfileTemplate.prototype.getMeasurementsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 28, opt_noLazyCreate, + proto.api.Measurement)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.api.DeviceProfileTemplate} returns this + */ +proto.api.DeviceProfileTemplate.prototype.clearMeasurementsMap = function() { + this.getMeasurementsMap().clear(); + return this;}; + + diff --git a/api/grpc-web/api/gateway_grpc_web_pb.d.ts b/api/grpc-web/api/gateway_grpc_web_pb.d.ts index e8cb8a4c..d9710178 100644 --- a/api/grpc-web/api/gateway_grpc_web_pb.d.ts +++ b/api/grpc-web/api/gateway_grpc_web_pb.d.ts @@ -51,12 +51,12 @@ export class GatewayServiceClient { response: api_gateway_pb.GenerateGatewayClientCertificateResponse) => void ): grpcWeb.ClientReadableStream; - getStats( - request: api_gateway_pb.GetGatewayStatsRequest, + getMetrics( + request: api_gateway_pb.GetGatewayMetricsRequest, metadata: grpcWeb.Metadata | undefined, callback: (err: grpcWeb.Error, - response: api_gateway_pb.GetGatewayStatsResponse) => void - ): grpcWeb.ClientReadableStream; + response: api_gateway_pb.GetGatewayMetricsResponse) => void + ): grpcWeb.ClientReadableStream; } @@ -95,10 +95,10 @@ export class GatewayServicePromiseClient { metadata?: grpcWeb.Metadata ): Promise; - getStats( - request: api_gateway_pb.GetGatewayStatsRequest, + getMetrics( + request: api_gateway_pb.GetGatewayMetricsRequest, metadata?: grpcWeb.Metadata - ): Promise; + ): Promise; } diff --git a/api/grpc-web/api/gateway_grpc_web_pb.js b/api/grpc-web/api/gateway_grpc_web_pb.js index 03dc5a2f..6e10b6e5 100644 --- a/api/grpc-web/api/gateway_grpc_web_pb.js +++ b/api/grpc-web/api/gateway_grpc_web_pb.js @@ -559,80 +559,80 @@ proto.api.GatewayServicePromiseClient.prototype.generateClientCertificate = /** * @const * @type {!grpc.web.MethodDescriptor< - * !proto.api.GetGatewayStatsRequest, - * !proto.api.GetGatewayStatsResponse>} + * !proto.api.GetGatewayMetricsRequest, + * !proto.api.GetGatewayMetricsResponse>} */ -const methodDescriptor_GatewayService_GetStats = new grpc.web.MethodDescriptor( - '/api.GatewayService/GetStats', +const methodDescriptor_GatewayService_GetMetrics = new grpc.web.MethodDescriptor( + '/api.GatewayService/GetMetrics', grpc.web.MethodType.UNARY, - proto.api.GetGatewayStatsRequest, - proto.api.GetGatewayStatsResponse, + proto.api.GetGatewayMetricsRequest, + proto.api.GetGatewayMetricsResponse, /** - * @param {!proto.api.GetGatewayStatsRequest} request + * @param {!proto.api.GetGatewayMetricsRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, - proto.api.GetGatewayStatsResponse.deserializeBinary + proto.api.GetGatewayMetricsResponse.deserializeBinary ); /** * @const * @type {!grpc.web.AbstractClientBase.MethodInfo< - * !proto.api.GetGatewayStatsRequest, - * !proto.api.GetGatewayStatsResponse>} + * !proto.api.GetGatewayMetricsRequest, + * !proto.api.GetGatewayMetricsResponse>} */ -const methodInfo_GatewayService_GetStats = new grpc.web.AbstractClientBase.MethodInfo( - proto.api.GetGatewayStatsResponse, +const methodInfo_GatewayService_GetMetrics = new grpc.web.AbstractClientBase.MethodInfo( + proto.api.GetGatewayMetricsResponse, /** - * @param {!proto.api.GetGatewayStatsRequest} request + * @param {!proto.api.GetGatewayMetricsRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, - proto.api.GetGatewayStatsResponse.deserializeBinary + proto.api.GetGatewayMetricsResponse.deserializeBinary ); /** - * @param {!proto.api.GetGatewayStatsRequest} request The + * @param {!proto.api.GetGatewayMetricsRequest} request The * request proto * @param {?Object} metadata User defined * call metadata - * @param {function(?grpc.web.Error, ?proto.api.GetGatewayStatsResponse)} + * @param {function(?grpc.web.Error, ?proto.api.GetGatewayMetricsResponse)} * callback The callback function(error, response) - * @return {!grpc.web.ClientReadableStream|undefined} + * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ -proto.api.GatewayServiceClient.prototype.getStats = +proto.api.GatewayServiceClient.prototype.getMetrics = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + - '/api.GatewayService/GetStats', + '/api.GatewayService/GetMetrics', request, metadata || {}, - methodDescriptor_GatewayService_GetStats, + methodDescriptor_GatewayService_GetMetrics, callback); }; /** - * @param {!proto.api.GetGatewayStatsRequest} request The + * @param {!proto.api.GetGatewayMetricsRequest} request The * request proto * @param {?Object} metadata User defined * call metadata - * @return {!Promise} + * @return {!Promise} * Promise that resolves to the response */ -proto.api.GatewayServicePromiseClient.prototype.getStats = +proto.api.GatewayServicePromiseClient.prototype.getMetrics = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + - '/api.GatewayService/GetStats', + '/api.GatewayService/GetMetrics', request, metadata || {}, - methodDescriptor_GatewayService_GetStats); + methodDescriptor_GatewayService_GetMetrics); }; diff --git a/api/grpc-web/api/gateway_pb.d.ts b/api/grpc-web/api/gateway_pb.d.ts index ec6db1bf..6462eda6 100644 --- a/api/grpc-web/api/gateway_pb.d.ts +++ b/api/grpc-web/api/gateway_pb.d.ts @@ -325,101 +325,93 @@ export namespace GenerateGatewayClientCertificateResponse { } } -export class GetGatewayStatsRequest extends jspb.Message { +export class GetGatewayMetricsRequest extends jspb.Message { getGatewayId(): string; - setGatewayId(value: string): GetGatewayStatsRequest; + setGatewayId(value: string): GetGatewayMetricsRequest; getStart(): google_protobuf_timestamp_pb.Timestamp | undefined; - setStart(value?: google_protobuf_timestamp_pb.Timestamp): GetGatewayStatsRequest; + setStart(value?: google_protobuf_timestamp_pb.Timestamp): GetGatewayMetricsRequest; hasStart(): boolean; - clearStart(): GetGatewayStatsRequest; + clearStart(): GetGatewayMetricsRequest; getEnd(): google_protobuf_timestamp_pb.Timestamp | undefined; - setEnd(value?: google_protobuf_timestamp_pb.Timestamp): GetGatewayStatsRequest; + setEnd(value?: google_protobuf_timestamp_pb.Timestamp): GetGatewayMetricsRequest; hasEnd(): boolean; - clearEnd(): GetGatewayStatsRequest; + clearEnd(): GetGatewayMetricsRequest; + + getAggregation(): common_common_pb.Aggregation; + setAggregation(value: common_common_pb.Aggregation): GetGatewayMetricsRequest; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetGatewayStatsRequest.AsObject; - static toObject(includeInstance: boolean, msg: GetGatewayStatsRequest): GetGatewayStatsRequest.AsObject; - static serializeBinaryToWriter(message: GetGatewayStatsRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetGatewayStatsRequest; - static deserializeBinaryFromReader(message: GetGatewayStatsRequest, reader: jspb.BinaryReader): GetGatewayStatsRequest; + toObject(includeInstance?: boolean): GetGatewayMetricsRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetGatewayMetricsRequest): GetGatewayMetricsRequest.AsObject; + static serializeBinaryToWriter(message: GetGatewayMetricsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetGatewayMetricsRequest; + static deserializeBinaryFromReader(message: GetGatewayMetricsRequest, reader: jspb.BinaryReader): GetGatewayMetricsRequest; } -export namespace GetGatewayStatsRequest { +export namespace GetGatewayMetricsRequest { export type AsObject = { gatewayId: string, start?: google_protobuf_timestamp_pb.Timestamp.AsObject, end?: google_protobuf_timestamp_pb.Timestamp.AsObject, + aggregation: common_common_pb.Aggregation, } } -export class GetGatewayStatsResponse extends jspb.Message { - getResultList(): Array; - setResultList(value: Array): GetGatewayStatsResponse; - clearResultList(): GetGatewayStatsResponse; - addResult(value?: GatewayStats, index?: number): GatewayStats; +export class GetGatewayMetricsResponse extends jspb.Message { + getRxPackets(): common_common_pb.Metric | undefined; + setRxPackets(value?: common_common_pb.Metric): GetGatewayMetricsResponse; + hasRxPackets(): boolean; + clearRxPackets(): GetGatewayMetricsResponse; + + getTxPackets(): common_common_pb.Metric | undefined; + setTxPackets(value?: common_common_pb.Metric): GetGatewayMetricsResponse; + hasTxPackets(): boolean; + clearTxPackets(): GetGatewayMetricsResponse; + + getTxPacketsPerFreq(): common_common_pb.Metric | undefined; + setTxPacketsPerFreq(value?: common_common_pb.Metric): GetGatewayMetricsResponse; + hasTxPacketsPerFreq(): boolean; + clearTxPacketsPerFreq(): GetGatewayMetricsResponse; + + getRxPacketsPerFreq(): common_common_pb.Metric | undefined; + setRxPacketsPerFreq(value?: common_common_pb.Metric): GetGatewayMetricsResponse; + hasRxPacketsPerFreq(): boolean; + clearRxPacketsPerFreq(): GetGatewayMetricsResponse; + + getTxPacketsPerDr(): common_common_pb.Metric | undefined; + setTxPacketsPerDr(value?: common_common_pb.Metric): GetGatewayMetricsResponse; + hasTxPacketsPerDr(): boolean; + clearTxPacketsPerDr(): GetGatewayMetricsResponse; + + getRxPacketsPerDr(): common_common_pb.Metric | undefined; + setRxPacketsPerDr(value?: common_common_pb.Metric): GetGatewayMetricsResponse; + hasRxPacketsPerDr(): boolean; + clearRxPacketsPerDr(): GetGatewayMetricsResponse; + + getTxPacketsPerStatus(): common_common_pb.Metric | undefined; + setTxPacketsPerStatus(value?: common_common_pb.Metric): GetGatewayMetricsResponse; + hasTxPacketsPerStatus(): boolean; + clearTxPacketsPerStatus(): GetGatewayMetricsResponse; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetGatewayStatsResponse.AsObject; - static toObject(includeInstance: boolean, msg: GetGatewayStatsResponse): GetGatewayStatsResponse.AsObject; - static serializeBinaryToWriter(message: GetGatewayStatsResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetGatewayStatsResponse; - static deserializeBinaryFromReader(message: GetGatewayStatsResponse, reader: jspb.BinaryReader): GetGatewayStatsResponse; + toObject(includeInstance?: boolean): GetGatewayMetricsResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetGatewayMetricsResponse): GetGatewayMetricsResponse.AsObject; + static serializeBinaryToWriter(message: GetGatewayMetricsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetGatewayMetricsResponse; + static deserializeBinaryFromReader(message: GetGatewayMetricsResponse, reader: jspb.BinaryReader): GetGatewayMetricsResponse; } -export namespace GetGatewayStatsResponse { +export namespace GetGatewayMetricsResponse { export type AsObject = { - resultList: Array, - } -} - -export class GatewayStats extends jspb.Message { - getTime(): google_protobuf_timestamp_pb.Timestamp | undefined; - setTime(value?: google_protobuf_timestamp_pb.Timestamp): GatewayStats; - hasTime(): boolean; - clearTime(): GatewayStats; - - getRxPackets(): number; - setRxPackets(value: number): GatewayStats; - - getTxPackets(): number; - setTxPackets(value: number): GatewayStats; - - getTxPacketsPerFrequencyMap(): jspb.Map; - clearTxPacketsPerFrequencyMap(): GatewayStats; - - getRxPacketsPerFrequencyMap(): jspb.Map; - clearRxPacketsPerFrequencyMap(): GatewayStats; - - getTxPacketsPerDrMap(): jspb.Map; - clearTxPacketsPerDrMap(): GatewayStats; - - getRxPacketsPerDrMap(): jspb.Map; - clearRxPacketsPerDrMap(): GatewayStats; - - getTxPacketsPerStatusMap(): jspb.Map; - clearTxPacketsPerStatusMap(): GatewayStats; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GatewayStats.AsObject; - static toObject(includeInstance: boolean, msg: GatewayStats): GatewayStats.AsObject; - static serializeBinaryToWriter(message: GatewayStats, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GatewayStats; - static deserializeBinaryFromReader(message: GatewayStats, reader: jspb.BinaryReader): GatewayStats; -} - -export namespace GatewayStats { - export type AsObject = { - time?: google_protobuf_timestamp_pb.Timestamp.AsObject, - rxPackets: number, - txPackets: number, - txPacketsPerFrequencyMap: Array<[number, number]>, - rxPacketsPerFrequencyMap: Array<[number, number]>, - txPacketsPerDrMap: Array<[number, number]>, - rxPacketsPerDrMap: Array<[number, number]>, - txPacketsPerStatusMap: Array<[string, number]>, + rxPackets?: common_common_pb.Metric.AsObject, + txPackets?: common_common_pb.Metric.AsObject, + txPacketsPerFreq?: common_common_pb.Metric.AsObject, + rxPacketsPerFreq?: common_common_pb.Metric.AsObject, + txPacketsPerDr?: common_common_pb.Metric.AsObject, + rxPacketsPerDr?: common_common_pb.Metric.AsObject, + txPacketsPerStatus?: common_common_pb.Metric.AsObject, } } diff --git a/api/grpc-web/api/gateway_pb.js b/api/grpc-web/api/gateway_pb.js index 130eba58..ab0c5df0 100644 --- a/api/grpc-web/api/gateway_pb.js +++ b/api/grpc-web/api/gateway_pb.js @@ -25,13 +25,12 @@ goog.exportSymbol('proto.api.CreateGatewayRequest', null, global); goog.exportSymbol('proto.api.DeleteGatewayRequest', null, global); goog.exportSymbol('proto.api.Gateway', null, global); goog.exportSymbol('proto.api.GatewayListItem', null, global); -goog.exportSymbol('proto.api.GatewayStats', null, global); goog.exportSymbol('proto.api.GenerateGatewayClientCertificateRequest', null, global); goog.exportSymbol('proto.api.GenerateGatewayClientCertificateResponse', null, global); +goog.exportSymbol('proto.api.GetGatewayMetricsRequest', null, global); +goog.exportSymbol('proto.api.GetGatewayMetricsResponse', null, global); goog.exportSymbol('proto.api.GetGatewayRequest', null, global); goog.exportSymbol('proto.api.GetGatewayResponse', null, global); -goog.exportSymbol('proto.api.GetGatewayStatsRequest', null, global); -goog.exportSymbol('proto.api.GetGatewayStatsResponse', null, global); goog.exportSymbol('proto.api.ListGatewaysRequest', null, global); goog.exportSymbol('proto.api.ListGatewaysResponse', null, global); goog.exportSymbol('proto.api.UpdateGatewayRequest', null, global); @@ -276,16 +275,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.GetGatewayStatsRequest = function(opt_data) { +proto.api.GetGatewayMetricsRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.api.GetGatewayStatsRequest, jspb.Message); +goog.inherits(proto.api.GetGatewayMetricsRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.GetGatewayStatsRequest.displayName = 'proto.api.GetGatewayStatsRequest'; + proto.api.GetGatewayMetricsRequest.displayName = 'proto.api.GetGatewayMetricsRequest'; } /** * Generated by JsPbCodeGenerator. @@ -297,37 +296,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.GetGatewayStatsResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.api.GetGatewayStatsResponse.repeatedFields_, null); -}; -goog.inherits(proto.api.GetGatewayStatsResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.api.GetGatewayStatsResponse.displayName = 'proto.api.GetGatewayStatsResponse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.api.GatewayStats = function(opt_data) { +proto.api.GetGatewayMetricsResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.api.GatewayStats, jspb.Message); +goog.inherits(proto.api.GetGatewayMetricsResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.GatewayStats.displayName = 'proto.api.GatewayStats'; + proto.api.GetGatewayMetricsResponse.displayName = 'proto.api.GetGatewayMetricsResponse'; } @@ -2786,8 +2764,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.GetGatewayStatsRequest.prototype.toObject = function(opt_includeInstance) { - return proto.api.GetGatewayStatsRequest.toObject(opt_includeInstance, this); +proto.api.GetGatewayMetricsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetGatewayMetricsRequest.toObject(opt_includeInstance, this); }; @@ -2796,15 +2774,16 @@ proto.api.GetGatewayStatsRequest.prototype.toObject = function(opt_includeInstan * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.GetGatewayStatsRequest} msg The msg instance to transform. + * @param {!proto.api.GetGatewayMetricsRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.GetGatewayStatsRequest.toObject = function(includeInstance, msg) { +proto.api.GetGatewayMetricsRequest.toObject = function(includeInstance, msg) { var f, obj = { gatewayId: jspb.Message.getFieldWithDefault(msg, 1, ""), start: (f = msg.getStart()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), - end: (f = msg.getEnd()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f) + end: (f = msg.getEnd()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), + aggregation: jspb.Message.getFieldWithDefault(msg, 4, 0) }; if (includeInstance) { @@ -2818,23 +2797,23 @@ proto.api.GetGatewayStatsRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.GetGatewayStatsRequest} + * @return {!proto.api.GetGatewayMetricsRequest} */ -proto.api.GetGatewayStatsRequest.deserializeBinary = function(bytes) { +proto.api.GetGatewayMetricsRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.GetGatewayStatsRequest; - return proto.api.GetGatewayStatsRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.GetGatewayMetricsRequest; + return proto.api.GetGatewayMetricsRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.GetGatewayStatsRequest} msg The message object to deserialize into. + * @param {!proto.api.GetGatewayMetricsRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.GetGatewayStatsRequest} + * @return {!proto.api.GetGatewayMetricsRequest} */ -proto.api.GetGatewayStatsRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.api.GetGatewayMetricsRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2855,6 +2834,10 @@ proto.api.GetGatewayStatsRequest.deserializeBinaryFromReader = function(msg, rea reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); msg.setEnd(value); break; + case 4: + var value = /** @type {!proto.common.Aggregation} */ (reader.readEnum()); + msg.setAggregation(value); + break; default: reader.skipField(); break; @@ -2868,9 +2851,9 @@ proto.api.GetGatewayStatsRequest.deserializeBinaryFromReader = function(msg, rea * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.GetGatewayStatsRequest.prototype.serializeBinary = function() { +proto.api.GetGatewayMetricsRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.GetGatewayStatsRequest.serializeBinaryToWriter(this, writer); + proto.api.GetGatewayMetricsRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2878,11 +2861,11 @@ proto.api.GetGatewayStatsRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.GetGatewayStatsRequest} message + * @param {!proto.api.GetGatewayMetricsRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.GetGatewayStatsRequest.serializeBinaryToWriter = function(message, writer) { +proto.api.GetGatewayMetricsRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getGatewayId(); if (f.length > 0) { @@ -2907,6 +2890,13 @@ proto.api.GetGatewayStatsRequest.serializeBinaryToWriter = function(message, wri google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter ); } + f = message.getAggregation(); + if (f !== 0.0) { + writer.writeEnum( + 4, + f + ); + } }; @@ -2914,16 +2904,16 @@ proto.api.GetGatewayStatsRequest.serializeBinaryToWriter = function(message, wri * optional string gateway_id = 1; * @return {string} */ -proto.api.GetGatewayStatsRequest.prototype.getGatewayId = function() { +proto.api.GetGatewayMetricsRequest.prototype.getGatewayId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.api.GetGatewayStatsRequest} returns this + * @return {!proto.api.GetGatewayMetricsRequest} returns this */ -proto.api.GetGatewayStatsRequest.prototype.setGatewayId = function(value) { +proto.api.GetGatewayMetricsRequest.prototype.setGatewayId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; @@ -2932,7 +2922,7 @@ proto.api.GetGatewayStatsRequest.prototype.setGatewayId = function(value) { * optional google.protobuf.Timestamp start = 2; * @return {?proto.google.protobuf.Timestamp} */ -proto.api.GetGatewayStatsRequest.prototype.getStart = function() { +proto.api.GetGatewayMetricsRequest.prototype.getStart = function() { return /** @type{?proto.google.protobuf.Timestamp} */ ( jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2)); }; @@ -2940,18 +2930,18 @@ proto.api.GetGatewayStatsRequest.prototype.getStart = function() { /** * @param {?proto.google.protobuf.Timestamp|undefined} value - * @return {!proto.api.GetGatewayStatsRequest} returns this + * @return {!proto.api.GetGatewayMetricsRequest} returns this */ -proto.api.GetGatewayStatsRequest.prototype.setStart = function(value) { +proto.api.GetGatewayMetricsRequest.prototype.setStart = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. - * @return {!proto.api.GetGatewayStatsRequest} returns this + * @return {!proto.api.GetGatewayMetricsRequest} returns this */ -proto.api.GetGatewayStatsRequest.prototype.clearStart = function() { +proto.api.GetGatewayMetricsRequest.prototype.clearStart = function() { return this.setStart(undefined); }; @@ -2960,7 +2950,7 @@ proto.api.GetGatewayStatsRequest.prototype.clearStart = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.GetGatewayStatsRequest.prototype.hasStart = function() { +proto.api.GetGatewayMetricsRequest.prototype.hasStart = function() { return jspb.Message.getField(this, 2) != null; }; @@ -2969,7 +2959,7 @@ proto.api.GetGatewayStatsRequest.prototype.hasStart = function() { * optional google.protobuf.Timestamp end = 3; * @return {?proto.google.protobuf.Timestamp} */ -proto.api.GetGatewayStatsRequest.prototype.getEnd = function() { +proto.api.GetGatewayMetricsRequest.prototype.getEnd = function() { return /** @type{?proto.google.protobuf.Timestamp} */ ( jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3)); }; @@ -2977,18 +2967,18 @@ proto.api.GetGatewayStatsRequest.prototype.getEnd = function() { /** * @param {?proto.google.protobuf.Timestamp|undefined} value - * @return {!proto.api.GetGatewayStatsRequest} returns this + * @return {!proto.api.GetGatewayMetricsRequest} returns this */ -proto.api.GetGatewayStatsRequest.prototype.setEnd = function(value) { +proto.api.GetGatewayMetricsRequest.prototype.setEnd = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. - * @return {!proto.api.GetGatewayStatsRequest} returns this + * @return {!proto.api.GetGatewayMetricsRequest} returns this */ -proto.api.GetGatewayStatsRequest.prototype.clearEnd = function() { +proto.api.GetGatewayMetricsRequest.prototype.clearEnd = function() { return this.setEnd(undefined); }; @@ -2997,168 +2987,26 @@ proto.api.GetGatewayStatsRequest.prototype.clearEnd = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.GetGatewayStatsRequest.prototype.hasEnd = function() { +proto.api.GetGatewayMetricsRequest.prototype.hasEnd = function() { return jspb.Message.getField(this, 3) != null; }; - /** - * List of repeated fields within this message type. - * @private {!Array} - * @const + * optional common.Aggregation aggregation = 4; + * @return {!proto.common.Aggregation} */ -proto.api.GetGatewayStatsResponse.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.GetGatewayStatsResponse.prototype.toObject = function(opt_includeInstance) { - return proto.api.GetGatewayStatsResponse.toObject(opt_includeInstance, this); +proto.api.GetGatewayMetricsRequest.prototype.getAggregation = function() { + return /** @type {!proto.common.Aggregation} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.GetGatewayStatsResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * @param {!proto.common.Aggregation} value + * @return {!proto.api.GetGatewayMetricsRequest} returns this */ -proto.api.GetGatewayStatsResponse.toObject = function(includeInstance, msg) { - var f, obj = { - resultList: jspb.Message.toObjectList(msg.getResultList(), - proto.api.GatewayStats.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.GetGatewayStatsResponse} - */ -proto.api.GetGatewayStatsResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.GetGatewayStatsResponse; - return proto.api.GetGatewayStatsResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.api.GetGatewayStatsResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.GetGatewayStatsResponse} - */ -proto.api.GetGatewayStatsResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.api.GatewayStats; - reader.readMessage(value,proto.api.GatewayStats.deserializeBinaryFromReader); - msg.addResult(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.api.GetGatewayStatsResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.GetGatewayStatsResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.api.GetGatewayStatsResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.GetGatewayStatsResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getResultList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.api.GatewayStats.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated GatewayStats result = 1; - * @return {!Array} - */ -proto.api.GetGatewayStatsResponse.prototype.getResultList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.api.GatewayStats, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.api.GetGatewayStatsResponse} returns this -*/ -proto.api.GetGatewayStatsResponse.prototype.setResultList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.api.GatewayStats=} opt_value - * @param {number=} opt_index - * @return {!proto.api.GatewayStats} - */ -proto.api.GetGatewayStatsResponse.prototype.addResult = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.api.GatewayStats, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.api.GetGatewayStatsResponse} returns this - */ -proto.api.GetGatewayStatsResponse.prototype.clearResultList = function() { - return this.setResultList([]); +proto.api.GetGatewayMetricsRequest.prototype.setAggregation = function(value) { + return jspb.Message.setProto3EnumField(this, 4, value); }; @@ -3178,8 +3026,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.api.GatewayStats.prototype.toObject = function(opt_includeInstance) { - return proto.api.GatewayStats.toObject(opt_includeInstance, this); +proto.api.GetGatewayMetricsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetGatewayMetricsResponse.toObject(opt_includeInstance, this); }; @@ -3188,20 +3036,19 @@ proto.api.GatewayStats.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.GatewayStats} msg The msg instance to transform. + * @param {!proto.api.GetGatewayMetricsResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.GatewayStats.toObject = function(includeInstance, msg) { +proto.api.GetGatewayMetricsResponse.toObject = function(includeInstance, msg) { var f, obj = { - time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), - rxPackets: jspb.Message.getFieldWithDefault(msg, 2, 0), - txPackets: jspb.Message.getFieldWithDefault(msg, 3, 0), - txPacketsPerFrequencyMap: (f = msg.getTxPacketsPerFrequencyMap()) ? f.toObject(includeInstance, undefined) : [], - rxPacketsPerFrequencyMap: (f = msg.getRxPacketsPerFrequencyMap()) ? f.toObject(includeInstance, undefined) : [], - txPacketsPerDrMap: (f = msg.getTxPacketsPerDrMap()) ? f.toObject(includeInstance, undefined) : [], - rxPacketsPerDrMap: (f = msg.getRxPacketsPerDrMap()) ? f.toObject(includeInstance, undefined) : [], - txPacketsPerStatusMap: (f = msg.getTxPacketsPerStatusMap()) ? f.toObject(includeInstance, undefined) : [] + rxPackets: (f = msg.getRxPackets()) && common_common_pb.Metric.toObject(includeInstance, f), + txPackets: (f = msg.getTxPackets()) && common_common_pb.Metric.toObject(includeInstance, f), + txPacketsPerFreq: (f = msg.getTxPacketsPerFreq()) && common_common_pb.Metric.toObject(includeInstance, f), + rxPacketsPerFreq: (f = msg.getRxPacketsPerFreq()) && common_common_pb.Metric.toObject(includeInstance, f), + txPacketsPerDr: (f = msg.getTxPacketsPerDr()) && common_common_pb.Metric.toObject(includeInstance, f), + rxPacketsPerDr: (f = msg.getRxPacketsPerDr()) && common_common_pb.Metric.toObject(includeInstance, f), + txPacketsPerStatus: (f = msg.getTxPacketsPerStatus()) && common_common_pb.Metric.toObject(includeInstance, f) }; if (includeInstance) { @@ -3215,23 +3062,23 @@ proto.api.GatewayStats.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.GatewayStats} + * @return {!proto.api.GetGatewayMetricsResponse} */ -proto.api.GatewayStats.deserializeBinary = function(bytes) { +proto.api.GetGatewayMetricsResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.GatewayStats; - return proto.api.GatewayStats.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.GetGatewayMetricsResponse; + return proto.api.GetGatewayMetricsResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.GatewayStats} msg The message object to deserialize into. + * @param {!proto.api.GetGatewayMetricsResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.GatewayStats} + * @return {!proto.api.GetGatewayMetricsResponse} */ -proto.api.GatewayStats.deserializeBinaryFromReader = function(msg, reader) { +proto.api.GetGatewayMetricsResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3239,47 +3086,39 @@ proto.api.GatewayStats.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new google_protobuf_timestamp_pb.Timestamp; - reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); - msg.setTime(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint32()); + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); msg.setRxPackets(value); break; - case 3: - var value = /** @type {number} */ (reader.readUint32()); + case 2: + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); msg.setTxPackets(value); break; + case 3: + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setTxPacketsPerFreq(value); + break; case 4: - var value = msg.getTxPacketsPerFrequencyMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readUint32, null, 0, 0); - }); + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setRxPacketsPerFreq(value); break; case 5: - var value = msg.getRxPacketsPerFrequencyMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readUint32, null, 0, 0); - }); + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setTxPacketsPerDr(value); break; case 6: - var value = msg.getTxPacketsPerDrMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readUint32, null, 0, 0); - }); + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setRxPacketsPerDr(value); break; case 7: - var value = msg.getRxPacketsPerDrMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readUint32, null, 0, 0); - }); - break; - case 8: - var value = msg.getTxPacketsPerStatusMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readUint32, null, "", 0); - }); + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setTxPacketsPerStatus(value); break; default: reader.skipField(); @@ -3294,9 +3133,9 @@ proto.api.GatewayStats.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.GatewayStats.prototype.serializeBinary = function() { +proto.api.GetGatewayMetricsResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.api.GatewayStats.serializeBinaryToWriter(this, writer); + proto.api.GetGatewayMetricsResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3304,82 +3143,96 @@ proto.api.GatewayStats.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.api.GatewayStats} message + * @param {!proto.api.GetGatewayMetricsResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.GatewayStats.serializeBinaryToWriter = function(message, writer) { +proto.api.GetGatewayMetricsResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getTime(); + f = message.getRxPackets(); if (f != null) { writer.writeMessage( 1, f, - google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter - ); - } - f = message.getRxPackets(); - if (f !== 0) { - writer.writeUint32( - 2, - f + common_common_pb.Metric.serializeBinaryToWriter ); } f = message.getTxPackets(); - if (f !== 0) { - writer.writeUint32( - 3, - f + if (f != null) { + writer.writeMessage( + 2, + f, + common_common_pb.Metric.serializeBinaryToWriter ); } - f = message.getTxPacketsPerFrequencyMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeUint32); + f = message.getTxPacketsPerFreq(); + if (f != null) { + writer.writeMessage( + 3, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); } - f = message.getRxPacketsPerFrequencyMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeUint32); + f = message.getRxPacketsPerFreq(); + if (f != null) { + writer.writeMessage( + 4, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); } - f = message.getTxPacketsPerDrMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeUint32); + f = message.getTxPacketsPerDr(); + if (f != null) { + writer.writeMessage( + 5, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); } - f = message.getRxPacketsPerDrMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(7, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeUint32); + f = message.getRxPacketsPerDr(); + if (f != null) { + writer.writeMessage( + 6, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); } - f = message.getTxPacketsPerStatusMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(8, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeUint32); + f = message.getTxPacketsPerStatus(); + if (f != null) { + writer.writeMessage( + 7, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); } }; /** - * optional google.protobuf.Timestamp time = 1; - * @return {?proto.google.protobuf.Timestamp} + * optional common.Metric rx_packets = 1; + * @return {?proto.common.Metric} */ -proto.api.GatewayStats.prototype.getTime = function() { - return /** @type{?proto.google.protobuf.Timestamp} */ ( - jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 1)); +proto.api.GetGatewayMetricsResponse.prototype.getRxPackets = function() { + return /** @type{?proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 1)); }; /** - * @param {?proto.google.protobuf.Timestamp|undefined} value - * @return {!proto.api.GatewayStats} returns this + * @param {?proto.common.Metric|undefined} value + * @return {!proto.api.GetGatewayMetricsResponse} returns this */ -proto.api.GatewayStats.prototype.setTime = function(value) { +proto.api.GetGatewayMetricsResponse.prototype.setRxPackets = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. - * @return {!proto.api.GatewayStats} returns this + * @return {!proto.api.GetGatewayMetricsResponse} returns this */ -proto.api.GatewayStats.prototype.clearTime = function() { - return this.setTime(undefined); +proto.api.GetGatewayMetricsResponse.prototype.clearRxPackets = function() { + return this.setRxPackets(undefined); }; @@ -3387,155 +3240,231 @@ proto.api.GatewayStats.prototype.clearTime = function() { * Returns whether this field is set. * @return {boolean} */ -proto.api.GatewayStats.prototype.hasTime = function() { +proto.api.GetGatewayMetricsResponse.prototype.hasRxPackets = function() { return jspb.Message.getField(this, 1) != null; }; /** - * optional uint32 rx_packets = 2; - * @return {number} + * optional common.Metric tx_packets = 2; + * @return {?proto.common.Metric} */ -proto.api.GatewayStats.prototype.getRxPackets = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +proto.api.GetGatewayMetricsResponse.prototype.getTxPackets = function() { + return /** @type{?proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 2)); }; /** - * @param {number} value - * @return {!proto.api.GatewayStats} returns this - */ -proto.api.GatewayStats.prototype.setRxPackets = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); + * @param {?proto.common.Metric|undefined} value + * @return {!proto.api.GetGatewayMetricsResponse} returns this +*/ +proto.api.GetGatewayMetricsResponse.prototype.setTxPackets = function(value) { + return jspb.Message.setWrapperField(this, 2, value); }; /** - * optional uint32 tx_packets = 3; - * @return {number} + * Clears the message field making it undefined. + * @return {!proto.api.GetGatewayMetricsResponse} returns this */ -proto.api.GatewayStats.prototype.getTxPackets = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +proto.api.GetGatewayMetricsResponse.prototype.clearTxPackets = function() { + return this.setTxPackets(undefined); }; /** - * @param {number} value - * @return {!proto.api.GatewayStats} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.api.GatewayStats.prototype.setTxPackets = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); +proto.api.GetGatewayMetricsResponse.prototype.hasTxPackets = function() { + return jspb.Message.getField(this, 2) != null; }; /** - * map tx_packets_per_frequency = 4; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} + * optional common.Metric tx_packets_per_freq = 3; + * @return {?proto.common.Metric} */ -proto.api.GatewayStats.prototype.getTxPacketsPerFrequencyMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 4, opt_noLazyCreate, - null)); +proto.api.GetGatewayMetricsResponse.prototype.getTxPacketsPerFreq = function() { + return /** @type{?proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 3)); }; /** - * Clears values from the map. The map will be non-null. - * @return {!proto.api.GatewayStats} returns this - */ -proto.api.GatewayStats.prototype.clearTxPacketsPerFrequencyMap = function() { - this.getTxPacketsPerFrequencyMap().clear(); - return this;}; - - -/** - * map rx_packets_per_frequency = 5; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.api.GatewayStats.prototype.getRxPacketsPerFrequencyMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 5, opt_noLazyCreate, - null)); + * @param {?proto.common.Metric|undefined} value + * @return {!proto.api.GetGatewayMetricsResponse} returns this +*/ +proto.api.GetGatewayMetricsResponse.prototype.setTxPacketsPerFreq = function(value) { + return jspb.Message.setWrapperField(this, 3, value); }; /** - * Clears values from the map. The map will be non-null. - * @return {!proto.api.GatewayStats} returns this + * Clears the message field making it undefined. + * @return {!proto.api.GetGatewayMetricsResponse} returns this */ -proto.api.GatewayStats.prototype.clearRxPacketsPerFrequencyMap = function() { - this.getRxPacketsPerFrequencyMap().clear(); - return this;}; - - -/** - * map tx_packets_per_dr = 6; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.api.GatewayStats.prototype.getTxPacketsPerDrMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 6, opt_noLazyCreate, - null)); +proto.api.GetGatewayMetricsResponse.prototype.clearTxPacketsPerFreq = function() { + return this.setTxPacketsPerFreq(undefined); }; /** - * Clears values from the map. The map will be non-null. - * @return {!proto.api.GatewayStats} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.api.GatewayStats.prototype.clearTxPacketsPerDrMap = function() { - this.getTxPacketsPerDrMap().clear(); - return this;}; - - -/** - * map rx_packets_per_dr = 7; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.api.GatewayStats.prototype.getRxPacketsPerDrMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 7, opt_noLazyCreate, - null)); +proto.api.GetGatewayMetricsResponse.prototype.hasTxPacketsPerFreq = function() { + return jspb.Message.getField(this, 3) != null; }; /** - * Clears values from the map. The map will be non-null. - * @return {!proto.api.GatewayStats} returns this + * optional common.Metric rx_packets_per_freq = 4; + * @return {?proto.common.Metric} */ -proto.api.GatewayStats.prototype.clearRxPacketsPerDrMap = function() { - this.getRxPacketsPerDrMap().clear(); - return this;}; - - -/** - * map tx_packets_per_status = 8; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.api.GatewayStats.prototype.getTxPacketsPerStatusMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 8, opt_noLazyCreate, - null)); +proto.api.GetGatewayMetricsResponse.prototype.getRxPacketsPerFreq = function() { + return /** @type{?proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 4)); }; /** - * Clears values from the map. The map will be non-null. - * @return {!proto.api.GatewayStats} returns this + * @param {?proto.common.Metric|undefined} value + * @return {!proto.api.GetGatewayMetricsResponse} returns this +*/ +proto.api.GetGatewayMetricsResponse.prototype.setRxPacketsPerFreq = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.GetGatewayMetricsResponse} returns this */ -proto.api.GatewayStats.prototype.clearTxPacketsPerStatusMap = function() { - this.getTxPacketsPerStatusMap().clear(); - return this;}; +proto.api.GetGatewayMetricsResponse.prototype.clearRxPacketsPerFreq = function() { + return this.setRxPacketsPerFreq(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.GetGatewayMetricsResponse.prototype.hasRxPacketsPerFreq = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional common.Metric tx_packets_per_dr = 5; + * @return {?proto.common.Metric} + */ +proto.api.GetGatewayMetricsResponse.prototype.getTxPacketsPerDr = function() { + return /** @type{?proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 5)); +}; + + +/** + * @param {?proto.common.Metric|undefined} value + * @return {!proto.api.GetGatewayMetricsResponse} returns this +*/ +proto.api.GetGatewayMetricsResponse.prototype.setTxPacketsPerDr = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.GetGatewayMetricsResponse} returns this + */ +proto.api.GetGatewayMetricsResponse.prototype.clearTxPacketsPerDr = function() { + return this.setTxPacketsPerDr(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.GetGatewayMetricsResponse.prototype.hasTxPacketsPerDr = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional common.Metric rx_packets_per_dr = 6; + * @return {?proto.common.Metric} + */ +proto.api.GetGatewayMetricsResponse.prototype.getRxPacketsPerDr = function() { + return /** @type{?proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 6)); +}; + + +/** + * @param {?proto.common.Metric|undefined} value + * @return {!proto.api.GetGatewayMetricsResponse} returns this +*/ +proto.api.GetGatewayMetricsResponse.prototype.setRxPacketsPerDr = function(value) { + return jspb.Message.setWrapperField(this, 6, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.GetGatewayMetricsResponse} returns this + */ +proto.api.GetGatewayMetricsResponse.prototype.clearRxPacketsPerDr = function() { + return this.setRxPacketsPerDr(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.GetGatewayMetricsResponse.prototype.hasRxPacketsPerDr = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional common.Metric tx_packets_per_status = 7; + * @return {?proto.common.Metric} + */ +proto.api.GetGatewayMetricsResponse.prototype.getTxPacketsPerStatus = function() { + return /** @type{?proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 7)); +}; + + +/** + * @param {?proto.common.Metric|undefined} value + * @return {!proto.api.GetGatewayMetricsResponse} returns this +*/ +proto.api.GetGatewayMetricsResponse.prototype.setTxPacketsPerStatus = function(value) { + return jspb.Message.setWrapperField(this, 7, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.api.GetGatewayMetricsResponse} returns this + */ +proto.api.GetGatewayMetricsResponse.prototype.clearTxPacketsPerStatus = function() { + return this.setTxPacketsPerStatus(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.api.GetGatewayMetricsResponse.prototype.hasTxPacketsPerStatus = function() { + return jspb.Message.getField(this, 7) != null; +}; goog.object.extend(exports, proto.api); diff --git a/api/grpc-web/common/common_pb.d.ts b/api/grpc-web/common/common_pb.d.ts index 96890127..c04732ca 100644 --- a/api/grpc-web/common/common_pb.d.ts +++ b/api/grpc-web/common/common_pb.d.ts @@ -1,5 +1,6 @@ import * as jspb from 'google-protobuf' +import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb'; export class Location extends jspb.Message { @@ -60,6 +61,60 @@ export namespace KeyEnvelope { } } +export class Metric extends jspb.Message { + getName(): string; + setName(value: string): Metric; + + getTimestampsList(): Array; + setTimestampsList(value: Array): Metric; + clearTimestampsList(): Metric; + addTimestamps(value?: google_protobuf_timestamp_pb.Timestamp, index?: number): google_protobuf_timestamp_pb.Timestamp; + + getDatasetsList(): Array; + setDatasetsList(value: Array): Metric; + clearDatasetsList(): Metric; + addDatasets(value?: MetricDataset, index?: number): MetricDataset; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Metric.AsObject; + static toObject(includeInstance: boolean, msg: Metric): Metric.AsObject; + static serializeBinaryToWriter(message: Metric, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Metric; + static deserializeBinaryFromReader(message: Metric, reader: jspb.BinaryReader): Metric; +} + +export namespace Metric { + export type AsObject = { + name: string, + timestampsList: Array, + datasetsList: Array, + } +} + +export class MetricDataset extends jspb.Message { + getLabel(): string; + setLabel(value: string): MetricDataset; + + getDataList(): Array; + setDataList(value: Array): MetricDataset; + clearDataList(): MetricDataset; + addData(value: number, index?: number): MetricDataset; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): MetricDataset.AsObject; + static toObject(includeInstance: boolean, msg: MetricDataset): MetricDataset.AsObject; + static serializeBinaryToWriter(message: MetricDataset, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): MetricDataset; + static deserializeBinaryFromReader(message: MetricDataset, reader: jspb.BinaryReader): MetricDataset; +} + +export namespace MetricDataset { + export type AsObject = { + label: string, + dataList: Array, + } +} + export enum Modulation { LORA = 0, FSK = 1, @@ -116,3 +171,8 @@ export enum LocationSource { GEO_RESOLVER_GNSS = 5, GEO_RESOLVER_WIFI = 6, } +export enum Aggregation { + HOUR = 0, + DAY = 1, + MONTH = 2, +} diff --git a/api/grpc-web/common/common_pb.js b/api/grpc-web/common/common_pb.js index 8b6ac9d9..9a161141 100644 --- a/api/grpc-web/common/common_pb.js +++ b/api/grpc-web/common/common_pb.js @@ -15,11 +15,16 @@ var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); +var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); +goog.object.extend(proto, google_protobuf_timestamp_pb); +goog.exportSymbol('proto.common.Aggregation', null, global); goog.exportSymbol('proto.common.KeyEnvelope', null, global); goog.exportSymbol('proto.common.Location', null, global); goog.exportSymbol('proto.common.LocationSource', null, global); goog.exportSymbol('proto.common.MType', null, global); goog.exportSymbol('proto.common.MacVersion', null, global); +goog.exportSymbol('proto.common.Metric', null, global); +goog.exportSymbol('proto.common.MetricDataset', null, global); goog.exportSymbol('proto.common.Modulation', null, global); goog.exportSymbol('proto.common.RegParamsRevision', null, global); goog.exportSymbol('proto.common.Region', null, global); @@ -65,6 +70,48 @@ if (goog.DEBUG && !COMPILED) { */ proto.common.KeyEnvelope.displayName = 'proto.common.KeyEnvelope'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.Metric = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.common.Metric.repeatedFields_, null); +}; +goog.inherits(proto.common.Metric, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.Metric.displayName = 'proto.common.Metric'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.MetricDataset = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.common.MetricDataset.repeatedFields_, null); +}; +goog.inherits(proto.common.MetricDataset, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.common.MetricDataset.displayName = 'proto.common.MetricDataset'; +} @@ -499,6 +546,437 @@ proto.common.KeyEnvelope.prototype.setAesKey = function(value) { }; + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.common.Metric.repeatedFields_ = [2,3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.Metric.prototype.toObject = function(opt_includeInstance) { + return proto.common.Metric.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.Metric} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.Metric.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + timestampsList: jspb.Message.toObjectList(msg.getTimestampsList(), + google_protobuf_timestamp_pb.Timestamp.toObject, includeInstance), + datasetsList: jspb.Message.toObjectList(msg.getDatasetsList(), + proto.common.MetricDataset.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.Metric} + */ +proto.common.Metric.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.Metric; + return proto.common.Metric.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.Metric} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.Metric} + */ +proto.common.Metric.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = new google_protobuf_timestamp_pb.Timestamp; + reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); + msg.addTimestamps(value); + break; + case 3: + var value = new proto.common.MetricDataset; + reader.readMessage(value,proto.common.MetricDataset.deserializeBinaryFromReader); + msg.addDatasets(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.Metric.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.Metric.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.Metric} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.Metric.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getTimestampsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter + ); + } + f = message.getDatasetsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.common.MetricDataset.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.common.Metric.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.Metric} returns this + */ +proto.common.Metric.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated google.protobuf.Timestamp timestamps = 2; + * @return {!Array} + */ +proto.common.Metric.prototype.getTimestampsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.common.Metric} returns this +*/ +proto.common.Metric.prototype.setTimestampsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.google.protobuf.Timestamp=} opt_value + * @param {number=} opt_index + * @return {!proto.google.protobuf.Timestamp} + */ +proto.common.Metric.prototype.addTimestamps = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.google.protobuf.Timestamp, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.common.Metric} returns this + */ +proto.common.Metric.prototype.clearTimestampsList = function() { + return this.setTimestampsList([]); +}; + + +/** + * repeated MetricDataset datasets = 3; + * @return {!Array} + */ +proto.common.Metric.prototype.getDatasetsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.common.MetricDataset, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.common.Metric} returns this +*/ +proto.common.Metric.prototype.setDatasetsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.common.MetricDataset=} opt_value + * @param {number=} opt_index + * @return {!proto.common.MetricDataset} + */ +proto.common.Metric.prototype.addDatasets = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.common.MetricDataset, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.common.Metric} returns this + */ +proto.common.Metric.prototype.clearDatasetsList = function() { + return this.setDatasetsList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.common.MetricDataset.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.MetricDataset.prototype.toObject = function(opt_includeInstance) { + return proto.common.MetricDataset.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.MetricDataset} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.MetricDataset.toObject = function(includeInstance, msg) { + var f, obj = { + label: jspb.Message.getFieldWithDefault(msg, 1, ""), + dataList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 2)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.MetricDataset} + */ +proto.common.MetricDataset.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.MetricDataset; + return proto.common.MetricDataset.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.MetricDataset} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.MetricDataset} + */ +proto.common.MetricDataset.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setLabel(value); + break; + case 2: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedFloat() : [reader.readFloat()]); + for (var i = 0; i < values.length; i++) { + msg.addData(values[i]); + } + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.MetricDataset.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.common.MetricDataset.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.common.MetricDataset} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.common.MetricDataset.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLabel(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getDataList(); + if (f.length > 0) { + writer.writePackedFloat( + 2, + f + ); + } +}; + + +/** + * optional string label = 1; + * @return {string} + */ +proto.common.MetricDataset.prototype.getLabel = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.common.MetricDataset} returns this + */ +proto.common.MetricDataset.prototype.setLabel = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated float data = 2; + * @return {!Array} + */ +proto.common.MetricDataset.prototype.getDataList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.common.MetricDataset} returns this + */ +proto.common.MetricDataset.prototype.setDataList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.common.MetricDataset} returns this + */ +proto.common.MetricDataset.prototype.addData = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.common.MetricDataset} returns this + */ +proto.common.MetricDataset.prototype.clearDataList = function() { + return this.setDataList([]); +}; + + /** * @enum {number} */ @@ -579,4 +1057,13 @@ proto.common.LocationSource = { GEO_RESOLVER_WIFI: 6 }; +/** + * @enum {number} + */ +proto.common.Aggregation = { + HOUR: 0, + DAY: 1, + MONTH: 2 +}; + goog.object.extend(exports, proto.common); diff --git a/api/js/api/device_grpc_pb.d.ts b/api/js/api/device_grpc_pb.d.ts index a48f934c..fe4e0082 100644 --- a/api/js/api/device_grpc_pb.d.ts +++ b/api/js/api/device_grpc_pb.d.ts @@ -22,7 +22,8 @@ interface IDeviceServiceService extends grpc.ServiceDefinition; getActivation: grpc.MethodDefinition; getRandomDevAddr: grpc.MethodDefinition; - getStats: grpc.MethodDefinition; + getMetrics: grpc.MethodDefinition; + getLinkMetrics: grpc.MethodDefinition; enqueue: grpc.MethodDefinition; flushQueue: grpc.MethodDefinition; getQueue: grpc.MethodDefinition; @@ -45,7 +46,8 @@ export interface IDeviceServiceServer extends grpc.UntypedServiceImplementation deactivate: grpc.handleUnaryCall; getActivation: grpc.handleUnaryCall; getRandomDevAddr: grpc.handleUnaryCall; - getStats: grpc.handleUnaryCall; + getMetrics: grpc.handleUnaryCall; + getLinkMetrics: grpc.handleUnaryCall; enqueue: grpc.handleUnaryCall; flushQueue: grpc.handleUnaryCall; getQueue: grpc.handleUnaryCall; @@ -95,9 +97,12 @@ export class DeviceServiceClient extends grpc.Client { getRandomDevAddr(argument: api_device_pb.GetRandomDevAddrRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; getRandomDevAddr(argument: api_device_pb.GetRandomDevAddrRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; getRandomDevAddr(argument: api_device_pb.GetRandomDevAddrRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - getStats(argument: api_device_pb.GetDeviceStatsRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - getStats(argument: api_device_pb.GetDeviceStatsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - getStats(argument: api_device_pb.GetDeviceStatsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + getMetrics(argument: api_device_pb.GetDeviceMetricsRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + getMetrics(argument: api_device_pb.GetDeviceMetricsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + getMetrics(argument: api_device_pb.GetDeviceMetricsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + getLinkMetrics(argument: api_device_pb.GetDeviceLinkMetricsRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + getLinkMetrics(argument: api_device_pb.GetDeviceLinkMetricsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + getLinkMetrics(argument: api_device_pb.GetDeviceLinkMetricsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; enqueue(argument: api_device_pb.EnqueueDeviceQueueItemRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; enqueue(argument: api_device_pb.EnqueueDeviceQueueItemRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; enqueue(argument: api_device_pb.EnqueueDeviceQueueItemRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; diff --git a/api/js/api/device_grpc_pb.js b/api/js/api/device_grpc_pb.js index 58f84c96..12a09be5 100644 --- a/api/js/api/device_grpc_pb.js +++ b/api/js/api/device_grpc_pb.js @@ -3,6 +3,7 @@ 'use strict'; var grpc = require('@grpc/grpc-js'); var api_device_pb = require('../api/device_pb.js'); +var common_common_pb = require('../common/common_pb.js'); var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); @@ -161,6 +162,50 @@ function deserialize_api_GetDeviceKeysResponse(buffer_arg) { return api_device_pb.GetDeviceKeysResponse.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_api_GetDeviceLinkMetricsRequest(arg) { + if (!(arg instanceof api_device_pb.GetDeviceLinkMetricsRequest)) { + throw new Error('Expected argument of type api.GetDeviceLinkMetricsRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_api_GetDeviceLinkMetricsRequest(buffer_arg) { + return api_device_pb.GetDeviceLinkMetricsRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_api_GetDeviceLinkMetricsResponse(arg) { + if (!(arg instanceof api_device_pb.GetDeviceLinkMetricsResponse)) { + throw new Error('Expected argument of type api.GetDeviceLinkMetricsResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_api_GetDeviceLinkMetricsResponse(buffer_arg) { + return api_device_pb.GetDeviceLinkMetricsResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_api_GetDeviceMetricsRequest(arg) { + if (!(arg instanceof api_device_pb.GetDeviceMetricsRequest)) { + throw new Error('Expected argument of type api.GetDeviceMetricsRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_api_GetDeviceMetricsRequest(buffer_arg) { + return api_device_pb.GetDeviceMetricsRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_api_GetDeviceMetricsResponse(arg) { + if (!(arg instanceof api_device_pb.GetDeviceMetricsResponse)) { + throw new Error('Expected argument of type api.GetDeviceMetricsResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_api_GetDeviceMetricsResponse(buffer_arg) { + return api_device_pb.GetDeviceMetricsResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + function serialize_api_GetDeviceQueueItemsRequest(arg) { if (!(arg instanceof api_device_pb.GetDeviceQueueItemsRequest)) { throw new Error('Expected argument of type api.GetDeviceQueueItemsRequest'); @@ -205,28 +250,6 @@ function deserialize_api_GetDeviceResponse(buffer_arg) { return api_device_pb.GetDeviceResponse.deserializeBinary(new Uint8Array(buffer_arg)); } -function serialize_api_GetDeviceStatsRequest(arg) { - if (!(arg instanceof api_device_pb.GetDeviceStatsRequest)) { - throw new Error('Expected argument of type api.GetDeviceStatsRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_api_GetDeviceStatsRequest(buffer_arg) { - return api_device_pb.GetDeviceStatsRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_api_GetDeviceStatsResponse(arg) { - if (!(arg instanceof api_device_pb.GetDeviceStatsResponse)) { - throw new Error('Expected argument of type api.GetDeviceStatsResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_api_GetDeviceStatsResponse(buffer_arg) { - return api_device_pb.GetDeviceStatsResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - function serialize_api_GetRandomDevAddrRequest(arg) { if (!(arg instanceof api_device_pb.GetRandomDevAddrRequest)) { throw new Error('Expected argument of type api.GetRandomDevAddrRequest'); @@ -475,17 +498,31 @@ getRandomDevAddr: { responseSerialize: serialize_api_GetRandomDevAddrResponse, responseDeserialize: deserialize_api_GetRandomDevAddrResponse, }, - // GetStats returns the device stats. -getStats: { - path: '/api.DeviceService/GetStats', + // GetMetrics returns the device metrics. +// Note that this requires a device-profile with codec and measurements configured. +getMetrics: { + path: '/api.DeviceService/GetMetrics', requestStream: false, responseStream: false, - requestType: api_device_pb.GetDeviceStatsRequest, - responseType: api_device_pb.GetDeviceStatsResponse, - requestSerialize: serialize_api_GetDeviceStatsRequest, - requestDeserialize: deserialize_api_GetDeviceStatsRequest, - responseSerialize: serialize_api_GetDeviceStatsResponse, - responseDeserialize: deserialize_api_GetDeviceStatsResponse, + requestType: api_device_pb.GetDeviceMetricsRequest, + responseType: api_device_pb.GetDeviceMetricsResponse, + requestSerialize: serialize_api_GetDeviceMetricsRequest, + requestDeserialize: deserialize_api_GetDeviceMetricsRequest, + responseSerialize: serialize_api_GetDeviceMetricsResponse, + responseDeserialize: deserialize_api_GetDeviceMetricsResponse, + }, + // GetLinkMetrics returns the device link metrics. +// This includes uplinks, downlinks, RSSI, SNR, etc... +getLinkMetrics: { + path: '/api.DeviceService/GetLinkMetrics', + requestStream: false, + responseStream: false, + requestType: api_device_pb.GetDeviceLinkMetricsRequest, + responseType: api_device_pb.GetDeviceLinkMetricsResponse, + requestSerialize: serialize_api_GetDeviceLinkMetricsRequest, + requestDeserialize: deserialize_api_GetDeviceLinkMetricsRequest, + responseSerialize: serialize_api_GetDeviceLinkMetricsResponse, + responseDeserialize: deserialize_api_GetDeviceLinkMetricsResponse, }, // Enqueue adds the given item to the downlink queue. enqueue: { diff --git a/api/js/api/device_pb.d.ts b/api/js/api/device_pb.d.ts index f2e8e87c..18f34596 100644 --- a/api/js/api/device_pb.d.ts +++ b/api/js/api/device_pb.d.ts @@ -2,6 +2,7 @@ // file: api/device.proto import * as jspb from "google-protobuf"; +import * as common_common_pb from "../common/common_pb"; import * as google_protobuf_timestamp_pb from "google-protobuf/google/protobuf/timestamp_pb"; import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; import * as google_protobuf_empty_pb from "google-protobuf/google/protobuf/empty_pb"; @@ -658,7 +659,7 @@ export namespace GetRandomDevAddrResponse { } } -export class GetDeviceStatsRequest extends jspb.Message { +export class GetDeviceMetricsRequest extends jspb.Message { getDevEui(): string; setDevEui(value: string): void; @@ -672,86 +673,159 @@ export class GetDeviceStatsRequest extends jspb.Message { getEnd(): google_protobuf_timestamp_pb.Timestamp | undefined; setEnd(value?: google_protobuf_timestamp_pb.Timestamp): void; + getAggregation(): common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap]; + setAggregation(value: common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap]): void; + serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetDeviceStatsRequest.AsObject; - static toObject(includeInstance: boolean, msg: GetDeviceStatsRequest): GetDeviceStatsRequest.AsObject; + toObject(includeInstance?: boolean): GetDeviceMetricsRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetDeviceMetricsRequest): GetDeviceMetricsRequest.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetDeviceStatsRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetDeviceStatsRequest; - static deserializeBinaryFromReader(message: GetDeviceStatsRequest, reader: jspb.BinaryReader): GetDeviceStatsRequest; + static serializeBinaryToWriter(message: GetDeviceMetricsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetDeviceMetricsRequest; + static deserializeBinaryFromReader(message: GetDeviceMetricsRequest, reader: jspb.BinaryReader): GetDeviceMetricsRequest; } -export namespace GetDeviceStatsRequest { +export namespace GetDeviceMetricsRequest { export type AsObject = { devEui: string, start?: google_protobuf_timestamp_pb.Timestamp.AsObject, end?: google_protobuf_timestamp_pb.Timestamp.AsObject, + aggregation: common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap], } } -export class GetDeviceStatsResponse extends jspb.Message { - clearResultList(): void; - getResultList(): Array; - setResultList(value: Array): void; - addResult(value?: DeviceStats, index?: number): DeviceStats; - +export class GetDeviceMetricsResponse extends jspb.Message { + getMetricsMap(): jspb.Map; + clearMetricsMap(): void; + getStatesMap(): jspb.Map; + clearStatesMap(): void; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetDeviceStatsResponse.AsObject; - static toObject(includeInstance: boolean, msg: GetDeviceStatsResponse): GetDeviceStatsResponse.AsObject; + toObject(includeInstance?: boolean): GetDeviceMetricsResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetDeviceMetricsResponse): GetDeviceMetricsResponse.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetDeviceStatsResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetDeviceStatsResponse; - static deserializeBinaryFromReader(message: GetDeviceStatsResponse, reader: jspb.BinaryReader): GetDeviceStatsResponse; + static serializeBinaryToWriter(message: GetDeviceMetricsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetDeviceMetricsResponse; + static deserializeBinaryFromReader(message: GetDeviceMetricsResponse, reader: jspb.BinaryReader): GetDeviceMetricsResponse; } -export namespace GetDeviceStatsResponse { +export namespace GetDeviceMetricsResponse { export type AsObject = { - resultList: Array, + metricsMap: Array<[string, common_common_pb.Metric.AsObject]>, + statesMap: Array<[string, DeviceState.AsObject]>, } } -export class DeviceStats extends jspb.Message { - hasTime(): boolean; - clearTime(): void; - getTime(): google_protobuf_timestamp_pb.Timestamp | undefined; - setTime(value?: google_protobuf_timestamp_pb.Timestamp): void; +export class DeviceState extends jspb.Message { + getName(): string; + setName(value: string): void; - getRxPackets(): number; - setRxPackets(value: number): void; + getValue(): string; + setValue(value: string): void; - getGwRssi(): number; - setGwRssi(value: number): void; - - getGwSnr(): number; - setGwSnr(value: number): void; - - getRxPacketsPerFrequencyMap(): jspb.Map; - clearRxPacketsPerFrequencyMap(): void; - getRxPacketsPerDrMap(): jspb.Map; - clearRxPacketsPerDrMap(): void; - getErrorsMap(): jspb.Map; - clearErrorsMap(): void; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DeviceStats.AsObject; - static toObject(includeInstance: boolean, msg: DeviceStats): DeviceStats.AsObject; + toObject(includeInstance?: boolean): DeviceState.AsObject; + static toObject(includeInstance: boolean, msg: DeviceState): DeviceState.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DeviceStats, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DeviceStats; - static deserializeBinaryFromReader(message: DeviceStats, reader: jspb.BinaryReader): DeviceStats; + static serializeBinaryToWriter(message: DeviceState, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeviceState; + static deserializeBinaryFromReader(message: DeviceState, reader: jspb.BinaryReader): DeviceState; } -export namespace DeviceStats { +export namespace DeviceState { export type AsObject = { - time?: google_protobuf_timestamp_pb.Timestamp.AsObject, - rxPackets: number, - gwRssi: number, - gwSnr: number, - rxPacketsPerFrequencyMap: Array<[number, number]>, - rxPacketsPerDrMap: Array<[number, number]>, - errorsMap: Array<[string, number]>, + name: string, + value: string, + } +} + +export class GetDeviceLinkMetricsRequest extends jspb.Message { + getDevEui(): string; + setDevEui(value: string): void; + + hasStart(): boolean; + clearStart(): void; + getStart(): google_protobuf_timestamp_pb.Timestamp | undefined; + setStart(value?: google_protobuf_timestamp_pb.Timestamp): void; + + hasEnd(): boolean; + clearEnd(): void; + getEnd(): google_protobuf_timestamp_pb.Timestamp | undefined; + setEnd(value?: google_protobuf_timestamp_pb.Timestamp): void; + + getAggregation(): common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap]; + setAggregation(value: common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap]): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetDeviceLinkMetricsRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetDeviceLinkMetricsRequest): GetDeviceLinkMetricsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetDeviceLinkMetricsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetDeviceLinkMetricsRequest; + static deserializeBinaryFromReader(message: GetDeviceLinkMetricsRequest, reader: jspb.BinaryReader): GetDeviceLinkMetricsRequest; +} + +export namespace GetDeviceLinkMetricsRequest { + export type AsObject = { + devEui: string, + start?: google_protobuf_timestamp_pb.Timestamp.AsObject, + end?: google_protobuf_timestamp_pb.Timestamp.AsObject, + aggregation: common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap], + } +} + +export class GetDeviceLinkMetricsResponse extends jspb.Message { + hasRxPackets(): boolean; + clearRxPackets(): void; + getRxPackets(): common_common_pb.Metric | undefined; + setRxPackets(value?: common_common_pb.Metric): void; + + hasGwRssi(): boolean; + clearGwRssi(): void; + getGwRssi(): common_common_pb.Metric | undefined; + setGwRssi(value?: common_common_pb.Metric): void; + + hasGwSnr(): boolean; + clearGwSnr(): void; + getGwSnr(): common_common_pb.Metric | undefined; + setGwSnr(value?: common_common_pb.Metric): void; + + hasRxPacketsPerFreq(): boolean; + clearRxPacketsPerFreq(): void; + getRxPacketsPerFreq(): common_common_pb.Metric | undefined; + setRxPacketsPerFreq(value?: common_common_pb.Metric): void; + + hasRxPacketsPerDr(): boolean; + clearRxPacketsPerDr(): void; + getRxPacketsPerDr(): common_common_pb.Metric | undefined; + setRxPacketsPerDr(value?: common_common_pb.Metric): void; + + hasErrors(): boolean; + clearErrors(): void; + getErrors(): common_common_pb.Metric | undefined; + setErrors(value?: common_common_pb.Metric): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetDeviceLinkMetricsResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetDeviceLinkMetricsResponse): GetDeviceLinkMetricsResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetDeviceLinkMetricsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetDeviceLinkMetricsResponse; + static deserializeBinaryFromReader(message: GetDeviceLinkMetricsResponse, reader: jspb.BinaryReader): GetDeviceLinkMetricsResponse; +} + +export namespace GetDeviceLinkMetricsResponse { + export type AsObject = { + rxPackets?: common_common_pb.Metric.AsObject, + gwRssi?: common_common_pb.Metric.AsObject, + gwSnr?: common_common_pb.Metric.AsObject, + rxPacketsPerFreq?: common_common_pb.Metric.AsObject, + rxPacketsPerDr?: common_common_pb.Metric.AsObject, + errors?: common_common_pb.Metric.AsObject, } } diff --git a/api/js/api/device_pb.js b/api/js/api/device_pb.js index 75dfed48..90c5d84c 100644 --- a/api/js/api/device_pb.js +++ b/api/js/api/device_pb.js @@ -9,6 +9,7 @@ var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); +var common_common_pb = require('../common/common_pb.js'); var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); @@ -23,7 +24,7 @@ goog.exportSymbol('proto.api.DeviceActivation', null, global); goog.exportSymbol('proto.api.DeviceKeys', null, global); goog.exportSymbol('proto.api.DeviceListItem', null, global); goog.exportSymbol('proto.api.DeviceQueueItem', null, global); -goog.exportSymbol('proto.api.DeviceStats', null, global); +goog.exportSymbol('proto.api.DeviceState', null, global); goog.exportSymbol('proto.api.DeviceStatus', null, global); goog.exportSymbol('proto.api.EnqueueDeviceQueueItemRequest', null, global); goog.exportSymbol('proto.api.EnqueueDeviceQueueItemResponse', null, global); @@ -33,12 +34,14 @@ goog.exportSymbol('proto.api.GetDeviceActivationRequest', null, global); goog.exportSymbol('proto.api.GetDeviceActivationResponse', null, global); goog.exportSymbol('proto.api.GetDeviceKeysRequest', null, global); goog.exportSymbol('proto.api.GetDeviceKeysResponse', null, global); +goog.exportSymbol('proto.api.GetDeviceLinkMetricsRequest', null, global); +goog.exportSymbol('proto.api.GetDeviceLinkMetricsResponse', null, global); +goog.exportSymbol('proto.api.GetDeviceMetricsRequest', null, global); +goog.exportSymbol('proto.api.GetDeviceMetricsResponse', null, global); goog.exportSymbol('proto.api.GetDeviceQueueItemsRequest', null, global); goog.exportSymbol('proto.api.GetDeviceQueueItemsResponse', null, global); goog.exportSymbol('proto.api.GetDeviceRequest', null, global); goog.exportSymbol('proto.api.GetDeviceResponse', null, global); -goog.exportSymbol('proto.api.GetDeviceStatsRequest', null, global); -goog.exportSymbol('proto.api.GetDeviceStatsResponse', null, global); goog.exportSymbol('proto.api.GetRandomDevAddrRequest', null, global); goog.exportSymbol('proto.api.GetRandomDevAddrResponse', null, global); goog.exportSymbol('proto.api.ListDevicesRequest', null, global); @@ -5091,12 +5094,12 @@ proto.api.GetRandomDevAddrResponse.prototype.setDevAddr = function(value) { * @extends {jspb.Message} * @constructor */ -proto.api.GetDeviceStatsRequest = function(opt_data) { +proto.api.GetDeviceMetricsRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.api.GetDeviceStatsRequest, jspb.Message); +goog.inherits(proto.api.GetDeviceMetricsRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.api.GetDeviceStatsRequest.displayName = 'proto.api.GetDeviceStatsRequest'; + proto.api.GetDeviceMetricsRequest.displayName = 'proto.api.GetDeviceMetricsRequest'; } @@ -5111,8 +5114,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.api.GetDeviceStatsRequest.prototype.toObject = function(opt_includeInstance) { - return proto.api.GetDeviceStatsRequest.toObject(opt_includeInstance, this); +proto.api.GetDeviceMetricsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetDeviceMetricsRequest.toObject(opt_includeInstance, this); }; @@ -5121,14 +5124,15 @@ proto.api.GetDeviceStatsRequest.prototype.toObject = function(opt_includeInstanc * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.GetDeviceStatsRequest} msg The msg instance to transform. + * @param {!proto.api.GetDeviceMetricsRequest} msg The msg instance to transform. * @return {!Object} */ -proto.api.GetDeviceStatsRequest.toObject = function(includeInstance, msg) { +proto.api.GetDeviceMetricsRequest.toObject = function(includeInstance, msg) { var f, obj = { devEui: msg.getDevEui(), start: (f = msg.getStart()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), - end: (f = msg.getEnd()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f) + end: (f = msg.getEnd()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), + aggregation: msg.getAggregation() }; if (includeInstance) { @@ -5142,23 +5146,23 @@ proto.api.GetDeviceStatsRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.GetDeviceStatsRequest} + * @return {!proto.api.GetDeviceMetricsRequest} */ -proto.api.GetDeviceStatsRequest.deserializeBinary = function(bytes) { +proto.api.GetDeviceMetricsRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.GetDeviceStatsRequest; - return proto.api.GetDeviceStatsRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.GetDeviceMetricsRequest; + return proto.api.GetDeviceMetricsRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.GetDeviceStatsRequest} msg The message object to deserialize into. + * @param {!proto.api.GetDeviceMetricsRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.GetDeviceStatsRequest} + * @return {!proto.api.GetDeviceMetricsRequest} */ -proto.api.GetDeviceStatsRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.api.GetDeviceMetricsRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -5179,6 +5183,10 @@ proto.api.GetDeviceStatsRequest.deserializeBinaryFromReader = function(msg, read reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); msg.setEnd(value); break; + case 4: + var value = /** @type {!proto.common.Aggregation} */ (reader.readEnum()); + msg.setAggregation(value); + break; default: reader.skipField(); break; @@ -5191,10 +5199,10 @@ proto.api.GetDeviceStatsRequest.deserializeBinaryFromReader = function(msg, read /** * Class method variant: serializes the given message to binary data * (in protobuf wire format), writing to the given BinaryWriter. - * @param {!proto.api.GetDeviceStatsRequest} message + * @param {!proto.api.GetDeviceMetricsRequest} message * @param {!jspb.BinaryWriter} writer */ -proto.api.GetDeviceStatsRequest.serializeBinaryToWriter = function(message, writer) { +proto.api.GetDeviceMetricsRequest.serializeBinaryToWriter = function(message, writer) { message.serializeBinaryToWriter(writer); }; @@ -5203,7 +5211,7 @@ proto.api.GetDeviceStatsRequest.serializeBinaryToWriter = function(message, writ * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.GetDeviceStatsRequest.prototype.serializeBinary = function() { +proto.api.GetDeviceMetricsRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); this.serializeBinaryToWriter(writer); return writer.getResultBuffer(); @@ -5215,7 +5223,7 @@ proto.api.GetDeviceStatsRequest.prototype.serializeBinary = function() { * writing to the given BinaryWriter. * @param {!jspb.BinaryWriter} writer */ -proto.api.GetDeviceStatsRequest.prototype.serializeBinaryToWriter = function (writer) { +proto.api.GetDeviceMetricsRequest.prototype.serializeBinaryToWriter = function (writer) { var f = undefined; f = this.getDevEui(); if (f.length > 0) { @@ -5240,15 +5248,22 @@ proto.api.GetDeviceStatsRequest.prototype.serializeBinaryToWriter = function (wr google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter ); } + f = this.getAggregation(); + if (f !== 0.0) { + writer.writeEnum( + 4, + f + ); + } }; /** * Creates a deep clone of this proto. No data is shared with the original. - * @return {!proto.api.GetDeviceStatsRequest} The clone. + * @return {!proto.api.GetDeviceMetricsRequest} The clone. */ -proto.api.GetDeviceStatsRequest.prototype.cloneMessage = function() { - return /** @type {!proto.api.GetDeviceStatsRequest} */ (jspb.Message.cloneMessage(this)); +proto.api.GetDeviceMetricsRequest.prototype.cloneMessage = function() { + return /** @type {!proto.api.GetDeviceMetricsRequest} */ (jspb.Message.cloneMessage(this)); }; @@ -5256,13 +5271,13 @@ proto.api.GetDeviceStatsRequest.prototype.cloneMessage = function() { * optional string dev_eui = 1; * @return {string} */ -proto.api.GetDeviceStatsRequest.prototype.getDevEui = function() { +proto.api.GetDeviceMetricsRequest.prototype.getDevEui = function() { return /** @type {string} */ (jspb.Message.getFieldProto3(this, 1, "")); }; /** @param {string} value */ -proto.api.GetDeviceStatsRequest.prototype.setDevEui = function(value) { +proto.api.GetDeviceMetricsRequest.prototype.setDevEui = function(value) { jspb.Message.setField(this, 1, value); }; @@ -5271,19 +5286,19 @@ proto.api.GetDeviceStatsRequest.prototype.setDevEui = function(value) { * optional google.protobuf.Timestamp start = 2; * @return {proto.google.protobuf.Timestamp} */ -proto.api.GetDeviceStatsRequest.prototype.getStart = function() { +proto.api.GetDeviceMetricsRequest.prototype.getStart = function() { return /** @type{proto.google.protobuf.Timestamp} */ ( jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2)); }; /** @param {proto.google.protobuf.Timestamp|undefined} value */ -proto.api.GetDeviceStatsRequest.prototype.setStart = function(value) { +proto.api.GetDeviceMetricsRequest.prototype.setStart = function(value) { jspb.Message.setWrapperField(this, 2, value); }; -proto.api.GetDeviceStatsRequest.prototype.clearStart = function() { +proto.api.GetDeviceMetricsRequest.prototype.clearStart = function() { this.setStart(undefined); }; @@ -5292,7 +5307,7 @@ proto.api.GetDeviceStatsRequest.prototype.clearStart = function() { * Returns whether this field is set. * @return{!boolean} */ -proto.api.GetDeviceStatsRequest.prototype.hasStart = function() { +proto.api.GetDeviceMetricsRequest.prototype.hasStart = function() { return jspb.Message.getField(this, 2) != null; }; @@ -5301,19 +5316,19 @@ proto.api.GetDeviceStatsRequest.prototype.hasStart = function() { * optional google.protobuf.Timestamp end = 3; * @return {proto.google.protobuf.Timestamp} */ -proto.api.GetDeviceStatsRequest.prototype.getEnd = function() { +proto.api.GetDeviceMetricsRequest.prototype.getEnd = function() { return /** @type{proto.google.protobuf.Timestamp} */ ( jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3)); }; /** @param {proto.google.protobuf.Timestamp|undefined} value */ -proto.api.GetDeviceStatsRequest.prototype.setEnd = function(value) { +proto.api.GetDeviceMetricsRequest.prototype.setEnd = function(value) { jspb.Message.setWrapperField(this, 3, value); }; -proto.api.GetDeviceStatsRequest.prototype.clearEnd = function() { +proto.api.GetDeviceMetricsRequest.prototype.clearEnd = function() { this.setEnd(undefined); }; @@ -5322,11 +5337,26 @@ proto.api.GetDeviceStatsRequest.prototype.clearEnd = function() { * Returns whether this field is set. * @return{!boolean} */ -proto.api.GetDeviceStatsRequest.prototype.hasEnd = function() { +proto.api.GetDeviceMetricsRequest.prototype.hasEnd = function() { return jspb.Message.getField(this, 3) != null; }; +/** + * optional common.Aggregation aggregation = 4; + * @return {!proto.common.Aggregation} + */ +proto.api.GetDeviceMetricsRequest.prototype.getAggregation = function() { + return /** @type {!proto.common.Aggregation} */ (jspb.Message.getFieldProto3(this, 4, 0)); +}; + + +/** @param {!proto.common.Aggregation} value */ +proto.api.GetDeviceMetricsRequest.prototype.setAggregation = function(value) { + jspb.Message.setField(this, 4, value); +}; + + /** * Generated by JsPbCodeGenerator. @@ -5338,20 +5368,13 @@ proto.api.GetDeviceStatsRequest.prototype.hasEnd = function() { * @extends {jspb.Message} * @constructor */ -proto.api.GetDeviceStatsResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.api.GetDeviceStatsResponse.repeatedFields_, null); +proto.api.GetDeviceMetricsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.api.GetDeviceStatsResponse, jspb.Message); +goog.inherits(proto.api.GetDeviceMetricsResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.api.GetDeviceStatsResponse.displayName = 'proto.api.GetDeviceStatsResponse'; + proto.api.GetDeviceMetricsResponse.displayName = 'proto.api.GetDeviceMetricsResponse'; } -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.api.GetDeviceStatsResponse.repeatedFields_ = [1]; - if (jspb.Message.GENERATE_TO_OBJECT) { @@ -5365,8 +5388,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.api.GetDeviceStatsResponse.prototype.toObject = function(opt_includeInstance) { - return proto.api.GetDeviceStatsResponse.toObject(opt_includeInstance, this); +proto.api.GetDeviceMetricsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetDeviceMetricsResponse.toObject(opt_includeInstance, this); }; @@ -5375,13 +5398,13 @@ proto.api.GetDeviceStatsResponse.prototype.toObject = function(opt_includeInstan * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.GetDeviceStatsResponse} msg The msg instance to transform. + * @param {!proto.api.GetDeviceMetricsResponse} msg The msg instance to transform. * @return {!Object} */ -proto.api.GetDeviceStatsResponse.toObject = function(includeInstance, msg) { +proto.api.GetDeviceMetricsResponse.toObject = function(includeInstance, msg) { var f, obj = { - resultList: jspb.Message.toObjectList(msg.getResultList(), - proto.api.DeviceStats.toObject, includeInstance) + metricsMap: (f = msg.getMetricsMap(true)) ? f.toArray() : [], + statesMap: (f = msg.getStatesMap(true)) ? f.toArray() : [] }; if (includeInstance) { @@ -5395,23 +5418,23 @@ proto.api.GetDeviceStatsResponse.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.GetDeviceStatsResponse} + * @return {!proto.api.GetDeviceMetricsResponse} */ -proto.api.GetDeviceStatsResponse.deserializeBinary = function(bytes) { +proto.api.GetDeviceMetricsResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.GetDeviceStatsResponse; - return proto.api.GetDeviceStatsResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.GetDeviceMetricsResponse; + return proto.api.GetDeviceMetricsResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.GetDeviceStatsResponse} msg The message object to deserialize into. + * @param {!proto.api.GetDeviceMetricsResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.GetDeviceStatsResponse} + * @return {!proto.api.GetDeviceMetricsResponse} */ -proto.api.GetDeviceStatsResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.api.GetDeviceMetricsResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -5419,10 +5442,16 @@ proto.api.GetDeviceStatsResponse.deserializeBinaryFromReader = function(msg, rea var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.api.DeviceStats; - reader.readMessage(value,proto.api.DeviceStats.deserializeBinaryFromReader); - msg.getResultList().push(value); - msg.setResultList(msg.getResultList()); + var value = msg.getMetricsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.common.Metric.deserializeBinaryFromReader); + }); + break; + case 2: + var value = msg.getStatesMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.api.DeviceState.deserializeBinaryFromReader); + }); break; default: reader.skipField(); @@ -5436,10 +5465,10 @@ proto.api.GetDeviceStatsResponse.deserializeBinaryFromReader = function(msg, rea /** * Class method variant: serializes the given message to binary data * (in protobuf wire format), writing to the given BinaryWriter. - * @param {!proto.api.GetDeviceStatsResponse} message + * @param {!proto.api.GetDeviceMetricsResponse} message * @param {!jspb.BinaryWriter} writer */ -proto.api.GetDeviceStatsResponse.serializeBinaryToWriter = function(message, writer) { +proto.api.GetDeviceMetricsResponse.serializeBinaryToWriter = function(message, writer) { message.serializeBinaryToWriter(writer); }; @@ -5448,7 +5477,7 @@ proto.api.GetDeviceStatsResponse.serializeBinaryToWriter = function(message, wri * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.GetDeviceStatsResponse.prototype.serializeBinary = function() { +proto.api.GetDeviceMetricsResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); this.serializeBinaryToWriter(writer); return writer.getResultBuffer(); @@ -5460,48 +5489,51 @@ proto.api.GetDeviceStatsResponse.prototype.serializeBinary = function() { * writing to the given BinaryWriter. * @param {!jspb.BinaryWriter} writer */ -proto.api.GetDeviceStatsResponse.prototype.serializeBinaryToWriter = function (writer) { +proto.api.GetDeviceMetricsResponse.prototype.serializeBinaryToWriter = function (writer) { var f = undefined; - f = this.getResultList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.api.DeviceStats.serializeBinaryToWriter - ); + f = this.getMetricsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.common.Metric.serializeBinaryToWriter); + } + f = this.getStatesMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.api.DeviceState.serializeBinaryToWriter); } }; /** * Creates a deep clone of this proto. No data is shared with the original. - * @return {!proto.api.GetDeviceStatsResponse} The clone. + * @return {!proto.api.GetDeviceMetricsResponse} The clone. */ -proto.api.GetDeviceStatsResponse.prototype.cloneMessage = function() { - return /** @type {!proto.api.GetDeviceStatsResponse} */ (jspb.Message.cloneMessage(this)); +proto.api.GetDeviceMetricsResponse.prototype.cloneMessage = function() { + return /** @type {!proto.api.GetDeviceMetricsResponse} */ (jspb.Message.cloneMessage(this)); }; /** - * repeated DeviceStats result = 1; - * If you change this array by adding, removing or replacing elements, or if you - * replace the array itself, then you must call the setter to update it. - * @return {!Array.} + * map metrics = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} */ -proto.api.GetDeviceStatsResponse.prototype.getResultList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.api.DeviceStats, 1)); +proto.api.GetDeviceMetricsResponse.prototype.getMetricsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + proto.common.Metric)); }; -/** @param {Array.} value */ -proto.api.GetDeviceStatsResponse.prototype.setResultList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -proto.api.GetDeviceStatsResponse.prototype.clearResultList = function() { - this.setResultList([]); +/** + * map states = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.api.GetDeviceMetricsResponse.prototype.getStatesMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + proto.api.DeviceState)); }; @@ -5516,12 +5548,12 @@ proto.api.GetDeviceStatsResponse.prototype.clearResultList = function() { * @extends {jspb.Message} * @constructor */ -proto.api.DeviceStats = function(opt_data) { +proto.api.DeviceState = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.api.DeviceStats, jspb.Message); +goog.inherits(proto.api.DeviceState, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.api.DeviceStats.displayName = 'proto.api.DeviceStats'; + proto.api.DeviceState.displayName = 'proto.api.DeviceState'; } @@ -5536,8 +5568,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.api.DeviceStats.prototype.toObject = function(opt_includeInstance) { - return proto.api.DeviceStats.toObject(opt_includeInstance, this); +proto.api.DeviceState.prototype.toObject = function(opt_includeInstance) { + return proto.api.DeviceState.toObject(opt_includeInstance, this); }; @@ -5546,18 +5578,13 @@ proto.api.DeviceStats.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.DeviceStats} msg The msg instance to transform. + * @param {!proto.api.DeviceState} msg The msg instance to transform. * @return {!Object} */ -proto.api.DeviceStats.toObject = function(includeInstance, msg) { +proto.api.DeviceState.toObject = function(includeInstance, msg) { var f, obj = { - time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), - rxPackets: msg.getRxPackets(), - gwRssi: msg.getGwRssi(), - gwSnr: msg.getGwSnr(), - rxPacketsPerFrequencyMap: (f = msg.getRxPacketsPerFrequencyMap(true)) ? f.toArray() : [], - rxPacketsPerDrMap: (f = msg.getRxPacketsPerDrMap(true)) ? f.toArray() : [], - errorsMap: (f = msg.getErrorsMap(true)) ? f.toArray() : [] + name: msg.getName(), + value: msg.getValue() }; if (includeInstance) { @@ -5571,63 +5598,36 @@ proto.api.DeviceStats.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.DeviceStats} + * @return {!proto.api.DeviceState} */ -proto.api.DeviceStats.deserializeBinary = function(bytes) { +proto.api.DeviceState.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.DeviceStats; - return proto.api.DeviceStats.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.DeviceState; + return proto.api.DeviceState.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.DeviceStats} msg The message object to deserialize into. + * @param {!proto.api.DeviceState} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.DeviceStats} + * @return {!proto.api.DeviceState} */ -proto.api.DeviceStats.deserializeBinaryFromReader = function(msg, reader) { +proto.api.DeviceState.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { - case 1: - var value = new google_protobuf_timestamp_pb.Timestamp; - reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); - msg.setTime(value); - break; case 2: - var value = /** @type {number} */ (reader.readUint32()); - msg.setRxPackets(value); + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); break; case 3: - var value = /** @type {number} */ (reader.readFloat()); - msg.setGwRssi(value); - break; - case 4: - var value = /** @type {number} */ (reader.readFloat()); - msg.setGwSnr(value); - break; - case 5: - var value = msg.getRxPacketsPerFrequencyMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readUint32); - }); - break; - case 6: - var value = msg.getRxPacketsPerDrMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readUint32); - }); - break; - case 7: - var value = msg.getErrorsMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readUint32); - }); + var value = /** @type {string} */ (reader.readString()); + msg.setValue(value); break; default: reader.skipField(); @@ -5641,10 +5641,10 @@ proto.api.DeviceStats.deserializeBinaryFromReader = function(msg, reader) { /** * Class method variant: serializes the given message to binary data * (in protobuf wire format), writing to the given BinaryWriter. - * @param {!proto.api.DeviceStats} message + * @param {!proto.api.DeviceState} message * @param {!jspb.BinaryWriter} writer */ -proto.api.DeviceStats.serializeBinaryToWriter = function(message, writer) { +proto.api.DeviceState.serializeBinaryToWriter = function(message, writer) { message.serializeBinaryToWriter(writer); }; @@ -5653,7 +5653,7 @@ proto.api.DeviceStats.serializeBinaryToWriter = function(message, writer) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.DeviceStats.prototype.serializeBinary = function() { +proto.api.DeviceState.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); this.serializeBinaryToWriter(writer); return writer.getResultBuffer(); @@ -5665,79 +5665,281 @@ proto.api.DeviceStats.prototype.serializeBinary = function() { * writing to the given BinaryWriter. * @param {!jspb.BinaryWriter} writer */ -proto.api.DeviceStats.prototype.serializeBinaryToWriter = function (writer) { +proto.api.DeviceState.prototype.serializeBinaryToWriter = function (writer) { var f = undefined; - f = this.getTime(); - if (f != null) { - writer.writeMessage( - 1, - f, - google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter - ); - } - f = this.getRxPackets(); - if (f !== 0) { - writer.writeUint32( + f = this.getName(); + if (f.length > 0) { + writer.writeString( 2, f ); } - f = this.getGwRssi(); - if (f !== 0.0) { - writer.writeFloat( + f = this.getValue(); + if (f.length > 0) { + writer.writeString( 3, f ); } - f = this.getGwSnr(); - if (f !== 0.0) { - writer.writeFloat( - 4, - f - ); - } - f = this.getRxPacketsPerFrequencyMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeUint32); - } - f = this.getRxPacketsPerDrMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeUint32); - } - f = this.getErrorsMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(7, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeUint32); - } }; /** * Creates a deep clone of this proto. No data is shared with the original. - * @return {!proto.api.DeviceStats} The clone. + * @return {!proto.api.DeviceState} The clone. */ -proto.api.DeviceStats.prototype.cloneMessage = function() { - return /** @type {!proto.api.DeviceStats} */ (jspb.Message.cloneMessage(this)); +proto.api.DeviceState.prototype.cloneMessage = function() { + return /** @type {!proto.api.DeviceState} */ (jspb.Message.cloneMessage(this)); }; /** - * optional google.protobuf.Timestamp time = 1; + * optional string name = 2; + * @return {string} + */ +proto.api.DeviceState.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldProto3(this, 2, "")); +}; + + +/** @param {string} value */ +proto.api.DeviceState.prototype.setName = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional string value = 3; + * @return {string} + */ +proto.api.DeviceState.prototype.getValue = function() { + return /** @type {string} */ (jspb.Message.getFieldProto3(this, 3, "")); +}; + + +/** @param {string} value */ +proto.api.DeviceState.prototype.setValue = function(value) { + jspb.Message.setField(this, 3, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.GetDeviceLinkMetricsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.GetDeviceLinkMetricsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.api.GetDeviceLinkMetricsRequest.displayName = 'proto.api.GetDeviceLinkMetricsRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetDeviceLinkMetricsRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.GetDeviceLinkMetricsRequest} msg The msg instance to transform. + * @return {!Object} + */ +proto.api.GetDeviceLinkMetricsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + devEui: msg.getDevEui(), + start: (f = msg.getStart()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), + end: (f = msg.getEnd()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), + aggregation: msg.getAggregation() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.GetDeviceLinkMetricsRequest} + */ +proto.api.GetDeviceLinkMetricsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.GetDeviceLinkMetricsRequest; + return proto.api.GetDeviceLinkMetricsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.GetDeviceLinkMetricsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.GetDeviceLinkMetricsRequest} + */ +proto.api.GetDeviceLinkMetricsRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setDevEui(value); + break; + case 2: + var value = new google_protobuf_timestamp_pb.Timestamp; + reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); + msg.setStart(value); + break; + case 3: + var value = new google_protobuf_timestamp_pb.Timestamp; + reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); + msg.setEnd(value); + break; + case 4: + var value = /** @type {!proto.common.Aggregation} */ (reader.readEnum()); + msg.setAggregation(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Class method variant: serializes the given message to binary data + * (in protobuf wire format), writing to the given BinaryWriter. + * @param {!proto.api.GetDeviceLinkMetricsRequest} message + * @param {!jspb.BinaryWriter} writer + */ +proto.api.GetDeviceLinkMetricsRequest.serializeBinaryToWriter = function(message, writer) { + message.serializeBinaryToWriter(writer); +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + this.serializeBinaryToWriter(writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the message to binary data (in protobuf wire format), + * writing to the given BinaryWriter. + * @param {!jspb.BinaryWriter} writer + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.serializeBinaryToWriter = function (writer) { + var f = undefined; + f = this.getDevEui(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = this.getStart(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter + ); + } + f = this.getEnd(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter + ); + } + f = this.getAggregation(); + if (f !== 0.0) { + writer.writeEnum( + 4, + f + ); + } +}; + + +/** + * Creates a deep clone of this proto. No data is shared with the original. + * @return {!proto.api.GetDeviceLinkMetricsRequest} The clone. + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.cloneMessage = function() { + return /** @type {!proto.api.GetDeviceLinkMetricsRequest} */ (jspb.Message.cloneMessage(this)); +}; + + +/** + * optional string dev_eui = 1; + * @return {string} + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.getDevEui = function() { + return /** @type {string} */ (jspb.Message.getFieldProto3(this, 1, "")); +}; + + +/** @param {string} value */ +proto.api.GetDeviceLinkMetricsRequest.prototype.setDevEui = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional google.protobuf.Timestamp start = 2; * @return {proto.google.protobuf.Timestamp} */ -proto.api.DeviceStats.prototype.getTime = function() { +proto.api.GetDeviceLinkMetricsRequest.prototype.getStart = function() { return /** @type{proto.google.protobuf.Timestamp} */ ( - jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 1)); + jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2)); }; /** @param {proto.google.protobuf.Timestamp|undefined} value */ -proto.api.DeviceStats.prototype.setTime = function(value) { - jspb.Message.setWrapperField(this, 1, value); +proto.api.GetDeviceLinkMetricsRequest.prototype.setStart = function(value) { + jspb.Message.setWrapperField(this, 2, value); }; -proto.api.DeviceStats.prototype.clearTime = function() { - this.setTime(undefined); +proto.api.GetDeviceLinkMetricsRequest.prototype.clearStart = function() { + this.setStart(undefined); }; @@ -5745,92 +5947,449 @@ proto.api.DeviceStats.prototype.clearTime = function() { * Returns whether this field is set. * @return{!boolean} */ -proto.api.DeviceStats.prototype.hasTime = function() { +proto.api.GetDeviceLinkMetricsRequest.prototype.hasStart = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional google.protobuf.Timestamp end = 3; + * @return {proto.google.protobuf.Timestamp} + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.getEnd = function() { + return /** @type{proto.google.protobuf.Timestamp} */ ( + jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3)); +}; + + +/** @param {proto.google.protobuf.Timestamp|undefined} value */ +proto.api.GetDeviceLinkMetricsRequest.prototype.setEnd = function(value) { + jspb.Message.setWrapperField(this, 3, value); +}; + + +proto.api.GetDeviceLinkMetricsRequest.prototype.clearEnd = function() { + this.setEnd(undefined); +}; + + +/** + * Returns whether this field is set. + * @return{!boolean} + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.hasEnd = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional common.Aggregation aggregation = 4; + * @return {!proto.common.Aggregation} + */ +proto.api.GetDeviceLinkMetricsRequest.prototype.getAggregation = function() { + return /** @type {!proto.common.Aggregation} */ (jspb.Message.getFieldProto3(this, 4, 0)); +}; + + +/** @param {!proto.common.Aggregation} value */ +proto.api.GetDeviceLinkMetricsRequest.prototype.setAggregation = function(value) { + jspb.Message.setField(this, 4, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.GetDeviceLinkMetricsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.GetDeviceLinkMetricsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.api.GetDeviceLinkMetricsResponse.displayName = 'proto.api.GetDeviceLinkMetricsResponse'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetDeviceLinkMetricsResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.GetDeviceLinkMetricsResponse} msg The msg instance to transform. + * @return {!Object} + */ +proto.api.GetDeviceLinkMetricsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + rxPackets: (f = msg.getRxPackets()) && common_common_pb.Metric.toObject(includeInstance, f), + gwRssi: (f = msg.getGwRssi()) && common_common_pb.Metric.toObject(includeInstance, f), + gwSnr: (f = msg.getGwSnr()) && common_common_pb.Metric.toObject(includeInstance, f), + rxPacketsPerFreq: (f = msg.getRxPacketsPerFreq()) && common_common_pb.Metric.toObject(includeInstance, f), + rxPacketsPerDr: (f = msg.getRxPacketsPerDr()) && common_common_pb.Metric.toObject(includeInstance, f), + errors: (f = msg.getErrors()) && common_common_pb.Metric.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.GetDeviceLinkMetricsResponse} + */ +proto.api.GetDeviceLinkMetricsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.GetDeviceLinkMetricsResponse; + return proto.api.GetDeviceLinkMetricsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.GetDeviceLinkMetricsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.GetDeviceLinkMetricsResponse} + */ +proto.api.GetDeviceLinkMetricsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setRxPackets(value); + break; + case 2: + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setGwRssi(value); + break; + case 3: + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setGwSnr(value); + break; + case 4: + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setRxPacketsPerFreq(value); + break; + case 5: + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setRxPacketsPerDr(value); + break; + case 6: + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setErrors(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Class method variant: serializes the given message to binary data + * (in protobuf wire format), writing to the given BinaryWriter. + * @param {!proto.api.GetDeviceLinkMetricsResponse} message + * @param {!jspb.BinaryWriter} writer + */ +proto.api.GetDeviceLinkMetricsResponse.serializeBinaryToWriter = function(message, writer) { + message.serializeBinaryToWriter(writer); +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + this.serializeBinaryToWriter(writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the message to binary data (in protobuf wire format), + * writing to the given BinaryWriter. + * @param {!jspb.BinaryWriter} writer + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.serializeBinaryToWriter = function (writer) { + var f = undefined; + f = this.getRxPackets(); + if (f != null) { + writer.writeMessage( + 1, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); + } + f = this.getGwRssi(); + if (f != null) { + writer.writeMessage( + 2, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); + } + f = this.getGwSnr(); + if (f != null) { + writer.writeMessage( + 3, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); + } + f = this.getRxPacketsPerFreq(); + if (f != null) { + writer.writeMessage( + 4, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); + } + f = this.getRxPacketsPerDr(); + if (f != null) { + writer.writeMessage( + 5, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); + } + f = this.getErrors(); + if (f != null) { + writer.writeMessage( + 6, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); + } +}; + + +/** + * Creates a deep clone of this proto. No data is shared with the original. + * @return {!proto.api.GetDeviceLinkMetricsResponse} The clone. + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.cloneMessage = function() { + return /** @type {!proto.api.GetDeviceLinkMetricsResponse} */ (jspb.Message.cloneMessage(this)); +}; + + +/** + * optional common.Metric rx_packets = 1; + * @return {proto.common.Metric} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.getRxPackets = function() { + return /** @type{proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 1)); +}; + + +/** @param {proto.common.Metric|undefined} value */ +proto.api.GetDeviceLinkMetricsResponse.prototype.setRxPackets = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.api.GetDeviceLinkMetricsResponse.prototype.clearRxPackets = function() { + this.setRxPackets(undefined); +}; + + +/** + * Returns whether this field is set. + * @return{!boolean} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.hasRxPackets = function() { return jspb.Message.getField(this, 1) != null; }; /** - * optional uint32 rx_packets = 2; - * @return {number} + * optional common.Metric gw_rssi = 2; + * @return {proto.common.Metric} */ -proto.api.DeviceStats.prototype.getRxPackets = function() { - return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0)); +proto.api.GetDeviceLinkMetricsResponse.prototype.getGwRssi = function() { + return /** @type{proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 2)); }; -/** @param {number} value */ -proto.api.DeviceStats.prototype.setRxPackets = function(value) { - jspb.Message.setField(this, 2, value); +/** @param {proto.common.Metric|undefined} value */ +proto.api.GetDeviceLinkMetricsResponse.prototype.setGwRssi = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +proto.api.GetDeviceLinkMetricsResponse.prototype.clearGwRssi = function() { + this.setGwRssi(undefined); }; /** - * optional float gw_rssi = 3; - * @return {number} + * Returns whether this field is set. + * @return{!boolean} */ -proto.api.DeviceStats.prototype.getGwRssi = function() { - return /** @type {number} */ (jspb.Message.getFieldProto3(this, 3, 0)); -}; - - -/** @param {number} value */ -proto.api.DeviceStats.prototype.setGwRssi = function(value) { - jspb.Message.setField(this, 3, value); +proto.api.GetDeviceLinkMetricsResponse.prototype.hasGwRssi = function() { + return jspb.Message.getField(this, 2) != null; }; /** - * optional float gw_snr = 4; - * @return {number} + * optional common.Metric gw_snr = 3; + * @return {proto.common.Metric} */ -proto.api.DeviceStats.prototype.getGwSnr = function() { - return /** @type {number} */ (jspb.Message.getFieldProto3(this, 4, 0)); +proto.api.GetDeviceLinkMetricsResponse.prototype.getGwSnr = function() { + return /** @type{proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 3)); }; -/** @param {number} value */ -proto.api.DeviceStats.prototype.setGwSnr = function(value) { - jspb.Message.setField(this, 4, value); +/** @param {proto.common.Metric|undefined} value */ +proto.api.GetDeviceLinkMetricsResponse.prototype.setGwSnr = function(value) { + jspb.Message.setWrapperField(this, 3, value); +}; + + +proto.api.GetDeviceLinkMetricsResponse.prototype.clearGwSnr = function() { + this.setGwSnr(undefined); }; /** - * map rx_packets_per_frequency = 5; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} + * Returns whether this field is set. + * @return{!boolean} */ -proto.api.DeviceStats.prototype.getRxPacketsPerFrequencyMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 5, opt_noLazyCreate, - null)); +proto.api.GetDeviceLinkMetricsResponse.prototype.hasGwSnr = function() { + return jspb.Message.getField(this, 3) != null; }; /** - * map rx_packets_per_dr = 6; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} + * optional common.Metric rx_packets_per_freq = 4; + * @return {proto.common.Metric} */ -proto.api.DeviceStats.prototype.getRxPacketsPerDrMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 6, opt_noLazyCreate, - null)); +proto.api.GetDeviceLinkMetricsResponse.prototype.getRxPacketsPerFreq = function() { + return /** @type{proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 4)); +}; + + +/** @param {proto.common.Metric|undefined} value */ +proto.api.GetDeviceLinkMetricsResponse.prototype.setRxPacketsPerFreq = function(value) { + jspb.Message.setWrapperField(this, 4, value); +}; + + +proto.api.GetDeviceLinkMetricsResponse.prototype.clearRxPacketsPerFreq = function() { + this.setRxPacketsPerFreq(undefined); }; /** - * map errors = 7; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} + * Returns whether this field is set. + * @return{!boolean} */ -proto.api.DeviceStats.prototype.getErrorsMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 7, opt_noLazyCreate, - null)); +proto.api.GetDeviceLinkMetricsResponse.prototype.hasRxPacketsPerFreq = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional common.Metric rx_packets_per_dr = 5; + * @return {proto.common.Metric} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.getRxPacketsPerDr = function() { + return /** @type{proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 5)); +}; + + +/** @param {proto.common.Metric|undefined} value */ +proto.api.GetDeviceLinkMetricsResponse.prototype.setRxPacketsPerDr = function(value) { + jspb.Message.setWrapperField(this, 5, value); +}; + + +proto.api.GetDeviceLinkMetricsResponse.prototype.clearRxPacketsPerDr = function() { + this.setRxPacketsPerDr(undefined); +}; + + +/** + * Returns whether this field is set. + * @return{!boolean} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.hasRxPacketsPerDr = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional common.Metric errors = 6; + * @return {proto.common.Metric} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.getErrors = function() { + return /** @type{proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 6)); +}; + + +/** @param {proto.common.Metric|undefined} value */ +proto.api.GetDeviceLinkMetricsResponse.prototype.setErrors = function(value) { + jspb.Message.setWrapperField(this, 6, value); +}; + + +proto.api.GetDeviceLinkMetricsResponse.prototype.clearErrors = function() { + this.setErrors(undefined); +}; + + +/** + * Returns whether this field is set. + * @return{!boolean} + */ +proto.api.GetDeviceLinkMetricsResponse.prototype.hasErrors = function() { + return jspb.Message.getField(this, 6) != null; }; diff --git a/api/js/api/device_profile_pb.d.ts b/api/js/api/device_profile_pb.d.ts index 247d5ca5..f0fea3f7 100644 --- a/api/js/api/device_profile_pb.d.ts +++ b/api/js/api/device_profile_pb.d.ts @@ -84,6 +84,8 @@ export class DeviceProfile extends jspb.Message { getTagsMap(): jspb.Map; clearTagsMap(): void; + getMeasurementsMap(): jspb.Map; + clearMeasurementsMap(): void; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): DeviceProfile.AsObject; static toObject(includeInstance: boolean, msg: DeviceProfile): DeviceProfile.AsObject; @@ -122,6 +124,31 @@ export namespace DeviceProfile { abpRx2Dr: number, abpRx2Freq: number, tagsMap: Array<[string, string]>, + measurementsMap: Array<[string, Measurement.AsObject]>, + } +} + +export class Measurement extends jspb.Message { + getName(): string; + setName(value: string): void; + + getKind(): MeasurementKindMap[keyof MeasurementKindMap]; + setKind(value: MeasurementKindMap[keyof MeasurementKindMap]): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Measurement.AsObject; + static toObject(includeInstance: boolean, msg: Measurement): Measurement.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Measurement, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Measurement; + static deserializeBinaryFromReader(message: Measurement, reader: jspb.BinaryReader): Measurement; +} + +export namespace Measurement { + export type AsObject = { + name: string, + kind: MeasurementKindMap[keyof MeasurementKindMap], } } @@ -439,3 +466,13 @@ export interface CodecRuntimeMap { export const CodecRuntime: CodecRuntimeMap; +export interface MeasurementKindMap { + UNKNOWN: 0; + COUNTER: 1; + ABSOLUTE: 2; + GAUGE: 3; + STRING: 4; +} + +export const MeasurementKind: MeasurementKindMap; + diff --git a/api/js/api/device_profile_pb.js b/api/js/api/device_profile_pb.js index a3adb2a4..16f703a4 100644 --- a/api/js/api/device_profile_pb.js +++ b/api/js/api/device_profile_pb.js @@ -24,6 +24,8 @@ goog.exportSymbol('proto.api.GetDeviceProfileResponse', null, global); goog.exportSymbol('proto.api.ListDeviceProfileAdrAlgorithmsResponse', null, global); goog.exportSymbol('proto.api.ListDeviceProfilesRequest', null, global); goog.exportSymbol('proto.api.ListDeviceProfilesResponse', null, global); +goog.exportSymbol('proto.api.Measurement', null, global); +goog.exportSymbol('proto.api.MeasurementKind', null, global); goog.exportSymbol('proto.api.UpdateDeviceProfileRequest', null, global); /** @@ -96,7 +98,8 @@ proto.api.DeviceProfile.toObject = function(includeInstance, msg) { abpRx1DrOffset: msg.getAbpRx1DrOffset(), abpRx2Dr: msg.getAbpRx2Dr(), abpRx2Freq: msg.getAbpRx2Freq(), - tagsMap: (f = msg.getTagsMap(true)) ? f.toArray() : [] + tagsMap: (f = msg.getTagsMap(true)) ? f.toArray() : [], + measurementsMap: (f = msg.getMeasurementsMap(true)) ? f.toArray() : [] }; if (includeInstance) { @@ -239,6 +242,12 @@ proto.api.DeviceProfile.deserializeBinaryFromReader = function(msg, reader) { jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString); }); break; + case 27: + var value = msg.getMeasurementsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.api.Measurement.deserializeBinaryFromReader); + }); + break; default: reader.skipField(); break; @@ -456,6 +465,10 @@ proto.api.DeviceProfile.prototype.serializeBinaryToWriter = function (writer) { if (f && f.getLength() > 0) { f.serializeBinary(25, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); } + f = this.getMeasurementsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(27, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.api.Measurement.serializeBinaryToWriter); + } }; @@ -864,6 +877,205 @@ proto.api.DeviceProfile.prototype.getTagsMap = function(opt_noLazyCreate) { }; +/** + * map measurements = 27; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.api.DeviceProfile.prototype.getMeasurementsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 27, opt_noLazyCreate, + proto.api.Measurement)); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.api.Measurement = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.api.Measurement, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.api.Measurement.displayName = 'proto.api.Measurement'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.api.Measurement.prototype.toObject = function(opt_includeInstance) { + return proto.api.Measurement.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Measurement} msg The msg instance to transform. + * @return {!Object} + */ +proto.api.Measurement.toObject = function(includeInstance, msg) { + var f, obj = { + name: msg.getName(), + kind: msg.getKind() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.api.Measurement} + */ +proto.api.Measurement.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.api.Measurement; + return proto.api.Measurement.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.api.Measurement} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.api.Measurement} + */ +proto.api.Measurement.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = /** @type {!proto.api.MeasurementKind} */ (reader.readEnum()); + msg.setKind(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Class method variant: serializes the given message to binary data + * (in protobuf wire format), writing to the given BinaryWriter. + * @param {!proto.api.Measurement} message + * @param {!jspb.BinaryWriter} writer + */ +proto.api.Measurement.serializeBinaryToWriter = function(message, writer) { + message.serializeBinaryToWriter(writer); +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.api.Measurement.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + this.serializeBinaryToWriter(writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the message to binary data (in protobuf wire format), + * writing to the given BinaryWriter. + * @param {!jspb.BinaryWriter} writer + */ +proto.api.Measurement.prototype.serializeBinaryToWriter = function (writer) { + var f = undefined; + f = this.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = this.getKind(); + if (f !== 0.0) { + writer.writeEnum( + 3, + f + ); + } +}; + + +/** + * Creates a deep clone of this proto. No data is shared with the original. + * @return {!proto.api.Measurement} The clone. + */ +proto.api.Measurement.prototype.cloneMessage = function() { + return /** @type {!proto.api.Measurement} */ (jspb.Message.cloneMessage(this)); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.api.Measurement.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldProto3(this, 2, "")); +}; + + +/** @param {string} value */ +proto.api.Measurement.prototype.setName = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional MeasurementKind kind = 3; + * @return {!proto.api.MeasurementKind} + */ +proto.api.Measurement.prototype.getKind = function() { + return /** @type {!proto.api.MeasurementKind} */ (jspb.Message.getFieldProto3(this, 3, 0)); +}; + + +/** @param {!proto.api.MeasurementKind} value */ +proto.api.Measurement.prototype.setKind = function(value) { + jspb.Message.setField(this, 3, value); +}; + + /** * Generated by JsPbCodeGenerator. @@ -3244,4 +3456,15 @@ proto.api.CodecRuntime = { JS: 2 }; +/** + * @enum {number} + */ +proto.api.MeasurementKind = { + UNKNOWN: 0, + COUNTER: 1, + ABSOLUTE: 2, + GAUGE: 3, + STRING: 4 +}; + goog.object.extend(exports, proto.api); diff --git a/api/js/api/device_profile_template_pb.d.ts b/api/js/api/device_profile_template_pb.d.ts index 7fe4a9db..663e53be 100644 --- a/api/js/api/device_profile_template_pb.d.ts +++ b/api/js/api/device_profile_template_pb.d.ts @@ -88,6 +88,8 @@ export class DeviceProfileTemplate extends jspb.Message { getTagsMap(): jspb.Map; clearTagsMap(): void; + getMeasurementsMap(): jspb.Map; + clearMeasurementsMap(): void; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): DeviceProfileTemplate.AsObject; static toObject(includeInstance: boolean, msg: DeviceProfileTemplate): DeviceProfileTemplate.AsObject; @@ -127,6 +129,7 @@ export namespace DeviceProfileTemplate { abpRx2Dr: number, abpRx2Freq: number, tagsMap: Array<[string, string]>, + measurementsMap: Array<[string, api_device_profile_pb.Measurement.AsObject]>, } } diff --git a/api/js/api/device_profile_template_pb.js b/api/js/api/device_profile_template_pb.js index aba1f1d8..d4b11cbc 100644 --- a/api/js/api/device_profile_template_pb.js +++ b/api/js/api/device_profile_template_pb.js @@ -94,7 +94,8 @@ proto.api.DeviceProfileTemplate.toObject = function(includeInstance, msg) { abpRx1DrOffset: msg.getAbpRx1DrOffset(), abpRx2Dr: msg.getAbpRx2Dr(), abpRx2Freq: msg.getAbpRx2Freq(), - tagsMap: (f = msg.getTagsMap(true)) ? f.toArray() : [] + tagsMap: (f = msg.getTagsMap(true)) ? f.toArray() : [], + measurementsMap: (f = msg.getMeasurementsMap(true)) ? f.toArray() : [] }; if (includeInstance) { @@ -241,6 +242,12 @@ proto.api.DeviceProfileTemplate.deserializeBinaryFromReader = function(msg, read jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString); }); break; + case 28: + var value = msg.getMeasurementsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.api.Measurement.deserializeBinaryFromReader); + }); + break; default: reader.skipField(); break; @@ -465,6 +472,10 @@ proto.api.DeviceProfileTemplate.prototype.serializeBinaryToWriter = function (wr if (f && f.getLength() > 0) { f.serializeBinary(27, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); } + f = this.getMeasurementsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(28, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.api.Measurement.serializeBinaryToWriter); + } }; @@ -888,6 +899,19 @@ proto.api.DeviceProfileTemplate.prototype.getTagsMap = function(opt_noLazyCreate }; +/** + * map measurements = 28; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.api.DeviceProfileTemplate.prototype.getMeasurementsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 28, opt_noLazyCreate, + proto.api.Measurement)); +}; + + /** * Generated by JsPbCodeGenerator. diff --git a/api/js/api/gateway_grpc_pb.d.ts b/api/js/api/gateway_grpc_pb.d.ts index d03c248e..86663ed3 100644 --- a/api/js/api/gateway_grpc_pb.d.ts +++ b/api/js/api/gateway_grpc_pb.d.ts @@ -14,7 +14,7 @@ interface IGatewayServiceService extends grpc.ServiceDefinition; list: grpc.MethodDefinition; generateClientCertificate: grpc.MethodDefinition; - getStats: grpc.MethodDefinition; + getMetrics: grpc.MethodDefinition; } export const GatewayServiceService: IGatewayServiceService; @@ -26,7 +26,7 @@ export interface IGatewayServiceServer extends grpc.UntypedServiceImplementation delete: grpc.handleUnaryCall; list: grpc.handleUnaryCall; generateClientCertificate: grpc.handleUnaryCall; - getStats: grpc.handleUnaryCall; + getMetrics: grpc.handleUnaryCall; } export class GatewayServiceClient extends grpc.Client { @@ -49,7 +49,7 @@ export class GatewayServiceClient extends grpc.Client { generateClientCertificate(argument: api_gateway_pb.GenerateGatewayClientCertificateRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; generateClientCertificate(argument: api_gateway_pb.GenerateGatewayClientCertificateRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; generateClientCertificate(argument: api_gateway_pb.GenerateGatewayClientCertificateRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - getStats(argument: api_gateway_pb.GetGatewayStatsRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - getStats(argument: api_gateway_pb.GetGatewayStatsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - getStats(argument: api_gateway_pb.GetGatewayStatsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + getMetrics(argument: api_gateway_pb.GetGatewayMetricsRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + getMetrics(argument: api_gateway_pb.GetGatewayMetricsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + getMetrics(argument: api_gateway_pb.GetGatewayMetricsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; } diff --git a/api/js/api/gateway_grpc_pb.js b/api/js/api/gateway_grpc_pb.js index 4d9063aa..bd120579 100644 --- a/api/js/api/gateway_grpc_pb.js +++ b/api/js/api/gateway_grpc_pb.js @@ -51,6 +51,28 @@ function deserialize_api_GenerateGatewayClientCertificateResponse(buffer_arg) { return api_gateway_pb.GenerateGatewayClientCertificateResponse.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_api_GetGatewayMetricsRequest(arg) { + if (!(arg instanceof api_gateway_pb.GetGatewayMetricsRequest)) { + throw new Error('Expected argument of type api.GetGatewayMetricsRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_api_GetGatewayMetricsRequest(buffer_arg) { + return api_gateway_pb.GetGatewayMetricsRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_api_GetGatewayMetricsResponse(arg) { + if (!(arg instanceof api_gateway_pb.GetGatewayMetricsResponse)) { + throw new Error('Expected argument of type api.GetGatewayMetricsResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_api_GetGatewayMetricsResponse(buffer_arg) { + return api_gateway_pb.GetGatewayMetricsResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + function serialize_api_GetGatewayRequest(arg) { if (!(arg instanceof api_gateway_pb.GetGatewayRequest)) { throw new Error('Expected argument of type api.GetGatewayRequest'); @@ -73,28 +95,6 @@ function deserialize_api_GetGatewayResponse(buffer_arg) { return api_gateway_pb.GetGatewayResponse.deserializeBinary(new Uint8Array(buffer_arg)); } -function serialize_api_GetGatewayStatsRequest(arg) { - if (!(arg instanceof api_gateway_pb.GetGatewayStatsRequest)) { - throw new Error('Expected argument of type api.GetGatewayStatsRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_api_GetGatewayStatsRequest(buffer_arg) { - return api_gateway_pb.GetGatewayStatsRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_api_GetGatewayStatsResponse(arg) { - if (!(arg instanceof api_gateway_pb.GetGatewayStatsResponse)) { - throw new Error('Expected argument of type api.GetGatewayStatsResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_api_GetGatewayStatsResponse(buffer_arg) { - return api_gateway_pb.GetGatewayStatsResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - function serialize_api_ListGatewaysRequest(arg) { if (!(arg instanceof api_gateway_pb.ListGatewaysRequest)) { throw new Error('Expected argument of type api.ListGatewaysRequest'); @@ -214,17 +214,17 @@ generateClientCertificate: { responseSerialize: serialize_api_GenerateGatewayClientCertificateResponse, responseDeserialize: deserialize_api_GenerateGatewayClientCertificateResponse, }, - // GetStats returns the gateway stats. -getStats: { - path: '/api.GatewayService/GetStats', + // GetMetrics returns the gateway metrics. +getMetrics: { + path: '/api.GatewayService/GetMetrics', requestStream: false, responseStream: false, - requestType: api_gateway_pb.GetGatewayStatsRequest, - responseType: api_gateway_pb.GetGatewayStatsResponse, - requestSerialize: serialize_api_GetGatewayStatsRequest, - requestDeserialize: deserialize_api_GetGatewayStatsRequest, - responseSerialize: serialize_api_GetGatewayStatsResponse, - responseDeserialize: deserialize_api_GetGatewayStatsResponse, + requestType: api_gateway_pb.GetGatewayMetricsRequest, + responseType: api_gateway_pb.GetGatewayMetricsResponse, + requestSerialize: serialize_api_GetGatewayMetricsRequest, + requestDeserialize: deserialize_api_GetGatewayMetricsRequest, + responseSerialize: serialize_api_GetGatewayMetricsResponse, + responseDeserialize: deserialize_api_GetGatewayMetricsResponse, }, }; diff --git a/api/js/api/gateway_pb.d.ts b/api/js/api/gateway_pb.d.ts index 2a5c574d..973c56dc 100644 --- a/api/js/api/gateway_pb.d.ts +++ b/api/js/api/gateway_pb.d.ts @@ -345,7 +345,7 @@ export namespace GenerateGatewayClientCertificateResponse { } } -export class GetGatewayStatsRequest extends jspb.Message { +export class GetGatewayMetricsRequest extends jspb.Message { getGatewayId(): string; setGatewayId(value: string): void; @@ -359,88 +359,83 @@ export class GetGatewayStatsRequest extends jspb.Message { getEnd(): google_protobuf_timestamp_pb.Timestamp | undefined; setEnd(value?: google_protobuf_timestamp_pb.Timestamp): void; + getAggregation(): common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap]; + setAggregation(value: common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap]): void; + serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetGatewayStatsRequest.AsObject; - static toObject(includeInstance: boolean, msg: GetGatewayStatsRequest): GetGatewayStatsRequest.AsObject; + toObject(includeInstance?: boolean): GetGatewayMetricsRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetGatewayMetricsRequest): GetGatewayMetricsRequest.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetGatewayStatsRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetGatewayStatsRequest; - static deserializeBinaryFromReader(message: GetGatewayStatsRequest, reader: jspb.BinaryReader): GetGatewayStatsRequest; + static serializeBinaryToWriter(message: GetGatewayMetricsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetGatewayMetricsRequest; + static deserializeBinaryFromReader(message: GetGatewayMetricsRequest, reader: jspb.BinaryReader): GetGatewayMetricsRequest; } -export namespace GetGatewayStatsRequest { +export namespace GetGatewayMetricsRequest { export type AsObject = { gatewayId: string, start?: google_protobuf_timestamp_pb.Timestamp.AsObject, end?: google_protobuf_timestamp_pb.Timestamp.AsObject, + aggregation: common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap], } } -export class GetGatewayStatsResponse extends jspb.Message { - clearResultList(): void; - getResultList(): Array; - setResultList(value: Array): void; - addResult(value?: GatewayStats, index?: number): GatewayStats; +export class GetGatewayMetricsResponse extends jspb.Message { + hasRxPackets(): boolean; + clearRxPackets(): void; + getRxPackets(): common_common_pb.Metric | undefined; + setRxPackets(value?: common_common_pb.Metric): void; + + hasTxPackets(): boolean; + clearTxPackets(): void; + getTxPackets(): common_common_pb.Metric | undefined; + setTxPackets(value?: common_common_pb.Metric): void; + + hasTxPacketsPerFreq(): boolean; + clearTxPacketsPerFreq(): void; + getTxPacketsPerFreq(): common_common_pb.Metric | undefined; + setTxPacketsPerFreq(value?: common_common_pb.Metric): void; + + hasRxPacketsPerFreq(): boolean; + clearRxPacketsPerFreq(): void; + getRxPacketsPerFreq(): common_common_pb.Metric | undefined; + setRxPacketsPerFreq(value?: common_common_pb.Metric): void; + + hasTxPacketsPerDr(): boolean; + clearTxPacketsPerDr(): void; + getTxPacketsPerDr(): common_common_pb.Metric | undefined; + setTxPacketsPerDr(value?: common_common_pb.Metric): void; + + hasRxPacketsPerDr(): boolean; + clearRxPacketsPerDr(): void; + getRxPacketsPerDr(): common_common_pb.Metric | undefined; + setRxPacketsPerDr(value?: common_common_pb.Metric): void; + + hasTxPacketsPerStatus(): boolean; + clearTxPacketsPerStatus(): void; + getTxPacketsPerStatus(): common_common_pb.Metric | undefined; + setTxPacketsPerStatus(value?: common_common_pb.Metric): void; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetGatewayStatsResponse.AsObject; - static toObject(includeInstance: boolean, msg: GetGatewayStatsResponse): GetGatewayStatsResponse.AsObject; + toObject(includeInstance?: boolean): GetGatewayMetricsResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetGatewayMetricsResponse): GetGatewayMetricsResponse.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetGatewayStatsResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetGatewayStatsResponse; - static deserializeBinaryFromReader(message: GetGatewayStatsResponse, reader: jspb.BinaryReader): GetGatewayStatsResponse; + static serializeBinaryToWriter(message: GetGatewayMetricsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetGatewayMetricsResponse; + static deserializeBinaryFromReader(message: GetGatewayMetricsResponse, reader: jspb.BinaryReader): GetGatewayMetricsResponse; } -export namespace GetGatewayStatsResponse { +export namespace GetGatewayMetricsResponse { export type AsObject = { - resultList: Array, - } -} - -export class GatewayStats extends jspb.Message { - hasTime(): boolean; - clearTime(): void; - getTime(): google_protobuf_timestamp_pb.Timestamp | undefined; - setTime(value?: google_protobuf_timestamp_pb.Timestamp): void; - - getRxPackets(): number; - setRxPackets(value: number): void; - - getTxPackets(): number; - setTxPackets(value: number): void; - - getTxPacketsPerFrequencyMap(): jspb.Map; - clearTxPacketsPerFrequencyMap(): void; - getRxPacketsPerFrequencyMap(): jspb.Map; - clearRxPacketsPerFrequencyMap(): void; - getTxPacketsPerDrMap(): jspb.Map; - clearTxPacketsPerDrMap(): void; - getRxPacketsPerDrMap(): jspb.Map; - clearRxPacketsPerDrMap(): void; - getTxPacketsPerStatusMap(): jspb.Map; - clearTxPacketsPerStatusMap(): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GatewayStats.AsObject; - static toObject(includeInstance: boolean, msg: GatewayStats): GatewayStats.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GatewayStats, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GatewayStats; - static deserializeBinaryFromReader(message: GatewayStats, reader: jspb.BinaryReader): GatewayStats; -} - -export namespace GatewayStats { - export type AsObject = { - time?: google_protobuf_timestamp_pb.Timestamp.AsObject, - rxPackets: number, - txPackets: number, - txPacketsPerFrequencyMap: Array<[number, number]>, - rxPacketsPerFrequencyMap: Array<[number, number]>, - txPacketsPerDrMap: Array<[number, number]>, - rxPacketsPerDrMap: Array<[number, number]>, - txPacketsPerStatusMap: Array<[string, number]>, + rxPackets?: common_common_pb.Metric.AsObject, + txPackets?: common_common_pb.Metric.AsObject, + txPacketsPerFreq?: common_common_pb.Metric.AsObject, + rxPacketsPerFreq?: common_common_pb.Metric.AsObject, + txPacketsPerDr?: common_common_pb.Metric.AsObject, + rxPacketsPerDr?: common_common_pb.Metric.AsObject, + txPacketsPerStatus?: common_common_pb.Metric.AsObject, } } diff --git a/api/js/api/gateway_pb.js b/api/js/api/gateway_pb.js index 7ac5d20a..74bcd205 100644 --- a/api/js/api/gateway_pb.js +++ b/api/js/api/gateway_pb.js @@ -16,13 +16,12 @@ goog.exportSymbol('proto.api.CreateGatewayRequest', null, global); goog.exportSymbol('proto.api.DeleteGatewayRequest', null, global); goog.exportSymbol('proto.api.Gateway', null, global); goog.exportSymbol('proto.api.GatewayListItem', null, global); -goog.exportSymbol('proto.api.GatewayStats', null, global); goog.exportSymbol('proto.api.GenerateGatewayClientCertificateRequest', null, global); goog.exportSymbol('proto.api.GenerateGatewayClientCertificateResponse', null, global); +goog.exportSymbol('proto.api.GetGatewayMetricsRequest', null, global); +goog.exportSymbol('proto.api.GetGatewayMetricsResponse', null, global); goog.exportSymbol('proto.api.GetGatewayRequest', null, global); goog.exportSymbol('proto.api.GetGatewayResponse', null, global); -goog.exportSymbol('proto.api.GetGatewayStatsRequest', null, global); -goog.exportSymbol('proto.api.GetGatewayStatsResponse', null, global); goog.exportSymbol('proto.api.ListGatewaysRequest', null, global); goog.exportSymbol('proto.api.ListGatewaysResponse', null, global); goog.exportSymbol('proto.api.UpdateGatewayRequest', null, global); @@ -2648,12 +2647,12 @@ proto.api.GenerateGatewayClientCertificateResponse.prototype.hasExpiresAt = func * @extends {jspb.Message} * @constructor */ -proto.api.GetGatewayStatsRequest = function(opt_data) { +proto.api.GetGatewayMetricsRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.api.GetGatewayStatsRequest, jspb.Message); +goog.inherits(proto.api.GetGatewayMetricsRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.api.GetGatewayStatsRequest.displayName = 'proto.api.GetGatewayStatsRequest'; + proto.api.GetGatewayMetricsRequest.displayName = 'proto.api.GetGatewayMetricsRequest'; } @@ -2668,8 +2667,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.api.GetGatewayStatsRequest.prototype.toObject = function(opt_includeInstance) { - return proto.api.GetGatewayStatsRequest.toObject(opt_includeInstance, this); +proto.api.GetGatewayMetricsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetGatewayMetricsRequest.toObject(opt_includeInstance, this); }; @@ -2678,14 +2677,15 @@ proto.api.GetGatewayStatsRequest.prototype.toObject = function(opt_includeInstan * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.GetGatewayStatsRequest} msg The msg instance to transform. + * @param {!proto.api.GetGatewayMetricsRequest} msg The msg instance to transform. * @return {!Object} */ -proto.api.GetGatewayStatsRequest.toObject = function(includeInstance, msg) { +proto.api.GetGatewayMetricsRequest.toObject = function(includeInstance, msg) { var f, obj = { gatewayId: msg.getGatewayId(), start: (f = msg.getStart()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), - end: (f = msg.getEnd()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f) + end: (f = msg.getEnd()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), + aggregation: msg.getAggregation() }; if (includeInstance) { @@ -2699,23 +2699,23 @@ proto.api.GetGatewayStatsRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.GetGatewayStatsRequest} + * @return {!proto.api.GetGatewayMetricsRequest} */ -proto.api.GetGatewayStatsRequest.deserializeBinary = function(bytes) { +proto.api.GetGatewayMetricsRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.GetGatewayStatsRequest; - return proto.api.GetGatewayStatsRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.GetGatewayMetricsRequest; + return proto.api.GetGatewayMetricsRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.GetGatewayStatsRequest} msg The message object to deserialize into. + * @param {!proto.api.GetGatewayMetricsRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.GetGatewayStatsRequest} + * @return {!proto.api.GetGatewayMetricsRequest} */ -proto.api.GetGatewayStatsRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.api.GetGatewayMetricsRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2736,6 +2736,10 @@ proto.api.GetGatewayStatsRequest.deserializeBinaryFromReader = function(msg, rea reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); msg.setEnd(value); break; + case 4: + var value = /** @type {!proto.common.Aggregation} */ (reader.readEnum()); + msg.setAggregation(value); + break; default: reader.skipField(); break; @@ -2748,10 +2752,10 @@ proto.api.GetGatewayStatsRequest.deserializeBinaryFromReader = function(msg, rea /** * Class method variant: serializes the given message to binary data * (in protobuf wire format), writing to the given BinaryWriter. - * @param {!proto.api.GetGatewayStatsRequest} message + * @param {!proto.api.GetGatewayMetricsRequest} message * @param {!jspb.BinaryWriter} writer */ -proto.api.GetGatewayStatsRequest.serializeBinaryToWriter = function(message, writer) { +proto.api.GetGatewayMetricsRequest.serializeBinaryToWriter = function(message, writer) { message.serializeBinaryToWriter(writer); }; @@ -2760,7 +2764,7 @@ proto.api.GetGatewayStatsRequest.serializeBinaryToWriter = function(message, wri * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.GetGatewayStatsRequest.prototype.serializeBinary = function() { +proto.api.GetGatewayMetricsRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); this.serializeBinaryToWriter(writer); return writer.getResultBuffer(); @@ -2772,7 +2776,7 @@ proto.api.GetGatewayStatsRequest.prototype.serializeBinary = function() { * writing to the given BinaryWriter. * @param {!jspb.BinaryWriter} writer */ -proto.api.GetGatewayStatsRequest.prototype.serializeBinaryToWriter = function (writer) { +proto.api.GetGatewayMetricsRequest.prototype.serializeBinaryToWriter = function (writer) { var f = undefined; f = this.getGatewayId(); if (f.length > 0) { @@ -2797,15 +2801,22 @@ proto.api.GetGatewayStatsRequest.prototype.serializeBinaryToWriter = function (w google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter ); } + f = this.getAggregation(); + if (f !== 0.0) { + writer.writeEnum( + 4, + f + ); + } }; /** * Creates a deep clone of this proto. No data is shared with the original. - * @return {!proto.api.GetGatewayStatsRequest} The clone. + * @return {!proto.api.GetGatewayMetricsRequest} The clone. */ -proto.api.GetGatewayStatsRequest.prototype.cloneMessage = function() { - return /** @type {!proto.api.GetGatewayStatsRequest} */ (jspb.Message.cloneMessage(this)); +proto.api.GetGatewayMetricsRequest.prototype.cloneMessage = function() { + return /** @type {!proto.api.GetGatewayMetricsRequest} */ (jspb.Message.cloneMessage(this)); }; @@ -2813,13 +2824,13 @@ proto.api.GetGatewayStatsRequest.prototype.cloneMessage = function() { * optional string gateway_id = 1; * @return {string} */ -proto.api.GetGatewayStatsRequest.prototype.getGatewayId = function() { +proto.api.GetGatewayMetricsRequest.prototype.getGatewayId = function() { return /** @type {string} */ (jspb.Message.getFieldProto3(this, 1, "")); }; /** @param {string} value */ -proto.api.GetGatewayStatsRequest.prototype.setGatewayId = function(value) { +proto.api.GetGatewayMetricsRequest.prototype.setGatewayId = function(value) { jspb.Message.setField(this, 1, value); }; @@ -2828,19 +2839,19 @@ proto.api.GetGatewayStatsRequest.prototype.setGatewayId = function(value) { * optional google.protobuf.Timestamp start = 2; * @return {proto.google.protobuf.Timestamp} */ -proto.api.GetGatewayStatsRequest.prototype.getStart = function() { +proto.api.GetGatewayMetricsRequest.prototype.getStart = function() { return /** @type{proto.google.protobuf.Timestamp} */ ( jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2)); }; /** @param {proto.google.protobuf.Timestamp|undefined} value */ -proto.api.GetGatewayStatsRequest.prototype.setStart = function(value) { +proto.api.GetGatewayMetricsRequest.prototype.setStart = function(value) { jspb.Message.setWrapperField(this, 2, value); }; -proto.api.GetGatewayStatsRequest.prototype.clearStart = function() { +proto.api.GetGatewayMetricsRequest.prototype.clearStart = function() { this.setStart(undefined); }; @@ -2849,7 +2860,7 @@ proto.api.GetGatewayStatsRequest.prototype.clearStart = function() { * Returns whether this field is set. * @return{!boolean} */ -proto.api.GetGatewayStatsRequest.prototype.hasStart = function() { +proto.api.GetGatewayMetricsRequest.prototype.hasStart = function() { return jspb.Message.getField(this, 2) != null; }; @@ -2858,19 +2869,19 @@ proto.api.GetGatewayStatsRequest.prototype.hasStart = function() { * optional google.protobuf.Timestamp end = 3; * @return {proto.google.protobuf.Timestamp} */ -proto.api.GetGatewayStatsRequest.prototype.getEnd = function() { +proto.api.GetGatewayMetricsRequest.prototype.getEnd = function() { return /** @type{proto.google.protobuf.Timestamp} */ ( jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3)); }; /** @param {proto.google.protobuf.Timestamp|undefined} value */ -proto.api.GetGatewayStatsRequest.prototype.setEnd = function(value) { +proto.api.GetGatewayMetricsRequest.prototype.setEnd = function(value) { jspb.Message.setWrapperField(this, 3, value); }; -proto.api.GetGatewayStatsRequest.prototype.clearEnd = function() { +proto.api.GetGatewayMetricsRequest.prototype.clearEnd = function() { this.setEnd(undefined); }; @@ -2879,186 +2890,23 @@ proto.api.GetGatewayStatsRequest.prototype.clearEnd = function() { * Returns whether this field is set. * @return{!boolean} */ -proto.api.GetGatewayStatsRequest.prototype.hasEnd = function() { +proto.api.GetGatewayMetricsRequest.prototype.hasEnd = function() { return jspb.Message.getField(this, 3) != null; }; - /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * optional common.Aggregation aggregation = 4; + * @return {!proto.common.Aggregation} */ -proto.api.GetGatewayStatsResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.api.GetGatewayStatsResponse.repeatedFields_, null); -}; -goog.inherits(proto.api.GetGatewayStatsResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - proto.api.GetGatewayStatsResponse.displayName = 'proto.api.GetGatewayStatsResponse'; -} -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.api.GetGatewayStatsResponse.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto suitable for use in Soy templates. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.GetGatewayStatsResponse.prototype.toObject = function(opt_includeInstance) { - return proto.api.GetGatewayStatsResponse.toObject(opt_includeInstance, this); +proto.api.GetGatewayMetricsRequest.prototype.getAggregation = function() { + return /** @type {!proto.common.Aggregation} */ (jspb.Message.getFieldProto3(this, 4, 0)); }; -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.GetGatewayStatsResponse} msg The msg instance to transform. - * @return {!Object} - */ -proto.api.GetGatewayStatsResponse.toObject = function(includeInstance, msg) { - var f, obj = { - resultList: jspb.Message.toObjectList(msg.getResultList(), - proto.api.GatewayStats.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.GetGatewayStatsResponse} - */ -proto.api.GetGatewayStatsResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.GetGatewayStatsResponse; - return proto.api.GetGatewayStatsResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.api.GetGatewayStatsResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.GetGatewayStatsResponse} - */ -proto.api.GetGatewayStatsResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.api.GatewayStats; - reader.readMessage(value,proto.api.GatewayStats.deserializeBinaryFromReader); - msg.getResultList().push(value); - msg.setResultList(msg.getResultList()); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Class method variant: serializes the given message to binary data - * (in protobuf wire format), writing to the given BinaryWriter. - * @param {!proto.api.GetGatewayStatsResponse} message - * @param {!jspb.BinaryWriter} writer - */ -proto.api.GetGatewayStatsResponse.serializeBinaryToWriter = function(message, writer) { - message.serializeBinaryToWriter(writer); -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.api.GetGatewayStatsResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - this.serializeBinaryToWriter(writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the message to binary data (in protobuf wire format), - * writing to the given BinaryWriter. - * @param {!jspb.BinaryWriter} writer - */ -proto.api.GetGatewayStatsResponse.prototype.serializeBinaryToWriter = function (writer) { - var f = undefined; - f = this.getResultList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.api.GatewayStats.serializeBinaryToWriter - ); - } -}; - - -/** - * Creates a deep clone of this proto. No data is shared with the original. - * @return {!proto.api.GetGatewayStatsResponse} The clone. - */ -proto.api.GetGatewayStatsResponse.prototype.cloneMessage = function() { - return /** @type {!proto.api.GetGatewayStatsResponse} */ (jspb.Message.cloneMessage(this)); -}; - - -/** - * repeated GatewayStats result = 1; - * If you change this array by adding, removing or replacing elements, or if you - * replace the array itself, then you must call the setter to update it. - * @return {!Array.} - */ -proto.api.GetGatewayStatsResponse.prototype.getResultList = function() { - return /** @type{!Array.} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.api.GatewayStats, 1)); -}; - - -/** @param {Array.} value */ -proto.api.GetGatewayStatsResponse.prototype.setResultList = function(value) { - jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -proto.api.GetGatewayStatsResponse.prototype.clearResultList = function() { - this.setResultList([]); +/** @param {!proto.common.Aggregation} value */ +proto.api.GetGatewayMetricsRequest.prototype.setAggregation = function(value) { + jspb.Message.setField(this, 4, value); }; @@ -3073,12 +2921,12 @@ proto.api.GetGatewayStatsResponse.prototype.clearResultList = function() { * @extends {jspb.Message} * @constructor */ -proto.api.GatewayStats = function(opt_data) { +proto.api.GetGatewayMetricsResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.api.GatewayStats, jspb.Message); +goog.inherits(proto.api.GetGatewayMetricsResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { - proto.api.GatewayStats.displayName = 'proto.api.GatewayStats'; + proto.api.GetGatewayMetricsResponse.displayName = 'proto.api.GetGatewayMetricsResponse'; } @@ -3093,8 +2941,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.api.GatewayStats.prototype.toObject = function(opt_includeInstance) { - return proto.api.GatewayStats.toObject(opt_includeInstance, this); +proto.api.GetGatewayMetricsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.api.GetGatewayMetricsResponse.toObject(opt_includeInstance, this); }; @@ -3103,19 +2951,18 @@ proto.api.GatewayStats.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.api.GatewayStats} msg The msg instance to transform. + * @param {!proto.api.GetGatewayMetricsResponse} msg The msg instance to transform. * @return {!Object} */ -proto.api.GatewayStats.toObject = function(includeInstance, msg) { +proto.api.GetGatewayMetricsResponse.toObject = function(includeInstance, msg) { var f, obj = { - time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), - rxPackets: msg.getRxPackets(), - txPackets: msg.getTxPackets(), - txPacketsPerFrequencyMap: (f = msg.getTxPacketsPerFrequencyMap(true)) ? f.toArray() : [], - rxPacketsPerFrequencyMap: (f = msg.getRxPacketsPerFrequencyMap(true)) ? f.toArray() : [], - txPacketsPerDrMap: (f = msg.getTxPacketsPerDrMap(true)) ? f.toArray() : [], - rxPacketsPerDrMap: (f = msg.getRxPacketsPerDrMap(true)) ? f.toArray() : [], - txPacketsPerStatusMap: (f = msg.getTxPacketsPerStatusMap(true)) ? f.toArray() : [] + rxPackets: (f = msg.getRxPackets()) && common_common_pb.Metric.toObject(includeInstance, f), + txPackets: (f = msg.getTxPackets()) && common_common_pb.Metric.toObject(includeInstance, f), + txPacketsPerFreq: (f = msg.getTxPacketsPerFreq()) && common_common_pb.Metric.toObject(includeInstance, f), + rxPacketsPerFreq: (f = msg.getRxPacketsPerFreq()) && common_common_pb.Metric.toObject(includeInstance, f), + txPacketsPerDr: (f = msg.getTxPacketsPerDr()) && common_common_pb.Metric.toObject(includeInstance, f), + rxPacketsPerDr: (f = msg.getRxPacketsPerDr()) && common_common_pb.Metric.toObject(includeInstance, f), + txPacketsPerStatus: (f = msg.getTxPacketsPerStatus()) && common_common_pb.Metric.toObject(includeInstance, f) }; if (includeInstance) { @@ -3129,23 +2976,23 @@ proto.api.GatewayStats.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.api.GatewayStats} + * @return {!proto.api.GetGatewayMetricsResponse} */ -proto.api.GatewayStats.deserializeBinary = function(bytes) { +proto.api.GetGatewayMetricsResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.GatewayStats; - return proto.api.GatewayStats.deserializeBinaryFromReader(msg, reader); + var msg = new proto.api.GetGatewayMetricsResponse; + return proto.api.GetGatewayMetricsResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.api.GatewayStats} msg The message object to deserialize into. + * @param {!proto.api.GetGatewayMetricsResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.api.GatewayStats} + * @return {!proto.api.GetGatewayMetricsResponse} */ -proto.api.GatewayStats.deserializeBinaryFromReader = function(msg, reader) { +proto.api.GetGatewayMetricsResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3153,47 +3000,39 @@ proto.api.GatewayStats.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new google_protobuf_timestamp_pb.Timestamp; - reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); - msg.setTime(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint32()); + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); msg.setRxPackets(value); break; - case 3: - var value = /** @type {number} */ (reader.readUint32()); + case 2: + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); msg.setTxPackets(value); break; + case 3: + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setTxPacketsPerFreq(value); + break; case 4: - var value = msg.getTxPacketsPerFrequencyMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readUint32); - }); + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setRxPacketsPerFreq(value); break; case 5: - var value = msg.getRxPacketsPerFrequencyMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readUint32); - }); + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setTxPacketsPerDr(value); break; case 6: - var value = msg.getTxPacketsPerDrMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readUint32); - }); + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setRxPacketsPerDr(value); break; case 7: - var value = msg.getRxPacketsPerDrMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readUint32); - }); - break; - case 8: - var value = msg.getTxPacketsPerStatusMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readUint32); - }); + var value = new common_common_pb.Metric; + reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader); + msg.setTxPacketsPerStatus(value); break; default: reader.skipField(); @@ -3207,10 +3046,10 @@ proto.api.GatewayStats.deserializeBinaryFromReader = function(msg, reader) { /** * Class method variant: serializes the given message to binary data * (in protobuf wire format), writing to the given BinaryWriter. - * @param {!proto.api.GatewayStats} message + * @param {!proto.api.GetGatewayMetricsResponse} message * @param {!jspb.BinaryWriter} writer */ -proto.api.GatewayStats.serializeBinaryToWriter = function(message, writer) { +proto.api.GetGatewayMetricsResponse.serializeBinaryToWriter = function(message, writer) { message.serializeBinaryToWriter(writer); }; @@ -3219,7 +3058,7 @@ proto.api.GatewayStats.serializeBinaryToWriter = function(message, writer) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.GatewayStats.prototype.serializeBinary = function() { +proto.api.GetGatewayMetricsResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); this.serializeBinaryToWriter(writer); return writer.getResultBuffer(); @@ -3231,80 +3070,94 @@ proto.api.GatewayStats.prototype.serializeBinary = function() { * writing to the given BinaryWriter. * @param {!jspb.BinaryWriter} writer */ -proto.api.GatewayStats.prototype.serializeBinaryToWriter = function (writer) { +proto.api.GetGatewayMetricsResponse.prototype.serializeBinaryToWriter = function (writer) { var f = undefined; - f = this.getTime(); + f = this.getRxPackets(); if (f != null) { writer.writeMessage( 1, f, - google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter - ); - } - f = this.getRxPackets(); - if (f !== 0) { - writer.writeUint32( - 2, - f + common_common_pb.Metric.serializeBinaryToWriter ); } f = this.getTxPackets(); - if (f !== 0) { - writer.writeUint32( - 3, - f + if (f != null) { + writer.writeMessage( + 2, + f, + common_common_pb.Metric.serializeBinaryToWriter ); } - f = this.getTxPacketsPerFrequencyMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeUint32); + f = this.getTxPacketsPerFreq(); + if (f != null) { + writer.writeMessage( + 3, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); } - f = this.getRxPacketsPerFrequencyMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeUint32); + f = this.getRxPacketsPerFreq(); + if (f != null) { + writer.writeMessage( + 4, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); } - f = this.getTxPacketsPerDrMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeUint32); + f = this.getTxPacketsPerDr(); + if (f != null) { + writer.writeMessage( + 5, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); } - f = this.getRxPacketsPerDrMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(7, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeUint32); + f = this.getRxPacketsPerDr(); + if (f != null) { + writer.writeMessage( + 6, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); } - f = this.getTxPacketsPerStatusMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(8, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeUint32); + f = this.getTxPacketsPerStatus(); + if (f != null) { + writer.writeMessage( + 7, + f, + common_common_pb.Metric.serializeBinaryToWriter + ); } }; /** * Creates a deep clone of this proto. No data is shared with the original. - * @return {!proto.api.GatewayStats} The clone. + * @return {!proto.api.GetGatewayMetricsResponse} The clone. */ -proto.api.GatewayStats.prototype.cloneMessage = function() { - return /** @type {!proto.api.GatewayStats} */ (jspb.Message.cloneMessage(this)); +proto.api.GetGatewayMetricsResponse.prototype.cloneMessage = function() { + return /** @type {!proto.api.GetGatewayMetricsResponse} */ (jspb.Message.cloneMessage(this)); }; /** - * optional google.protobuf.Timestamp time = 1; - * @return {proto.google.protobuf.Timestamp} + * optional common.Metric rx_packets = 1; + * @return {proto.common.Metric} */ -proto.api.GatewayStats.prototype.getTime = function() { - return /** @type{proto.google.protobuf.Timestamp} */ ( - jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 1)); +proto.api.GetGatewayMetricsResponse.prototype.getRxPackets = function() { + return /** @type{proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 1)); }; -/** @param {proto.google.protobuf.Timestamp|undefined} value */ -proto.api.GatewayStats.prototype.setTime = function(value) { +/** @param {proto.common.Metric|undefined} value */ +proto.api.GetGatewayMetricsResponse.prototype.setRxPackets = function(value) { jspb.Message.setWrapperField(this, 1, value); }; -proto.api.GatewayStats.prototype.clearTime = function() { - this.setTime(undefined); +proto.api.GetGatewayMetricsResponse.prototype.clearRxPackets = function() { + this.setRxPackets(undefined); }; @@ -3312,103 +3165,188 @@ proto.api.GatewayStats.prototype.clearTime = function() { * Returns whether this field is set. * @return{!boolean} */ -proto.api.GatewayStats.prototype.hasTime = function() { +proto.api.GetGatewayMetricsResponse.prototype.hasRxPackets = function() { return jspb.Message.getField(this, 1) != null; }; /** - * optional uint32 rx_packets = 2; - * @return {number} + * optional common.Metric tx_packets = 2; + * @return {proto.common.Metric} */ -proto.api.GatewayStats.prototype.getRxPackets = function() { - return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0)); +proto.api.GetGatewayMetricsResponse.prototype.getTxPackets = function() { + return /** @type{proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 2)); }; -/** @param {number} value */ -proto.api.GatewayStats.prototype.setRxPackets = function(value) { - jspb.Message.setField(this, 2, value); +/** @param {proto.common.Metric|undefined} value */ +proto.api.GetGatewayMetricsResponse.prototype.setTxPackets = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +proto.api.GetGatewayMetricsResponse.prototype.clearTxPackets = function() { + this.setTxPackets(undefined); }; /** - * optional uint32 tx_packets = 3; - * @return {number} + * Returns whether this field is set. + * @return{!boolean} */ -proto.api.GatewayStats.prototype.getTxPackets = function() { - return /** @type {number} */ (jspb.Message.getFieldProto3(this, 3, 0)); -}; - - -/** @param {number} value */ -proto.api.GatewayStats.prototype.setTxPackets = function(value) { - jspb.Message.setField(this, 3, value); +proto.api.GetGatewayMetricsResponse.prototype.hasTxPackets = function() { + return jspb.Message.getField(this, 2) != null; }; /** - * map tx_packets_per_frequency = 4; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} + * optional common.Metric tx_packets_per_freq = 3; + * @return {proto.common.Metric} */ -proto.api.GatewayStats.prototype.getTxPacketsPerFrequencyMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 4, opt_noLazyCreate, - null)); +proto.api.GetGatewayMetricsResponse.prototype.getTxPacketsPerFreq = function() { + return /** @type{proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 3)); +}; + + +/** @param {proto.common.Metric|undefined} value */ +proto.api.GetGatewayMetricsResponse.prototype.setTxPacketsPerFreq = function(value) { + jspb.Message.setWrapperField(this, 3, value); +}; + + +proto.api.GetGatewayMetricsResponse.prototype.clearTxPacketsPerFreq = function() { + this.setTxPacketsPerFreq(undefined); }; /** - * map rx_packets_per_frequency = 5; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} + * Returns whether this field is set. + * @return{!boolean} */ -proto.api.GatewayStats.prototype.getRxPacketsPerFrequencyMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 5, opt_noLazyCreate, - null)); +proto.api.GetGatewayMetricsResponse.prototype.hasTxPacketsPerFreq = function() { + return jspb.Message.getField(this, 3) != null; }; /** - * map tx_packets_per_dr = 6; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} + * optional common.Metric rx_packets_per_freq = 4; + * @return {proto.common.Metric} */ -proto.api.GatewayStats.prototype.getTxPacketsPerDrMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 6, opt_noLazyCreate, - null)); +proto.api.GetGatewayMetricsResponse.prototype.getRxPacketsPerFreq = function() { + return /** @type{proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 4)); +}; + + +/** @param {proto.common.Metric|undefined} value */ +proto.api.GetGatewayMetricsResponse.prototype.setRxPacketsPerFreq = function(value) { + jspb.Message.setWrapperField(this, 4, value); +}; + + +proto.api.GetGatewayMetricsResponse.prototype.clearRxPacketsPerFreq = function() { + this.setRxPacketsPerFreq(undefined); }; /** - * map rx_packets_per_dr = 7; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} + * Returns whether this field is set. + * @return{!boolean} */ -proto.api.GatewayStats.prototype.getRxPacketsPerDrMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 7, opt_noLazyCreate, - null)); +proto.api.GetGatewayMetricsResponse.prototype.hasRxPacketsPerFreq = function() { + return jspb.Message.getField(this, 4) != null; }; /** - * map tx_packets_per_status = 8; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} + * optional common.Metric tx_packets_per_dr = 5; + * @return {proto.common.Metric} */ -proto.api.GatewayStats.prototype.getTxPacketsPerStatusMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 8, opt_noLazyCreate, - null)); +proto.api.GetGatewayMetricsResponse.prototype.getTxPacketsPerDr = function() { + return /** @type{proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 5)); +}; + + +/** @param {proto.common.Metric|undefined} value */ +proto.api.GetGatewayMetricsResponse.prototype.setTxPacketsPerDr = function(value) { + jspb.Message.setWrapperField(this, 5, value); +}; + + +proto.api.GetGatewayMetricsResponse.prototype.clearTxPacketsPerDr = function() { + this.setTxPacketsPerDr(undefined); +}; + + +/** + * Returns whether this field is set. + * @return{!boolean} + */ +proto.api.GetGatewayMetricsResponse.prototype.hasTxPacketsPerDr = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional common.Metric rx_packets_per_dr = 6; + * @return {proto.common.Metric} + */ +proto.api.GetGatewayMetricsResponse.prototype.getRxPacketsPerDr = function() { + return /** @type{proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 6)); +}; + + +/** @param {proto.common.Metric|undefined} value */ +proto.api.GetGatewayMetricsResponse.prototype.setRxPacketsPerDr = function(value) { + jspb.Message.setWrapperField(this, 6, value); +}; + + +proto.api.GetGatewayMetricsResponse.prototype.clearRxPacketsPerDr = function() { + this.setRxPacketsPerDr(undefined); +}; + + +/** + * Returns whether this field is set. + * @return{!boolean} + */ +proto.api.GetGatewayMetricsResponse.prototype.hasRxPacketsPerDr = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional common.Metric tx_packets_per_status = 7; + * @return {proto.common.Metric} + */ +proto.api.GetGatewayMetricsResponse.prototype.getTxPacketsPerStatus = function() { + return /** @type{proto.common.Metric} */ ( + jspb.Message.getWrapperField(this, common_common_pb.Metric, 7)); +}; + + +/** @param {proto.common.Metric|undefined} value */ +proto.api.GetGatewayMetricsResponse.prototype.setTxPacketsPerStatus = function(value) { + jspb.Message.setWrapperField(this, 7, value); +}; + + +proto.api.GetGatewayMetricsResponse.prototype.clearTxPacketsPerStatus = function() { + this.setTxPacketsPerStatus(undefined); +}; + + +/** + * Returns whether this field is set. + * @return{!boolean} + */ +proto.api.GetGatewayMetricsResponse.prototype.hasTxPacketsPerStatus = function() { + return jspb.Message.getField(this, 7) != null; }; diff --git a/api/js/common/common_pb.d.ts b/api/js/common/common_pb.d.ts index 791eeb0d..a077fa22 100644 --- a/api/js/common/common_pb.d.ts +++ b/api/js/common/common_pb.d.ts @@ -2,6 +2,7 @@ // file: common/common.proto import * as jspb from "google-protobuf"; +import * as google_protobuf_timestamp_pb from "google-protobuf/google/protobuf/timestamp_pb"; export class Location extends jspb.Message { getLatitude(): number; @@ -65,6 +66,64 @@ export namespace KeyEnvelope { } } +export class Metric extends jspb.Message { + getName(): string; + setName(value: string): void; + + clearTimestampsList(): void; + getTimestampsList(): Array; + setTimestampsList(value: Array): void; + addTimestamps(value?: google_protobuf_timestamp_pb.Timestamp, index?: number): google_protobuf_timestamp_pb.Timestamp; + + clearDatasetsList(): void; + getDatasetsList(): Array; + setDatasetsList(value: Array): void; + addDatasets(value?: MetricDataset, index?: number): MetricDataset; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Metric.AsObject; + static toObject(includeInstance: boolean, msg: Metric): Metric.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Metric, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Metric; + static deserializeBinaryFromReader(message: Metric, reader: jspb.BinaryReader): Metric; +} + +export namespace Metric { + export type AsObject = { + name: string, + timestampsList: Array, + datasetsList: Array, + } +} + +export class MetricDataset extends jspb.Message { + getLabel(): string; + setLabel(value: string): void; + + clearDataList(): void; + getDataList(): Array; + setDataList(value: Array): void; + addData(value: number, index?: number): number; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): MetricDataset.AsObject; + static toObject(includeInstance: boolean, msg: MetricDataset): MetricDataset.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: MetricDataset, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): MetricDataset; + static deserializeBinaryFromReader(message: MetricDataset, reader: jspb.BinaryReader): MetricDataset; +} + +export namespace MetricDataset { + export type AsObject = { + label: string, + dataList: Array, + } +} + export interface ModulationMap { LORA: 0; FSK: 1; @@ -139,3 +198,11 @@ export interface LocationSourceMap { export const LocationSource: LocationSourceMap; +export interface AggregationMap { + HOUR: 0; + DAY: 1; + MONTH: 2; +} + +export const Aggregation: AggregationMap; + diff --git a/api/js/common/common_pb.js b/api/js/common/common_pb.js index 49660b35..89249654 100644 --- a/api/js/common/common_pb.js +++ b/api/js/common/common_pb.js @@ -9,11 +9,15 @@ var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); +var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); +goog.exportSymbol('proto.common.Aggregation', null, global); goog.exportSymbol('proto.common.KeyEnvelope', null, global); goog.exportSymbol('proto.common.Location', null, global); goog.exportSymbol('proto.common.LocationSource', null, global); goog.exportSymbol('proto.common.MType', null, global); goog.exportSymbol('proto.common.MacVersion', null, global); +goog.exportSymbol('proto.common.Metric', null, global); +goog.exportSymbol('proto.common.MetricDataset', null, global); goog.exportSymbol('proto.common.Modulation', null, global); goog.exportSymbol('proto.common.RegParamsRevision', null, global); goog.exportSymbol('proto.common.Region', null, global); @@ -494,6 +498,450 @@ proto.common.KeyEnvelope.prototype.setAesKey = function(value) { }; + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.Metric = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.common.Metric.repeatedFields_, null); +}; +goog.inherits(proto.common.Metric, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.common.Metric.displayName = 'proto.common.Metric'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.common.Metric.repeatedFields_ = [2,3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.Metric.prototype.toObject = function(opt_includeInstance) { + return proto.common.Metric.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.Metric} msg The msg instance to transform. + * @return {!Object} + */ +proto.common.Metric.toObject = function(includeInstance, msg) { + var f, obj = { + name: msg.getName(), + timestampsList: jspb.Message.toObjectList(msg.getTimestampsList(), + google_protobuf_timestamp_pb.Timestamp.toObject, includeInstance), + datasetsList: jspb.Message.toObjectList(msg.getDatasetsList(), + proto.common.MetricDataset.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.Metric} + */ +proto.common.Metric.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.Metric; + return proto.common.Metric.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.Metric} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.Metric} + */ +proto.common.Metric.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = new google_protobuf_timestamp_pb.Timestamp; + reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); + msg.getTimestampsList().push(value); + msg.setTimestampsList(msg.getTimestampsList()); + break; + case 3: + var value = new proto.common.MetricDataset; + reader.readMessage(value,proto.common.MetricDataset.deserializeBinaryFromReader); + msg.getDatasetsList().push(value); + msg.setDatasetsList(msg.getDatasetsList()); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Class method variant: serializes the given message to binary data + * (in protobuf wire format), writing to the given BinaryWriter. + * @param {!proto.common.Metric} message + * @param {!jspb.BinaryWriter} writer + */ +proto.common.Metric.serializeBinaryToWriter = function(message, writer) { + message.serializeBinaryToWriter(writer); +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.Metric.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + this.serializeBinaryToWriter(writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the message to binary data (in protobuf wire format), + * writing to the given BinaryWriter. + * @param {!jspb.BinaryWriter} writer + */ +proto.common.Metric.prototype.serializeBinaryToWriter = function (writer) { + var f = undefined; + f = this.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = this.getTimestampsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter + ); + } + f = this.getDatasetsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.common.MetricDataset.serializeBinaryToWriter + ); + } +}; + + +/** + * Creates a deep clone of this proto. No data is shared with the original. + * @return {!proto.common.Metric} The clone. + */ +proto.common.Metric.prototype.cloneMessage = function() { + return /** @type {!proto.common.Metric} */ (jspb.Message.cloneMessage(this)); +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.common.Metric.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldProto3(this, 1, "")); +}; + + +/** @param {string} value */ +proto.common.Metric.prototype.setName = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * repeated google.protobuf.Timestamp timestamps = 2; + * If you change this array by adding, removing or replacing elements, or if you + * replace the array itself, then you must call the setter to update it. + * @return {!Array.} + */ +proto.common.Metric.prototype.getTimestampsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2)); +}; + + +/** @param {Array.} value */ +proto.common.Metric.prototype.setTimestampsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +proto.common.Metric.prototype.clearTimestampsList = function() { + this.setTimestampsList([]); +}; + + +/** + * repeated MetricDataset datasets = 3; + * If you change this array by adding, removing or replacing elements, or if you + * replace the array itself, then you must call the setter to update it. + * @return {!Array.} + */ +proto.common.Metric.prototype.getDatasetsList = function() { + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.common.MetricDataset, 3)); +}; + + +/** @param {Array.} value */ +proto.common.Metric.prototype.setDatasetsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +proto.common.Metric.prototype.clearDatasetsList = function() { + this.setDatasetsList([]); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.common.MetricDataset = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.common.MetricDataset.repeatedFields_, null); +}; +goog.inherits(proto.common.MetricDataset, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.common.MetricDataset.displayName = 'proto.common.MetricDataset'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.common.MetricDataset.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.common.MetricDataset.prototype.toObject = function(opt_includeInstance) { + return proto.common.MetricDataset.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.common.MetricDataset} msg The msg instance to transform. + * @return {!Object} + */ +proto.common.MetricDataset.toObject = function(includeInstance, msg) { + var f, obj = { + label: msg.getLabel(), + dataList: jspb.Message.getRepeatedFloatingPointField(msg, 2) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.common.MetricDataset} + */ +proto.common.MetricDataset.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.common.MetricDataset; + return proto.common.MetricDataset.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.common.MetricDataset} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.common.MetricDataset} + */ +proto.common.MetricDataset.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setLabel(value); + break; + case 2: + var value = /** @type {!Array.} */ (reader.readPackedFloat()); + msg.setDataList(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Class method variant: serializes the given message to binary data + * (in protobuf wire format), writing to the given BinaryWriter. + * @param {!proto.common.MetricDataset} message + * @param {!jspb.BinaryWriter} writer + */ +proto.common.MetricDataset.serializeBinaryToWriter = function(message, writer) { + message.serializeBinaryToWriter(writer); +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.common.MetricDataset.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + this.serializeBinaryToWriter(writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the message to binary data (in protobuf wire format), + * writing to the given BinaryWriter. + * @param {!jspb.BinaryWriter} writer + */ +proto.common.MetricDataset.prototype.serializeBinaryToWriter = function (writer) { + var f = undefined; + f = this.getLabel(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = this.getDataList(); + if (f.length > 0) { + writer.writePackedFloat( + 2, + f + ); + } +}; + + +/** + * Creates a deep clone of this proto. No data is shared with the original. + * @return {!proto.common.MetricDataset} The clone. + */ +proto.common.MetricDataset.prototype.cloneMessage = function() { + return /** @type {!proto.common.MetricDataset} */ (jspb.Message.cloneMessage(this)); +}; + + +/** + * optional string label = 1; + * @return {string} + */ +proto.common.MetricDataset.prototype.getLabel = function() { + return /** @type {string} */ (jspb.Message.getFieldProto3(this, 1, "")); +}; + + +/** @param {string} value */ +proto.common.MetricDataset.prototype.setLabel = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * repeated float data = 2; + * If you change this array by adding, removing or replacing elements, or if you + * replace the array itself, then you must call the setter to update it. + * @return {!Array.} + */ +proto.common.MetricDataset.prototype.getDataList = function() { + return /** @type {!Array.} */ (jspb.Message.getRepeatedFloatingPointField(this, 2)); +}; + + +/** @param {Array.} value */ +proto.common.MetricDataset.prototype.setDataList = function(value) { + jspb.Message.setField(this, 2, value || []); +}; + + +proto.common.MetricDataset.prototype.clearDataList = function() { + jspb.Message.setField(this, 2, []); +}; + + /** * @enum {number} */ @@ -574,4 +1022,13 @@ proto.common.LocationSource = { GEO_RESOLVER_WIFI: 6 }; +/** + * @enum {number} + */ +proto.common.Aggregation = { + HOUR: 0, + DAY: 1, + MONTH: 2 +}; + goog.object.extend(exports, proto.common); diff --git a/api/proto/api/device.proto b/api/proto/api/device.proto index 8091097e..0ee519df 100644 --- a/api/proto/api/device.proto +++ b/api/proto/api/device.proto @@ -7,6 +7,7 @@ option java_package = "io.chirpstack.api"; option java_multiple_files = true; option java_outer_classname = "DeviceProto"; +import "common/common.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/empty.proto"; @@ -55,8 +56,13 @@ service DeviceService { // GetRandomDevAddr returns a random DevAddr taking the NwkID prefix into account. rpc GetRandomDevAddr(GetRandomDevAddrRequest) returns (GetRandomDevAddrResponse) {} - // GetStats returns the device stats. - rpc GetStats(GetDeviceStatsRequest) returns (GetDeviceStatsResponse) {} + // GetMetrics returns the device metrics. + // Note that this requires a device-profile with codec and measurements configured. + rpc GetMetrics(GetDeviceMetricsRequest) returns (GetDeviceMetricsResponse) {} + + // GetLinkMetrics returns the device link metrics. + // This includes uplinks, downlinks, RSSI, SNR, etc... + rpc GetLinkMetrics(GetDeviceLinkMetricsRequest) returns (GetDeviceLinkMetricsResponse) {} // Enqueue adds the given item to the downlink queue. rpc Enqueue(EnqueueDeviceQueueItemRequest) returns (EnqueueDeviceQueueItemResponse) {} @@ -309,7 +315,7 @@ message GetRandomDevAddrResponse { string dev_addr = 1; } -message GetDeviceStatsRequest { +message GetDeviceMetricsRequest { // DevEUI (EUI64). string dev_eui = 1; @@ -318,33 +324,57 @@ message GetDeviceStatsRequest { // Interval end timestamp. google.protobuf.Timestamp end = 3; + + // Aggregation. + common.Aggregation aggregation = 4; } -message GetDeviceStatsResponse { - repeated DeviceStats result = 1; +message GetDeviceMetricsResponse { + map metrics = 1; + + map states = 2; } -message DeviceStats { - // Timestamp of the (aggregated) measurement. - google.protobuf.Timestamp time = 1; +message DeviceState { + // Name. + string name = 2; + // Value. + string value = 3; +} + +message GetDeviceLinkMetricsRequest { + // DevEUI (EUI64). + string dev_eui = 1; + + // Interval start timestamp. + google.protobuf.Timestamp start = 2; + + // Interval end timestamp. + google.protobuf.Timestamp end = 3; + + // Aggregation. + common.Aggregation aggregation = 4; +} + +message GetDeviceLinkMetricsResponse { // Packets received from the device. - uint32 rx_packets = 2; + common.Metric rx_packets = 1; - // Average RSSI (as reported by the gateway(s)). - float gw_rssi = 3; + // RSSI (as reported by the gateway(s)). + common.Metric gw_rssi = 2; - // Average SNR (as reported by the gateway(s)). - float gw_snr = 4; + // SNR (as reported by the gateway(s)). + common.Metric gw_snr = 3; // Packets received by frequency. - map rx_packets_per_frequency = 5; + common.Metric rx_packets_per_freq = 4; // Packets received by DR. - map rx_packets_per_dr = 6; + common.Metric rx_packets_per_dr = 5; - // Error count. - map errors = 7; + // Errors. + common.Metric errors = 6; } message DeviceQueueItem { diff --git a/api/proto/api/device_profile.proto b/api/proto/api/device_profile.proto index 4e778dcd..9dae3b75 100644 --- a/api/proto/api/device_profile.proto +++ b/api/proto/api/device_profile.proto @@ -22,6 +22,23 @@ enum CodecRuntime { JS = 2; } +enum MeasurementKind { + // Unknown (in which case it is not tracked). + UNKNOWN = 0; + + // Incrementing counters that never decrease (these are not reset on each reading). + COUNTER = 1; + + // Counters that do get reset upon reading. + ABSOLUTE = 2; + + // E.g. a temperature value. + GAUGE = 3; + + // E.g. a firmware version, true / false value. + STRING = 4; +} + // DeviceProfileService is the service providing API methods for managing device-profiles. service DeviceProfileService { // Create the given device-profile. @@ -129,6 +146,18 @@ message DeviceProfile { // User defined tags. map tags = 25; + + // Measurements. + // If defined, ChirpStack will visualize these metrics in the web-interface. + map measurements = 27; +} + +message Measurement { + // Name (user defined). + string name = 2; + + // Kind. + MeasurementKind kind = 3; } message DeviceProfileListItem { diff --git a/api/proto/api/device_profile_template.proto b/api/proto/api/device_profile_template.proto index d795fe61..0366006b 100644 --- a/api/proto/api/device_profile_template.proto +++ b/api/proto/api/device_profile_template.proto @@ -118,6 +118,10 @@ message DeviceProfileTemplate { // User defined tags. map tags = 27; + + // Measurements. + // If defined, ChirpStack will visualize these metrics in the web-interface. + map measurements = 28; } message DeviceProfileTemplateListItem { diff --git a/api/proto/api/gateway.proto b/api/proto/api/gateway.proto index 9b0e5d34..5548ad12 100644 --- a/api/proto/api/gateway.proto +++ b/api/proto/api/gateway.proto @@ -31,8 +31,8 @@ service GatewayService { // Generate client-certificate for the gateway. rpc GenerateClientCertificate(GenerateGatewayClientCertificateRequest) returns (GenerateGatewayClientCertificateResponse) {} - // GetStats returns the gateway stats. - rpc GetStats(GetGatewayStatsRequest) returns (GetGatewayStatsResponse) {} + // GetMetrics returns the gateway metrics. + rpc GetMetrics(GetGatewayMetricsRequest) returns (GetGatewayMetricsResponse) {} } message Gateway { @@ -163,7 +163,7 @@ message GenerateGatewayClientCertificateResponse { google.protobuf.Timestamp expires_at = 4; } -message GetGatewayStatsRequest { +message GetGatewayMetricsRequest { // Gateway ID (EUI64). string gateway_id = 1; @@ -172,34 +172,30 @@ message GetGatewayStatsRequest { // Interval end timestamp. google.protobuf.Timestamp end = 3; + + // Aggregation. + common.Aggregation aggregation = 4; } -message GetGatewayStatsResponse { - repeated GatewayStats result = 1; -} - -message GatewayStats { - // Timestamp of the (aggregated) measurement. - google.protobuf.Timestamp time = 1; - - // Packets received. - uint32 rx_packets = 2; - - // Packets emitted. - uint32 tx_packets = 3; - - // Tx packets per frequency. - map tx_packets_per_frequency = 4; - - // Rx packets per frequency. - map rx_packets_per_frequency = 5; - - // Tx packets per DR. - map tx_packets_per_dr = 6; - - // Rx packets per DR. - map rx_packets_per_dr = 7; - - // Tx packets per status. - map tx_packets_per_status = 8; +message GetGatewayMetricsResponse { + // RX packets. + common.Metric rx_packets = 1; + + // TX packets. + common.Metric tx_packets = 2; + + // TX packets / frequency. + common.Metric tx_packets_per_freq = 3; + + // RX packets / frequency. + common.Metric rx_packets_per_freq = 4; + + // TX packets / DR. + common.Metric tx_packets_per_dr = 5; + + // RX packets / DR. + common.Metric rx_packets_per_dr = 6; + + // TX packets per status. + common.Metric tx_packets_per_status = 7; } diff --git a/api/proto/common/common.proto b/api/proto/common/common.proto index d5d6caaf..791bd235 100644 --- a/api/proto/common/common.proto +++ b/api/proto/common/common.proto @@ -7,6 +7,8 @@ option java_package = "io.chirpstack.api"; option java_multiple_files = true; option java_outer_classname = "CommonProto"; +import "google/protobuf/timestamp.proto"; + enum Modulation { // LoRa LORA = 0; @@ -129,6 +131,17 @@ enum LocationSource { GEO_RESOLVER_WIFI = 6; } +enum Aggregation { + // Hour. + HOUR = 0; + + // Day. + DAY = 1; + + // Month. + MONTH = 2; +} + message Location { // Latitude. double latitude = 1; @@ -153,3 +166,23 @@ message KeyEnvelope { // AES key (when the kek_label is set, this value must first be decrypted). bytes aes_key = 2; } + +message Metric { + // Name. + string name = 1; + + // Timestamps. + repeated google.protobuf.Timestamp timestamps = 2; + + // Datasets. + repeated MetricDataset datasets = 3; +} + +message MetricDataset { + // Label. + string label = 1; + + // Data. + // Each value index corresponds with the same timestamp index of the Metric. + repeated float data = 2; +} diff --git a/api/rust/Cargo.lock b/api/rust/Cargo.lock index a3b1f2ee..f548b5b9 100644 --- a/api/rust/Cargo.lock +++ b/api/rust/Cargo.lock @@ -121,7 +121,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chirpstack_api" -version = "4.0.0-test.5" +version = "4.0.0-test.6" dependencies = [ "hex", "pbjson", diff --git a/api/rust/proto/chirpstack/api/device.proto b/api/rust/proto/chirpstack/api/device.proto index 8091097e..0ee519df 100644 --- a/api/rust/proto/chirpstack/api/device.proto +++ b/api/rust/proto/chirpstack/api/device.proto @@ -7,6 +7,7 @@ option java_package = "io.chirpstack.api"; option java_multiple_files = true; option java_outer_classname = "DeviceProto"; +import "common/common.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/empty.proto"; @@ -55,8 +56,13 @@ service DeviceService { // GetRandomDevAddr returns a random DevAddr taking the NwkID prefix into account. rpc GetRandomDevAddr(GetRandomDevAddrRequest) returns (GetRandomDevAddrResponse) {} - // GetStats returns the device stats. - rpc GetStats(GetDeviceStatsRequest) returns (GetDeviceStatsResponse) {} + // GetMetrics returns the device metrics. + // Note that this requires a device-profile with codec and measurements configured. + rpc GetMetrics(GetDeviceMetricsRequest) returns (GetDeviceMetricsResponse) {} + + // GetLinkMetrics returns the device link metrics. + // This includes uplinks, downlinks, RSSI, SNR, etc... + rpc GetLinkMetrics(GetDeviceLinkMetricsRequest) returns (GetDeviceLinkMetricsResponse) {} // Enqueue adds the given item to the downlink queue. rpc Enqueue(EnqueueDeviceQueueItemRequest) returns (EnqueueDeviceQueueItemResponse) {} @@ -309,7 +315,7 @@ message GetRandomDevAddrResponse { string dev_addr = 1; } -message GetDeviceStatsRequest { +message GetDeviceMetricsRequest { // DevEUI (EUI64). string dev_eui = 1; @@ -318,33 +324,57 @@ message GetDeviceStatsRequest { // Interval end timestamp. google.protobuf.Timestamp end = 3; + + // Aggregation. + common.Aggregation aggregation = 4; } -message GetDeviceStatsResponse { - repeated DeviceStats result = 1; +message GetDeviceMetricsResponse { + map metrics = 1; + + map states = 2; } -message DeviceStats { - // Timestamp of the (aggregated) measurement. - google.protobuf.Timestamp time = 1; +message DeviceState { + // Name. + string name = 2; + // Value. + string value = 3; +} + +message GetDeviceLinkMetricsRequest { + // DevEUI (EUI64). + string dev_eui = 1; + + // Interval start timestamp. + google.protobuf.Timestamp start = 2; + + // Interval end timestamp. + google.protobuf.Timestamp end = 3; + + // Aggregation. + common.Aggregation aggregation = 4; +} + +message GetDeviceLinkMetricsResponse { // Packets received from the device. - uint32 rx_packets = 2; + common.Metric rx_packets = 1; - // Average RSSI (as reported by the gateway(s)). - float gw_rssi = 3; + // RSSI (as reported by the gateway(s)). + common.Metric gw_rssi = 2; - // Average SNR (as reported by the gateway(s)). - float gw_snr = 4; + // SNR (as reported by the gateway(s)). + common.Metric gw_snr = 3; // Packets received by frequency. - map rx_packets_per_frequency = 5; + common.Metric rx_packets_per_freq = 4; // Packets received by DR. - map rx_packets_per_dr = 6; + common.Metric rx_packets_per_dr = 5; - // Error count. - map errors = 7; + // Errors. + common.Metric errors = 6; } message DeviceQueueItem { diff --git a/api/rust/proto/chirpstack/api/device_profile.proto b/api/rust/proto/chirpstack/api/device_profile.proto index 4e778dcd..9dae3b75 100644 --- a/api/rust/proto/chirpstack/api/device_profile.proto +++ b/api/rust/proto/chirpstack/api/device_profile.proto @@ -22,6 +22,23 @@ enum CodecRuntime { JS = 2; } +enum MeasurementKind { + // Unknown (in which case it is not tracked). + UNKNOWN = 0; + + // Incrementing counters that never decrease (these are not reset on each reading). + COUNTER = 1; + + // Counters that do get reset upon reading. + ABSOLUTE = 2; + + // E.g. a temperature value. + GAUGE = 3; + + // E.g. a firmware version, true / false value. + STRING = 4; +} + // DeviceProfileService is the service providing API methods for managing device-profiles. service DeviceProfileService { // Create the given device-profile. @@ -129,6 +146,18 @@ message DeviceProfile { // User defined tags. map tags = 25; + + // Measurements. + // If defined, ChirpStack will visualize these metrics in the web-interface. + map measurements = 27; +} + +message Measurement { + // Name (user defined). + string name = 2; + + // Kind. + MeasurementKind kind = 3; } message DeviceProfileListItem { diff --git a/api/rust/proto/chirpstack/api/device_profile_template.proto b/api/rust/proto/chirpstack/api/device_profile_template.proto index d795fe61..0366006b 100644 --- a/api/rust/proto/chirpstack/api/device_profile_template.proto +++ b/api/rust/proto/chirpstack/api/device_profile_template.proto @@ -118,6 +118,10 @@ message DeviceProfileTemplate { // User defined tags. map tags = 27; + + // Measurements. + // If defined, ChirpStack will visualize these metrics in the web-interface. + map measurements = 28; } message DeviceProfileTemplateListItem { diff --git a/api/rust/proto/chirpstack/api/gateway.proto b/api/rust/proto/chirpstack/api/gateway.proto index 9b0e5d34..5548ad12 100644 --- a/api/rust/proto/chirpstack/api/gateway.proto +++ b/api/rust/proto/chirpstack/api/gateway.proto @@ -31,8 +31,8 @@ service GatewayService { // Generate client-certificate for the gateway. rpc GenerateClientCertificate(GenerateGatewayClientCertificateRequest) returns (GenerateGatewayClientCertificateResponse) {} - // GetStats returns the gateway stats. - rpc GetStats(GetGatewayStatsRequest) returns (GetGatewayStatsResponse) {} + // GetMetrics returns the gateway metrics. + rpc GetMetrics(GetGatewayMetricsRequest) returns (GetGatewayMetricsResponse) {} } message Gateway { @@ -163,7 +163,7 @@ message GenerateGatewayClientCertificateResponse { google.protobuf.Timestamp expires_at = 4; } -message GetGatewayStatsRequest { +message GetGatewayMetricsRequest { // Gateway ID (EUI64). string gateway_id = 1; @@ -172,34 +172,30 @@ message GetGatewayStatsRequest { // Interval end timestamp. google.protobuf.Timestamp end = 3; + + // Aggregation. + common.Aggregation aggregation = 4; } -message GetGatewayStatsResponse { - repeated GatewayStats result = 1; -} - -message GatewayStats { - // Timestamp of the (aggregated) measurement. - google.protobuf.Timestamp time = 1; - - // Packets received. - uint32 rx_packets = 2; - - // Packets emitted. - uint32 tx_packets = 3; - - // Tx packets per frequency. - map tx_packets_per_frequency = 4; - - // Rx packets per frequency. - map rx_packets_per_frequency = 5; - - // Tx packets per DR. - map tx_packets_per_dr = 6; - - // Rx packets per DR. - map rx_packets_per_dr = 7; - - // Tx packets per status. - map tx_packets_per_status = 8; +message GetGatewayMetricsResponse { + // RX packets. + common.Metric rx_packets = 1; + + // TX packets. + common.Metric tx_packets = 2; + + // TX packets / frequency. + common.Metric tx_packets_per_freq = 3; + + // RX packets / frequency. + common.Metric rx_packets_per_freq = 4; + + // TX packets / DR. + common.Metric tx_packets_per_dr = 5; + + // RX packets / DR. + common.Metric rx_packets_per_dr = 6; + + // TX packets per status. + common.Metric tx_packets_per_status = 7; } diff --git a/api/rust/proto/chirpstack/common/common.proto b/api/rust/proto/chirpstack/common/common.proto index d5d6caaf..791bd235 100644 --- a/api/rust/proto/chirpstack/common/common.proto +++ b/api/rust/proto/chirpstack/common/common.proto @@ -7,6 +7,8 @@ option java_package = "io.chirpstack.api"; option java_multiple_files = true; option java_outer_classname = "CommonProto"; +import "google/protobuf/timestamp.proto"; + enum Modulation { // LoRa LORA = 0; @@ -129,6 +131,17 @@ enum LocationSource { GEO_RESOLVER_WIFI = 6; } +enum Aggregation { + // Hour. + HOUR = 0; + + // Day. + DAY = 1; + + // Month. + MONTH = 2; +} + message Location { // Latitude. double latitude = 1; @@ -153,3 +166,23 @@ message KeyEnvelope { // AES key (when the kek_label is set, this value must first be decrypted). bytes aes_key = 2; } + +message Metric { + // Name. + string name = 1; + + // Timestamps. + repeated google.protobuf.Timestamp timestamps = 2; + + // Datasets. + repeated MetricDataset datasets = 3; +} + +message MetricDataset { + // Label. + string label = 1; + + // Data. + // Each value index corresponds with the same timestamp index of the Metric. + repeated float data = 2; +} diff --git a/chirpstack/migrations/2022-06-14-130020_device_profile_measurements/down.sql b/chirpstack/migrations/2022-06-14-130020_device_profile_measurements/down.sql new file mode 100644 index 00000000..852398e6 --- /dev/null +++ b/chirpstack/migrations/2022-06-14-130020_device_profile_measurements/down.sql @@ -0,0 +1,5 @@ +alter table device_profile + drop column measurements; + +alter table device_profile_template + drop column measurements; diff --git a/chirpstack/migrations/2022-06-14-130020_device_profile_measurements/up.sql b/chirpstack/migrations/2022-06-14-130020_device_profile_measurements/up.sql new file mode 100644 index 00000000..b5b19ef5 --- /dev/null +++ b/chirpstack/migrations/2022-06-14-130020_device_profile_measurements/up.sql @@ -0,0 +1,11 @@ +alter table device_profile + add column measurements jsonb not null default '{}'; + +alter table device_profile_template + add column measurements jsonb not null default '{}'; + +alter table device_profile + alter column measurements drop default; + +alter table device_profile_template + alter column measurements drop default; diff --git a/chirpstack/src/api/device.rs b/chirpstack/src/api/device.rs index 7a49067c..53c31f65 100644 --- a/chirpstack/src/api/device.rs +++ b/chirpstack/src/api/device.rs @@ -1,8 +1,9 @@ +use std::collections::HashSet; use std::str::FromStr; use std::time::SystemTime; use bigdecimal::ToPrimitive; -use chrono::{DateTime, Local}; +use chrono::{DateTime, Local, Utc}; use rand::RngCore; use tonic::{Request, Response, Status}; use uuid::Uuid; @@ -13,7 +14,7 @@ use lrwn::{AES128Key, DevAddr, EUI64}; use super::auth::validator; use super::error::ToStatus; -use super::helpers::{self, ToProto}; +use super::helpers::{self, FromProto, ToProto}; use crate::storage::error::Error; use crate::storage::{ device, device_keys, device_profile, device_queue, device_session, fields, metrics, @@ -563,10 +564,10 @@ impl DeviceService for Device { })) } - async fn get_stats( + async fn get_metrics( &self, - request: Request, - ) -> Result, Status> { + request: Request, + ) -> Result, Status> { let req = request.get_ref(); let dev_eui = EUI64::from_str(&req.dev_eui).map_err(|e| e.status())?; @@ -597,62 +598,313 @@ impl DeviceService for Device { let start: DateTime = start.into(); let end: DateTime = end.into(); + let aggregation = req.aggregation().from_proto(); + + let dev = device::get(&dev_eui).await.map_err(|e| e.status())?; + let dp = device_profile::get(&dev.device_profile_id) + .await + .map_err(|e| e.status())?; + + let mut out = api::GetDeviceMetricsResponse { + ..Default::default() + }; + + for (k, v) in dp.measurements.iter() { + match v.kind { + fields::MeasurementKind::UNKNOWN => { + continue; + } + fields::MeasurementKind::STRING => { + out.states.insert( + k.to_string(), + api::DeviceState { + name: v.name.to_string(), + value: metrics::get_state(&format!("device:{}:{}", dev.dev_eui, k)) + .await + .map_err(|e| e.status())?, + }, + ); + } + fields::MeasurementKind::COUNTER + | fields::MeasurementKind::ABSOLUTE + | fields::MeasurementKind::GAUGE => { + let m = metrics::get( + &format!("device:{}:{}", dev.dev_eui, k), + match v.kind { + fields::MeasurementKind::COUNTER => metrics::Kind::COUNTER, + fields::MeasurementKind::ABSOLUTE => metrics::Kind::ABSOLUTE, + fields::MeasurementKind::GAUGE => metrics::Kind::GAUGE, + _ => panic!("Unexpected MeasurementKind: {:?}", v.kind), + }, + aggregation, + start, + end, + ) + .await + .map_err(|e| e.status())?; + + out.metrics.insert( + k.to_string(), + common::Metric { + name: v.name.to_string(), + timestamps: m + .iter() + .map(|row| { + let ts: DateTime = row.time.into(); + let ts: pbjson_types::Timestamp = ts.into(); + ts + }) + .collect(), + datasets: vec![common::MetricDataset { + label: k.to_string(), + data: m + .iter() + .map(|row| { + row.metrics.get("value").cloned().unwrap_or(0.0) as f32 + }) + .collect(), + }], + }, + ); + } + } + } + + Ok(Response::new(out)) + } + + async fn get_link_metrics( + &self, + request: Request, + ) -> Result, Status> { + let req = request.get_ref(); + let dev_eui = EUI64::from_str(&req.dev_eui).map_err(|e| e.status())?; + + self.validator + .validate( + request.extensions(), + validator::ValidateDeviceAccess::new(validator::Flag::Read, dev_eui), + ) + .await?; + + let start = SystemTime::try_from( + req.start + .as_ref() + .ok_or(anyhow!("start is None")) + .map_err(|e| e.status())? + .clone(), + ) + .map_err(|e| e.status())?; + + let end = SystemTime::try_from( + req.end + .as_ref() + .ok_or(anyhow!("end is None")) + .map_err(|e| e.status())? + .clone(), + ) + .map_err(|e| e.status())?; + + let start: DateTime = start.into(); + let end: DateTime = end.into(); + let aggregation = req.aggregation().from_proto(); let device_metrics = metrics::get( &format!("device:{}", dev_eui), - metrics::Aggregation::DAY, + metrics::Kind::ABSOLUTE, + aggregation, start, end, ) .await .map_err(|e| e.status())?; - let mut out: api::GetDeviceStatsResponse = Default::default(); - - for m in device_metrics { - let ts: SystemTime = m.time.into(); - let ts: prost_types::Timestamp = ts.into(); - - let mut item = api::DeviceStats { - time: Some(ts), - ..Default::default() - }; - - item.rx_packets = m.metrics.get("rx_count").cloned().unwrap_or(0.0) as u32; - - if item.rx_packets > 0 { - let gw_rssi_sum = m.metrics.get("gw_rssi_sum").cloned().unwrap_or(0.0) as f32; - let gw_snr_sum = m.metrics.get("gw_snr_sum").cloned().unwrap_or(0.0) as f32; - - item.gw_rssi = gw_rssi_sum / (item.rx_packets as f32); - item.gw_snr = gw_snr_sum / (item.rx_packets as f32); - } - - for (k, v) in m.metrics { - if k.starts_with("rx_freq_") { - let freq: u32 = k - .trim_start_matches("rx_freq_") - .parse() - .map_err(|e: std::num::ParseIntError| e.status())?; - item.rx_packets_per_frequency.insert(freq, v as u32); + let out = api::GetDeviceLinkMetricsResponse { + rx_packets: Some(common::Metric { + name: "Received".to_string(), + timestamps: device_metrics + .iter() + .map(|row| { + let ts: DateTime = row.time.into(); + let ts: pbjson_types::Timestamp = ts.into(); + ts + }) + .collect(), + datasets: vec![common::MetricDataset { + label: "rx_count".to_string(), + data: device_metrics + .iter() + .map(|row| row.metrics.get("rx_count").cloned().unwrap_or(0.0) as f32) + .collect(), + }], + }), + gw_rssi: Some(common::Metric { + name: "RSSI".to_string(), + timestamps: device_metrics + .iter() + .map(|row| { + let ts: DateTime = row.time.into(); + let ts: pbjson_types::Timestamp = ts.into(); + ts + }) + .collect(), + datasets: vec![common::MetricDataset { + label: "rssi".to_string(), + data: device_metrics + .iter() + .map(|row| { + let rx_packets = row.metrics.get("rx_count").cloned().unwrap_or(0.0); + let rssi_sum = row.metrics.get("gw_rssi_sum").cloned().unwrap_or(0.0); + if rx_packets > 0.0 { + (rssi_sum / rx_packets) as f32 + } else { + 0.0 + } + }) + .collect(), + }], + }), + gw_snr: Some(common::Metric { + name: "SNR".to_string(), + timestamps: device_metrics + .iter() + .map(|row| { + let ts: DateTime = row.time.into(); + let ts: pbjson_types::Timestamp = ts.into(); + ts + }) + .collect(), + datasets: vec![common::MetricDataset { + label: "snr".to_string(), + data: device_metrics + .iter() + .map(|row| { + let rx_packets = row.metrics.get("rx_count").cloned().unwrap_or(0.0); + let rssi_sum = row.metrics.get("gw_snr_sum").cloned().unwrap_or(0.0); + if rx_packets > 0.0 { + (rssi_sum / rx_packets) as f32 + } else { + 0.0 + } + }) + .collect(), + }], + }), + rx_packets_per_freq: Some({ + // discover all data-sets + let mut datasets: HashSet = HashSet::new(); + for m in &device_metrics { + for k in m.metrics.keys() { + if k.starts_with("rx_freq_") { + datasets.insert(k.trim_start_matches("rx_freq_").to_string()); + } + } } - if k.starts_with("rx_dr_") { - let dr: u32 = k - .trim_start_matches("rx_dr_") - .parse() - .map_err(|e: std::num::ParseIntError| e.status())?; - item.rx_packets_per_dr.insert(dr, v as u32); + common::Metric { + name: "Received / frequency".to_string(), + timestamps: device_metrics + .iter() + .map(|row| { + let ts: DateTime = row.time.into(); + let ts: pbjson_types::Timestamp = ts.into(); + ts + }) + .collect(), + datasets: datasets + .iter() + .map(|label| common::MetricDataset { + label: label.to_string(), + data: device_metrics + .iter() + .map(|row| { + row.metrics + .get(&format!("rx_freq_{}", label)) + .cloned() + .unwrap_or(0.0) as f32 + }) + .collect(), + }) + .collect(), + } + }), + rx_packets_per_dr: Some({ + // discover all data-sets + let mut datasets: HashSet = HashSet::new(); + for m in &device_metrics { + for k in m.metrics.keys() { + if k.starts_with("rx_dr_") { + datasets.insert(k.trim_start_matches("rx_dr_").to_string()); + } + } } - if k.starts_with("error_") { - let code = k.trim_start_matches("error_").to_string(); - item.errors.insert(code, v as u32); + common::Metric { + name: "Received / DR".to_string(), + timestamps: device_metrics + .iter() + .map(|row| { + let ts: DateTime = row.time.into(); + let ts: pbjson_types::Timestamp = ts.into(); + ts + }) + .collect(), + datasets: datasets + .iter() + .map(|label| common::MetricDataset { + label: label.to_string(), + data: device_metrics + .iter() + .map(|row| { + row.metrics + .get(&format!("rx_dr_{}", label)) + .cloned() + .unwrap_or(0.0) as f32 + }) + .collect(), + }) + .collect(), + } + }), + errors: Some({ + // discover all data-sets + let mut datasets: HashSet = HashSet::new(); + for m in &device_metrics { + for k in m.metrics.keys() { + if k.starts_with("error_") { + datasets.insert(k.trim_start_matches("error_").to_string()); + } + } } - } - out.result.push(item); - } + common::Metric { + name: "Errors".to_string(), + timestamps: device_metrics + .iter() + .map(|row| { + let ts: DateTime = row.time.into(); + let ts: pbjson_types::Timestamp = ts.into(); + ts + }) + .collect(), + datasets: datasets + .iter() + .map(|label| common::MetricDataset { + label: label.to_string(), + data: device_metrics + .iter() + .map(|row| { + row.metrics + .get(&format!("error_{}", label)) + .cloned() + .unwrap_or(0.0) as f32 + }) + .collect(), + }) + .collect(), + } + }), + }; Ok(Response::new(out)) } diff --git a/chirpstack/src/api/device_profile.rs b/chirpstack/src/api/device_profile.rs index 8fec57be..45b94eba 100644 --- a/chirpstack/src/api/device_profile.rs +++ b/chirpstack/src/api/device_profile.rs @@ -70,6 +70,21 @@ impl DeviceProfileService for DeviceProfile { abp_rx2_dr: req_dp.abp_rx2_dr as i16, abp_rx2_freq: req_dp.abp_rx2_freq as i64, tags: fields::KeyValue::new(req_dp.tags.clone()), + measurements: fields::Measurements::new( + req_dp + .measurements + .iter() + .map(|(k, v)| { + ( + k.to_string(), + fields::Measurement { + name: v.name.clone(), + kind: v.kind().from_proto(), + }, + ) + }) + .collect(), + ), ..Default::default() }; @@ -124,6 +139,20 @@ impl DeviceProfileService for DeviceProfile { abp_rx2_dr: dp.abp_rx2_dr as u32, abp_rx2_freq: dp.abp_rx2_freq as u32, tags: dp.tags.into_hashmap(), + measurements: dp + .measurements + .into_hashmap() + .iter() + .map(|(k, v)| { + ( + k.to_string(), + api::Measurement { + name: v.name.clone(), + kind: v.kind.to_proto().into(), + }, + ) + }) + .collect(), }), created_at: Some(helpers::datetime_to_prost_timestamp(&dp.created_at)), updated_at: Some(helpers::datetime_to_prost_timestamp(&dp.updated_at)), @@ -176,6 +205,21 @@ impl DeviceProfileService for DeviceProfile { abp_rx2_dr: req_dp.abp_rx2_dr as i16, abp_rx2_freq: req_dp.abp_rx2_freq as i64, tags: fields::KeyValue::new(req_dp.tags.clone()), + measurements: fields::Measurements::new( + req_dp + .measurements + .iter() + .map(|(k, v)| { + ( + k.to_string(), + fields::Measurement { + name: v.name.clone(), + kind: v.kind().from_proto(), + }, + ) + }) + .collect(), + ), ..Default::default() }) .await diff --git a/chirpstack/src/api/device_profile_template.rs b/chirpstack/src/api/device_profile_template.rs index b1af4551..05393e86 100644 --- a/chirpstack/src/api/device_profile_template.rs +++ b/chirpstack/src/api/device_profile_template.rs @@ -69,6 +69,21 @@ impl DeviceProfileTemplateService for DeviceProfileTemplate { abp_rx2_dr: req_dp.abp_rx2_dr as i16, abp_rx2_freq: req_dp.abp_rx2_freq as i64, tags: fields::KeyValue::new(req_dp.tags.clone()), + measurements: fields::Measurements::new( + req_dp + .measurements + .iter() + .map(|(k, v)| { + ( + k.to_string(), + fields::Measurement { + name: v.name.clone(), + kind: v.kind().from_proto(), + }, + ) + }) + .collect(), + ), ..Default::default() }; @@ -125,6 +140,20 @@ impl DeviceProfileTemplateService for DeviceProfileTemplate { abp_rx2_dr: dp.abp_rx2_dr as u32, abp_rx2_freq: dp.abp_rx2_freq as u32, tags: dp.tags.into_hashmap(), + measurements: dp + .measurements + .into_hashmap() + .iter() + .map(|(k, v)| { + ( + k.to_string(), + api::Measurement { + name: v.name.clone(), + kind: v.kind.to_proto().into(), + }, + ) + }) + .collect(), }), created_at: Some(helpers::datetime_to_prost_timestamp(&dp.created_at)), updated_at: Some(helpers::datetime_to_prost_timestamp(&dp.updated_at)), @@ -182,6 +211,21 @@ impl DeviceProfileTemplateService for DeviceProfileTemplate { abp_rx2_dr: req_dp.abp_rx2_dr as i16, abp_rx2_freq: req_dp.abp_rx2_freq as i64, tags: fields::KeyValue::new(req_dp.tags.clone()), + measurements: fields::Measurements::new( + req_dp + .measurements + .iter() + .map(|(k, v)| { + ( + k.to_string(), + fields::Measurement { + name: v.name.clone(), + kind: v.kind().from_proto(), + }, + ) + }) + .collect(), + ), ..Default::default() }) .await diff --git a/chirpstack/src/api/gateway.rs b/chirpstack/src/api/gateway.rs index eaa2f05d..7bf7554f 100644 --- a/chirpstack/src/api/gateway.rs +++ b/chirpstack/src/api/gateway.rs @@ -1,7 +1,8 @@ +use std::collections::HashSet; use std::str::FromStr; use std::time::SystemTime; -use chrono::{DateTime, Local}; +use chrono::{DateTime, Local, Utc}; use tonic::{Request, Response, Status}; use uuid::Uuid; @@ -11,7 +12,7 @@ use lrwn::EUI64; use super::auth::validator; use super::error::ToStatus; -use super::helpers; +use super::helpers::{self, FromProto}; use crate::certificate; use crate::storage::{fields, gateway, metrics}; @@ -261,10 +262,10 @@ impl GatewayService for Gateway { )) } - async fn get_stats( + async fn get_metrics( &self, - request: Request, - ) -> Result, Status> { + request: Request, + ) -> Result, Status> { let req = request.get_ref(); let gateway_id = EUI64::from_str(&req.gateway_id).map_err(|e| e.status())?; @@ -295,71 +296,246 @@ impl GatewayService for Gateway { let start: DateTime = start.into(); let end: DateTime = end.into(); + let aggregation = req.aggregation().from_proto(); let gw_metrics = metrics::get( &format!("gw:{}", gateway_id), - metrics::Aggregation::DAY, + metrics::Kind::ABSOLUTE, + aggregation, start, end, ) .await .map_err(|e| e.status())?; - let mut out: api::GetGatewayStatsResponse = Default::default(); - - for m in gw_metrics { - let ts: SystemTime = m.time.into(); - let ts: prost_types::Timestamp = ts.into(); - - let mut item = api::GatewayStats { - time: Some(ts), - ..Default::default() - }; - - item.rx_packets = m.metrics.get("rx_count").cloned().unwrap_or(0.0) as u32; - item.tx_packets = m.metrics.get("tx_count").cloned().unwrap_or(0.0) as u32; - - for (k, v) in m.metrics { - if k.starts_with("tx_freq_") { - let freq: u32 = k - .trim_start_matches("tx_freq_") - .parse() - .map_err(|e: std::num::ParseIntError| e.status())?; - item.tx_packets_per_frequency.insert(freq, v as u32); + let out = api::GetGatewayMetricsResponse { + rx_packets: Some(common::Metric { + name: "Received".to_string(), + timestamps: gw_metrics + .iter() + .map(|row| { + let ts: DateTime = row.time.into(); + let ts: pbjson_types::Timestamp = ts.into(); + ts + }) + .collect(), + datasets: vec![common::MetricDataset { + label: "rx_count".to_string(), + data: gw_metrics + .iter() + .map(|row| row.metrics.get("rx_count").cloned().unwrap_or(0.0) as f32) + .collect(), + }], + }), + tx_packets: Some(common::Metric { + name: "Transmitted".to_string(), + timestamps: gw_metrics + .iter() + .map(|row| { + let ts: DateTime = row.time.into(); + let ts: pbjson_types::Timestamp = ts.into(); + ts + }) + .collect(), + datasets: vec![common::MetricDataset { + label: "tx_count".to_string(), + data: gw_metrics + .iter() + .map(|row| row.metrics.get("tx_count").cloned().unwrap_or(0.0) as f32) + .collect(), + }], + }), + tx_packets_per_freq: Some({ + // discover all data-sets + let mut datasets: HashSet = HashSet::new(); + for m in &gw_metrics { + for k in m.metrics.keys() { + if k.starts_with("tx_freq_") { + datasets.insert(k.trim_start_matches("tx_freq_").to_string()); + } + } } - if k.starts_with("rx_freq_") { - let freq: u32 = k - .trim_start_matches("rx_freq_") - .parse() - .map_err(|e: std::num::ParseIntError| e.status())?; - item.rx_packets_per_frequency.insert(freq, v as u32); + common::Metric { + name: "Transmitted / frequency".to_string(), + timestamps: gw_metrics + .iter() + .map(|row| { + let ts: DateTime = row.time.into(); + let ts: pbjson_types::Timestamp = ts.into(); + ts + }) + .collect(), + datasets: datasets + .iter() + .map(|label| common::MetricDataset { + label: label.to_string(), + data: gw_metrics + .iter() + .map(|row| { + row.metrics + .get(&format!("tx_freq_{}", label)) + .cloned() + .unwrap_or(0.0) as f32 + }) + .collect(), + }) + .collect(), + } + }), + rx_packets_per_freq: Some({ + // discover all data-sets + let mut datasets: HashSet = HashSet::new(); + for m in &gw_metrics { + for k in m.metrics.keys() { + if k.starts_with("rx_freq_") { + datasets.insert(k.trim_start_matches("rx_freq_").to_string()); + } + } } - if k.starts_with("tx_status_") { - let code = k.trim_start_matches("tx_status_").to_string(); - item.tx_packets_per_status.insert(code, v as u32); + common::Metric { + name: "Received / frequency".to_string(), + timestamps: gw_metrics + .iter() + .map(|row| { + let ts: DateTime = row.time.into(); + let ts: pbjson_types::Timestamp = ts.into(); + ts + }) + .collect(), + datasets: datasets + .iter() + .map(|label| common::MetricDataset { + label: label.to_string(), + data: gw_metrics + .iter() + .map(|row| { + row.metrics + .get(&format!("rx_freq_{}", label)) + .cloned() + .unwrap_or(0.0) as f32 + }) + .collect(), + }) + .collect(), + } + }), + rx_packets_per_dr: Some({ + // discover all data-sets + let mut datasets: HashSet = HashSet::new(); + for m in &gw_metrics { + for k in m.metrics.keys() { + if k.starts_with("rx_dr_") { + datasets.insert(k.trim_start_matches("rx_dr_").to_string()); + } + } } - if k.starts_with("tx_dr_") { - let dr: u32 = k - .trim_start_matches("tx_dr_") - .parse() - .map_err(|e: std::num::ParseIntError| e.status())?; - item.tx_packets_per_dr.insert(dr, v as u32); + common::Metric { + name: "Received / DR".to_string(), + timestamps: gw_metrics + .iter() + .map(|row| { + let ts: DateTime = row.time.into(); + let ts: pbjson_types::Timestamp = ts.into(); + ts + }) + .collect(), + datasets: datasets + .iter() + .map(|label| common::MetricDataset { + label: label.to_string(), + data: gw_metrics + .iter() + .map(|row| { + row.metrics + .get(&format!("rx_dr_{}", label)) + .cloned() + .unwrap_or(0.0) as f32 + }) + .collect(), + }) + .collect(), + } + }), + tx_packets_per_dr: Some({ + // discover all data-sets + let mut datasets: HashSet = HashSet::new(); + for m in &gw_metrics { + for k in m.metrics.keys() { + if k.starts_with("tx_dr_") { + datasets.insert(k.trim_start_matches("tx_dr_").to_string()); + } + } } - if k.starts_with("rx_dr_") { - let dr: u32 = k - .trim_start_matches("rx_dr_") - .parse() - .map_err(|e: std::num::ParseIntError| e.status())?; - item.rx_packets_per_dr.insert(dr, v as u32); + common::Metric { + name: "Transmitted / DR".to_string(), + timestamps: gw_metrics + .iter() + .map(|row| { + let ts: DateTime = row.time.into(); + let ts: pbjson_types::Timestamp = ts.into(); + ts + }) + .collect(), + datasets: datasets + .iter() + .map(|label| common::MetricDataset { + label: label.to_string(), + data: gw_metrics + .iter() + .map(|row| { + row.metrics + .get(&format!("tx_dr_{}", label)) + .cloned() + .unwrap_or(0.0) as f32 + }) + .collect(), + }) + .collect(), + } + }), + tx_packets_per_status: Some({ + // discover all data-sets + let mut datasets: HashSet = HashSet::new(); + for m in &gw_metrics { + for k in m.metrics.keys() { + if k.starts_with("tx_status_") { + datasets.insert(k.trim_start_matches("tx_status_").to_string()); + } + } } - } - out.result.push(item); - } + common::Metric { + name: "TX packets / status".to_string(), + timestamps: gw_metrics + .iter() + .map(|row| { + let ts: DateTime = row.time.into(); + let ts: pbjson_types::Timestamp = ts.into(); + ts + }) + .collect(), + datasets: datasets + .iter() + .map(|label| common::MetricDataset { + label: label.to_string(), + data: gw_metrics + .iter() + .map(|row| { + row.metrics + .get(&format!("tx_status_{}", label)) + .cloned() + .unwrap_or(0.0) as f32 + }) + .collect(), + }) + .collect(), + } + }), + }; Ok(Response::new(out)) } @@ -558,6 +734,7 @@ pub mod test { // insert stats let mut m = metrics::Record { + kind: metrics::Kind::ABSOLUTE, time: now.into(), metrics: HashMap::new(), }; @@ -577,36 +754,35 @@ pub mod test { // request stats let now_st: SystemTime = now.into(); - let stats_req = api::GetGatewayStatsRequest { + let stats_req = api::GetGatewayMetricsRequest { gateway_id: "0102030405060708".into(), start: Some(now_st.into()), end: Some(now_st.into()), + aggregation: common::Aggregation::Day.into(), }; let mut stats_req = Request::new(stats_req); stats_req .extensions_mut() .insert(AuthID::User(u.id.clone())); - let stats_resp = service.get_stats(stats_req).await.unwrap(); + let stats_resp = service.get_metrics(stats_req).await.unwrap(); let stats_resp = stats_resp.get_ref(); - assert_eq!(1, stats_resp.result.len()); assert_eq!( - api::GatewayStats { - time: Some({ + Some(common::Metric { + name: "Received".to_string(), + timestamps: vec![{ let ts = Local .ymd(now.year(), now.month(), now.day()) .and_hms(0, 0, 0); - let ts: SystemTime = ts.into(); + //let ts: SystemTime = ts.into(); + let ts: DateTime = ts.into(); ts.into() - }), - rx_packets: 10, - tx_packets: 5, - rx_packets_per_frequency: [(868100000, 10)].iter().cloned().collect(), - rx_packets_per_dr: [(5, 10)].iter().cloned().collect(), - tx_packets_per_frequency: [(868200000, 5)].iter().cloned().collect(), - tx_packets_per_dr: [(4, 5)].iter().cloned().collect(), - ..Default::default() - }, - stats_resp.result[0] + }], + datasets: vec![common::MetricDataset { + label: "rx_count".to_string(), + data: vec![10.0], + }], + }), + stats_resp.rx_packets ); } } diff --git a/chirpstack/src/api/helpers.rs b/chirpstack/src/api/helpers.rs index 381cc703..36dff698 100644 --- a/chirpstack/src/api/helpers.rs +++ b/chirpstack/src/api/helpers.rs @@ -1,6 +1,8 @@ use chrono::{DateTime, Utc}; use crate::codec::Codec; +use crate::storage::fields::MeasurementKind; +use crate::storage::metrics::Aggregation; use chirpstack_api::{api, common}; use lrwn::region::{CommonName, MacVersion, Revision}; @@ -140,6 +142,50 @@ impl FromProto for api::CodecRuntime { } } +impl ToProto for MeasurementKind { + fn to_proto(self) -> api::MeasurementKind { + match self { + MeasurementKind::UNKNOWN => api::MeasurementKind::Unknown, + MeasurementKind::COUNTER => api::MeasurementKind::Counter, + MeasurementKind::ABSOLUTE => api::MeasurementKind::Absolute, + MeasurementKind::GAUGE => api::MeasurementKind::Gauge, + MeasurementKind::STRING => api::MeasurementKind::String, + } + } +} + +impl FromProto for api::MeasurementKind { + fn from_proto(self) -> MeasurementKind { + match self { + api::MeasurementKind::Unknown => MeasurementKind::UNKNOWN, + api::MeasurementKind::Counter => MeasurementKind::COUNTER, + api::MeasurementKind::Absolute => MeasurementKind::ABSOLUTE, + api::MeasurementKind::Gauge => MeasurementKind::GAUGE, + api::MeasurementKind::String => MeasurementKind::STRING, + } + } +} + +impl ToProto for Aggregation { + fn to_proto(self) -> common::Aggregation { + match self { + Aggregation::HOUR => common::Aggregation::Hour, + Aggregation::DAY => common::Aggregation::Day, + Aggregation::MONTH => common::Aggregation::Month, + } + } +} + +impl FromProto for common::Aggregation { + fn from_proto(self) -> Aggregation { + match self { + common::Aggregation::Hour => Aggregation::HOUR, + common::Aggregation::Day => Aggregation::DAY, + common::Aggregation::Month => Aggregation::MONTH, + } + } +} + pub fn datetime_to_prost_timestamp(dt: &DateTime) -> prost_types::Timestamp { let ts = dt.timestamp_nanos(); diff --git a/chirpstack/src/codec/mod.rs b/chirpstack/src/codec/mod.rs index e7d7dea5..495ec23e 100644 --- a/chirpstack/src/codec/mod.rs +++ b/chirpstack/src/codec/mod.rs @@ -95,3 +95,84 @@ pub async fn struct_to_binary( .context("JavaScript encoder")?, }) } + +/* +pub fn get_data_keys(s: &pbjson_types::Struct) -> Vec { + let mut out: Vec = Vec::new(); + + for (k, v) in &s.fields { + out.extend_from_slice(&_get_data_keys(k, v)); + } + + out +} + +fn _get_data_keys(prefix: &str, v: &pbjson_types::Value) -> Vec { + match &v.kind { + None => vec![prefix.to_string()], + Some(v) => match v { + pbjson_types::value::Kind::NullValue(_) + | pbjson_types::value::Kind::NumberValue(_) + | pbjson_types::value::Kind::StringValue(_) + | pbjson_types::value::Kind::BoolValue(_) => { + vec![prefix.to_string()] + } + pbjson_types::value::Kind::StructValue(v) => { + let mut out: Vec = Vec::new(); + for (k, v) in &v.fields { + out.extend_from_slice(&_get_data_keys(&format!("{}_{}", prefix, k), v)); + } + out + } + pbjson_types::value::Kind::ListValue(v) => { + let mut out: Vec = Vec::new(); + for (i, v) in v.values.iter().enumerate() { + out.extend_from_slice(&_get_data_keys(&format!("{}_{}", prefix, i), v)); + } + out + } + }, + } +} +*/ + +pub fn get_measurements(s: &pbjson_types::Struct) -> HashMap { + let mut out: HashMap = HashMap::new(); + + for (k, v) in &s.fields { + out.extend(_get_measurements(k, v)); + } + + out +} + +fn _get_measurements( + prefix: &str, + v: &pbjson_types::Value, +) -> HashMap { + let mut out: HashMap = HashMap::new(); + + match &v.kind { + None => {} + Some(v) => match v { + pbjson_types::value::Kind::NullValue(_) => {} + pbjson_types::value::Kind::NumberValue(_) + | pbjson_types::value::Kind::StringValue(_) + | pbjson_types::value::Kind::BoolValue(_) => { + out.insert(prefix.to_string(), v.clone()); + } + pbjson_types::value::Kind::StructValue(v) => { + for (k, v) in &v.fields { + out.extend(_get_measurements(&format!("{}_{}", prefix, k), v)); + } + } + pbjson_types::value::Kind::ListValue(v) => { + for (i, v) in v.values.iter().enumerate() { + out.extend(_get_measurements(&format!("{}_{}", prefix, i), v)); + } + } + }, + } + + out +} diff --git a/chirpstack/src/storage/device_profile.rs b/chirpstack/src/storage/device_profile.rs index 82ad8121..684dd949 100644 --- a/chirpstack/src/storage/device_profile.rs +++ b/chirpstack/src/storage/device_profile.rs @@ -47,6 +47,7 @@ pub struct DeviceProfile { pub payload_codec_script: String, pub flush_queue_on_activate: bool, pub description: String, + pub measurements: fields::Measurements, } impl DeviceProfile { @@ -91,6 +92,7 @@ impl Default for DeviceProfile { abp_rx2_dr: 0, abp_rx2_freq: 0, tags: fields::KeyValue::new(HashMap::new()), + measurements: fields::Measurements::new(HashMap::new()), } } } @@ -204,6 +206,7 @@ pub async fn update(dp: DeviceProfile) -> Result { device_profile::abp_rx2_dr.eq(&dp.abp_rx2_dr), device_profile::abp_rx2_freq.eq(&dp.abp_rx2_freq), device_profile::tags.eq(&dp.tags), + device_profile::measurements.eq(&dp.measurements), )) .get_result(&c) .map_err(|e| error::Error::from_diesel(e, dp.id.to_string())) @@ -214,6 +217,22 @@ pub async fn update(dp: DeviceProfile) -> Result { Ok(dp) } +pub async fn set_measurements(id: Uuid, m: &fields::Measurements) -> Result { + let dp = task::spawn_blocking({ + let m = m.clone(); + move || -> Result { + let c = get_db_conn()?; + diesel::update(device_profile::dsl::device_profile.find(&id)) + .set(device_profile::measurements.eq(m)) + .get_result(&c) + .map_err(|e| Error::from_diesel(e, id.to_string())) + } + }) + .await??; + info!(id = %id, "Device-profile measurements updated"); + Ok(dp) +} + pub async fn delete(id: &Uuid) -> Result<(), Error> { task::spawn_blocking({ let id = *id; diff --git a/chirpstack/src/storage/device_profile_template.rs b/chirpstack/src/storage/device_profile_template.rs index 402a5787..846be6fa 100644 --- a/chirpstack/src/storage/device_profile_template.rs +++ b/chirpstack/src/storage/device_profile_template.rs @@ -47,6 +47,7 @@ pub struct DeviceProfileTemplate { pub abp_rx2_dr: i16, pub abp_rx2_freq: i64, pub tags: fields::KeyValue, + pub measurements: fields::Measurements, } impl DeviceProfileTemplate { @@ -108,6 +109,7 @@ impl Default for DeviceProfileTemplate { abp_rx2_dr: 0, abp_rx2_freq: 0, tags: fields::KeyValue::new(HashMap::new()), + measurements: fields::Measurements::new(HashMap::new()), } } } @@ -184,6 +186,7 @@ pub async fn upsert(dp: DeviceProfileTemplate) -> Result for KeyValue { >::to_sql(&value, out) } } + +#[derive(Debug, Clone, AsExpression, FromSqlRow, PartialEq)] +#[sql_type = "Jsonb"] +pub struct Measurements(HashMap); + +impl Measurements { + pub fn new(m: HashMap) -> Self { + Measurements(m) + } + + #[allow(clippy::wrong_self_convention)] + pub fn into_hashmap(&self) -> HashMap { + self.0.clone() + } +} + +impl Deref for Measurements { + type Target = HashMap; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl DerefMut for Measurements { + fn deref_mut(&mut self) -> &mut HashMap { + &mut self.0 + } +} + +impl deserialize::FromSql for Measurements { + fn from_sql(bytes: Option<&[u8]>) -> deserialize::Result { + let value = >::from_sql(bytes)?; + let kv: HashMap = serde_json::from_value(value)?; + Ok(Measurements::new(kv)) + } +} + +impl serialize::ToSql for Measurements { + fn to_sql(&self, out: &mut serialize::Output) -> serialize::Result { + let value = serde_json::to_value(&self.0)?; + >::to_sql(&value, out) + } +} + +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +pub struct Measurement { + pub name: String, + pub kind: MeasurementKind, +} + +#[allow(clippy::upper_case_acronyms)] +#[allow(non_camel_case_types)] +#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq)] +pub enum MeasurementKind { + // Unknown. + UNKNOWN, + // Incrementing counters which are not reset on each reporting. + COUNTER, + // Counters that do get reset upon reading. + ABSOLUTE, + // E.g. a temperature value. + GAUGE, + // E.g. a firmware version, true / false value. + STRING, +} diff --git a/chirpstack/src/storage/metrics.rs b/chirpstack/src/storage/metrics.rs index 798364f2..664b7375 100644 --- a/chirpstack/src/storage/metrics.rs +++ b/chirpstack/src/storage/metrics.rs @@ -25,9 +25,25 @@ impl fmt::Display for Aggregation { } } +#[allow(clippy::upper_case_acronyms)] +#[allow(non_camel_case_types)] +#[derive(Deserialize, Serialize, Copy, Clone, Debug, Eq, PartialEq)] +pub enum Kind { + COUNTER, + ABSOLUTE, + GAUGE, +} + +impl fmt::Display for Kind { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{:?}", self) + } +} + #[derive(Debug, PartialEq, Clone)] pub struct Record { pub time: DateTime, + pub kind: Kind, pub metrics: HashMap, } @@ -52,6 +68,29 @@ fn get_key(name: &str, a: Aggregation, dt: DateTime) -> String { )) } +pub async fn save_state(name: &str, state: &str) -> Result<()> { + task::spawn_blocking({ + let key = redis_key(format!("metrics:{{{}}}", name)); + let state = state.to_string(); + let ttl = get_ttl(Aggregation::MONTH); + + move || -> Result<()> { + let mut c = get_redis_conn()?; + redis::cmd("PSETEX") + .arg(key) + .arg(ttl.as_millis() as usize) + .arg(state) + .query(&mut *c)?; + + Ok(()) + } + }) + .await??; + + info!(state = %state, "State saved"); + Ok(()) +} + pub async fn save(name: &str, record: &Record) -> Result<()> { for a in get_aggregations() { save_for_interval(a, name, record).await?; @@ -92,7 +131,23 @@ async fn save_for_interval(a: Aggregation, name: &str, record: &Record) -> Resul // Passing a reference to hincr will return a runtime error. let k = k.clone(); let v = *v; - pipe.cmd("HINCRBYFLOAT").arg(&key).arg(k).arg(v).ignore(); + + match record.kind { + Kind::COUNTER => { + pipe.cmd("HSET").arg(&key).arg(k).arg(v).ignore(); + } + Kind::ABSOLUTE => { + pipe.cmd("HINCRBYFLOAT").arg(&key).arg(k).arg(v).ignore(); + } + Kind::GAUGE => { + pipe.cmd("HINCRBYFLOAT") + .arg(&key) + .arg(format!("_{}_count", k)) + .arg(1.0) + .ignore(); + pipe.cmd("HINCRBYFLOAT").arg(&key).arg(k).arg(v).ignore(); + } + } } pipe.cmd("PEXPIRE") @@ -110,8 +165,21 @@ async fn save_for_interval(a: Aggregation, name: &str, record: &Record) -> Resul Ok(()) } +pub async fn get_state(name: &str) -> Result { + task::spawn_blocking({ + let key = redis_key(format!("metrics:{{{}}}", name)); + move || -> Result { + let mut c = get_redis_conn()?; + let v: Option = redis::cmd("GET").arg(key).query(&mut *c)?; + Ok(v.unwrap_or_default()) + } + }) + .await? +} + pub async fn get( name: &str, + kind: Kind, a: Aggregation, start: DateTime, end: DateTime, @@ -184,9 +252,33 @@ pub async fn get( let mut out: Vec = Vec::new(); for (i, r) in res.iter().enumerate() { + let mut metrics = r.clone(); + + // In case of GAUGE values, the total aggregated value must be divided by the + // number of measurements. + if kind == Kind::GAUGE { + let counts: HashMap = r + .iter() + .filter(|(k, _)| k.starts_with('_') && k.ends_with("_count")) + .map(|(k, v)| (k.to_string(), *v)) + .collect(); + + for (k, count) in counts { + let k = k.strip_prefix('_').unwrap().strip_suffix("_count").unwrap(); + if let Some(v) = metrics.get_mut(k) { + *v /= count; + } + } + } + out.push(Record { time: timestamps[i], - metrics: r.clone(), + kind, + metrics: metrics + .iter() + .filter(|(k, _)| !k.starts_with('_')) + .map(|(k, v)| (k.to_string(), *v)) + .collect(), }); } @@ -208,6 +300,7 @@ pub mod test { let records = vec![ Record { time: Local.ymd(2018, 1, 1).and_hms(1, 1, 0), + kind: Kind::ABSOLUTE, metrics: [("foo".into(), 1f64), ("bar".into(), 2f64)] .iter() .cloned() @@ -215,6 +308,7 @@ pub mod test { }, Record { time: Local.ymd(2018, 1, 1).and_hms(1, 2, 0), + kind: Kind::ABSOLUTE, metrics: [("foo".into(), 3f64), ("bar".into(), 4f64)] .iter() .cloned() @@ -222,6 +316,7 @@ pub mod test { }, Record { time: Local.ymd(2018, 1, 1).and_hms(2, 1, 0), + kind: Kind::ABSOLUTE, metrics: [("foo".into(), 5f64), ("bar".into(), 6f64)] .iter() .cloned() @@ -236,6 +331,7 @@ pub mod test { let resp = get( "test", + Kind::ABSOLUTE, Aggregation::HOUR, Local.ymd(2018, 1, 1).and_hms(1, 0, 0), Local.ymd(2018, 1, 1).and_hms(2, 0, 0), @@ -247,6 +343,7 @@ pub mod test { vec![ Record { time: Local.ymd(2018, 1, 1).and_hms(1, 0, 0), + kind: Kind::ABSOLUTE, metrics: [("foo".into(), 4f64), ("bar".into(), 6f64)] .iter() .cloned() @@ -254,6 +351,7 @@ pub mod test { }, Record { time: Local.ymd(2018, 1, 1).and_hms(2, 0, 0), + kind: Kind::ABSOLUTE, metrics: [("foo".into(), 5f64), ("bar".into(), 6f64)] .iter() .cloned() @@ -271,6 +369,7 @@ pub mod test { let records = vec![ Record { time: Local.ymd(2018, 1, 1).and_hms(1, 0, 0), + kind: Kind::ABSOLUTE, metrics: [("foo".into(), 1f64), ("bar".into(), 2f64)] .iter() .cloned() @@ -278,6 +377,7 @@ pub mod test { }, Record { time: Local.ymd(2018, 1, 1).and_hms(2, 0, 0), + kind: Kind::ABSOLUTE, metrics: [("foo".into(), 3f64), ("bar".into(), 4f64)] .iter() .cloned() @@ -285,6 +385,7 @@ pub mod test { }, Record { time: Local.ymd(2018, 1, 2).and_hms(1, 0, 0), + kind: Kind::ABSOLUTE, metrics: [("foo".into(), 5f64), ("bar".into(), 6f64)] .iter() .cloned() @@ -299,6 +400,7 @@ pub mod test { let resp = get( "test", + Kind::ABSOLUTE, Aggregation::DAY, Local.ymd(2018, 1, 1).and_hms(1, 0, 0), Local.ymd(2018, 1, 2).and_hms(1, 0, 0), @@ -310,6 +412,7 @@ pub mod test { vec![ Record { time: Local.ymd(2018, 1, 1).and_hms(0, 0, 0), + kind: Kind::ABSOLUTE, metrics: [("foo".into(), 4f64), ("bar".into(), 6f64)] .iter() .cloned() @@ -317,6 +420,7 @@ pub mod test { }, Record { time: Local.ymd(2018, 1, 2).and_hms(0, 0, 0), + kind: Kind::ABSOLUTE, metrics: [("foo".into(), 5f64), ("bar".into(), 6f64)] .iter() .cloned() @@ -334,6 +438,7 @@ pub mod test { let records = vec![ Record { time: Local.ymd(2018, 1, 1).and_hms(0, 0, 0), + kind: Kind::ABSOLUTE, metrics: [("foo".into(), 1f64), ("bar".into(), 2f64)] .iter() .cloned() @@ -341,6 +446,7 @@ pub mod test { }, Record { time: Local.ymd(2018, 1, 2).and_hms(0, 0, 0), + kind: Kind::ABSOLUTE, metrics: [("foo".into(), 3f64), ("bar".into(), 4f64)] .iter() .cloned() @@ -348,6 +454,7 @@ pub mod test { }, Record { time: Local.ymd(2018, 2, 1).and_hms(0, 0, 0), + kind: Kind::ABSOLUTE, metrics: [("foo".into(), 5f64), ("bar".into(), 6f64)] .iter() .cloned() @@ -362,6 +469,7 @@ pub mod test { let resp = get( "test", + Kind::ABSOLUTE, Aggregation::MONTH, Local.ymd(2018, 1, 1).and_hms(0, 0, 0), Local.ymd(2018, 2, 1).and_hms(0, 0, 0), @@ -373,6 +481,7 @@ pub mod test { vec![ Record { time: Local.ymd(2018, 1, 1).and_hms(0, 0, 0), + kind: Kind::ABSOLUTE, metrics: [("foo".into(), 4f64), ("bar".into(), 6f64)] .iter() .cloned() @@ -380,6 +489,7 @@ pub mod test { }, Record { time: Local.ymd(2018, 2, 1).and_hms(0, 0, 0), + kind: Kind::ABSOLUTE, metrics: [("foo".into(), 5f64), ("bar".into(), 6f64)] .iter() .cloned() @@ -389,4 +499,157 @@ pub mod test { resp ); } + + #[tokio::test] + async fn test_counter() { + let _guard = test::prepare().await; + + let records = vec![ + Record { + time: Local.ymd(2018, 1, 1).and_hms(1, 1, 0), + kind: Kind::COUNTER, + metrics: [("foo".into(), 1.0), ("bar".into(), 2.0)] + .iter() + .cloned() + .collect(), + }, + Record { + time: Local.ymd(2018, 1, 1).and_hms(1, 2, 0), + kind: Kind::COUNTER, + metrics: [("foo".into(), 2.0), ("bar".into(), 4.0)] + .iter() + .cloned() + .collect(), + }, + ]; + for r in &records { + save_for_interval(Aggregation::HOUR, "test", r) + .await + .unwrap(); + } + + let resp = get( + "test", + Kind::COUNTER, + Aggregation::HOUR, + Local.ymd(2018, 1, 1).and_hms(1, 0, 0), + Local.ymd(2018, 1, 1).and_hms(1, 0, 0), + ) + .await + .unwrap(); + + assert_eq!( + vec![Record { + time: Local.ymd(2018, 1, 1).and_hms(1, 0, 0), + kind: Kind::COUNTER, + metrics: [("foo".into(), 2.0), ("bar".into(), 4.0)] + .iter() + .cloned() + .collect(), + },], + resp + ); + } + + #[tokio::test] + async fn test_absolute() { + let _guard = test::prepare().await; + + let records = vec![ + Record { + time: Local.ymd(2018, 1, 1).and_hms(1, 1, 0), + kind: Kind::ABSOLUTE, + metrics: [("foo".into(), 1.0), ("bar".into(), 2.0)] + .iter() + .cloned() + .collect(), + }, + Record { + time: Local.ymd(2018, 1, 1).and_hms(1, 2, 0), + kind: Kind::ABSOLUTE, + metrics: [("foo".into(), 2.0), ("bar".into(), 4.0)] + .iter() + .cloned() + .collect(), + }, + ]; + for r in &records { + save_for_interval(Aggregation::HOUR, "test", r) + .await + .unwrap(); + } + + let resp = get( + "test", + Kind::ABSOLUTE, + Aggregation::HOUR, + Local.ymd(2018, 1, 1).and_hms(1, 0, 0), + Local.ymd(2018, 1, 1).and_hms(1, 0, 0), + ) + .await + .unwrap(); + + assert_eq!( + vec![Record { + time: Local.ymd(2018, 1, 1).and_hms(1, 0, 0), + kind: Kind::ABSOLUTE, + metrics: [("foo".into(), 3.0), ("bar".into(), 6.0)] + .iter() + .cloned() + .collect(), + },], + resp + ); + } + + #[tokio::test] + async fn test_gauge() { + let _guard = test::prepare().await; + + let records = vec![ + Record { + time: Local.ymd(2018, 1, 1).and_hms(1, 1, 0), + kind: Kind::GAUGE, + metrics: [("foo".into(), 1.0), ("bar".into(), 2.0)] + .iter() + .cloned() + .collect(), + }, + Record { + time: Local.ymd(2018, 1, 1).and_hms(1, 2, 0), + kind: Kind::GAUGE, + metrics: [("foo".into(), 2.0), ("bar".into(), 4.0)] + .iter() + .cloned() + .collect(), + }, + ]; + for r in &records { + save_for_interval(Aggregation::HOUR, "test", r) + .await + .unwrap(); + } + + let resp = get( + "test", + Kind::GAUGE, + Aggregation::HOUR, + Local.ymd(2018, 1, 1).and_hms(1, 0, 0), + Local.ymd(2018, 1, 1).and_hms(1, 0, 0), + ) + .await + .unwrap(); + + assert_eq!( + vec![Record { + time: Local.ymd(2018, 1, 1).and_hms(1, 0, 0), + kind: Kind::GAUGE, + metrics: [("foo".into(), 1.5), ("bar".into(), 3.0)] + .iter() + .cloned() + .collect(), + },], + resp + ); + } } diff --git a/chirpstack/src/storage/schema.rs b/chirpstack/src/storage/schema.rs index 70eff91d..3a832df8 100644 --- a/chirpstack/src/storage/schema.rs +++ b/chirpstack/src/storage/schema.rs @@ -99,6 +99,7 @@ table! { payload_codec_script -> Text, flush_queue_on_activate -> Bool, description -> Text, + measurements -> Jsonb, } } @@ -133,6 +134,7 @@ table! { abp_rx2_dr -> Int2, abp_rx2_freq -> Int8, tags -> Jsonb, + measurements -> Jsonb, } } diff --git a/chirpstack/src/uplink/data.rs b/chirpstack/src/uplink/data.rs index 95362e0e..7a8a7228 100644 --- a/chirpstack/src/uplink/data.rs +++ b/chirpstack/src/uplink/data.rs @@ -8,8 +8,8 @@ use super::error::Error; use super::{filter_rx_info_by_tenant_id, helpers, UplinkFrameSet}; use crate::storage::error::Error as StorageError; use crate::storage::{ - application, device, device_gateway, device_profile, device_queue, device_session, metrics, - tenant, + application, device, device_gateway, device_profile, device_queue, device_session, fields, + metrics, tenant, }; use crate::{codec, config, downlink, framelog, integration, maccommand}; use chirpstack_api::{api, common, integration as integration_pb, internal}; @@ -28,6 +28,7 @@ pub struct Data { application: Option, device_info: Option, mac_payload: Option, + uplink_event: Option, must_send_downlink: bool, downlink_mac_commands: Vec, device_gateway_rx_info: Option, @@ -62,6 +63,7 @@ impl Data { application: None, device_info: None, mac_payload: None, + uplink_event: None, must_send_downlink: false, downlink_mac_commands: Vec::new(), device_gateway_rx_info: None, @@ -91,6 +93,7 @@ impl Data { ctx.save_device_gateway_rx_info().await?; ctx.append_meta_data_to_uplink_history()?; ctx.send_uplink_event().await?; + ctx.detect_and_save_measurements().await?; ctx.sync_uplink_f_cnt()?; ctx.set_region_name()?; ctx.save_device_session().await?; @@ -562,7 +565,7 @@ impl Data { Ok(()) } - async fn send_uplink_event(&self) -> Result<()> { + async fn send_uplink_event(&mut self) -> Result<()> { trace!("Sending uplink event"); let ts: DateTime = @@ -624,6 +627,86 @@ impl Data { integration::uplink_event(&app.id, &dev.variables, &pl).await?; + self.uplink_event = Some(pl); + + Ok(()) + } + + async fn detect_and_save_measurements(&mut self) -> Result<()> { + trace!("Detecing and saving measurements"); + + let dp = self.device_profile.as_ref().unwrap(); + let up_event = self.uplink_event.as_ref().unwrap(); + let dev = self.device.as_ref().unwrap(); + + let data_measurements: HashMap = match &up_event.object { + None => HashMap::new(), + Some(v) => codec::get_measurements(v), + }; + + let mut measurements = dp.measurements.clone(); + let mut update_dp_measurements = false; + + for (k, v) in data_measurements { + if let Some(dp_m) = measurements.get(&k) { + if dp_m.kind == fields::MeasurementKind::UNKNOWN { + continue; + } + + // Only Number, String and BoolValues are expected. + match v { + pbjson_types::value::Kind::NumberValue(v) => { + let record = metrics::Record { + time: DateTime::::try_from( + up_event.time.as_ref().unwrap().clone(), + )? + .with_timezone(&Local), + kind: match dp_m.kind { + fields::MeasurementKind::COUNTER => metrics::Kind::COUNTER, + fields::MeasurementKind::ABSOLUTE => metrics::Kind::ABSOLUTE, + fields::MeasurementKind::GAUGE => metrics::Kind::GAUGE, + _ => { + continue; + } + }, + metrics: [("value".to_string(), v)].iter().cloned().collect(), + }; + + metrics::save(&format!("device:{}:{}", dev.dev_eui, k), &record).await?; + } + pbjson_types::value::Kind::StringValue(v) => { + metrics::save_state( + &format!("device:{}:{}", dev.dev_eui, k), + &v.to_string(), + ) + .await?; + } + pbjson_types::value::Kind::BoolValue(v) => { + metrics::save_state( + &format!("device:{}:{}", dev.dev_eui, k), + &format!("{}", v), + ) + .await?; + } + _ => {} + } + } else { + update_dp_measurements = true; + measurements.insert( + k.clone(), + fields::Measurement { + kind: fields::MeasurementKind::UNKNOWN, + name: "".to_string(), + }, + ); + } + } + + if update_dp_measurements { + self.device_profile = + Some(device_profile::set_measurements(dp.id, &measurements).await?); + } + Ok(()) } @@ -732,6 +815,7 @@ impl Data { let mut record = metrics::Record { time: Local::now(), + kind: metrics::Kind::ABSOLUTE, metrics: HashMap::new(), }; diff --git a/chirpstack/src/uplink/join.rs b/chirpstack/src/uplink/join.rs index 520bb203..ef6483ca 100644 --- a/chirpstack/src/uplink/join.rs +++ b/chirpstack/src/uplink/join.rs @@ -250,6 +250,7 @@ impl JoinRequest { &format!("device:{}", dev.dev_eui), &metrics::Record { time: Local::now(), + kind: metrics::Kind::ABSOLUTE, metrics: [("error_OTAA".into(), 1f64)].iter().cloned().collect(), }, ) @@ -299,6 +300,7 @@ impl JoinRequest { &format!("device:{}", dev.dev_eui), &metrics::Record { time: Local::now(), + kind: metrics::Kind::ABSOLUTE, metrics: [("error_UPLINK_MIC".into(), 1f64)] .iter() .cloned() diff --git a/chirpstack/src/uplink/stats.rs b/chirpstack/src/uplink/stats.rs index 0f1c7a1e..9d67c1cb 100644 --- a/chirpstack/src/uplink/stats.rs +++ b/chirpstack/src/uplink/stats.rs @@ -83,6 +83,7 @@ impl Stats { Some(v) => DateTime::try_from(v.clone())?.into(), None => Local::now(), }, + kind: metrics::Kind::ABSOLUTE, metrics: HashMap::new(), }; diff --git a/ui/package.json b/ui/package.json index 80dcbc5e..9969e7d2 100644 --- a/ui/package.json +++ b/ui/package.json @@ -47,7 +47,7 @@ "test": "react-scripts test", "eject": "react-scripts eject", "lint": "prettier --check .", - "format": "prettier --write . && git add -A ." + "format": "prettier --write ." }, "husky": { "hooks": { diff --git a/ui/src/components/MetricBar.tsx b/ui/src/components/MetricBar.tsx new file mode 100644 index 00000000..7de7408d --- /dev/null +++ b/ui/src/components/MetricBar.tsx @@ -0,0 +1,98 @@ +import React, { Component } from "react"; + +import { Card, Empty } from "antd"; + +import { TimeUnit } from "chart.js"; +import { Bar } from "react-chartjs-2"; +import moment from "moment"; + +import { Metric, Aggregation } from "@chirpstack/chirpstack-api-grpc-web/common/common_pb"; + +interface IProps { + metric: Metric; + aggregation: Aggregation; +} + +class MetricBar extends Component { + render() { + if (this.props.metric.getTimestampsList().length === 0 || this.props.metric.getDatasetsList().length === 0) { + return ; + } + + let unit: TimeUnit = "hour"; + if (this.props.aggregation === Aggregation.DAY) { + unit = "day"; + } else if (this.props.aggregation === Aggregation.MONTH) { + unit = "month"; + } + + let backgroundColors = [ + "#8bc34a", + "#ff5722", + "#ff9800", + "#ffc107", + "#ffeb3b", + "#cddc39", + "#4caf50", + "#009688", + "#00bcd4", + "#03a9f4", + "#2196f3", + "#3f51b5", + "#673ab7", + "#9c27b0", + "#e91e63", + ]; + + const animation: false = false; + + const options = { + animation: animation, + plugins: { + legend: { + display: true, + }, + }, + maintainAspectRatio: false, + scales: { + y: { + beginAtZero: true, + }, + x: { + type: "time" as const, + time: { + unit: unit, + }, + }, + }, + }; + + let data: { + labels: number[]; + datasets: { + label: string; + data: number[]; + backgroundColor: string; + }[]; + } = { + labels: this.props.metric.getTimestampsList().map(v => moment(v.toDate()).valueOf()), + datasets: [], + }; + + for (let ds of this.props.metric.getDatasetsList()) { + data.datasets.push({ + label: ds.getLabel(), + data: ds.getDataList(), + backgroundColor: backgroundColors.shift()!, + }); + } + + return ( + + + + ); + } +} + +export default MetricBar; diff --git a/ui/src/components/MetricChart.tsx b/ui/src/components/MetricChart.tsx new file mode 100644 index 00000000..822baeff --- /dev/null +++ b/ui/src/components/MetricChart.tsx @@ -0,0 +1,81 @@ +import React, { Component } from "react"; + +import { Card, Empty } from "antd"; + +import { TimeUnit } from "chart.js"; +import { Line } from "react-chartjs-2"; +import moment from "moment"; + +import { Metric, Aggregation } from "@chirpstack/chirpstack-api-grpc-web/common/common_pb"; + +interface IProps { + metric: Metric; + aggregation: Aggregation; + zeroToNull?: boolean; +} + +class MetricChart extends Component { + render() { + if (this.props.metric.getTimestampsList().length === 0 || this.props.metric.getDatasetsList().length === 0) { + return ; + } + + let unit: TimeUnit = "hour"; + if (this.props.aggregation === Aggregation.DAY) { + unit = "day"; + } else if (this.props.aggregation === Aggregation.MONTH) { + unit = "month"; + } + + const animation: false = false; + + const options = { + animation: animation, + plugins: { + legend: { + display: false, + }, + }, + maintainAspectRatio: false, + scales: { + y: { + beginAtZero: true, + }, + x: { + type: "time" as const, + time: { + unit: unit, + }, + }, + }, + }; + + let data = { + labels: this.props.metric.getTimestampsList().map(v => moment(v.toDate()).valueOf()), + datasets: this.props.metric.getDatasetsList().map(v => { + return { + label: v.getLabel(), + borderColor: "rgba(33, 150, 243, 1)", + backgroundColor: "rgba(0, 0, 0, 0)", + lineTension: 0, + pointBackgroundColor: "rgba(33, 150, 243, 1)", + data: v.getDataList().map(v => { + if (v === 0 && this.props.zeroToNull) { + return null; + } else { + return v; + } + }), + }; + }), + }; + + return ( + + + + ); + } +} + +export default MetricChart; diff --git a/ui/src/components/Heatmap.tsx b/ui/src/components/MetricHeatmap.tsx similarity index 57% rename from ui/src/components/Heatmap.tsx rename to ui/src/components/MetricHeatmap.tsx index f3075289..7138c431 100644 --- a/ui/src/components/Heatmap.tsx +++ b/ui/src/components/MetricHeatmap.tsx @@ -1,44 +1,89 @@ import React, { Component } from "react"; -import { color } from "chart.js/helpers"; -import { Chart } from "react-chartjs-2"; +import { Card, Empty } from "antd"; -interface HeatmapData { - x: string; - y: Array<[string, number]>; -} +import { color } from "chart.js/helpers"; +import { TimeUnit } from "chart.js"; +import { Chart } from "react-chartjs-2"; +import moment from "moment"; + +import { Metric, Aggregation } from "@chirpstack/chirpstack-api-grpc-web/common/common_pb"; interface IProps { - data: HeatmapData[]; + metric: Metric; fromColor: string; toColor: string; + aggregation: Aggregation; } -class Heatmap extends Component { +class MetricHeatmap extends Component { render() { - if (this.props.data.length === 0) { - return null; + if (this.props.metric.getTimestampsList().length === 0 || this.props.metric.getDatasetsList().length === 0) { + return ; } - let xSet: { [key: string]: any } = {}; - let ySet: { [key: string]: any } = {}; + let unit: TimeUnit = "hour"; + if (this.props.aggregation === Aggregation.DAY) { + unit = "day"; + } else if (this.props.aggregation === Aggregation.MONTH) { + unit = "month"; + } + + const animation: false = false; + + let options = { + animation: animation, + maintainAspectRatio: false, + scales: { + y: { + type: "category" as const, + offset: true, + grid: { + display: false, + }, + }, + x: { + type: "time" as const, + time: { + unit: unit, + }, + offset: true, + labels: this.props.metric.getTimestampsList().map(v => moment(v.toDate().valueOf())), + grid: { + display: false, + }, + }, + }, + plugins: { + legend: { display: false }, + tooltip: { + callbacks: { + title: () => { + return ""; + }, + label: (ctx: any) => { + const v = ctx.dataset.data[ctx.dataIndex].v; + return "Count: " + v; + }, + }, + }, + }, + }; let dataData: { - x: string; + x: number; y: string; v: number; }[] = []; let data = { - labels: [], + labels: this.props.metric.getDatasetsList().map(v => v.getLabel()), datasets: [ { label: "Heatmap", data: dataData, minValue: -1, maxValue: -1, - xSet: xSet, - ySet: ySet, fromColor: this.props.fromColor.match(/\d+/g)!.map(Number), toColor: this.props.toColor.match(/\d+/g)!.map(Number), backgroundColor: (ctx: any): string => { @@ -64,80 +109,49 @@ class Heatmap extends Component { }, borderWidth: 0, width: (ctx: any) => { - return (ctx.chart.chartArea || {}).width / Object.keys(ctx.dataset.xSet).length - 1; + return (ctx.chart.chartArea || {}).width / this.props.metric.getTimestampsList().length - 1; }, height: (ctx: any) => { - return (ctx.chart.chartArea || {}).height / Object.keys(ctx.dataset.ySet).length - 1; + return (ctx.chart.chartArea || {}).height / this.props.metric.getDatasetsList().length - 1; }, }, ], }; - let xLabels: string[] = []; + data.labels.sort(); - const animation: false = false; + const tsList = this.props.metric.getTimestampsList(); + const dsList = this.props.metric.getDatasetsList(); - let options = { - animation: animation, - maintainAspectRatio: false, - scales: { - y: { - type: "category" as const, - offset: true, - grid: { - display: false, - }, - }, - x: { - type: "time" as const, - offset: true, - labels: xLabels, - grid: { - display: false, - }, - }, - }, - plugins: { - legend: { display: false }, - tooltip: { - callbacks: { - title: () => { - return ""; - }, - label: (ctx: any) => { - const v = ctx.dataset.data[ctx.dataIndex].v; - return "Count: " + v; - }, - }, - }, - }, - }; - - for (const row of this.props.data) { - options.scales.x.labels.push(row.x); - data.datasets[0].xSet[row.x] = {}; - - for (const y of row.y) { - data.datasets[0].ySet[y[0]] = {}; - - data.datasets[0].data.push({ - x: row.x, - y: y[0], - v: y[1], - }); - - if (data.datasets[0].minValue === -1 || data.datasets[0].minValue > y[1]) { - data.datasets[0].minValue = y[1]; + for (let i = 0; i < tsList.length; i++) { + for (let ds of dsList) { + let v = ds.getDataList()[i]; + if (v === 0) { + continue; } - if (data.datasets[0].maxValue < y[1]) { - data.datasets[0].maxValue = y[1]; + data.datasets[0].data.push({ + x: moment(tsList[i].toDate()).valueOf(), + y: ds.getLabel(), + v: v, + }); + + if (data.datasets[0].minValue === -1 || data.datasets[0].minValue > v) { + data.datasets[0].minValue = v; + } + + if (data.datasets[0].maxValue < v) { + data.datasets[0].maxValue = v; } } } - return ; + return ( + + + + ); } } -export default Heatmap; +export default MetricHeatmap; diff --git a/ui/src/stores/DeviceStore.ts b/ui/src/stores/DeviceStore.ts index 887ec5c1..c3a75613 100644 --- a/ui/src/stores/DeviceStore.ts +++ b/ui/src/stores/DeviceStore.ts @@ -15,8 +15,6 @@ import { GetDeviceKeysResponse, UpdateDeviceKeysRequest, DeleteDeviceKeysRequest, - GetDeviceStatsRequest, - GetDeviceStatsResponse, EnqueueDeviceQueueItemRequest, EnqueueDeviceQueueItemResponse, FlushDeviceQueueRequest, @@ -28,6 +26,10 @@ import { ActivateDeviceRequest, GetRandomDevAddrRequest, GetRandomDevAddrResponse, + GetDeviceMetricsRequest, + GetDeviceMetricsResponse, + GetDeviceLinkMetricsRequest, + GetDeviceLinkMetricsResponse, } from "@chirpstack/chirpstack-api-grpc-web/api/device_pb"; import SessionStore from "./SessionStore"; @@ -172,8 +174,19 @@ class DeviceStore extends EventEmitter { }); }; - getStats = (req: GetDeviceStatsRequest, callbackFunc: (resp: GetDeviceStatsResponse) => void) => { - this.client.getStats(req, SessionStore.getMetadata(), (err, resp) => { + getMetrics = (req: GetDeviceMetricsRequest, callbackFunc: (resp: GetDeviceMetricsResponse) => void) => { + this.client.getMetrics(req, SessionStore.getMetadata(), (err, resp) => { + if (err !== null) { + HandleError(err); + return; + } + + callbackFunc(resp); + }); + }; + + getLinkMetrics = (req: GetDeviceLinkMetricsRequest, callbackFunc: (resp: GetDeviceLinkMetricsResponse) => void) => { + this.client.getLinkMetrics(req, SessionStore.getMetadata(), (err, resp) => { if (err !== null) { HandleError(err); return; diff --git a/ui/src/stores/GatewayStore.ts b/ui/src/stores/GatewayStore.ts index 78b23b8c..53c28e55 100644 --- a/ui/src/stores/GatewayStore.ts +++ b/ui/src/stores/GatewayStore.ts @@ -9,8 +9,8 @@ import { DeleteGatewayRequest, ListGatewaysRequest, ListGatewaysResponse, - GetGatewayStatsRequest, - GetGatewayStatsResponse, + GetGatewayMetricsRequest, + GetGatewayMetricsResponse, GenerateGatewayClientCertificateRequest, GenerateGatewayClientCertificateResponse, } from "@chirpstack/chirpstack-api-grpc-web/api/gateway_pb"; @@ -96,8 +96,8 @@ class GatewayStore extends EventEmitter { }); }; - getStats = (req: GetGatewayStatsRequest, callbackFunc: (resp: GetGatewayStatsResponse) => void) => { - this.client.getStats(req, SessionStore.getMetadata(), (err, resp) => { + getMetrics = (req: GetGatewayMetricsRequest, callbackFunc: (resp: GetGatewayMetricsResponse) => void) => { + this.client.getMetrics(req, SessionStore.getMetadata(), (err, resp) => { if (err !== null) { HandleError(err); return; diff --git a/ui/src/views/device-profile-templates/DeviceProfileTemplateForm.tsx b/ui/src/views/device-profile-templates/DeviceProfileTemplateForm.tsx index af45c245..ec804293 100644 --- a/ui/src/views/device-profile-templates/DeviceProfileTemplateForm.tsx +++ b/ui/src/views/device-profile-templates/DeviceProfileTemplateForm.tsx @@ -4,7 +4,7 @@ import { Form, Input, Select, InputNumber, Switch, Row, Col, Button, Tabs } from import { MinusCircleOutlined, PlusOutlined } from "@ant-design/icons"; import { DeviceProfileTemplate } from "@chirpstack/chirpstack-api-grpc-web/api/device_profile_template_pb"; -import { CodecRuntime } from "@chirpstack/chirpstack-api-grpc-web/api/device_profile_pb"; +import { CodecRuntime, Measurement, MeasurementKind } from "@chirpstack/chirpstack-api-grpc-web/api/device_profile_pb"; import { Region, MacVersion, RegParamsRevision } from "@chirpstack/chirpstack-api-grpc-web/common/common_pb"; import { ListDeviceProfileAdrAlgorithmsResponse } from "@chirpstack/chirpstack-api-grpc-web/api/device_profile_pb"; @@ -102,6 +102,14 @@ class DeviceProfileTemplateForm extends Component { dp.getTagsMap().set(elm[0], elm[1]); } + // measurements + for (const elm of v.measurementsMap) { + let m = new Measurement(); + m.setKind(elm[1].kind); + m.setName(elm[1].name); + dp.getMeasurementsMap().set(elm[0], m); + } + this.props.onFinish(dp); }; @@ -405,6 +413,88 @@ class DeviceProfileTemplateForm extends Component { )} + + +

+ ChirpStack can aggregate and visualize decoded device measurements in the device dashboard. To setup the + aggregation of device measurements, you must configure the key, kind of measurement and name + (user-defined). Please note that ChirpStack will automatically configure the keys once it has received + the first uplink(s). The following measurement-kinds can be selected: +

+
    +
  • + Unknown / unset: Default for auto-detected keys. This disables the aggregation of + this metric. +
  • +
  • + Counter: For continuous incrementing counters. +
  • +
  • + Absolute: For counters which get reset upon reading / uplink. +
  • +
  • + Gauge: For temperature, humidity, pressure etc... +
  • +
  • + String: For boolean or string values. +
  • +
+
+ + {(fields, { add, remove }) => ( + <> + {fields.map(({ key, name, ...restField }) => ( + + + + + + + + + + + + + + + + + + remove(name)} /> + + + ))} + + + + + )} + +
+ + + )} + +