diff options
| author | KubeEdge Bot <48982446+kubeedge-bot@users.noreply.github.com> | 2024-07-18 15:49:01 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-18 15:49:01 +0800 |
| commit | ee368059fc181f92e87826b11ff215d883efba16 (patch) | |
| tree | 987ad515b34d40208a574c94c8e715baa8b4961d | |
| parent | Merge pull request #5535 from luomengY/edgepod_restart_get_proposal (diff) | |
| parent | edge support device state (diff) | |
| download | kubeedge-ee368059fc181f92e87826b11ff215d883efba16.tar.gz | |
Merge pull request #5650 from JiaweiGithub/feat/dmi_state
edge support device state
17 files changed, 722 insertions, 372 deletions
diff --git a/edge/pkg/devicetwin/dmiserver/event_type.go b/edge/pkg/devicetwin/dmiserver/event_type.go index ce12b521e..e78b1221c 100644 --- a/edge/pkg/devicetwin/dmiserver/event_type.go +++ b/edge/pkg/devicetwin/dmiserver/event_type.go @@ -28,6 +28,12 @@ type DeviceTwinUpdate struct { Twin map[string]*types.MsgTwin `json:"twin"` } +// DeviceStateUpdate the structure of device state update. +type DeviceStateUpdate struct { + types.BaseMessage + State string +} + // getTimestamp get current timestamp. func getTimestamp() int64 { return time.Now().UnixNano() / 1e6 diff --git a/edge/pkg/devicetwin/dmiserver/server.go b/edge/pkg/devicetwin/dmiserver/server.go index 9f4fbb90a..49b1fb0e7 100644 --- a/edge/pkg/devicetwin/dmiserver/server.go +++ b/edge/pkg/devicetwin/dmiserver/server.go @@ -129,7 +129,8 @@ func (s *server) MapperRegister(_ context.Context, in *pb.MapperRegisterRequest) }, nil } -func (s *server) ReportDeviceStatus(_ context.Context, in *pb.ReportDeviceStatusRequest) (*pb.ReportDeviceStatusResponse, error) { +func (s *server) ReportDeviceStatus(_ context.Context, in *pb.ReportDeviceStatusRequest) (*pb. + ReportDeviceStatusResponse, error) { if !s.limiter.Allow() { return nil, fmt.Errorf("fail to report device status because of too many request: %s", in.DeviceName) } @@ -150,6 +151,26 @@ func (s *server) ReportDeviceStatus(_ context.Context, in *pb.ReportDeviceStatus return &pb.ReportDeviceStatusResponse{}, nil } +func (s *server) ReportDeviceStates(_ context.Context, in *pb.ReportDeviceStatesRequest) (*pb. + ReportDeviceStatesResponse, error) { + if !s.limiter.Allow() { + return nil, fmt.Errorf("fail to report device states because of too many request: %s", in.DeviceName) + } + + if in != nil && in.State != "" && in.DeviceName != "" { + msg, err := CreateMessageStateUpdate(in) + if err != nil { + klog.Errorf("fail to create state message data of device %s with err: %v", in.DeviceName, err) + return nil, err + } + handleDeviceState(in, msg) + } else { + return &pb.ReportDeviceStatesResponse{}, fmt.Errorf("ReportDeviceStatesRequest is invalid data") + } + + return &pb.ReportDeviceStatesResponse{}, nil +} + func handleDeviceTwin(in *pb.ReportDeviceStatusRequest, payload []byte) { deviceID := util.GetResourceID(in.DeviceNamespace, in.DeviceName) topic := dtcommon.DeviceETPrefix + deviceID + dtcommon.TwinETUpdateSuffix @@ -162,6 +183,18 @@ func handleDeviceTwin(in *pb.ReportDeviceStatusRequest, payload []byte) { beehiveContext.SendToGroup(target, *message) } +func handleDeviceState(in *pb.ReportDeviceStatesRequest, payload []byte) { + deviceID := util.GetResourceID(in.DeviceNamespace, in.DeviceName) + topic := dtcommon.DeviceETPrefix + deviceID + dtcommon.DeviceETStateUpdateSuffix + target := modules.TwinGroup + resource := base64.URLEncoding.EncodeToString([]byte(topic)) + // routing key will be $hw.<project_id>.events.user.bus.response.cluster.<cluster_id>.node.<node_id>.<base64_topic> + message := beehiveModel.NewMessage("").BuildRouter(modules.BusGroup, modules.UserGroup, + resource, messagepkg.OperationResponse).FillBody(string(payload)) + + beehiveContext.SendToGroup(target, *message) +} + // CreateMessageTwinUpdate create twin update message. func CreateMessageTwinUpdate(twin *pb.Twin) ([]byte, error) { var updateMsg DeviceTwinUpdate @@ -176,6 +209,15 @@ func CreateMessageTwinUpdate(twin *pb.Twin) ([]byte, error) { return msg, err } +// CreateMessageStateUpdate create state update message. +func CreateMessageStateUpdate(in *pb.ReportDeviceStatesRequest) ([]byte, error) { + var stateMsg DeviceStateUpdate + stateMsg.BaseMessage.Timestamp = getTimestamp() + stateMsg.State = in.State + msg, err := json.Marshal(stateMsg) + return msg, err +} + func StartDMIServer(cache *DMICache) { var DMISockPath string if deviceconfig.Get().DeviceTwin.DMISockPath != "" { diff --git a/edge/pkg/devicetwin/dtcommon/common.go b/edge/pkg/devicetwin/dtcommon/common.go index cf5ad44a6..0c0acf282 100644 --- a/edge/pkg/devicetwin/dtcommon/common.go +++ b/edge/pkg/devicetwin/dtcommon/common.go @@ -122,4 +122,10 @@ const ( TypeDeleted = "deleted" TypeUpdated = "updated" + + DeviceStatusOK = "ok" + DeviceStatusOnline = "online" + DeviceStatusOffline = "offline" + DeviceStatusUnhealthy = "unhealthy" /* Unhealthy status from device */ + DeviceStatusUnknown = "unknown" ) diff --git a/edge/pkg/devicetwin/dtmanager/device.go b/edge/pkg/devicetwin/dtmanager/device.go index 9c3801917..7c5882b0f 100644 --- a/edge/pkg/devicetwin/dtmanager/device.go +++ b/edge/pkg/devicetwin/dtmanager/device.go @@ -16,6 +16,7 @@ import ( "github.com/kubeedge/kubeedge/edge/pkg/devicetwin/dtcommon" "github.com/kubeedge/kubeedge/edge/pkg/devicetwin/dtcontext" "github.com/kubeedge/kubeedge/edge/pkg/devicetwin/dttype" + "github.com/kubeedge/kubeedge/pkg/apis" ) var ( @@ -91,11 +92,15 @@ func dealDeviceStateUpdate(context *dtcontext.DTContext, resource string, msg in // state refers to definition in mappers-go/pkg/common/const.go state := strings.ToLower(updatedDevice.State) switch state { - case "online", "offline", "ok", "unknown", "disconnected": + case dtcommon.DeviceStatusOnline, dtcommon.DeviceStatusOffline, dtcommon.DeviceStatusOK, + dtcommon.DeviceStatusUnknown, dtcommon.DeviceStatusUnhealthy: default: return nil } - lastOnline := time.Now().Format("2006-01-02 15:04:05") + var lastOnline string + if state == dtcommon.DeviceStatusOnline || state == dtcommon.DeviceStatusOK { + lastOnline = time.Now().Format(apis.ISO8601UTC) + } for i := 1; i <= dtcommon.RetryTimes; i++ { err = dtclient.UpdateDeviceFields( device.ID, diff --git a/pkg/apis/dmi/services.go b/pkg/apis/dmi/services.go index 2b63a29ac..24b75585b 100644 --- a/pkg/apis/dmi/services.go +++ b/pkg/apis/dmi/services.go @@ -34,6 +34,8 @@ type DeviceManagerService interface { // When the mapper collects some properties of a device, it can make them a map of device twins // and report it to the device manager through the interface of ReportDeviceStatus. ReportDeviceStatus(*dmiapi.ReportDeviceStatusRequest) (*dmiapi.ReportDeviceStatusResponse, error) + // ReportDeviceStates reports the state of devices to device manager. + ReportDeviceState(*dmiapi.ReportDeviceStatesRequest) (*dmiapi.ReportDeviceStatesResponse, error) } // DeviceMapperService defines the public APIS for remote device management. diff --git a/pkg/apis/dmi/v1beta1/api.pb.go b/pkg/apis/dmi/v1beta1/api.pb.go index 831333fa1..d9b99a6f6 100644 --- a/pkg/apis/dmi/v1beta1/api.pb.go +++ b/pkg/apis/dmi/v1beta1/api.pb.go @@ -13,23 +13,21 @@ Copyright 2023 The KubeEdge Authors. See the License for the specific language governing permissions and limitations under the License. */ - -// // To regenerate api.pb.go run hack/generate-dmi.sh // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 -// protoc v3.6.1 +// protoc-gen-go v1.26.0 +// protoc v3.19.4 // source: api.proto package v1beta1 import ( "google.golang.org/grpc" - any1 "github.com/golang/protobuf/ptypes/any" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" reflect "reflect" sync "sync" ) @@ -849,7 +847,7 @@ type CustomizedValue struct { unknownFields protoimpl.UnknownFields // data is the customized value and it can be any form. - Data map[string]*any1.Any `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Data map[string]*anypb.Any `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *CustomizedValue) Reset() { @@ -884,7 +882,7 @@ func (*CustomizedValue) Descriptor() ([]byte, []int) { return file_api_proto_rawDescGZIP(), []int{11} } -func (x *CustomizedValue) GetData() map[string]*any1.Any { +func (x *CustomizedValue) GetData() map[string]*anypb.Any { if x != nil { return x.Data } @@ -898,7 +896,7 @@ type PushMethod struct { Http *PushMethodHTTP `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"` Mqtt *PushMethodMQTT `protobuf:"bytes,2,opt,name=mqtt,proto3" json:"mqtt,omitempty"` - DBMethod *DBMethod `protobuf:"bytes,3,opt,name=dbMethod,proto3" json:"dbMethod,omitempty"` + DbMethod *DBMethod `protobuf:"bytes,3,opt,name=dbMethod,proto3" json:"dbMethod,omitempty"` } func (x *PushMethod) Reset() { @@ -947,9 +945,9 @@ func (x *PushMethod) GetMqtt() *PushMethodMQTT { return nil } -func (x *PushMethod) GetDBMethod() *DBMethod { +func (x *PushMethod) GetDbMethod() *DBMethod { if x != nil { - return x.DBMethod + return x.DbMethod } return nil } @@ -1856,6 +1854,69 @@ func (x *ReportDeviceStatusRequest) GetDeviceNamespace() string { return "" } +type ReportDeviceStatesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DeviceName string `protobuf:"bytes,1,opt,name=deviceName,proto3" json:"deviceName,omitempty"` + DeviceNamespace string `protobuf:"bytes,2,opt,name=deviceNamespace,proto3" json:"deviceNamespace,omitempty"` + State string `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"` +} + +func (x *ReportDeviceStatesRequest) Reset() { + *x = ReportDeviceStatesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReportDeviceStatesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportDeviceStatesRequest) ProtoMessage() {} + +func (x *ReportDeviceStatesRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_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 ReportDeviceStatesRequest.ProtoReflect.Descriptor instead. +func (*ReportDeviceStatesRequest) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{27} +} + +func (x *ReportDeviceStatesRequest) GetDeviceName() string { + if x != nil { + return x.DeviceName + } + return "" +} + +func (x *ReportDeviceStatesRequest) GetDeviceNamespace() string { + if x != nil { + return x.DeviceNamespace + } + return "" +} + +func (x *ReportDeviceStatesRequest) GetState() string { + if x != nil { + return x.State + } + return "" +} + // DeviceStatus is the status of the device. type DeviceStatus struct { state protoimpl.MessageState @@ -1869,7 +1930,7 @@ type DeviceStatus struct { func (x *DeviceStatus) Reset() { *x = DeviceStatus{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[27] + mi := &file_api_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1882,7 +1943,7 @@ func (x *DeviceStatus) String() string { func (*DeviceStatus) ProtoMessage() {} func (x *DeviceStatus) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[27] + mi := &file_api_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1895,7 +1956,7 @@ func (x *DeviceStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use DeviceStatus.ProtoReflect.Descriptor instead. func (*DeviceStatus) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{27} + return file_api_proto_rawDescGZIP(), []int{28} } func (x *DeviceStatus) GetTwins() []*Twin { @@ -1922,7 +1983,7 @@ type Twin struct { func (x *Twin) Reset() { *x = Twin{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[28] + mi := &file_api_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1935,7 +1996,7 @@ func (x *Twin) String() string { func (*Twin) ProtoMessage() {} func (x *Twin) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[28] + mi := &file_api_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1948,7 +2009,7 @@ func (x *Twin) ProtoReflect() protoreflect.Message { // Deprecated: Use Twin.ProtoReflect.Descriptor instead. func (*Twin) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{28} + return file_api_proto_rawDescGZIP(), []int{29} } func (x *Twin) GetPropertyName() string { @@ -1987,7 +2048,7 @@ type TwinProperty struct { func (x *TwinProperty) Reset() { *x = TwinProperty{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[29] + mi := &file_api_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2000,7 +2061,7 @@ func (x *TwinProperty) String() string { func (*TwinProperty) ProtoMessage() {} func (x *TwinProperty) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[29] + mi := &file_api_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2013,7 +2074,7 @@ func (x *TwinProperty) ProtoReflect() protoreflect.Message { // Deprecated: Use TwinProperty.ProtoReflect.Descriptor instead. func (*TwinProperty) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{29} + return file_api_proto_rawDescGZIP(), []int{30} } func (x *TwinProperty) GetValue() string { @@ -2039,7 +2100,7 @@ type ReportDeviceStatusResponse struct { func (x *ReportDeviceStatusResponse) Reset() { *x = ReportDeviceStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[30] + mi := &file_api_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2052,7 +2113,7 @@ func (x *ReportDeviceStatusResponse) String() string { func (*ReportDeviceStatusResponse) ProtoMessage() {} func (x *ReportDeviceStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[30] + mi := &file_api_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2065,7 +2126,45 @@ func (x *ReportDeviceStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportDeviceStatusResponse.ProtoReflect.Descriptor instead. func (*ReportDeviceStatusResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{30} + return file_api_proto_rawDescGZIP(), []int{31} +} + +type ReportDeviceStatesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ReportDeviceStatesResponse) Reset() { + *x = ReportDeviceStatesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReportDeviceStatesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportDeviceStatesResponse) ProtoMessage() {} + +func (x *ReportDeviceStatesResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[32] + 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 ReportDeviceStatesResponse.ProtoReflect.Descriptor instead. +func (*ReportDeviceStatesResponse) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{32} } type RegisterDeviceRequest struct { @@ -2079,7 +2178,7 @@ type RegisterDeviceRequest struct { func (x *RegisterDeviceRequest) Reset() { *x = RegisterDeviceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[31] + mi := &file_api_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2092,7 +2191,7 @@ func (x *RegisterDeviceRequest) String() string { func (*RegisterDeviceRequest) ProtoMessage() {} func (x *RegisterDeviceRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[31] + mi := &file_api_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2105,7 +2204,7 @@ func (x *RegisterDeviceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RegisterDeviceRequest.ProtoReflect.Descriptor instead. func (*RegisterDeviceRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{31} + return file_api_proto_rawDescGZIP(), []int{33} } func (x *RegisterDeviceRequest) GetDevice() *Device { @@ -2127,7 +2226,7 @@ type RegisterDeviceResponse struct { func (x *RegisterDeviceResponse) Reset() { *x = RegisterDeviceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[32] + mi := &file_api_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2140,7 +2239,7 @@ func (x *RegisterDeviceResponse) String() string { func (*RegisterDeviceResponse) ProtoMessage() {} func (x *RegisterDeviceResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[32] + mi := &file_api_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2153,7 +2252,7 @@ func (x *RegisterDeviceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RegisterDeviceResponse.ProtoReflect.Descriptor instead. func (*RegisterDeviceResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{32} + return file_api_proto_rawDescGZIP(), []int{34} } func (x *RegisterDeviceResponse) GetDeviceName() string { @@ -2181,7 +2280,7 @@ type CreateDeviceModelRequest struct { func (x *CreateDeviceModelRequest) Reset() { *x = CreateDeviceModelRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[33] + mi := &file_api_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2194,7 +2293,7 @@ func (x *CreateDeviceModelRequest) String() string { func (*CreateDeviceModelRequest) ProtoMessage() {} func (x *CreateDeviceModelRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[33] + mi := &file_api_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2207,7 +2306,7 @@ func (x *CreateDeviceModelRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateDeviceModelRequest.ProtoReflect.Descriptor instead. func (*CreateDeviceModelRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{33} + return file_api_proto_rawDescGZIP(), []int{35} } func (x *CreateDeviceModelRequest) GetModel() *DeviceModel { @@ -2229,7 +2328,7 @@ type CreateDeviceModelResponse struct { func (x *CreateDeviceModelResponse) Reset() { *x = CreateDeviceModelResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[34] + mi := &file_api_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2242,7 +2341,7 @@ func (x *CreateDeviceModelResponse) String() string { func (*CreateDeviceModelResponse) ProtoMessage() {} func (x *CreateDeviceModelResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[34] + mi := &file_api_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2255,7 +2354,7 @@ func (x *CreateDeviceModelResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateDeviceModelResponse.ProtoReflect.Descriptor instead. func (*CreateDeviceModelResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{34} + return file_api_proto_rawDescGZIP(), []int{36} } func (x *CreateDeviceModelResponse) GetDeviceModelName() string { @@ -2284,7 +2383,7 @@ type RemoveDeviceRequest struct { func (x *RemoveDeviceRequest) Reset() { *x = RemoveDeviceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[35] + mi := &file_api_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2297,7 +2396,7 @@ func (x *RemoveDeviceRequest) String() string { func (*RemoveDeviceRequest) ProtoMessage() {} func (x *RemoveDeviceRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[35] + mi := &file_api_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2310,7 +2409,7 @@ func (x *RemoveDeviceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveDeviceRequest.ProtoReflect.Descriptor instead. func (*RemoveDeviceRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{35} + return file_api_proto_rawDescGZIP(), []int{37} } func (x *RemoveDeviceRequest) GetDeviceName() string { @@ -2336,7 +2435,7 @@ type RemoveDeviceResponse struct { func (x *RemoveDeviceResponse) Reset() { *x = RemoveDeviceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[36] + mi := &file_api_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2349,7 +2448,7 @@ func (x *RemoveDeviceResponse) String() string { func (*RemoveDeviceResponse) ProtoMessage() {} func (x *RemoveDeviceResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[36] + mi := &file_api_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2362,7 +2461,7 @@ func (x *RemoveDeviceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveDeviceResponse.ProtoReflect.Descriptor instead. func (*RemoveDeviceResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{36} + return file_api_proto_rawDescGZIP(), []int{38} } type RemoveDeviceModelRequest struct { @@ -2377,7 +2476,7 @@ type RemoveDeviceModelRequest struct { func (x *RemoveDeviceModelRequest) Reset() { *x = RemoveDeviceModelRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[37] + mi := &file_api_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2390,7 +2489,7 @@ func (x *RemoveDeviceModelRequest) String() string { func (*RemoveDeviceModelRequest) ProtoMessage() {} func (x *RemoveDeviceModelRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[37] + mi := &file_api_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2403,7 +2502,7 @@ func (x *RemoveDeviceModelRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveDeviceModelRequest.ProtoReflect.Descriptor instead. func (*RemoveDeviceModelRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{37} + return file_api_proto_rawDescGZIP(), []int{39} } func (x *RemoveDeviceModelRequest) GetModelName() string { @@ -2429,7 +2528,7 @@ type RemoveDeviceModelResponse struct { func (x *RemoveDeviceModelResponse) Reset() { *x = RemoveDeviceModelResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[38] + mi := &file_api_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2442,7 +2541,7 @@ func (x *RemoveDeviceModelResponse) String() string { func (*RemoveDeviceModelResponse) ProtoMessage() {} func (x *RemoveDeviceModelResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[38] + mi := &file_api_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2455,7 +2554,7 @@ func (x *RemoveDeviceModelResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveDeviceModelResponse.ProtoReflect.Descriptor instead. func (*RemoveDeviceModelResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{38} + return file_api_proto_rawDescGZIP(), []int{40} } type UpdateDeviceRequest struct { @@ -2469,7 +2568,7 @@ type UpdateDeviceRequest struct { func (x *UpdateDeviceRequest) Reset() { *x = UpdateDeviceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[39] + mi := &file_api_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2482,7 +2581,7 @@ func (x *UpdateDeviceRequest) String() string { func (*UpdateDeviceRequest) ProtoMessage() {} func (x *UpdateDeviceRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[39] + mi := &file_api_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2495,7 +2594,7 @@ func (x *UpdateDeviceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateDeviceRequest.ProtoReflect.Descriptor instead. func (*UpdateDeviceRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{39} + return file_api_proto_rawDescGZIP(), []int{41} } func (x *UpdateDeviceRequest) GetDevice() *Device { @@ -2514,7 +2613,7 @@ type UpdateDeviceResponse struct { func (x *UpdateDeviceResponse) Reset() { *x = UpdateDeviceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[40] + mi := &file_api_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2527,7 +2626,7 @@ func (x *UpdateDeviceResponse) String() string { func (*UpdateDeviceResponse) ProtoMessage() {} func (x *UpdateDeviceResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[40] + mi := &file_api_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2540,7 +2639,7 @@ func (x *UpdateDeviceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateDeviceResponse.ProtoReflect.Descriptor instead. func (*UpdateDeviceResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{40} + return file_api_proto_rawDescGZIP(), []int{42} } type UpdateDeviceModelRequest struct { @@ -2554,7 +2653,7 @@ type UpdateDeviceModelRequest struct { func (x *UpdateDeviceModelRequest) Reset() { *x = UpdateDeviceModelRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[41] + mi := &file_api_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2567,7 +2666,7 @@ func (x *UpdateDeviceModelRequest) String() string { func (*UpdateDeviceModelRequest) ProtoMessage() {} func (x *UpdateDeviceModelRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[41] + mi := &file_api_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2580,7 +2679,7 @@ func (x *UpdateDeviceModelRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateDeviceModelRequest.ProtoReflect.Descriptor instead. func (*UpdateDeviceModelRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{41} + return file_api_proto_rawDescGZIP(), []int{43} } func (x *UpdateDeviceModelRequest) GetModel() *DeviceModel { @@ -2599,7 +2698,7 @@ type UpdateDeviceModelResponse struct { func (x *UpdateDeviceModelResponse) Reset() { *x = UpdateDeviceModelResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[42] + mi := &file_api_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2612,7 +2711,7 @@ func (x *UpdateDeviceModelResponse) String() string { func (*UpdateDeviceModelResponse) ProtoMessage() {} func (x *UpdateDeviceModelResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[42] + mi := &file_api_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2625,7 +2724,7 @@ func (x *UpdateDeviceModelResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateDeviceModelResponse.ProtoReflect.Descriptor instead. func (*UpdateDeviceModelResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{42} + return file_api_proto_rawDescGZIP(), []int{44} } type GetDeviceRequest struct { @@ -2640,7 +2739,7 @@ type GetDeviceRequest struct { func (x *GetDeviceRequest) Reset() { *x = GetDeviceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[43] + mi := &file_api_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2653,7 +2752,7 @@ func (x *GetDeviceRequest) String() string { func (*GetDeviceRequest) ProtoMessage() {} func (x *GetDeviceRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[43] + mi := &file_api_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2666,7 +2765,7 @@ func (x *GetDeviceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDeviceRequest.ProtoReflect.Descriptor instead. func (*GetDeviceRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{43} + return file_api_proto_rawDescGZIP(), []int{45} } func (x *GetDeviceRequest) GetDeviceName() string { @@ -2694,7 +2793,7 @@ type GetDeviceResponse struct { func (x *GetDeviceResponse) Reset() { *x = GetDeviceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[44] + mi := &file_api_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2707,7 +2806,7 @@ func (x *GetDeviceResponse) String() string { func (*GetDeviceResponse) ProtoMessage() {} func (x *GetDeviceResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[44] + mi := &file_api_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2720,7 +2819,7 @@ func (x *GetDeviceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDeviceResponse.ProtoReflect.Descriptor instead. func (*GetDeviceResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{44} + return file_api_proto_rawDescGZIP(), []int{46} } func (x *GetDeviceResponse) GetDevice() *Device { @@ -2975,145 +3074,160 @@ var file_api_proto_rawDesc = []byte{ 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x22, 0x33, 0x0a, 0x0c, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x23, 0x0a, 0x05, 0x74, 0x77, 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x0d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x77, 0x69, 0x6e, 0x52, 0x05, - 0x74, 0x77, 0x69, 0x6e, 0x73, 0x22, 0x9e, 0x01, 0x0a, 0x04, 0x54, 0x77, 0x69, 0x6e, 0x12, 0x22, - 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x0f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x44, 0x65, - 0x73, 0x69, 0x72, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x77, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x52, 0x0f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x44, 0x65, 0x73, 0x69, - 0x72, 0x65, 0x64, 0x12, 0x31, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x54, 0x77, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x08, 0x72, 0x65, - 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x22, 0xa2, 0x01, 0x0a, 0x0c, 0x54, 0x77, 0x69, 0x6e, 0x50, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3f, 0x0a, - 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x23, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x77, 0x69, 0x6e, 0x50, 0x72, - 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x3b, - 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 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, 0x1c, 0x0a, 0x1a, 0x52, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x0a, 0x15, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x65, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x27, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x62, 0x0a, 0x16, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, - 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, - 0x46, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, - 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x05, 0x6d, - 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, - 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x22, 0x79, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, - 0x64, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x32, - 0x0a, 0x14, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x4e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x64, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x22, 0x5f, 0x0a, 0x13, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x64, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x22, 0x16, 0x0a, 0x14, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x60, 0x0a, 0x18, 0x52, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, - 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x4e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6d, - 0x6f, 0x64, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x1b, 0x0a, - 0x19, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, - 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x0a, 0x13, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x27, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x16, 0x0a, 0x14, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x46, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, - 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, - 0x64, 0x65, 0x6c, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x22, 0x1b, 0x0a, 0x19, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5c, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x44, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x3c, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x06, 0x64, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, 0x64, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x32, 0xcc, 0x01, 0x0a, 0x14, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x0e, - 0x4d, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1e, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x5f, 0x0a, 0x12, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x22, 0x7b, 0x0a, 0x19, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, + 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, + 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x33, 0x0a, + 0x0c, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, + 0x05, 0x74, 0x77, 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x77, 0x69, 0x6e, 0x52, 0x05, 0x74, 0x77, 0x69, + 0x6e, 0x73, 0x22, 0x9e, 0x01, 0x0a, 0x04, 0x54, 0x77, 0x69, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x70, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x3f, 0x0a, 0x0f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x44, 0x65, 0x73, 0x69, 0x72, + 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x54, 0x77, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, + 0x0f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x44, 0x65, 0x73, 0x69, 0x72, 0x65, 0x64, + 0x12, 0x31, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x77, 0x69, + 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x65, 0x64, 0x22, 0xa2, 0x01, 0x0a, 0x0c, 0x54, 0x77, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3f, 0x0a, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x77, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 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, 0x1c, 0x0a, 0x1a, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x0a, 0x15, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, + 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, + 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x62, 0x0a, 0x16, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x28, 0x0a, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x46, 0x0a, 0x18, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x05, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x22, 0x79, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x28, 0x0a, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x4e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x14, 0x64, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, + 0x6f, 0x64, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x5f, 0x0a, + 0x13, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x16, + 0x0a, 0x14, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x60, 0x0a, 0x18, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x26, 0x0a, 0x0e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x1b, 0x0a, 0x19, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x06, + 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x16, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x46, 0x0a, + 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, + 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x05, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x05, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x22, 0x1b, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x5c, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x22, 0x3c, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x32, 0xad, + 0x02, 0x0a, 0x14, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x0e, 0x4d, 0x61, 0x70, 0x70, 0x65, + 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x12, + 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x22, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5f, 0x0a, + 0x12, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x73, 0x12, 0x22, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x32, 0xe8, 0x04, 0x0a, 0x13, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x70, - 0x70, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x0e, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1e, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x44, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x44, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x4d, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x1c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, - 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, - 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1c, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5c, 0x0a, - 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, - 0x65, 0x6c, 0x12, 0x21, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, - 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x11, 0x52, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, - 0x12, 0x21, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x11, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0xe8, + 0x04, 0x0a, 0x13, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x70, 0x65, 0x72, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0c, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0c, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x21, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x22, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x1a, 0x22, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x44, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x19, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0c, 0x5a, - 0x0a, 0x2e, 0x2f, 0x3b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x76, + 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x21, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x22, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x21, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x19, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x3b, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3128,7 +3242,7 @@ func file_api_proto_rawDescGZIP() []byte { return file_api_proto_rawDescData } -var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 48) +var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 50) var file_api_proto_goTypes = []interface{}{ (*MapperRegisterRequest)(nil), // 0: v1beta1.MapperRegisterRequest (*MapperRegisterResponse)(nil), // 1: v1beta1.MapperRegisterResponse @@ -3157,28 +3271,30 @@ var file_api_proto_goTypes = []interface{}{ (*MySQLClientConfig)(nil), // 24: v1beta1.MySQLClientConfig (*MapperInfo)(nil), // 25: v1beta1.MapperInfo (*ReportDeviceStatusRequest)(nil), // 26: v1beta1.ReportDeviceStatusRequest - (*DeviceStatus)(nil), // 27: v1beta1.DeviceStatus - (*Twin)(nil), // 28: v1beta1.Twin - (*TwinProperty)(nil), // 29: v1beta1.TwinProperty - (*ReportDeviceStatusResponse)(nil), // 30: v1beta1.ReportDeviceStatusResponse - (*RegisterDeviceRequest)(nil), // 31: v1beta1.RegisterDeviceRequest - (*RegisterDeviceResponse)(nil), // 32: v1beta1.RegisterDeviceResponse - (*CreateDeviceModelRequest)(nil), // 33: v1beta1.CreateDeviceModelRequest - (*CreateDeviceModelResponse)(nil), // 34: v1beta1.CreateDeviceModelResponse - (*RemoveDeviceRequest)(nil), // 35: v1beta1.RemoveDeviceRequest - (*RemoveDeviceResponse)(nil), // 36: v1beta1.RemoveDeviceResponse - (*RemoveDeviceModelRequest)(nil), // 37: v1beta1.RemoveDeviceModelRequest - (*RemoveDeviceModelResponse)(nil), // 38: v1beta1.RemoveDeviceModelResponse - (*UpdateDeviceRequest)(nil), // 39: v1beta1.UpdateDeviceRequest - (*UpdateDeviceResponse)(nil), // 40: v1beta1.UpdateDeviceResponse - (*UpdateDeviceModelRequest)(nil), // 41: v1beta1.UpdateDeviceModelRequest - (*UpdateDeviceModelResponse)(nil), // 42: v1beta1.UpdateDeviceModelResponse - (*GetDeviceRequest)(nil), // 43: v1beta1.GetDeviceRequest - (*GetDeviceResponse)(nil), // 44: v1beta1.GetDeviceResponse - nil, // 45: v1beta1.CustomizedValue.DataEntry - nil, // 46: v1beta1.Influxdb2DataConfig.TagEntry - nil, // 47: v1beta1.TwinProperty.MetadataEntry - (*any1.Any)(nil), // 48: google.protobuf.Any + (*ReportDeviceStatesRequest)(nil), // 27: v1beta1.ReportDeviceStatesRequest + (*DeviceStatus)(nil), // 28: v1beta1.DeviceStatus + (*Twin)(nil), // 29: v1beta1.Twin + (*TwinProperty)(nil), // 30: v1beta1.TwinProperty + (*ReportDeviceStatusResponse)(nil), // 31: v1beta1.ReportDeviceStatusResponse + (*ReportDeviceStatesResponse)(nil), // 32: v1beta1.ReportDeviceStatesResponse + (*RegisterDeviceRequest)(nil), // 33: v1beta1.RegisterDeviceRequest + (*RegisterDeviceResponse)(nil), // 34: v1beta1.RegisterDeviceResponse + (*CreateDeviceModelRequest)(nil), // 35: v1beta1.CreateDeviceModelRequest + (*CreateDeviceModelResponse)(nil), // 36: v1beta1.CreateDeviceModelResponse + (*RemoveDeviceRequest)(nil), // 37: v1beta1.RemoveDeviceRequest + (*RemoveDeviceResponse)(nil), // 38: v1beta1.RemoveDeviceResponse + (*RemoveDeviceModelRequest)(nil), // 39: v1beta1.RemoveDeviceModelRequest + (*RemoveDeviceModelResponse)(nil), // 40: v1beta1.RemoveDeviceModelResponse + (*UpdateDeviceRequest)(nil), // 41: v1beta1.UpdateDeviceRequest + (*UpdateDeviceResponse)(nil), // 42: v1beta1.UpdateDeviceResponse + (*UpdateDeviceModelRequest)(nil), // 43: v1beta1.UpdateDeviceModelRequest + (*UpdateDeviceModelResponse)(nil), // 44: v1beta1.UpdateDeviceModelResponse + (*GetDeviceRequest)(nil), // 45: v1beta1.GetDeviceRequest + (*GetDeviceResponse)(nil), // 46: v1beta1.GetDeviceResponse + nil, // 47: v1beta1.CustomizedValue.DataEntry + nil, // 48: v1beta1.Influxdb2DataConfig.TagEntry + nil, // 49: v1beta1.TwinProperty.MetadataEntry + (*anypb.Any)(nil), // 50: google.protobuf.Any } var file_api_proto_depIdxs = []int32{ 25, // 0: v1beta1.MapperRegisterRequest.mapper:type_name -> v1beta1.MapperInfo @@ -3188,15 +3304,15 @@ var file_api_proto_depIdxs = []int32{ 4, // 4: v1beta1.DeviceModelSpec.properties:type_name -> v1beta1.ModelProperty 5, // 5: v1beta1.DeviceModelSpec.commands:type_name -> v1beta1.DeviceCommand 7, // 6: v1beta1.Device.spec:type_name -> v1beta1.DeviceSpec - 27, // 7: v1beta1.Device.status:type_name -> v1beta1.DeviceStatus + 28, // 7: v1beta1.Device.status:type_name -> v1beta1.DeviceStatus 9, // 8: v1beta1.DeviceSpec.protocol:type_name -> v1beta1.ProtocolConfig 8, // 9: v1beta1.DeviceSpec.properties:type_name -> v1beta1.DeviceProperty - 29, // 10: v1beta1.DeviceProperty.desired:type_name -> v1beta1.TwinProperty + 30, // 10: v1beta1.DeviceProperty.desired:type_name -> v1beta1.TwinProperty 10, // 11: v1beta1.DeviceProperty.visitors:type_name -> v1beta1.VisitorConfig 12, // 12: v1beta1.DeviceProperty.pushMethod:type_name -> v1beta1.PushMethod 11, // 13: v1beta1.ProtocolConfig.configData:type_name -> v1beta1.CustomizedValue 11, // 14: v1beta1.VisitorConfig.configData:type_name -> v1beta1.CustomizedValue - 45, // 15: v1beta1.CustomizedValue.data:type_name -> v1beta1.CustomizedValue.DataEntry + 47, // 15: v1beta1.CustomizedValue.data:type_name -> v1beta1.CustomizedValue.DataEntry 13, // 16: v1beta1.PushMethod.http:type_name -> v1beta1.PushMethodHTTP 14, // 17: v1beta1.PushMethod.mqtt:type_name -> v1beta1.PushMethodMQTT 15, // 18: v1beta1.PushMethod.dbMethod:type_name -> v1beta1.DBMethod @@ -3206,41 +3322,43 @@ var file_api_proto_depIdxs = []int32{ 23, // 22: v1beta1.DBMethod.mysql:type_name -> v1beta1.DBMethodMySQL 18, // 23: v1beta1.DBMethodInfluxdb2.influxdb2ClientConfig:type_name -> v1beta1.Influxdb2ClientConfig 17, // 24: v1beta1.DBMethodInfluxdb2.influxdb2DataConfig:type_name -> v1beta1.Influxdb2DataConfig - 46, // 25: v1beta1.Influxdb2DataConfig.tag:type_name -> v1beta1.Influxdb2DataConfig.TagEntry + 48, // 25: v1beta1.Influxdb2DataConfig.tag:type_name -> v1beta1.Influxdb2DataConfig.TagEntry 20, // 26: v1beta1.DBMethodRedis.redisClientConfig:type_name -> v1beta1.RedisClientConfig 22, // 27: v1beta1.DBMethodTDEngine.tdEngineClientConfig:type_name -> v1beta1.TDEngineClientConfig 24, // 28: v1beta1.DBMethodMySQL.mysqlClientConfig:type_name -> v1beta1.MySQLClientConfig - 27, // 29: v1beta1.ReportDeviceStatusRequest.reportedDevice:type_name -> v1beta1.DeviceStatus - 28, // 30: v1beta1.DeviceStatus.twins:type_name -> v1beta1.Twin - 29, // 31: v1beta1.Twin.observedDesired:type_name -> v1beta1.TwinProperty - 29, // 32: v1beta1.Twin.reported:type_name -> v1beta1.TwinProperty - 47, // 33: v1beta1.TwinProperty.metadata:type_name -> v1beta1.TwinProperty.MetadataEntry + 28, // 29: v1beta1.ReportDeviceStatusRequest.reportedDevice:type_name -> v1beta1.DeviceStatus + 29, // 30: v1beta1.DeviceStatus.twins:type_name -> v1beta1.Twin + 30, // 31: v1beta1.Twin.observedDesired:type_name -> v1beta1.TwinProperty + 30, // 32: v1beta1.Twin.reported:type_name -> v1beta1.TwinProperty + 49, // 33: v1beta1.TwinProperty.metadata:type_name -> v1beta1.TwinProperty.MetadataEntry 6, // 34: v1beta1.RegisterDeviceRequest.device:type_name -> v1beta1.Device 2, // 35: v1beta1.CreateDeviceModelRequest.model:type_name -> v1beta1.DeviceModel 6, // 36: v1beta1.UpdateDeviceRequest.device:type_name -> v1beta1.Device 2, // 37: v1beta1.UpdateDeviceModelRequest.model:type_name -> v1beta1.DeviceModel 6, // 38: v1beta1.GetDeviceResponse.device:type_name -> v1beta1.Device - 48, // 39: v1beta1.CustomizedValue.DataEntry.value:type_name -> google.protobuf.Any + 50, // 39: v1beta1.CustomizedValue.DataEntry.value:type_name -> google.protobuf.Any 0, // 40: v1beta1.DeviceManagerService.MapperRegister:input_type -> v1beta1.MapperRegisterRequest 26, // 41: v1beta1.DeviceManagerService.ReportDeviceStatus:input_type -> v1beta1.ReportDeviceStatusRequest - 31, // 42: v1beta1.DeviceMapperService.RegisterDevice:input_type -> v1beta1.RegisterDeviceRequest - 35, // 43: v1beta1.DeviceMapperService.RemoveDevice:input_type -> v1beta1.RemoveDeviceRequest - 39, // 44: v1beta1.DeviceMapperService.UpdateDevice:input_type -> v1beta1.UpdateDeviceRequest - 33, // 45: v1beta1.DeviceMapperService.CreateDeviceModel:input_type -> v1beta1.CreateDeviceModelRequest - 37, // 46: v1beta1.DeviceMapperService.RemoveDeviceModel:input_type -> v1beta1.RemoveDeviceModelRequest - 41, // 47: v1beta1.DeviceMapperService.UpdateDeviceModel:input_type -> v1beta1.UpdateDeviceModelRequest - 43, // 48: v1beta1.DeviceMapperService.GetDevice:input_type -> v1beta1.GetDeviceRequest - 1, // 49: v1beta1.DeviceManagerService.MapperRegister:output_type -> v1beta1.MapperRegisterResponse - 30, // 50: v1beta1.DeviceManagerService.ReportDeviceStatus:output_type -> v1beta1.ReportDeviceStatusResponse - 32, // 51: v1beta1.DeviceMapperService.RegisterDevice:output_type -> v1beta1.RegisterDeviceResponse - 36, // 52: v1beta1.DeviceMapperService.RemoveDevice:output_type -> v1beta1.RemoveDeviceResponse - 40, // 53: v1beta1.DeviceMapperService.UpdateDevice:output_type -> v1beta1.UpdateDeviceResponse - 34, // 54: v1beta1.DeviceMapperService.CreateDeviceModel:output_type -> v1beta1.CreateDeviceModelResponse - 38, // 55: v1beta1.DeviceMapperService.RemoveDeviceModel:output_type -> v1beta1.RemoveDeviceModelResponse - 42, // 56: v1beta1.DeviceMapperService.UpdateDeviceModel:output_type -> v1beta1.UpdateDeviceModelResponse - 44, // 57: v1beta1.DeviceMapperService.GetDevice:output_type -> v1beta1.GetDeviceResponse - 49, // [49:58] is the sub-list for method output_type - 40, // [40:49] is the sub-list for method input_type + 27, // 42: v1beta1.DeviceManagerService.ReportDeviceStates:input_type -> v1beta1.ReportDeviceStatesRequest + 33, // 43: v1beta1.DeviceMapperService.RegisterDevice:input_type -> v1beta1.RegisterDeviceRequest + 37, // 44: v1beta1.DeviceMapperService.RemoveDevice:input_type -> v1beta1.RemoveDeviceRequest + 41, // 45: v1beta1.DeviceMapperService.UpdateDevice:input_type -> v1beta1.UpdateDeviceRequest + 35, // 46: v1beta1.DeviceMapperService.CreateDeviceModel:input_type -> v1beta1.CreateDeviceModelRequest + 39, // 47: v1beta1.DeviceMapperService.RemoveDeviceModel:input_type -> v1beta1.RemoveDeviceModelRequest + 43, // 48: v1beta1.DeviceMapperService.UpdateDeviceModel:input_type -> v1beta1.UpdateDeviceModelRequest + 45, // 49: v1beta1.DeviceMapperService.GetDevice:input_type -> v1beta1.GetDeviceRequest + 1, // 50: v1beta1.DeviceManagerService.MapperRegister:output_type -> v1beta1.MapperRegisterResponse + 31, // 51: v1beta1.DeviceManagerService.ReportDeviceStatus:output_type -> v1beta1.ReportDeviceStatusResponse + 32, // 52: v1beta1.DeviceManagerService.ReportDeviceStates:output_type -> v1beta1.ReportDeviceStatesResponse + 34, // 53: v1beta1.DeviceMapperService.RegisterDevice:output_type -> v1beta1.RegisterDeviceResponse + 38, // 54: v1beta1.DeviceMapperService.RemoveDevice:output_type -> v1beta1.RemoveDeviceResponse + 42, // 55: v1beta1.DeviceMapperService.UpdateDevice:output_type -> v1beta1.UpdateDeviceResponse + 36, // 56: v1beta1.DeviceMapperService.CreateDeviceModel:output_type -> v1beta1.CreateDeviceModelResponse + 40, // 57: v1beta1.DeviceMapperService.RemoveDeviceModel:output_type -> v1beta1.RemoveDeviceModelResponse + 44, // 58: v1beta1.DeviceMapperService.UpdateDeviceModel:output_type -> v1beta1.UpdateDeviceModelResponse + 46, // 59: v1beta1.DeviceMapperService.GetDevice:output_type -> v1beta1.GetDeviceResponse + 50, // [50:60] is the sub-list for method output_type + 40, // [40:50] 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 @@ -3577,7 +3695,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeviceStatus); i { + switch v := v.(*ReportDeviceStatesRequest); i { case 0: return &v.state case 1: @@ -3589,7 +3707,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Twin); i { + switch v := v.(*DeviceStatus); i { case 0: return &v.state case 1: @@ -3601,7 +3719,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TwinProperty); i { + switch v := v.(*Twin); i { case 0: return &v.state case 1: @@ -3613,7 +3731,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReportDeviceStatusResponse); i { + switch v := v.(*TwinProperty); i { case 0: return &v.state case 1: @@ -3625,7 +3743,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterDeviceRequest); i { + switch v := v.(*ReportDeviceStatusResponse); i { case 0: return &v.state case 1: @@ -3637,7 +3755,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterDeviceResponse); i { + switch v := v.(*ReportDeviceStatesResponse); i { case 0: return &v.state case 1: @@ -3649,7 +3767,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateDeviceModelRequest); i { + switch v := v.(*RegisterDeviceRequest); i { case 0: return &v.state case 1: @@ -3661,7 +3779,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateDeviceModelResponse); i { + switch v := v.(*RegisterDeviceResponse); i { case 0: return &v.state case 1: @@ -3673,7 +3791,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveDeviceRequest); i { + switch v := v.(*CreateDeviceModelRequest); i { case 0: return &v.state case 1: @@ -3685,7 +3803,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveDeviceResponse); i { + switch v := v.(*CreateDeviceModelResponse); i { case 0: return &v.state case 1: @@ -3697,7 +3815,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveDeviceModelRequest); i { + switch v := v.(*RemoveDeviceRequest); i { case 0: return &v.state case 1: @@ -3709,7 +3827,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveDeviceModelResponse); i { + switch v := v.(*RemoveDeviceResponse); i { case 0: return &v.state case 1: @@ -3721,7 +3839,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateDeviceRequest); i { + switch v := v.(*RemoveDeviceModelRequest); i { case 0: return &v.state case 1: @@ -3733,7 +3851,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateDeviceResponse); i { + switch v := v.(*RemoveDeviceModelResponse); i { case 0: return &v.state case 1: @@ -3745,7 +3863,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateDeviceModelRequest); i { + switch v := v.(*UpdateDeviceRequest); i { case 0: return &v.state case 1: @@ -3757,7 +3875,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateDeviceModelResponse); i { + switch v := v.(*UpdateDeviceResponse); i { case 0: return &v.state case 1: @@ -3769,7 +3887,7 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDeviceRequest); i { + switch v := v.(*UpdateDeviceModelRequest); i { case 0: return &v.state case 1: @@ -3781,6 +3899,30 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateDeviceModelResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDeviceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetDeviceResponse); i { case 0: return &v.state @@ -3799,7 +3941,7 @@ func file_api_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_proto_rawDesc, NumEnums: 0, - NumMessages: 48, + NumMessages: 50, NumExtensions: 0, NumServices: 2, }, diff --git a/pkg/apis/dmi/v1beta1/api.proto b/pkg/apis/dmi/v1beta1/api.proto index 843bf6070..1542c7b84 100644 --- a/pkg/apis/dmi/v1beta1/api.proto +++ b/pkg/apis/dmi/v1beta1/api.proto @@ -37,6 +37,9 @@ service DeviceManagerService { // When the mapper collects some properties of a device, it can make them a map of device twins // and report it to the device manager through the interface of ReportDeviceStatus. rpc ReportDeviceStatus(ReportDeviceStatusRequest) returns (ReportDeviceStatusResponse) {} + // TODO Rename ReportDeviceStatus to ReportDeviceTwins + // ReportDeviceStates reports the state of devices to device manager. + rpc ReportDeviceStates(ReportDeviceStatesRequest) returns (ReportDeviceStatesResponse) {} } // DeviceMapperService defines the public APIS for remote device management. @@ -340,6 +343,14 @@ message ReportDeviceStatusRequest { string deviceNamespace = 3; } + +message ReportDeviceStatesRequest { + string deviceName = 1; + string deviceNamespace = 2; + string state = 3; +} + + // DeviceStatus is the status of the device. message DeviceStatus { // the device twins of the device. @@ -366,6 +377,8 @@ message TwinProperty { message ReportDeviceStatusResponse {} +message ReportDeviceStatesResponse {} + message RegisterDeviceRequest { Device device = 1; } diff --git a/pkg/apis/dmi/v1beta1/api_grpc.pb.go b/pkg/apis/dmi/v1beta1/api_grpc.pb.go index f4c8437b2..31ae67626 100644 --- a/pkg/apis/dmi/v1beta1/api_grpc.pb.go +++ b/pkg/apis/dmi/v1beta1/api_grpc.pb.go @@ -1,24 +1,25 @@ -// -//Copyright 2023 The KubeEdge Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. +/* +Copyright 2023 The KubeEdge Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ // To regenerate api.pb.go run hack/generate-dmi.sh -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.6.1 +// protoc-gen-go v1.26.0 +// protoc v3.19.4 // source: api.proto package v1beta1 @@ -35,11 +36,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - DeviceManagerService_MapperRegister_FullMethodName = "/v1beta1.DeviceManagerService/MapperRegister" - DeviceManagerService_ReportDeviceStatus_FullMethodName = "/v1beta1.DeviceManagerService/ReportDeviceStatus" -) - // DeviceManagerServiceClient is the client API for DeviceManagerService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -52,6 +48,8 @@ type DeviceManagerServiceClient interface { // When the mapper collects some properties of a device, it can make them a map of device twins // and report it to the device manager through the interface of ReportDeviceStatus. ReportDeviceStatus(ctx context.Context, in *ReportDeviceStatusRequest, opts ...grpc.CallOption) (*ReportDeviceStatusResponse, error) + // ReportDeviceStates reports the state of devices to device manager. + ReportDeviceStates(ctx context.Context, in *ReportDeviceStatesRequest, opts ...grpc.CallOption) (*ReportDeviceStatesResponse, error) } type deviceManagerServiceClient struct { @@ -64,7 +62,7 @@ func NewDeviceManagerServiceClient(cc grpc.ClientConnInterface) DeviceManagerSer func (c *deviceManagerServiceClient) MapperRegister(ctx context.Context, in *MapperRegisterRequest, opts ...grpc.CallOption) (*MapperRegisterResponse, error) { out := new(MapperRegisterResponse) - err := c.cc.Invoke(ctx, DeviceManagerService_MapperRegister_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/v1beta1.DeviceManagerService/MapperRegister", in, out, opts...) if err != nil { return nil, err } @@ -73,7 +71,16 @@ func (c *deviceManagerServiceClient) MapperRegister(ctx context.Context, in *Map func (c *deviceManagerServiceClient) ReportDeviceStatus(ctx context.Context, in *ReportDeviceStatusRequest, opts ...grpc.CallOption) (*ReportDeviceStatusResponse, error) { out := new(ReportDeviceStatusResponse) - err := c.cc.Invoke(ctx, DeviceManagerService_ReportDeviceStatus_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/v1beta1.DeviceManagerService/ReportDeviceStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceManagerServiceClient) ReportDeviceStates(ctx context.Context, in *ReportDeviceStatesRequest, opts ...grpc.CallOption) (*ReportDeviceStatesResponse, error) { + out := new(ReportDeviceStatesResponse) + err := c.cc.Invoke(ctx, "/v1beta1.DeviceManagerService/ReportDeviceStates", in, out, opts...) if err != nil { return nil, err } @@ -92,6 +99,8 @@ type DeviceManagerServiceServer interface { // When the mapper collects some properties of a device, it can make them a map of device twins // and report it to the device manager through the interface of ReportDeviceStatus. ReportDeviceStatus(context.Context, *ReportDeviceStatusRequest) (*ReportDeviceStatusResponse, error) + // ReportDeviceStates reports the state of devices to device manager. + ReportDeviceStates(context.Context, *ReportDeviceStatesRequest) (*ReportDeviceStatesResponse, error) mustEmbedUnimplementedDeviceManagerServiceServer() } @@ -105,6 +114,9 @@ func (UnimplementedDeviceManagerServiceServer) MapperRegister(context.Context, * func (UnimplementedDeviceManagerServiceServer) ReportDeviceStatus(context.Context, *ReportDeviceStatusRequest) (*ReportDeviceStatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ReportDeviceStatus not implemented") } +func (UnimplementedDeviceManagerServiceServer) ReportDeviceStates(context.Context, *ReportDeviceStatesRequest) (*ReportDeviceStatesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReportDeviceStates not implemented") +} func (UnimplementedDeviceManagerServiceServer) mustEmbedUnimplementedDeviceManagerServiceServer() {} // UnsafeDeviceManagerServiceServer may be embedded to opt out of forward compatibility for this service. @@ -128,7 +140,7 @@ func _DeviceManagerService_MapperRegister_Handler(srv interface{}, ctx context.C } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DeviceManagerService_MapperRegister_FullMethodName, + FullMethod: "/v1beta1.DeviceManagerService/MapperRegister", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DeviceManagerServiceServer).MapperRegister(ctx, req.(*MapperRegisterRequest)) @@ -146,7 +158,7 @@ func _DeviceManagerService_ReportDeviceStatus_Handler(srv interface{}, ctx conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DeviceManagerService_ReportDeviceStatus_FullMethodName, + FullMethod: "/v1beta1.DeviceManagerService/ReportDeviceStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DeviceManagerServiceServer).ReportDeviceStatus(ctx, req.(*ReportDeviceStatusRequest)) @@ -154,6 +166,24 @@ func _DeviceManagerService_ReportDeviceStatus_Handler(srv interface{}, ctx conte return interceptor(ctx, in, info, handler) } +func _DeviceManagerService_ReportDeviceStates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReportDeviceStatesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceManagerServiceServer).ReportDeviceStates(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/v1beta1.DeviceManagerService/ReportDeviceStates", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceManagerServiceServer).ReportDeviceStates(ctx, req.(*ReportDeviceStatesRequest)) + } + return interceptor(ctx, in, info, handler) +} + // DeviceManagerService_ServiceDesc is the grpc.ServiceDesc for DeviceManagerService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -169,21 +199,15 @@ var DeviceManagerService_ServiceDesc = grpc.ServiceDesc{ MethodName: "ReportDeviceStatus", Handler: _DeviceManagerService_ReportDeviceStatus_Handler, }, + { + MethodName: "ReportDeviceStates", + Handler: _DeviceManagerService_ReportDeviceStates_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "api.proto", } -const ( - DeviceMapperService_RegisterDevice_FullMethodName = "/v1beta1.DeviceMapperService/RegisterDevice" - DeviceMapperService_RemoveDevice_FullMethodName = "/v1beta1.DeviceMapperService/RemoveDevice" - DeviceMapperService_UpdateDevice_FullMethodName = "/v1beta1.DeviceMapperService/UpdateDevice" - DeviceMapperService_CreateDeviceModel_FullMethodName = "/v1beta1.DeviceMapperService/CreateDeviceModel" - DeviceMapperService_RemoveDeviceModel_FullMethodName = "/v1beta1.DeviceMapperService/RemoveDeviceModel" - DeviceMapperService_UpdateDeviceModel_FullMethodName = "/v1beta1.DeviceMapperService/UpdateDeviceModel" - DeviceMapperService_GetDevice_FullMethodName = "/v1beta1.DeviceMapperService/GetDevice" -) - // DeviceMapperServiceClient is the client API for DeviceMapperService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -243,7 +267,7 @@ func NewDeviceMapperServiceClient(cc grpc.ClientConnInterface) DeviceMapperServi func (c *deviceMapperServiceClient) RegisterDevice(ctx context.Context, in *RegisterDeviceRequest, opts ...grpc.CallOption) (*RegisterDeviceResponse, error) { out := new(RegisterDeviceResponse) - err := c.cc.Invoke(ctx, DeviceMapperService_RegisterDevice_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/v1beta1.DeviceMapperService/RegisterDevice", in, out, opts...) if err != nil { return nil, err } @@ -252,7 +276,7 @@ func (c *deviceMapperServiceClient) RegisterDevice(ctx context.Context, in *Regi func (c *deviceMapperServiceClient) RemoveDevice(ctx context.Context, in *RemoveDeviceRequest, opts ...grpc.CallOption) (*RemoveDeviceResponse, error) { out := new(RemoveDeviceResponse) - err := c.cc.Invoke(ctx, DeviceMapperService_RemoveDevice_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/v1beta1.DeviceMapperService/RemoveDevice", in, out, opts...) if err != nil { return nil, err } @@ -261,7 +285,7 @@ func (c *deviceMapperServiceClient) RemoveDevice(ctx context.Context, in *Remove func (c *deviceMapperServiceClient) UpdateDevice(ctx context.Context, in *UpdateDeviceRequest, opts ...grpc.CallOption) (*UpdateDeviceResponse, error) { out := new(UpdateDeviceResponse) - err := c.cc.Invoke(ctx, DeviceMapperService_UpdateDevice_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/v1beta1.DeviceMapperService/UpdateDevice", in, out, opts...) if err != nil { return nil, err } @@ -270,7 +294,7 @@ func (c *deviceMapperServiceClient) UpdateDevice(ctx context.Context, in *Update func (c *deviceMapperServiceClient) CreateDeviceModel(ctx context.Context, in *CreateDeviceModelRequest, opts ...grpc.CallOption) (*CreateDeviceModelResponse, error) { out := new(CreateDeviceModelResponse) - err := c.cc.Invoke(ctx, DeviceMapperService_CreateDeviceModel_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/v1beta1.DeviceMapperService/CreateDeviceModel", in, out, opts...) if err != nil { return nil, err } @@ -279,7 +303,7 @@ func (c *deviceMapperServiceClient) CreateDeviceModel(ctx context.Context, in *C func (c *deviceMapperServiceClient) RemoveDeviceModel(ctx context.Context, in *RemoveDeviceModelRequest, opts ...grpc.CallOption) (*RemoveDeviceModelResponse, error) { out := new(RemoveDeviceModelResponse) - err := c.cc.Invoke(ctx, DeviceMapperService_RemoveDeviceModel_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/v1beta1.DeviceMapperService/RemoveDeviceModel", in, out, opts...) if err != nil { return nil, err } @@ -288,7 +312,7 @@ func (c *deviceMapperServiceClient) RemoveDeviceModel(ctx context.Context, in *R func (c *deviceMapperServiceClient) UpdateDeviceModel(ctx context.Context, in *UpdateDeviceModelRequest, opts ...grpc.CallOption) (*UpdateDeviceModelResponse, error) { out := new(UpdateDeviceModelResponse) - err := c.cc.Invoke(ctx, DeviceMapperService_UpdateDeviceModel_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/v1beta1.DeviceMapperService/UpdateDeviceModel", in, out, opts...) if err != nil { return nil, err } @@ -297,7 +321,7 @@ func (c *deviceMapperServiceClient) UpdateDeviceModel(ctx context.Context, in *U func (c *deviceMapperServiceClient) GetDevice(ctx context.Context, in *GetDeviceRequest, opts ...grpc.CallOption) (*GetDeviceResponse, error) { out := new(GetDeviceResponse) - err := c.cc.Invoke(ctx, DeviceMapperService_GetDevice_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/v1beta1.DeviceMapperService/GetDevice", in, out, opts...) if err != nil { return nil, err } @@ -402,7 +426,7 @@ func _DeviceMapperService_RegisterDevice_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DeviceMapperService_RegisterDevice_FullMethodName, + FullMethod: "/v1beta1.DeviceMapperService/RegisterDevice", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DeviceMapperServiceServer).RegisterDevice(ctx, req.(*RegisterDeviceRequest)) @@ -420,7 +444,7 @@ func _DeviceMapperService_RemoveDevice_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DeviceMapperService_RemoveDevice_FullMethodName, + FullMethod: "/v1beta1.DeviceMapperService/RemoveDevice", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DeviceMapperServiceServer).RemoveDevice(ctx, req.(*RemoveDeviceRequest)) @@ -438,7 +462,7 @@ func _DeviceMapperService_UpdateDevice_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DeviceMapperService_UpdateDevice_FullMethodName, + FullMethod: "/v1beta1.DeviceMapperService/UpdateDevice", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DeviceMapperServiceServer).UpdateDevice(ctx, req.(*UpdateDeviceRequest)) @@ -456,7 +480,7 @@ func _DeviceMapperService_CreateDeviceModel_Handler(srv interface{}, ctx context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DeviceMapperService_CreateDeviceModel_FullMethodName, + FullMethod: "/v1beta1.DeviceMapperService/CreateDeviceModel", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DeviceMapperServiceServer).CreateDeviceModel(ctx, req.(*CreateDeviceModelRequest)) @@ -474,7 +498,7 @@ func _DeviceMapperService_RemoveDeviceModel_Handler(srv interface{}, ctx context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DeviceMapperService_RemoveDeviceModel_FullMethodName, + FullMethod: "/v1beta1.DeviceMapperService/RemoveDeviceModel", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DeviceMapperServiceServer).RemoveDeviceModel(ctx, req.(*RemoveDeviceModelRequest)) @@ -492,7 +516,7 @@ func _DeviceMapperService_UpdateDeviceModel_Handler(srv interface{}, ctx context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DeviceMapperService_UpdateDeviceModel_FullMethodName, + FullMethod: "/v1beta1.DeviceMapperService/UpdateDeviceModel", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DeviceMapperServiceServer).UpdateDeviceModel(ctx, req.(*UpdateDeviceModelRequest)) @@ -510,7 +534,7 @@ func _DeviceMapperService_GetDevice_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: DeviceMapperService_GetDevice_FullMethodName, + FullMethod: "/v1beta1.DeviceMapperService/GetDevice", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DeviceMapperServiceServer).GetDevice(ctx, req.(*GetDeviceRequest)) diff --git a/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/device.go b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/device.go index c8c7fe947..9f909d57f 100644 --- a/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/device.go +++ b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/device.go @@ -149,6 +149,12 @@ func dataHandler(ctx context.Context, dev *driver.CustomizedDev) { ReportToCloud: twin.Property.ReportToCloud, } go twinData.Run(ctx) + + //handle status + getStates := &DeviceStates{Client: dev.CustomizedClient, DeviceName: dev.Instance.Name, + DeviceNamespace: dev.Instance.Namespace} + go getStates.Run(ctx) + // handle push method if twin.Property.PushMethod.MethodConfig != nil && twin.Property.PushMethod.MethodName != "" { dataModel := common.NewDataModel(dev.Instance.Name, twin.Property.PropertyName, dev.Instance.Namespace, common.WithType(twin.ObservedDesired.Metadata.Type)) diff --git a/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/devicestatus.go b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/devicestatus.go new file mode 100644 index 000000000..ccac57775 --- /dev/null +++ b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/devicestatus.go @@ -0,0 +1,69 @@ +/* +Copyright 2024 The KubeEdge Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package device + +import ( + "context" + "log" + "time" + + "k8s.io/klog/v2" + + "github.com/kubeedge/Template/driver" + dmiapi "github.com/kubeedge/kubeedge/pkg/apis/dmi/v1beta1" + "github.com/kubeedge/mapper-framework/pkg/grpcclient" +) + +// DeviceStates is structure for getting device states. +type DeviceStates struct { + Client *driver.CustomizedClient + DeviceName string + DeviceNamespace string +} + +// Run timer function. +func (deviceStates *DeviceStates) PushStatesToEdgeCore() { + states, error := deviceStates.Client.GetDeviceStates() + if error != nil { + klog.Errorf("GetDeviceStates failed: %v", error) + return + } + + statesRequest := &dmiapi.ReportDeviceStatesRequest{ + DeviceName: deviceStates.DeviceName, + State: states, + DeviceNamespace: deviceStates.DeviceNamespace, + } + + log.Printf("send statesRequest", statesRequest.DeviceName, statesRequest.State) + if err := grpcclient.ReportDeviceStates(statesRequest); err != nil { + klog.Errorf("fail to report device states of %s with err: %+v", deviceStates.DeviceName, err) + } +} + +func (deviceStates *DeviceStates) Run(ctx context.Context) { + // TODO setting states reportCycle + ticker := time.NewTicker(2 * time.Second) + for { + select { + case <-ticker.C: + deviceStates.PushStatesToEdgeCore() + case <-ctx.Done(): + return + } + } +} diff --git a/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/driver/driver.go b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/driver/driver.go index f79fcce08..51c33faa7 100644 --- a/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/driver/driver.go +++ b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/driver/driver.go @@ -2,6 +2,8 @@ package driver import ( "sync" + + "github.com/kubeedge/mapper-framework/pkg/common" ) func NewClient(protocol ProtocolConfig) (*CustomizedClient, error) { @@ -36,3 +38,8 @@ func (c *CustomizedClient) StopDevice() error { // you can use c.ProtocolConfig return nil } + +func (c *CustomizedClient) GetDeviceStates() (string, error) { + // TODO: GetDeviceStates + return common.DeviceStatusOK, nil +} diff --git a/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/go.mod b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/go.mod index 252277277..db112ca4c 100644 --- a/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/go.mod +++ b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/go.mod @@ -6,18 +6,11 @@ require ( github.com/eclipse/paho.mqtt.golang v1.2.0 github.com/go-redis/redis/v8 v8.11.5 github.com/go-sql-driver/mysql v1.7.1 - github.com/golang/protobuf v1.5.3 // indirect - github.com/gorilla/mux v1.8.0 // indirect github.com/influxdata/influxdb-client-go/v2 v2.13.0 github.com/kubeedge/kubeedge v0.0.0 github.com/kubeedge/mapper-framework v0.0.0 github.com/sailorvii/goav v0.1.4 - github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace // indirect github.com/taosdata/driver-go/v3 v3.5.1 - golang.org/x/net v0.17.0 // indirect - google.golang.org/grpc v1.53.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/klog/v2 v2.100.1 ) @@ -26,8 +19,10 @@ require ( github.com/avast/retry-go v3.0.0+incompatible // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/go-logr/logr v1.2.4 // indirect - github.com/google/uuid v1.3.1 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -35,9 +30,14 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/oapi-codegen/runtime v1.0.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect - google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect + github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/grpc v1.63.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect ) replace ( diff --git a/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/go.sum b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/go.sum index ab00f7702..78753ce98 100644 --- a/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/go.sum +++ b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/go.sum @@ -16,21 +16,19 @@ github.com/eclipse/paho.mqtt.golang v1.2.0 h1:1F8mhG9+aO5/xpdtFkW4SxOJB67ukuDC3t github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= @@ -67,24 +65,21 @@ github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKk github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/taosdata/driver-go/v3 v3.5.1 h1:ln8gLJ6HR6gHU6dodmOa9utUjPUpAcdIplh6arFO26Q= github.com/taosdata/driver-go/v3 v3.5.1/go.mod h1:H2vo/At+rOPY1aMzUV9P49SVX7NlXb3LAbKw+MCLrmU= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= -google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/grpc v1.63.0 h1:WjKe+dnvABXyPJMD7KDNLxtoGk5tgk+YFWN6cBWjZE8= +google.golang.org/grpc v1.63.0/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= diff --git a/staging/src/github.com/kubeedge/mapper-framework/pkg/common/const.go b/staging/src/github.com/kubeedge/mapper-framework/pkg/common/const.go index 6352e2120..5a3b1e0fe 100644 --- a/staging/src/github.com/kubeedge/mapper-framework/pkg/common/const.go +++ b/staging/src/github.com/kubeedge/mapper-framework/pkg/common/const.go @@ -20,11 +20,12 @@ import "time" // Device status definition. const ( - DEVSTOK = "OK" - DEVSTERR = "ERROR" /* Expected value is not equal as setting */ - DEVSTDISCONN = "DISCONNECTED" /* Disconnected */ - DEVSTUNHEALTHY = "UNHEALTHY" /* Unhealthy status from device */ - DEVSTUNKNOWN = "UNKNOWN" + DeviceStatusOK = "ok" + DeviceStatusOnline = "online" + DeviceStatusOffline = "offline" + DeviceStatusDisCONN = "disconnected" /* Disconnected */ + DeviceStatusUnhealthy = "unhealthy" /* Unhealthy status from device */ + DeviceStatusUnknown = "unknown" ) const ( ProtocolCustomized = "customized-protocol" diff --git a/staging/src/github.com/kubeedge/mapper-framework/pkg/grpcclient/register.go b/staging/src/github.com/kubeedge/mapper-framework/pkg/grpcclient/register.go index 1756ee8c2..723a403f3 100644 --- a/staging/src/github.com/kubeedge/mapper-framework/pkg/grpcclient/register.go +++ b/staging/src/github.com/kubeedge/mapper-framework/pkg/grpcclient/register.go @@ -51,7 +51,7 @@ func RegisterMapper(withData bool) ([]*dmiapi.Device, []*dmiapi.DeviceModel, err ApiVersion: cfg.Common.APIVersion, Protocol: cfg.Common.Protocol, Address: []byte(cfg.GrpcServer.SocketPath), - State: common.DEVSTOK, + State: common.DeviceStatusOK, }, }) if err != nil { diff --git a/staging/src/github.com/kubeedge/mapper-framework/pkg/grpcclient/report.go b/staging/src/github.com/kubeedge/mapper-framework/pkg/grpcclient/report.go index 3e9d2ba0b..eff790c4c 100644 --- a/staging/src/github.com/kubeedge/mapper-framework/pkg/grpcclient/report.go +++ b/staging/src/github.com/kubeedge/mapper-framework/pkg/grpcclient/report.go @@ -44,3 +44,35 @@ func ReportDeviceStatus(request *dmiapi.ReportDeviceStatusRequest) error { _, err = c.ReportDeviceStatus(ctx, request) return err } + +func ReportDeviceStates(request *dmiapi.ReportDeviceStatesRequest) error { + cfg := config.Cfg() + + conn, err := grpc.Dial(cfg.Common.EdgeCoreSock, + grpc.WithInsecure(), + grpc.WithBlock(), + grpc.WithContextDialer( + func(ctx context.Context, s string) (net.Conn, error) { + unixAddress, err := net.ResolveUnixAddr("unix", cfg.Common.EdgeCoreSock) + if err != nil { + return nil, err + } + return net.DialUnix("unix", nil, unixAddress) + }, + ), + ) + if err != nil { + return fmt.Errorf("did not connect: %v", err) + } + defer conn.Close() + + // init Greeter client + c := dmiapi.NewDeviceManagerServiceClient(conn) + + // init context,set timeout + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + defer cancel() + + _, err = c.ReportDeviceStates(ctx, request) + return err +} diff --git a/staging/src/github.com/kubeedge/mapper-framework/pkg/util/parse/grpc.go b/staging/src/github.com/kubeedge/mapper-framework/pkg/util/parse/grpc.go index 0377da069..6f4099bc2 100644 --- a/staging/src/github.com/kubeedge/mapper-framework/pkg/util/parse/grpc.go +++ b/staging/src/github.com/kubeedge/mapper-framework/pkg/util/parse/grpc.go @@ -106,17 +106,17 @@ func buildPropertiesFromGrpc(device *dmiapi.Device) []common.DeviceProperty { var dbconfig common.DBConfig var pushMethod []byte var pushMethodName string - if pptv.PushMethod != nil && pptv.PushMethod.DBMethod != nil { + if pptv.PushMethod != nil && pptv.PushMethod.DbMethod != nil { //parse dbmethod filed switch { - case pptv.PushMethod.DBMethod.Influxdb2 != nil: + case pptv.PushMethod.DbMethod.Influxdb2 != nil: dbMethodName = "influx" - clientconfig, err := json.Marshal(pptv.PushMethod.DBMethod.Influxdb2.Influxdb2ClientConfig) + clientconfig, err := json.Marshal(pptv.PushMethod.DbMethod.Influxdb2.Influxdb2ClientConfig) if err != nil { klog.Errorf("influx client config err: %+v", err) return nil } - dataconfig, err := json.Marshal(pptv.PushMethod.DBMethod.Influxdb2.Influxdb2DataConfig) + dataconfig, err := json.Marshal(pptv.PushMethod.DbMethod.Influxdb2.Influxdb2DataConfig) if err != nil { klog.Errorf("influx data config err: %+v", err) return nil @@ -125,9 +125,9 @@ func buildPropertiesFromGrpc(device *dmiapi.Device) []common.DeviceProperty { Influxdb2ClientConfig: clientconfig, Influxdb2DataConfig: dataconfig, } - case pptv.PushMethod.DBMethod.Redis != nil: + case pptv.PushMethod.DbMethod.Redis != nil: dbMethodName = "redis" - clientConfig, err := json.Marshal(pptv.PushMethod.DBMethod.Redis.RedisClientConfig) + clientConfig, err := json.Marshal(pptv.PushMethod.DbMethod.Redis.RedisClientConfig) if err != nil { klog.Errorf("redis config err: %+v", err) return nil @@ -135,9 +135,9 @@ func buildPropertiesFromGrpc(device *dmiapi.Device) []common.DeviceProperty { dbconfig = common.DBConfig{ RedisClientConfig: clientConfig, } - case pptv.PushMethod.DBMethod.Tdengine != nil: + case pptv.PushMethod.DbMethod.Tdengine != nil: dbMethodName = "tdengine" - clientConfig, err := json.Marshal(pptv.PushMethod.DBMethod.Tdengine.TdEngineClientConfig) + clientConfig, err := json.Marshal(pptv.PushMethod.DbMethod.Tdengine.TdEngineClientConfig) if err != nil { klog.Errorf("tdengine config err: %+v", err) return nil @@ -145,9 +145,9 @@ func buildPropertiesFromGrpc(device *dmiapi.Device) []common.DeviceProperty { dbconfig = common.DBConfig{ TDEngineClientConfig: clientConfig, } - case pptv.PushMethod.DBMethod.Mysql != nil: + case pptv.PushMethod.DbMethod.Mysql != nil: dbMethodName = "mysql" - clientConfig, err := json.Marshal(pptv.PushMethod.DBMethod.Mysql.MysqlClientConfig) + clientConfig, err := json.Marshal(pptv.PushMethod.DbMethod.Mysql.MysqlClientConfig) if err != nil { klog.Errorf("mysql config err: %+v", err) return nil |
