diff --git a/mappers/v1beta1-mapper/modbus/Dockerfile b/mappers/kubeedge-v1.15.0/modbus/Dockerfile similarity index 100% rename from mappers/v1beta1-mapper/modbus/Dockerfile rename to mappers/kubeedge-v1.15.0/modbus/Dockerfile diff --git a/mappers/v1beta1-mapper/modbus/Makefile b/mappers/kubeedge-v1.15.0/modbus/Makefile similarity index 100% rename from mappers/v1beta1-mapper/modbus/Makefile rename to mappers/kubeedge-v1.15.0/modbus/Makefile diff --git a/mappers/v1beta1-mapper/modbus/cmd/main.go b/mappers/kubeedge-v1.15.0/modbus/cmd/main.go similarity index 92% rename from mappers/v1beta1-mapper/modbus/cmd/main.go rename to mappers/kubeedge-v1.15.0/modbus/cmd/main.go index 04559263..78d5d2e6 100644 --- a/mappers/v1beta1-mapper/modbus/cmd/main.go +++ b/mappers/kubeedge-v1.15.0/modbus/cmd/main.go @@ -9,9 +9,9 @@ import ( "github.com/kubeedge/modbus/device" "github.com/kubeedge/modbus/pkg/common" "github.com/kubeedge/modbus/pkg/config" + "github.com/kubeedge/modbus/pkg/grpcclient" "github.com/kubeedge/modbus/pkg/grpcserver" "github.com/kubeedge/modbus/pkg/httpserver" - "github.com/kubeedge/modbus/pkg/util/grpcclient" "github.com/kubeedge/modbus/pkg/util/parse" ) @@ -50,7 +50,7 @@ func main() { // if dev init mode is register, mapper's dev will init when registry to edgecore if c.DevInit.Mode != common.DevInitModeRegister { klog.Infoln("======dev init mode is not register, will register to edgecore") - if _, _, err = grpcclient.RegisterMapper(&c, false); err != nil { + if _, _, err = grpcclient.RegisterMapper(false); err != nil { klog.Fatal(err) } klog.Infoln("registerMapper finished") diff --git a/mappers/v1beta1-mapper/modbus/config.yaml b/mappers/kubeedge-v1.15.0/modbus/config.yaml similarity index 100% rename from mappers/v1beta1-mapper/modbus/config.yaml rename to mappers/kubeedge-v1.15.0/modbus/config.yaml diff --git a/mappers/v1beta1-mapper/modbus/data/dbmethod/influxdb2/client.go b/mappers/kubeedge-v1.15.0/modbus/data/dbmethod/influxdb2/client.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/data/dbmethod/influxdb2/client.go rename to mappers/kubeedge-v1.15.0/modbus/data/dbmethod/influxdb2/client.go diff --git a/mappers/v1beta1-mapper/modbus/data/publish/http/client.go b/mappers/kubeedge-v1.15.0/modbus/data/publish/http/client.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/data/publish/http/client.go rename to mappers/kubeedge-v1.15.0/modbus/data/publish/http/client.go diff --git a/mappers/v1beta1-mapper/modbus/data/publish/mqtt/client.go b/mappers/kubeedge-v1.15.0/modbus/data/publish/mqtt/client.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/data/publish/mqtt/client.go rename to mappers/kubeedge-v1.15.0/modbus/data/publish/mqtt/client.go diff --git a/mappers/v1beta1-mapper/modbus/device/device.go b/mappers/kubeedge-v1.15.0/modbus/device/device.go similarity index 90% rename from mappers/v1beta1-mapper/modbus/device/device.go rename to mappers/kubeedge-v1.15.0/modbus/device/device.go index 6e1bbb9a..109174f9 100644 --- a/mappers/v1beta1-mapper/modbus/device/device.go +++ b/mappers/kubeedge-v1.15.0/modbus/device/device.go @@ -5,7 +5,6 @@ import ( "encoding/json" "errors" "fmt" - "os" "os/signal" "strings" @@ -15,7 +14,6 @@ import ( "k8s.io/klog/v2" dbInflux "github.com/kubeedge/modbus/data/dbmethod/influxdb2" - dbOpenGemini "github.com/kubeedge/modbus/data/dbmethod/openGemini" httpMethod "github.com/kubeedge/modbus/data/publish/http" mqttMethod "github.com/kubeedge/modbus/data/publish/mqtt" "github.com/kubeedge/modbus/driver" @@ -111,6 +109,7 @@ func dataHandler(ctx context.Context, dev *driver.CustomizedDev) { var visitorConfig driver.VisitorConfig err := json.Unmarshal(twin.Property.Visitors, &visitorConfig) + visitorConfig.VisitorConfigData.DataType = strings.ToLower(visitorConfig.VisitorConfigData.DataType) if err != nil { klog.Errorf("Unmarshal VisitorConfig error: %v", err) continue @@ -130,10 +129,10 @@ func dataHandler(ctx context.Context, dev *driver.CustomizedDev) { VisitorConfig: &visitorConfig, Topic: fmt.Sprintf(common.TopicTwinUpdate, dev.Instance.ID), CollectCycle: time.Duration(twin.Property.CollectCycle), + ReportToCloud: twin.Property.ReportToCloud, } go twinData.Run(ctx) // handle push method - // todo need to consider if PushMethod == nil if twin.Property.PushMethod.MethodConfig != nil && twin.Property.PushMethod.MethodName != "" { dataModel := common.NewDataModel(dev.Instance.Name, twin.Property.PropertyName, common.WithType(twin.ObservedDesired.Metadata.Type)) pushHandler(ctx, &twin, dev.CustomizedClient, &visitorConfig, dataModel) @@ -246,50 +245,6 @@ func dbHandler(ctx context.Context, twin *common.Twin, client *driver.Customized } } }() - case "openGemini": - dbConfig, err := dbOpenGemini.NewDataBaseClient(twin.Property.PushMethod.DBMethod.DBConfig.OpenGeminiClientConfig, twin.Property.PushMethod.DBMethod.DBConfig.OpenGeminiDataConfig) - if err != nil { - klog.Errorf("new openGemini database client error: %v", err) - return - } - dbClient, err := dbConfig.InitDbClient() - if err != nil { - klog.Errorf("init openGemini database client err: %v", err) - return - } - reportCycle := time.Duration(twin.Property.ReportCycle) - if reportCycle == 0 { - reportCycle = 1 * time.Second - } - ticker := time.NewTicker(reportCycle) - go func() { - for { - select { - case <-ticker.C: - deviceData, err := client.GetDeviceData(visitorConfig) - if err != nil { - klog.Errorf("publish error: %v", err) - continue - } - sData, err := common.ConvertToString(deviceData) - if err != nil { - klog.Errorf("Failed to convert publish method data : %v", err) - continue - } - dataModel.SetValue(sData) - dataModel.SetTimeStamp() - - err = dbConfig.AddData(dataModel, dbClient) - if err != nil { - klog.Errorf("openGemini database add data error: %v", err) - return - } - case <-ctx.Done(): - dbConfig.CloseSession(dbClient) - return - } - } - }() } } @@ -305,7 +260,7 @@ func setVisitor(visitorConfig *driver.VisitorConfig, twin *common.Twin, dev *dri klog.Errorf("Failed to convert value as %s : %v", twin.Property.PProperty.DataType, err) return err } - _, err = dev.CustomizedClient.SetDeviceData(value, visitorConfig) + err = dev.CustomizedClient.SetDeviceData(value, visitorConfig) if err != nil { return fmt.Errorf("%s set device data error: %v", twin.PropertyName, err) } @@ -322,7 +277,7 @@ func (d *DevPanel) DevInit(cfg *config.Config) error { // return err // } case common.DevInitModeRegister: - if err := parse.ParseByUsingRegister(cfg, devs, d.models, d.protocols); err != nil { + if err := parse.ParseByUsingRegister(devs, d.models, d.protocols); err != nil { return err } } diff --git a/mappers/v1beta1-mapper/modbus/device/devicetwin.go b/mappers/kubeedge-v1.15.0/modbus/device/devicetwin.go similarity index 92% rename from mappers/v1beta1-mapper/modbus/device/devicetwin.go rename to mappers/kubeedge-v1.15.0/modbus/device/devicetwin.go index afd49b21..bd5a2d9a 100644 --- a/mappers/v1beta1-mapper/modbus/device/devicetwin.go +++ b/mappers/kubeedge-v1.15.0/modbus/device/devicetwin.go @@ -12,7 +12,7 @@ import ( "github.com/kubeedge/modbus/driver" "github.com/kubeedge/modbus/pkg/common" dmiapi "github.com/kubeedge/modbus/pkg/dmi-api" - "github.com/kubeedge/modbus/pkg/util/grpcclient" + "github.com/kubeedge/modbus/pkg/grpcclient" "github.com/kubeedge/modbus/pkg/util/parse" ) @@ -26,11 +26,12 @@ type TwinData struct { Topic string Results interface{} CollectCycle time.Duration + ReportToCloud bool } func (td *TwinData) GetPayLoad() ([]byte, error) { var err error - //td.VisitorConfig.VisitorConfigData.DataType = strings.ToLower(td.VisitorConfig.VisitorConfigData.DataType) + td.VisitorConfig.VisitorConfigData.DataType = strings.ToLower(td.VisitorConfig.VisitorConfigData.DataType) td.Results, err = td.Client.GetDeviceData(td.VisitorConfig) if err != nil { return nil, fmt.Errorf("get device data failed: %v", err) @@ -87,6 +88,9 @@ func (td *TwinData) PushToEdgeCore() { } func (td *TwinData) Run(ctx context.Context) { + if !td.ReportToCloud { + return + } if td.CollectCycle == 0 { td.CollectCycle = 1 * time.Second } diff --git a/mappers/v1beta1-mapper/modbus/driver/devicetype.go b/mappers/kubeedge-v1.15.0/modbus/driver/devicetype.go similarity index 97% rename from mappers/v1beta1-mapper/modbus/driver/devicetype.go rename to mappers/kubeedge-v1.15.0/modbus/driver/devicetype.go index 5fc559e0..5fc4aa84 100644 --- a/mappers/v1beta1-mapper/modbus/driver/devicetype.go +++ b/mappers/kubeedge-v1.15.0/modbus/driver/devicetype.go @@ -1,10 +1,12 @@ package driver import ( - "github.com/kubeedge/modbus/pkg/common" - "github.com/sailorvii/modbus" "sync" "time" + + "github.com/sailorvii/modbus" + + "github.com/kubeedge/modbus/pkg/common" ) // CustomizedDev is the customized device configuration and client information. @@ -54,6 +56,7 @@ type VisitorConfig struct { type VisitorConfigData struct { // TODO: add your visitor config data + DataType string `json:"dataType"` Register string `json:"register"` Offset uint16 `json:"offset"` Limit int `json:"limit"` diff --git a/mappers/v1beta1-mapper/modbus/driver/driver.go b/mappers/kubeedge-v1.15.0/modbus/driver/driver.go similarity index 96% rename from mappers/v1beta1-mapper/modbus/driver/driver.go rename to mappers/kubeedge-v1.15.0/modbus/driver/driver.go index 984462c7..23940756 100644 --- a/mappers/v1beta1-mapper/modbus/driver/driver.go +++ b/mappers/kubeedge-v1.15.0/modbus/driver/driver.go @@ -2,11 +2,11 @@ package driver import ( "errors" - "k8s.io/klog/v2" "sync" "time" "github.com/sailorvii/modbus" + "k8s.io/klog/v2" ) var clients *sync.Map @@ -89,7 +89,7 @@ func (c *CustomizedClient) GetDeviceData(visitor *VisitorConfig) (interface{}, e return results, err } -func (c *CustomizedClient) SetDeviceData(data interface{}, visitor *VisitorConfig) (interface{}, error) { +func (c *CustomizedClient) SetDeviceData(data interface{}, visitor *VisitorConfig) error { // TODO: set device's data // you can use c.ProtocolConfig and visitor var results []byte @@ -109,16 +109,16 @@ func (c *CustomizedClient) SetDeviceData(data interface{}, visitor *VisitorConfi case 1: valueSet = 0xFF00 default: - return nil, errors.New("Wrong value") + return errors.New("Wrong value") } results, err = c.ModbusClient.WriteSingleCoil(visitor.Offset, valueSet) case "HoldingRegister": results, err = c.ModbusClient.WriteSingleRegister(visitor.Offset, uint16(visitor.Limit)) default: - return nil, errors.New("Bad register type") + return errors.New("Bad register type") } klog.V(1).Info("Set result:", err, results) - return results, err + return nil } func (c *CustomizedClient) StopDevice() error { diff --git a/mappers/v1beta1-mapper/modbus/go.mod b/mappers/kubeedge-v1.15.0/modbus/go.mod similarity index 93% rename from mappers/v1beta1-mapper/modbus/go.mod rename to mappers/kubeedge-v1.15.0/modbus/go.mod index 9eac5741..03bfee2e 100644 --- a/mappers/v1beta1-mapper/modbus/go.mod +++ b/mappers/kubeedge-v1.15.0/modbus/go.mod @@ -17,7 +17,6 @@ require ( require ( github.com/eclipse/paho.mqtt.golang v1.4.3 github.com/influxdata/influxdb-client-go/v2 v2.12.3 - github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c ) require ( diff --git a/mappers/v1beta1-mapper/modbus/go.sum b/mappers/kubeedge-v1.15.0/modbus/go.sum similarity index 98% rename from mappers/v1beta1-mapper/modbus/go.sum rename to mappers/kubeedge-v1.15.0/modbus/go.sum index 5e23e373..5a0fd6c4 100644 --- a/mappers/v1beta1-mapper/modbus/go.sum +++ b/mappers/kubeedge-v1.15.0/modbus/go.sum @@ -69,8 +69,6 @@ github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/influxdata/influxdb-client-go/v2 v2.12.3 h1:28nRlNMRIV4QbtIUvxhWqaxn0IpXeMSkY/uJa/O/vC4= github.com/influxdata/influxdb-client-go/v2 v2.12.3/go.mod h1:IrrLUbCjjfkmRuaCiGQg4m2GbkaeJDcuWoxiWdQEbA0= -github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c h1:qSHzRbhzK8RdXOsAdfDgO49TtqC1oZ+acxPrkfTxcCs= -github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= diff --git a/mappers/v1beta1-mapper/modbus/hack/make-rules/mapper.sh b/mappers/kubeedge-v1.15.0/modbus/hack/make-rules/mapper.sh similarity index 100% rename from mappers/v1beta1-mapper/modbus/hack/make-rules/mapper.sh rename to mappers/kubeedge-v1.15.0/modbus/hack/make-rules/mapper.sh diff --git a/mappers/v1beta1-mapper/modbus/pkg/common/configmaptype.go b/mappers/kubeedge-v1.15.0/modbus/pkg/common/configmaptype.go similarity index 92% rename from mappers/v1beta1-mapper/modbus/pkg/common/configmaptype.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/common/configmaptype.go index 4ddfcc4e..0e8e756e 100644 --- a/mappers/v1beta1-mapper/modbus/pkg/common/configmaptype.go +++ b/mappers/kubeedge-v1.15.0/modbus/pkg/common/configmaptype.go @@ -94,11 +94,9 @@ type DBMethodConfig struct { } type DBConfig struct { - Influxdb2ClientConfig json.RawMessage `json:"influxdb2ClientConfig"` - Influxdb2DataConfig json.RawMessage `json:"influxdb2DataConfig"` - RedisConfigData json.RawMessage `json:"redisConfigData"` - OpenGeminiClientConfig json.RawMessage `json:"openGeminiClientConfig"` - OpenGeminiDataConfig json.RawMessage `json:"openGeminiDataConfig"` + Influxdb2ClientConfig json.RawMessage `json:"influxdb2ClientConfig"` + Influxdb2DataConfig json.RawMessage `json:"influxdb2DataConfig"` + RedisConfigData json.RawMessage `json:"redisConfigData"` } // Metadata is the metadata for data. diff --git a/mappers/v1beta1-mapper/modbus/pkg/common/const.go b/mappers/kubeedge-v1.15.0/modbus/pkg/common/const.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/common/const.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/common/const.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/common/dataconverter.go b/mappers/kubeedge-v1.15.0/modbus/pkg/common/dataconverter.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/common/dataconverter.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/common/dataconverter.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/common/datamodel.go b/mappers/kubeedge-v1.15.0/modbus/pkg/common/datamodel.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/common/datamodel.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/common/datamodel.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/common/event.go b/mappers/kubeedge-v1.15.0/modbus/pkg/common/event.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/common/event.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/common/event.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/common/eventtype.go b/mappers/kubeedge-v1.15.0/modbus/pkg/common/eventtype.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/common/eventtype.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/common/eventtype.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/config/config.go b/mappers/kubeedge-v1.15.0/modbus/pkg/config/config.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/config/config.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/config/config.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/dmi-api/api.pb.go b/mappers/kubeedge-v1.15.0/modbus/pkg/dmi-api/api.pb.go similarity index 85% rename from mappers/v1beta1-mapper/modbus/pkg/dmi-api/api.pb.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/dmi-api/api.pb.go index 2751341b..19e252db 100644 --- a/mappers/v1beta1-mapper/modbus/pkg/dmi-api/api.pb.go +++ b/mappers/kubeedge-v1.15.0/modbus/pkg/dmi-api/api.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The KubeEdge Authors. +Copyright 2022 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. @@ -1088,8 +1088,7 @@ type DBMethod struct { unknownFields protoimpl.UnknownFields // the config of database . - Influxdb2 *DBMethodInfluxdb2 `protobuf:"bytes,1,opt,name=influxdb2,proto3" json:"influxdb2,omitempty"` - OpenGemini *DBMethodOpenGemini `protobuf:"bytes,2,opt,name=openGemini,proto3" json:"openGemini,omitempty"` + Influxdb2 *DBMethodInfluxdb2 `protobuf:"bytes,1,opt,name=influxdb2,proto3" json:"influxdb2,omitempty"` } func (x *DBMethod) Reset() { @@ -1131,13 +1130,6 @@ func (x *DBMethod) GetInfluxdb2() *DBMethodInfluxdb2 { return nil } -func (x *DBMethod) GetOpenGemini() *DBMethodOpenGemini { - if x != nil { - return x.OpenGemini - } - return nil -} - type DBMethodInfluxdb2 struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1324,192 +1316,6 @@ func (x *Influxdb2ClientConfig) GetBucket() string { return "" } -type DBMethodOpenGemini struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // the config of OpenGemini database. - OpenGeminiClientConfig *OpenGeminiClientConfig `protobuf:"bytes,1,opt,name=openGeminiClientConfig,proto3" json:"openGeminiClientConfig,omitempty"` - OpenGeminiDataConfig *OpenGeminiDataConfig `protobuf:"bytes,2,opt,name=openGeminiDataConfig,proto3" json:"openGeminiDataConfig,omitempty"` -} - -func (x *DBMethodOpenGemini) Reset() { - *x = DBMethodOpenGemini{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DBMethodOpenGemini) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DBMethodOpenGemini) ProtoMessage() {} - -func (x *DBMethodOpenGemini) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[19] - 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 DBMethodOpenGemini.ProtoReflect.Descriptor instead. -func (*DBMethodOpenGemini) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{19} -} - -func (x *DBMethodOpenGemini) GetOpenGeminiClientConfig() *OpenGeminiClientConfig { - if x != nil { - return x.OpenGeminiClientConfig - } - return nil -} - -func (x *DBMethodOpenGemini) GetOpenGeminiDataConfig() *OpenGeminiDataConfig { - if x != nil { - return x.OpenGeminiDataConfig - } - return nil -} - -type OpenGeminiDataConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // data config when push data to OpenGemini - Measurement string `protobuf:"bytes,1,opt,name=measurement,proto3" json:"measurement,omitempty"` - Tags map[string]string `protobuf:"bytes,2,rep,name=tags,proto3" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - FieldKey string `protobuf:"bytes,3,opt,name=fieldKey,proto3" json:"fieldKey,omitempty"` -} - -func (x *OpenGeminiDataConfig) Reset() { - *x = OpenGeminiDataConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OpenGeminiDataConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OpenGeminiDataConfig) ProtoMessage() {} - -func (x *OpenGeminiDataConfig) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[20] - 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 OpenGeminiDataConfig.ProtoReflect.Descriptor instead. -func (*OpenGeminiDataConfig) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{20} -} - -func (x *OpenGeminiDataConfig) GetMeasurement() string { - if x != nil { - return x.Measurement - } - return "" -} - -func (x *OpenGeminiDataConfig) GetTags() map[string]string { - if x != nil { - return x.Tags - } - return nil -} - -func (x *OpenGeminiDataConfig) GetFieldKey() string { - if x != nil { - return x.FieldKey - } - return "" -} - -type OpenGeminiClientConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // OpenGemini database url - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` - // usr database in OpenGemini database - Database string `protobuf:"bytes,2,opt,name=database,proto3" json:"database,omitempty"` - // data retentionPolicy in OpenGemini database - RetentionPolicy string `protobuf:"bytes,3,opt,name=retentionPolicy,proto3" json:"retentionPolicy,omitempty"` -} - -func (x *OpenGeminiClientConfig) Reset() { - *x = OpenGeminiClientConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OpenGeminiClientConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OpenGeminiClientConfig) ProtoMessage() {} - -func (x *OpenGeminiClientConfig) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[21] - 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 OpenGeminiClientConfig.ProtoReflect.Descriptor instead. -func (*OpenGeminiClientConfig) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{21} -} - -func (x *OpenGeminiClientConfig) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *OpenGeminiClientConfig) GetDatabase() string { - if x != nil { - return x.Database - } - return "" -} - -func (x *OpenGeminiClientConfig) GetRetentionPolicy() string { - if x != nil { - return x.RetentionPolicy - } - return "" -} - // MapperInfo is the information of mapper. type MapperInfo struct { state protoimpl.MessageState @@ -1533,7 +1339,7 @@ type MapperInfo struct { func (x *MapperInfo) Reset() { *x = MapperInfo{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[22] + mi := &file_api_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1546,7 +1352,7 @@ func (x *MapperInfo) String() string { func (*MapperInfo) ProtoMessage() {} func (x *MapperInfo) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[22] + mi := &file_api_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1559,7 +1365,7 @@ func (x *MapperInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use MapperInfo.ProtoReflect.Descriptor instead. func (*MapperInfo) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{22} + return file_api_proto_rawDescGZIP(), []int{19} } func (x *MapperInfo) GetName() string { @@ -1616,7 +1422,7 @@ type ReportDeviceStatusRequest struct { func (x *ReportDeviceStatusRequest) Reset() { *x = ReportDeviceStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[23] + mi := &file_api_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1629,7 +1435,7 @@ func (x *ReportDeviceStatusRequest) String() string { func (*ReportDeviceStatusRequest) ProtoMessage() {} func (x *ReportDeviceStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[23] + mi := &file_api_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1642,7 +1448,7 @@ func (x *ReportDeviceStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportDeviceStatusRequest.ProtoReflect.Descriptor instead. func (*ReportDeviceStatusRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{23} + return file_api_proto_rawDescGZIP(), []int{20} } func (x *ReportDeviceStatusRequest) GetDeviceName() string { @@ -1672,7 +1478,7 @@ type DeviceStatus struct { func (x *DeviceStatus) Reset() { *x = DeviceStatus{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[24] + mi := &file_api_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1685,7 +1491,7 @@ func (x *DeviceStatus) String() string { func (*DeviceStatus) ProtoMessage() {} func (x *DeviceStatus) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[24] + mi := &file_api_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1698,7 +1504,7 @@ func (x *DeviceStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use DeviceStatus.ProtoReflect.Descriptor instead. func (*DeviceStatus) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{24} + return file_api_proto_rawDescGZIP(), []int{21} } func (x *DeviceStatus) GetTwins() []*Twin { @@ -1725,7 +1531,7 @@ type Twin struct { func (x *Twin) Reset() { *x = Twin{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[25] + mi := &file_api_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1738,7 +1544,7 @@ func (x *Twin) String() string { func (*Twin) ProtoMessage() {} func (x *Twin) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[25] + mi := &file_api_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1751,7 +1557,7 @@ func (x *Twin) ProtoReflect() protoreflect.Message { // Deprecated: Use Twin.ProtoReflect.Descriptor instead. func (*Twin) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{25} + return file_api_proto_rawDescGZIP(), []int{22} } func (x *Twin) GetPropertyName() string { @@ -1790,7 +1596,7 @@ type TwinProperty struct { func (x *TwinProperty) Reset() { *x = TwinProperty{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[26] + mi := &file_api_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1803,7 +1609,7 @@ func (x *TwinProperty) String() string { func (*TwinProperty) ProtoMessage() {} func (x *TwinProperty) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[26] + mi := &file_api_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1816,7 +1622,7 @@ func (x *TwinProperty) ProtoReflect() protoreflect.Message { // Deprecated: Use TwinProperty.ProtoReflect.Descriptor instead. func (*TwinProperty) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{26} + return file_api_proto_rawDescGZIP(), []int{23} } func (x *TwinProperty) GetValue() string { @@ -1842,7 +1648,7 @@ type ReportDeviceStatusResponse struct { func (x *ReportDeviceStatusResponse) Reset() { *x = ReportDeviceStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[27] + mi := &file_api_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1855,7 +1661,7 @@ func (x *ReportDeviceStatusResponse) String() string { func (*ReportDeviceStatusResponse) ProtoMessage() {} func (x *ReportDeviceStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[27] + mi := &file_api_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1868,7 +1674,7 @@ func (x *ReportDeviceStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportDeviceStatusResponse.ProtoReflect.Descriptor instead. func (*ReportDeviceStatusResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{27} + return file_api_proto_rawDescGZIP(), []int{24} } type RegisterDeviceRequest struct { @@ -1882,7 +1688,7 @@ type RegisterDeviceRequest struct { func (x *RegisterDeviceRequest) Reset() { *x = RegisterDeviceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[28] + mi := &file_api_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1895,7 +1701,7 @@ func (x *RegisterDeviceRequest) String() string { func (*RegisterDeviceRequest) ProtoMessage() {} func (x *RegisterDeviceRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[28] + mi := &file_api_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1908,7 +1714,7 @@ func (x *RegisterDeviceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RegisterDeviceRequest.ProtoReflect.Descriptor instead. func (*RegisterDeviceRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{28} + return file_api_proto_rawDescGZIP(), []int{25} } func (x *RegisterDeviceRequest) GetDevice() *Device { @@ -1929,7 +1735,7 @@ type RegisterDeviceResponse struct { func (x *RegisterDeviceResponse) Reset() { *x = RegisterDeviceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[29] + mi := &file_api_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1942,7 +1748,7 @@ func (x *RegisterDeviceResponse) String() string { func (*RegisterDeviceResponse) ProtoMessage() {} func (x *RegisterDeviceResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[29] + mi := &file_api_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1955,7 +1761,7 @@ func (x *RegisterDeviceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RegisterDeviceResponse.ProtoReflect.Descriptor instead. func (*RegisterDeviceResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{29} + return file_api_proto_rawDescGZIP(), []int{26} } func (x *RegisterDeviceResponse) GetDeviceName() string { @@ -1976,7 +1782,7 @@ type CreateDeviceModelRequest struct { func (x *CreateDeviceModelRequest) Reset() { *x = CreateDeviceModelRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[30] + mi := &file_api_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1989,7 +1795,7 @@ func (x *CreateDeviceModelRequest) String() string { func (*CreateDeviceModelRequest) ProtoMessage() {} func (x *CreateDeviceModelRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[30] + mi := &file_api_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2002,7 +1808,7 @@ func (x *CreateDeviceModelRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateDeviceModelRequest.ProtoReflect.Descriptor instead. func (*CreateDeviceModelRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{30} + return file_api_proto_rawDescGZIP(), []int{27} } func (x *CreateDeviceModelRequest) GetModel() *DeviceModel { @@ -2023,7 +1829,7 @@ type CreateDeviceModelResponse struct { func (x *CreateDeviceModelResponse) Reset() { *x = CreateDeviceModelResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[31] + mi := &file_api_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2036,7 +1842,7 @@ func (x *CreateDeviceModelResponse) String() string { func (*CreateDeviceModelResponse) ProtoMessage() {} func (x *CreateDeviceModelResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[31] + mi := &file_api_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2049,7 +1855,7 @@ func (x *CreateDeviceModelResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateDeviceModelResponse.ProtoReflect.Descriptor instead. func (*CreateDeviceModelResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{31} + return file_api_proto_rawDescGZIP(), []int{28} } func (x *CreateDeviceModelResponse) GetDeviceModelName() string { @@ -2070,7 +1876,7 @@ type RemoveDeviceRequest struct { func (x *RemoveDeviceRequest) Reset() { *x = RemoveDeviceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[32] + mi := &file_api_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2083,7 +1889,7 @@ func (x *RemoveDeviceRequest) String() string { func (*RemoveDeviceRequest) ProtoMessage() {} func (x *RemoveDeviceRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[32] + mi := &file_api_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2096,7 +1902,7 @@ func (x *RemoveDeviceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveDeviceRequest.ProtoReflect.Descriptor instead. func (*RemoveDeviceRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{32} + return file_api_proto_rawDescGZIP(), []int{29} } func (x *RemoveDeviceRequest) GetDeviceName() string { @@ -2115,7 +1921,7 @@ type RemoveDeviceResponse struct { func (x *RemoveDeviceResponse) Reset() { *x = RemoveDeviceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[33] + mi := &file_api_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2128,7 +1934,7 @@ func (x *RemoveDeviceResponse) String() string { func (*RemoveDeviceResponse) ProtoMessage() {} func (x *RemoveDeviceResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[33] + mi := &file_api_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2141,7 +1947,7 @@ func (x *RemoveDeviceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveDeviceResponse.ProtoReflect.Descriptor instead. func (*RemoveDeviceResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{33} + return file_api_proto_rawDescGZIP(), []int{30} } type RemoveDeviceModelRequest struct { @@ -2155,7 +1961,7 @@ type RemoveDeviceModelRequest struct { func (x *RemoveDeviceModelRequest) Reset() { *x = RemoveDeviceModelRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[34] + mi := &file_api_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2168,7 +1974,7 @@ func (x *RemoveDeviceModelRequest) String() string { func (*RemoveDeviceModelRequest) ProtoMessage() {} func (x *RemoveDeviceModelRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[34] + mi := &file_api_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2181,7 +1987,7 @@ func (x *RemoveDeviceModelRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveDeviceModelRequest.ProtoReflect.Descriptor instead. func (*RemoveDeviceModelRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{34} + return file_api_proto_rawDescGZIP(), []int{31} } func (x *RemoveDeviceModelRequest) GetModelName() string { @@ -2200,7 +2006,7 @@ type RemoveDeviceModelResponse struct { func (x *RemoveDeviceModelResponse) Reset() { *x = RemoveDeviceModelResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[35] + mi := &file_api_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2213,7 +2019,7 @@ func (x *RemoveDeviceModelResponse) String() string { func (*RemoveDeviceModelResponse) ProtoMessage() {} func (x *RemoveDeviceModelResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[35] + mi := &file_api_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2226,7 +2032,7 @@ func (x *RemoveDeviceModelResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveDeviceModelResponse.ProtoReflect.Descriptor instead. func (*RemoveDeviceModelResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{35} + return file_api_proto_rawDescGZIP(), []int{32} } type UpdateDeviceRequest struct { @@ -2240,7 +2046,7 @@ type UpdateDeviceRequest struct { func (x *UpdateDeviceRequest) Reset() { *x = UpdateDeviceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[36] + mi := &file_api_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2253,7 +2059,7 @@ func (x *UpdateDeviceRequest) String() string { func (*UpdateDeviceRequest) ProtoMessage() {} func (x *UpdateDeviceRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[36] + mi := &file_api_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2266,7 +2072,7 @@ func (x *UpdateDeviceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateDeviceRequest.ProtoReflect.Descriptor instead. func (*UpdateDeviceRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{36} + return file_api_proto_rawDescGZIP(), []int{33} } func (x *UpdateDeviceRequest) GetDevice() *Device { @@ -2285,7 +2091,7 @@ type UpdateDeviceResponse struct { func (x *UpdateDeviceResponse) Reset() { *x = UpdateDeviceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[37] + mi := &file_api_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2298,7 +2104,7 @@ func (x *UpdateDeviceResponse) String() string { func (*UpdateDeviceResponse) ProtoMessage() {} func (x *UpdateDeviceResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[37] + mi := &file_api_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2311,7 +2117,7 @@ func (x *UpdateDeviceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateDeviceResponse.ProtoReflect.Descriptor instead. func (*UpdateDeviceResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{37} + return file_api_proto_rawDescGZIP(), []int{34} } type UpdateDeviceModelRequest struct { @@ -2325,7 +2131,7 @@ type UpdateDeviceModelRequest struct { func (x *UpdateDeviceModelRequest) Reset() { *x = UpdateDeviceModelRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[38] + mi := &file_api_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2338,7 +2144,7 @@ func (x *UpdateDeviceModelRequest) String() string { func (*UpdateDeviceModelRequest) ProtoMessage() {} func (x *UpdateDeviceModelRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[38] + mi := &file_api_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2351,7 +2157,7 @@ func (x *UpdateDeviceModelRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateDeviceModelRequest.ProtoReflect.Descriptor instead. func (*UpdateDeviceModelRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{38} + return file_api_proto_rawDescGZIP(), []int{35} } func (x *UpdateDeviceModelRequest) GetModel() *DeviceModel { @@ -2370,7 +2176,7 @@ type UpdateDeviceModelResponse struct { func (x *UpdateDeviceModelResponse) Reset() { *x = UpdateDeviceModelResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[39] + mi := &file_api_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2383,7 +2189,7 @@ func (x *UpdateDeviceModelResponse) String() string { func (*UpdateDeviceModelResponse) ProtoMessage() {} func (x *UpdateDeviceModelResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[39] + mi := &file_api_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2396,7 +2202,7 @@ func (x *UpdateDeviceModelResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateDeviceModelResponse.ProtoReflect.Descriptor instead. func (*UpdateDeviceModelResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{39} + return file_api_proto_rawDescGZIP(), []int{36} } type GetDeviceRequest struct { @@ -2410,7 +2216,7 @@ type GetDeviceRequest struct { func (x *GetDeviceRequest) Reset() { *x = GetDeviceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[40] + mi := &file_api_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2423,7 +2229,7 @@ func (x *GetDeviceRequest) String() string { func (*GetDeviceRequest) ProtoMessage() {} func (x *GetDeviceRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[40] + mi := &file_api_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2436,7 +2242,7 @@ func (x *GetDeviceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDeviceRequest.ProtoReflect.Descriptor instead. func (*GetDeviceRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{40} + return file_api_proto_rawDescGZIP(), []int{37} } func (x *GetDeviceRequest) GetDeviceName() string { @@ -2457,7 +2263,7 @@ type GetDeviceResponse struct { func (x *GetDeviceResponse) Reset() { *x = GetDeviceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[41] + mi := &file_api_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2470,7 +2276,7 @@ func (x *GetDeviceResponse) String() string { func (*GetDeviceResponse) ProtoMessage() {} func (x *GetDeviceResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[41] + mi := &file_api_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2483,7 +2289,7 @@ func (x *GetDeviceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDeviceResponse.ProtoReflect.Descriptor instead. func (*GetDeviceResponse) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{41} + return file_api_proto_rawDescGZIP(), []int{38} } func (x *GetDeviceResponse) GetDevice() *Device { @@ -2634,77 +2440,41 @@ var file_api_proto_rawDesc = []byte{ 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x71, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x71, 0x6f, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x81, 0x01, 0x0a, 0x08, 0x44, 0x42, 0x4d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x12, 0x38, 0x0a, 0x09, 0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x61, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x44, 0x0a, 0x08, 0x44, 0x42, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x12, 0x38, 0x0a, 0x09, 0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, + 0x42, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x49, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, + 0x52, 0x09, 0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, 0x22, 0xb9, 0x01, 0x0a, 0x11, 0x44, 0x42, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x49, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, - 0x32, 0x52, 0x09, 0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, 0x12, 0x3b, 0x0a, 0x0a, - 0x6f, 0x70, 0x65, 0x6e, 0x47, 0x65, 0x6d, 0x69, 0x6e, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x42, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x65, 0x6e, 0x47, 0x65, 0x6d, 0x69, 0x6e, 0x69, 0x52, 0x0a, 0x6f, - 0x70, 0x65, 0x6e, 0x47, 0x65, 0x6d, 0x69, 0x6e, 0x69, 0x22, 0xb9, 0x01, 0x0a, 0x11, 0x44, 0x42, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x49, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, 0x12, - 0x54, 0x0a, 0x15, 0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, + 0x32, 0x12, 0x54, 0x0a, 0x15, 0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6c, 0x75, + 0x78, 0x64, 0x62, 0x32, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x15, 0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4e, 0x0a, 0x13, 0x69, 0x6e, 0x66, 0x6c, 0x75, + 0x78, 0x64, 0x62, 0x32, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x49, + 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x13, 0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, 0x44, 0x61, 0x74, + 0x61, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0xc4, 0x01, 0x0a, 0x13, 0x49, 0x6e, 0x66, 0x6c, + 0x75, 0x78, 0x64, 0x62, 0x32, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x20, 0x0a, 0x0b, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x12, 0x37, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, - 0x62, 0x32, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x15, - 0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4e, 0x0a, 0x13, 0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, - 0x62, 0x32, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x66, - 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x52, 0x13, 0x69, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, 0x44, 0x61, 0x74, 0x61, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0xc4, 0x01, 0x0a, 0x13, 0x49, 0x6e, 0x66, 0x6c, 0x75, 0x78, - 0x64, 0x62, 0x32, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x20, 0x0a, - 0x0b, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, - 0x37, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, - 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x54, 0x61, 0x67, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x4b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x4b, 0x65, 0x79, 0x1a, 0x36, 0x0a, 0x08, 0x54, 0x61, 0x67, 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, 0x53, 0x0a, 0x15, - 0x49, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x72, 0x67, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x72, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x22, 0xc0, 0x01, 0x0a, 0x12, 0x44, 0x42, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, - 0x65, 0x6e, 0x47, 0x65, 0x6d, 0x69, 0x6e, 0x69, 0x12, 0x57, 0x0a, 0x16, 0x6f, 0x70, 0x65, 0x6e, - 0x47, 0x65, 0x6d, 0x69, 0x6e, 0x69, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x47, 0x65, 0x6d, 0x69, 0x6e, 0x69, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x16, 0x6f, 0x70, 0x65, 0x6e, 0x47, - 0x65, 0x6d, 0x69, 0x6e, 0x69, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x51, 0x0a, 0x14, 0x6f, 0x70, 0x65, 0x6e, 0x47, 0x65, 0x6d, 0x69, 0x6e, 0x69, 0x44, - 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x47, 0x65, - 0x6d, 0x69, 0x6e, 0x69, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x14, - 0x6f, 0x70, 0x65, 0x6e, 0x47, 0x65, 0x6d, 0x69, 0x6e, 0x69, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x22, 0xca, 0x01, 0x0a, 0x14, 0x4f, 0x70, 0x65, 0x6e, 0x47, 0x65, 0x6d, - 0x69, 0x6e, 0x69, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x20, 0x0a, - 0x0b, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, - 0x3b, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x47, 0x65, 0x6d, 0x69, - 0x6e, 0x69, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x54, 0x61, 0x67, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x1a, 0x0a, 0x08, - 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4b, 0x65, 0x79, 0x1a, 0x37, 0x0a, 0x09, 0x54, 0x61, 0x67, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0x70, 0x0a, 0x16, 0x4f, 0x70, 0x65, 0x6e, 0x47, 0x65, 0x6d, 0x69, 0x6e, 0x69, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x75, - 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1a, 0x0a, - 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x72, 0x65, 0x74, - 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x22, 0xa7, 0x01, 0x0a, 0x0a, 0x4d, 0x61, 0x70, 0x70, 0x65, 0x72, 0x49, 0x6e, + 0x62, 0x32, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x54, 0x61, 0x67, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x4b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x4b, 0x65, 0x79, 0x1a, 0x36, 0x0a, 0x08, 0x54, 0x61, 0x67, 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, 0x53, + 0x0a, 0x15, 0x49, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x72, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x72, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x22, 0xa7, 0x01, 0x0a, 0x0a, 0x4d, 0x61, 0x70, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, @@ -2862,7 +2632,7 @@ func file_api_proto_rawDescGZIP() []byte { return file_api_proto_rawDescData } -var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 46) +var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 42) var file_api_proto_goTypes = []interface{}{ (*MapperRegisterRequest)(nil), // 0: v1beta1.MapperRegisterRequest (*MapperRegisterResponse)(nil), // 1: v1beta1.MapperRegisterResponse @@ -2883,97 +2653,89 @@ var file_api_proto_goTypes = []interface{}{ (*DBMethodInfluxdb2)(nil), // 16: v1beta1.DBMethodInfluxdb2 (*Influxdb2DataConfig)(nil), // 17: v1beta1.Influxdb2DataConfig (*Influxdb2ClientConfig)(nil), // 18: v1beta1.Influxdb2ClientConfig - (*DBMethodOpenGemini)(nil), // 19: v1beta1.DBMethodOpenGemini - (*OpenGeminiDataConfig)(nil), // 20: v1beta1.OpenGeminiDataConfig - (*OpenGeminiClientConfig)(nil), // 21: v1beta1.OpenGeminiClientConfig - (*MapperInfo)(nil), // 22: v1beta1.MapperInfo - (*ReportDeviceStatusRequest)(nil), // 23: v1beta1.ReportDeviceStatusRequest - (*DeviceStatus)(nil), // 24: v1beta1.DeviceStatus - (*Twin)(nil), // 25: v1beta1.Twin - (*TwinProperty)(nil), // 26: v1beta1.TwinProperty - (*ReportDeviceStatusResponse)(nil), // 27: v1beta1.ReportDeviceStatusResponse - (*RegisterDeviceRequest)(nil), // 28: v1beta1.RegisterDeviceRequest - (*RegisterDeviceResponse)(nil), // 29: v1beta1.RegisterDeviceResponse - (*CreateDeviceModelRequest)(nil), // 30: v1beta1.CreateDeviceModelRequest - (*CreateDeviceModelResponse)(nil), // 31: v1beta1.CreateDeviceModelResponse - (*RemoveDeviceRequest)(nil), // 32: v1beta1.RemoveDeviceRequest - (*RemoveDeviceResponse)(nil), // 33: v1beta1.RemoveDeviceResponse - (*RemoveDeviceModelRequest)(nil), // 34: v1beta1.RemoveDeviceModelRequest - (*RemoveDeviceModelResponse)(nil), // 35: v1beta1.RemoveDeviceModelResponse - (*UpdateDeviceRequest)(nil), // 36: v1beta1.UpdateDeviceRequest - (*UpdateDeviceResponse)(nil), // 37: v1beta1.UpdateDeviceResponse - (*UpdateDeviceModelRequest)(nil), // 38: v1beta1.UpdateDeviceModelRequest - (*UpdateDeviceModelResponse)(nil), // 39: v1beta1.UpdateDeviceModelResponse - (*GetDeviceRequest)(nil), // 40: v1beta1.GetDeviceRequest - (*GetDeviceResponse)(nil), // 41: v1beta1.GetDeviceResponse - nil, // 42: v1beta1.CustomizedValue.DataEntry - nil, // 43: v1beta1.Influxdb2DataConfig.TagEntry - nil, // 44: v1beta1.OpenGeminiDataConfig.TagsEntry - nil, // 45: v1beta1.TwinProperty.MetadataEntry - (*anypb.Any)(nil), // 46: google.protobuf.Any + (*MapperInfo)(nil), // 19: v1beta1.MapperInfo + (*ReportDeviceStatusRequest)(nil), // 20: v1beta1.ReportDeviceStatusRequest + (*DeviceStatus)(nil), // 21: v1beta1.DeviceStatus + (*Twin)(nil), // 22: v1beta1.Twin + (*TwinProperty)(nil), // 23: v1beta1.TwinProperty + (*ReportDeviceStatusResponse)(nil), // 24: v1beta1.ReportDeviceStatusResponse + (*RegisterDeviceRequest)(nil), // 25: v1beta1.RegisterDeviceRequest + (*RegisterDeviceResponse)(nil), // 26: v1beta1.RegisterDeviceResponse + (*CreateDeviceModelRequest)(nil), // 27: v1beta1.CreateDeviceModelRequest + (*CreateDeviceModelResponse)(nil), // 28: v1beta1.CreateDeviceModelResponse + (*RemoveDeviceRequest)(nil), // 29: v1beta1.RemoveDeviceRequest + (*RemoveDeviceResponse)(nil), // 30: v1beta1.RemoveDeviceResponse + (*RemoveDeviceModelRequest)(nil), // 31: v1beta1.RemoveDeviceModelRequest + (*RemoveDeviceModelResponse)(nil), // 32: v1beta1.RemoveDeviceModelResponse + (*UpdateDeviceRequest)(nil), // 33: v1beta1.UpdateDeviceRequest + (*UpdateDeviceResponse)(nil), // 34: v1beta1.UpdateDeviceResponse + (*UpdateDeviceModelRequest)(nil), // 35: v1beta1.UpdateDeviceModelRequest + (*UpdateDeviceModelResponse)(nil), // 36: v1beta1.UpdateDeviceModelResponse + (*GetDeviceRequest)(nil), // 37: v1beta1.GetDeviceRequest + (*GetDeviceResponse)(nil), // 38: v1beta1.GetDeviceResponse + nil, // 39: v1beta1.CustomizedValue.DataEntry + nil, // 40: v1beta1.Influxdb2DataConfig.TagEntry + nil, // 41: v1beta1.TwinProperty.MetadataEntry + (*anypb.Any)(nil), // 42: google.protobuf.Any } var file_api_proto_depIdxs = []int32{ - 22, // 0: v1beta1.MapperRegisterRequest.mapper:type_name -> v1beta1.MapperInfo + 19, // 0: v1beta1.MapperRegisterRequest.mapper:type_name -> v1beta1.MapperInfo 2, // 1: v1beta1.MapperRegisterResponse.modelList:type_name -> v1beta1.DeviceModel 6, // 2: v1beta1.MapperRegisterResponse.deviceList:type_name -> v1beta1.Device 3, // 3: v1beta1.DeviceModel.spec:type_name -> v1beta1.DeviceModelSpec 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 - 24, // 7: v1beta1.Device.status:type_name -> v1beta1.DeviceStatus + 21, // 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 - 26, // 10: v1beta1.DeviceProperty.desired:type_name -> v1beta1.TwinProperty + 23, // 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 - 42, // 15: v1beta1.CustomizedValue.data:type_name -> v1beta1.CustomizedValue.DataEntry + 39, // 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 16, // 19: v1beta1.DBMethod.influxdb2:type_name -> v1beta1.DBMethodInfluxdb2 - 19, // 20: v1beta1.DBMethod.openGemini:type_name -> v1beta1.DBMethodOpenGemini - 18, // 21: v1beta1.DBMethodInfluxdb2.influxdb2ClientConfig:type_name -> v1beta1.Influxdb2ClientConfig - 17, // 22: v1beta1.DBMethodInfluxdb2.influxdb2DataConfig:type_name -> v1beta1.Influxdb2DataConfig - 43, // 23: v1beta1.Influxdb2DataConfig.tag:type_name -> v1beta1.Influxdb2DataConfig.TagEntry - 21, // 24: v1beta1.DBMethodOpenGemini.openGeminiClientConfig:type_name -> v1beta1.OpenGeminiClientConfig - 20, // 25: v1beta1.DBMethodOpenGemini.openGeminiDataConfig:type_name -> v1beta1.OpenGeminiDataConfig - 44, // 26: v1beta1.OpenGeminiDataConfig.tags:type_name -> v1beta1.OpenGeminiDataConfig.TagsEntry - 24, // 27: v1beta1.ReportDeviceStatusRequest.reportedDevice:type_name -> v1beta1.DeviceStatus - 25, // 28: v1beta1.DeviceStatus.twins:type_name -> v1beta1.Twin - 26, // 29: v1beta1.Twin.observedDesired:type_name -> v1beta1.TwinProperty - 26, // 30: v1beta1.Twin.reported:type_name -> v1beta1.TwinProperty - 45, // 31: v1beta1.TwinProperty.metadata:type_name -> v1beta1.TwinProperty.MetadataEntry - 6, // 32: v1beta1.RegisterDeviceRequest.device:type_name -> v1beta1.Device - 2, // 33: v1beta1.CreateDeviceModelRequest.model:type_name -> v1beta1.DeviceModel - 6, // 34: v1beta1.UpdateDeviceRequest.device:type_name -> v1beta1.Device - 2, // 35: v1beta1.UpdateDeviceModelRequest.model:type_name -> v1beta1.DeviceModel - 6, // 36: v1beta1.GetDeviceResponse.device:type_name -> v1beta1.Device - 46, // 37: v1beta1.CustomizedValue.DataEntry.value:type_name -> google.protobuf.Any - 0, // 38: v1beta1.DeviceManagerService.MapperRegister:input_type -> v1beta1.MapperRegisterRequest - 23, // 39: v1beta1.DeviceManagerService.ReportDeviceStatus:input_type -> v1beta1.ReportDeviceStatusRequest - 28, // 40: v1beta1.DeviceMapperService.RegisterDevice:input_type -> v1beta1.RegisterDeviceRequest - 32, // 41: v1beta1.DeviceMapperService.RemoveDevice:input_type -> v1beta1.RemoveDeviceRequest - 36, // 42: v1beta1.DeviceMapperService.UpdateDevice:input_type -> v1beta1.UpdateDeviceRequest - 30, // 43: v1beta1.DeviceMapperService.CreateDeviceModel:input_type -> v1beta1.CreateDeviceModelRequest - 34, // 44: v1beta1.DeviceMapperService.RemoveDeviceModel:input_type -> v1beta1.RemoveDeviceModelRequest - 38, // 45: v1beta1.DeviceMapperService.UpdateDeviceModel:input_type -> v1beta1.UpdateDeviceModelRequest - 40, // 46: v1beta1.DeviceMapperService.GetDevice:input_type -> v1beta1.GetDeviceRequest - 1, // 47: v1beta1.DeviceManagerService.MapperRegister:output_type -> v1beta1.MapperRegisterResponse - 27, // 48: v1beta1.DeviceManagerService.ReportDeviceStatus:output_type -> v1beta1.ReportDeviceStatusResponse - 29, // 49: v1beta1.DeviceMapperService.RegisterDevice:output_type -> v1beta1.RegisterDeviceResponse - 33, // 50: v1beta1.DeviceMapperService.RemoveDevice:output_type -> v1beta1.RemoveDeviceResponse - 37, // 51: v1beta1.DeviceMapperService.UpdateDevice:output_type -> v1beta1.UpdateDeviceResponse - 31, // 52: v1beta1.DeviceMapperService.CreateDeviceModel:output_type -> v1beta1.CreateDeviceModelResponse - 35, // 53: v1beta1.DeviceMapperService.RemoveDeviceModel:output_type -> v1beta1.RemoveDeviceModelResponse - 39, // 54: v1beta1.DeviceMapperService.UpdateDeviceModel:output_type -> v1beta1.UpdateDeviceModelResponse - 41, // 55: v1beta1.DeviceMapperService.GetDevice:output_type -> v1beta1.GetDeviceResponse - 47, // [47:56] is the sub-list for method output_type - 38, // [38:47] is the sub-list for method input_type - 38, // [38:38] is the sub-list for extension type_name - 38, // [38:38] is the sub-list for extension extendee - 0, // [0:38] is the sub-list for field type_name + 18, // 20: v1beta1.DBMethodInfluxdb2.influxdb2ClientConfig:type_name -> v1beta1.Influxdb2ClientConfig + 17, // 21: v1beta1.DBMethodInfluxdb2.influxdb2DataConfig:type_name -> v1beta1.Influxdb2DataConfig + 40, // 22: v1beta1.Influxdb2DataConfig.tag:type_name -> v1beta1.Influxdb2DataConfig.TagEntry + 21, // 23: v1beta1.ReportDeviceStatusRequest.reportedDevice:type_name -> v1beta1.DeviceStatus + 22, // 24: v1beta1.DeviceStatus.twins:type_name -> v1beta1.Twin + 23, // 25: v1beta1.Twin.observedDesired:type_name -> v1beta1.TwinProperty + 23, // 26: v1beta1.Twin.reported:type_name -> v1beta1.TwinProperty + 41, // 27: v1beta1.TwinProperty.metadata:type_name -> v1beta1.TwinProperty.MetadataEntry + 6, // 28: v1beta1.RegisterDeviceRequest.device:type_name -> v1beta1.Device + 2, // 29: v1beta1.CreateDeviceModelRequest.model:type_name -> v1beta1.DeviceModel + 6, // 30: v1beta1.UpdateDeviceRequest.device:type_name -> v1beta1.Device + 2, // 31: v1beta1.UpdateDeviceModelRequest.model:type_name -> v1beta1.DeviceModel + 6, // 32: v1beta1.GetDeviceResponse.device:type_name -> v1beta1.Device + 42, // 33: v1beta1.CustomizedValue.DataEntry.value:type_name -> google.protobuf.Any + 0, // 34: v1beta1.DeviceManagerService.MapperRegister:input_type -> v1beta1.MapperRegisterRequest + 20, // 35: v1beta1.DeviceManagerService.ReportDeviceStatus:input_type -> v1beta1.ReportDeviceStatusRequest + 25, // 36: v1beta1.DeviceMapperService.RegisterDevice:input_type -> v1beta1.RegisterDeviceRequest + 29, // 37: v1beta1.DeviceMapperService.RemoveDevice:input_type -> v1beta1.RemoveDeviceRequest + 33, // 38: v1beta1.DeviceMapperService.UpdateDevice:input_type -> v1beta1.UpdateDeviceRequest + 27, // 39: v1beta1.DeviceMapperService.CreateDeviceModel:input_type -> v1beta1.CreateDeviceModelRequest + 31, // 40: v1beta1.DeviceMapperService.RemoveDeviceModel:input_type -> v1beta1.RemoveDeviceModelRequest + 35, // 41: v1beta1.DeviceMapperService.UpdateDeviceModel:input_type -> v1beta1.UpdateDeviceModelRequest + 37, // 42: v1beta1.DeviceMapperService.GetDevice:input_type -> v1beta1.GetDeviceRequest + 1, // 43: v1beta1.DeviceManagerService.MapperRegister:output_type -> v1beta1.MapperRegisterResponse + 24, // 44: v1beta1.DeviceManagerService.ReportDeviceStatus:output_type -> v1beta1.ReportDeviceStatusResponse + 26, // 45: v1beta1.DeviceMapperService.RegisterDevice:output_type -> v1beta1.RegisterDeviceResponse + 30, // 46: v1beta1.DeviceMapperService.RemoveDevice:output_type -> v1beta1.RemoveDeviceResponse + 34, // 47: v1beta1.DeviceMapperService.UpdateDevice:output_type -> v1beta1.UpdateDeviceResponse + 28, // 48: v1beta1.DeviceMapperService.CreateDeviceModel:output_type -> v1beta1.CreateDeviceModelResponse + 32, // 49: v1beta1.DeviceMapperService.RemoveDeviceModel:output_type -> v1beta1.RemoveDeviceModelResponse + 36, // 50: v1beta1.DeviceMapperService.UpdateDeviceModel:output_type -> v1beta1.UpdateDeviceModelResponse + 38, // 51: v1beta1.DeviceMapperService.GetDevice:output_type -> v1beta1.GetDeviceResponse + 43, // [43:52] is the sub-list for method output_type + 34, // [34:43] is the sub-list for method input_type + 34, // [34:34] is the sub-list for extension type_name + 34, // [34:34] is the sub-list for extension extendee + 0, // [0:34] is the sub-list for field type_name } func init() { file_api_proto_init() } @@ -3211,42 +2973,6 @@ func file_api_proto_init() { } } file_api_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DBMethodOpenGemini); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OpenGeminiDataConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OpenGeminiClientConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MapperInfo); i { case 0: return &v.state @@ -3258,7 +2984,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReportDeviceStatusRequest); i { case 0: return &v.state @@ -3270,7 +2996,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeviceStatus); i { case 0: return &v.state @@ -3282,7 +3008,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Twin); i { case 0: return &v.state @@ -3294,7 +3020,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TwinProperty); i { case 0: return &v.state @@ -3306,7 +3032,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReportDeviceStatusResponse); i { case 0: return &v.state @@ -3318,7 +3044,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RegisterDeviceRequest); i { case 0: return &v.state @@ -3330,7 +3056,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RegisterDeviceResponse); i { case 0: return &v.state @@ -3342,7 +3068,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateDeviceModelRequest); i { case 0: return &v.state @@ -3354,7 +3080,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateDeviceModelResponse); i { case 0: return &v.state @@ -3366,7 +3092,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemoveDeviceRequest); i { case 0: return &v.state @@ -3378,7 +3104,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemoveDeviceResponse); i { case 0: return &v.state @@ -3390,7 +3116,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemoveDeviceModelRequest); i { case 0: return &v.state @@ -3402,7 +3128,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemoveDeviceModelResponse); i { case 0: return &v.state @@ -3414,7 +3140,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateDeviceRequest); i { case 0: return &v.state @@ -3426,7 +3152,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateDeviceResponse); i { case 0: return &v.state @@ -3438,7 +3164,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateDeviceModelRequest); i { case 0: return &v.state @@ -3450,7 +3176,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateDeviceModelResponse); i { case 0: return &v.state @@ -3462,7 +3188,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetDeviceRequest); i { case 0: return &v.state @@ -3474,7 +3200,7 @@ func file_api_proto_init() { return nil } } - file_api_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + file_api_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetDeviceResponse); i { case 0: return &v.state @@ -3493,7 +3219,7 @@ func file_api_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_proto_rawDesc, NumEnums: 0, - NumMessages: 46, + NumMessages: 42, NumExtensions: 0, NumServices: 2, }, diff --git a/mappers/v1beta1-mapper/modbus/pkg/dmi-api/api.proto b/mappers/kubeedge-v1.15.0/modbus/pkg/dmi-api/api.proto similarity index 95% rename from mappers/v1beta1-mapper/modbus/pkg/dmi-api/api.proto rename to mappers/kubeedge-v1.15.0/modbus/pkg/dmi-api/api.proto index 8040a6bc..a6f94859 100644 --- a/mappers/v1beta1-mapper/modbus/pkg/dmi-api/api.proto +++ b/mappers/kubeedge-v1.15.0/modbus/pkg/dmi-api/api.proto @@ -245,7 +245,6 @@ message PushMethodMQTT { message DBMethod{ // the config of database . DBMethodInfluxdb2 influxdb2 = 1; - DBMethodOpenGemini openGemini = 2; } message DBMethodInfluxdb2{ @@ -270,28 +269,6 @@ message Influxdb2ClientConfig{ string bucket = 3; } -message DBMethodOpenGemini{ - // the config of OpenGemini database. - OpenGeminiClientConfig openGeminiClientConfig = 1; - OpenGeminiDataConfig openGeminiDataConfig = 2; -} - -message OpenGeminiDataConfig{ - // data config when push data to OpenGemini - string measurement = 1; - map tags = 2; - string fieldKey = 3; -} - -message OpenGeminiClientConfig{ - // OpenGemini database url - string url = 1; - // usr database in OpenGemini database - string database = 2; - // data retentionPolicy in OpenGemini database - string retentionPolicy = 3; -} - // MapperInfo is the information of mapper. message MapperInfo { // name of the mapper. diff --git a/mappers/v1beta1-mapper/modbus/pkg/dmi-api/api_grpc.pb.go b/mappers/kubeedge-v1.15.0/modbus/pkg/dmi-api/api_grpc.pb.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/dmi-api/api_grpc.pb.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/dmi-api/api_grpc.pb.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/global/global.go b/mappers/kubeedge-v1.15.0/modbus/pkg/global/global.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/global/global.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/global/global.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/util/grpcclient/config.go b/mappers/kubeedge-v1.15.0/modbus/pkg/grpcclient/config.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/util/grpcclient/config.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/grpcclient/config.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/util/grpcclient/register.go b/mappers/kubeedge-v1.15.0/modbus/pkg/grpcclient/register.go similarity index 90% rename from mappers/v1beta1-mapper/modbus/pkg/util/grpcclient/register.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/grpcclient/register.go index bb539662..140dcc9f 100644 --- a/mappers/v1beta1-mapper/modbus/pkg/util/grpcclient/register.go +++ b/mappers/kubeedge-v1.15.0/modbus/pkg/grpcclient/register.go @@ -9,12 +9,11 @@ import ( "google.golang.org/grpc" "github.com/kubeedge/modbus/pkg/common" - "github.com/kubeedge/modbus/pkg/config" dmiapi "github.com/kubeedge/modbus/pkg/dmi-api" ) // RegisterMapper if withData is true, edgecore will send device and model list. -func RegisterMapper(cfg *config.Config, withData bool) ([]*dmiapi.Device, []*dmiapi.DeviceModel, error) { +func RegisterMapper(withData bool) ([]*dmiapi.Device, []*dmiapi.DeviceModel, error) { // connect grpc server conn, err := grpc.Dial(cfg.Common.EdgeCoreSock, grpc.WithInsecure(), diff --git a/mappers/v1beta1-mapper/modbus/pkg/util/grpcclient/report.go b/mappers/kubeedge-v1.15.0/modbus/pkg/grpcclient/report.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/util/grpcclient/report.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/grpcclient/report.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/grpcserver/device.go b/mappers/kubeedge-v1.15.0/modbus/pkg/grpcserver/device.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/grpcserver/device.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/grpcserver/device.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/grpcserver/server.go b/mappers/kubeedge-v1.15.0/modbus/pkg/grpcserver/server.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/grpcserver/server.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/grpcserver/server.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/httpserver/callback.go b/mappers/kubeedge-v1.15.0/modbus/pkg/httpserver/callback.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/httpserver/callback.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/httpserver/callback.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/httpserver/responsetype.go b/mappers/kubeedge-v1.15.0/modbus/pkg/httpserver/responsetype.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/httpserver/responsetype.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/httpserver/responsetype.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/httpserver/restapi.go b/mappers/kubeedge-v1.15.0/modbus/pkg/httpserver/restapi.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/httpserver/restapi.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/httpserver/restapi.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/httpserver/router.go b/mappers/kubeedge-v1.15.0/modbus/pkg/httpserver/router.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/httpserver/router.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/httpserver/router.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/httpserver/server.go b/mappers/kubeedge-v1.15.0/modbus/pkg/httpserver/server.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/httpserver/server.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/httpserver/server.go diff --git a/mappers/v1beta1-mapper/modbus/pkg/util/parse/grpc.go b/mappers/kubeedge-v1.15.0/modbus/pkg/util/parse/grpc.go similarity index 72% rename from mappers/v1beta1-mapper/modbus/pkg/util/parse/grpc.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/util/parse/grpc.go index 328d6d2d..962f3478 100644 --- a/mappers/v1beta1-mapper/modbus/pkg/util/parse/grpc.go +++ b/mappers/kubeedge-v1.15.0/modbus/pkg/util/parse/grpc.go @@ -35,8 +35,6 @@ func getDBMethodFromGrpc(visitor *dmiapi.DeviceProperty) (string, error) { // TODO add more dbMethod if visitor.PushMethod.DBMethod.Influxdb2 != nil { return "influx", nil - } else if visitor.PushMethod.DBMethod.OpenGemini != nil { - return "openGemini", nil } return "", errors.New("can not parse dbMethod") } @@ -74,26 +72,18 @@ func BuildProtocolFromGrpc(device *dmiapi.Device) (common.ProtocolConfig, error) } func buildTwinsFromGrpc(device *dmiapi.Device) []common.Twin { - if len(device.Status.Twins) == 0 { + if len(device.Spec.Properties) == 0 { return nil } - res := make([]common.Twin, 0, len(device.Status.Twins)) - for _, twin := range device.Status.Twins { + res := make([]common.Twin, 0, len(device.Spec.Properties)) + for _, property := range device.Spec.Properties { cur := common.Twin{ - PropertyName: twin.PropertyName, - + PropertyName: property.Name, ObservedDesired: common.TwinProperty{ - Value: twin.ObservedDesired.Value, - Metadata: common.Metadata{ - Timestamp: twin.ObservedDesired.Metadata["timestamp"], - Type: twin.ObservedDesired.Metadata["type"], - }, - }, - Reported: common.TwinProperty{ - Value: twin.Reported.Value, + Value: property.Desired.Value, Metadata: common.Metadata{ - Timestamp: twin.ObservedDesired.Metadata["timestamp"], - Type: twin.ObservedDesired.Metadata["type"], + Timestamp: property.Desired.Metadata["timestamp"], + Type: property.Desired.Metadata["type"], }, }, } @@ -136,77 +126,65 @@ func buildPropertiesFromGrpc(device *dmiapi.Device) []common.DeviceProperty { // get dbMethod filed by grpc device instance var dbMethodName string var dbconfig common.DBConfig - if pptv.PushMethod.DBMethod != nil { - dbMethodName, err = getDBMethodFromGrpc(pptv) - if err != nil { - klog.Errorf("err: %+v", err) - return nil - } - switch dbMethodName { - case "influx": - clientconfig, err := json.Marshal(pptv.PushMethod.DBMethod.Influxdb2.Influxdb2ClientConfig) - if err != nil { - klog.Errorf("err: %+v", err) - return nil - } - dataconfig, err := json.Marshal(pptv.PushMethod.DBMethod.Influxdb2.Influxdb2DataConfig) + var pushMethod []byte + var pushMethodName string + if pptv.PushMethod != nil { + if pptv.PushMethod.DBMethod != nil { + dbMethodName, err = getDBMethodFromGrpc(pptv) if err != nil { klog.Errorf("err: %+v", err) return nil } - dbconfig = common.DBConfig{ - Influxdb2ClientConfig: clientconfig, - Influxdb2DataConfig: dataconfig, + switch dbMethodName { + case "influx": + clientconfig, err := json.Marshal(pptv.PushMethod.DBMethod.Influxdb2.Influxdb2ClientConfig) + if err != nil { + klog.Errorf("err: %+v", err) + return nil + } + dataconfig, err := json.Marshal(pptv.PushMethod.DBMethod.Influxdb2.Influxdb2DataConfig) + if err != nil { + klog.Errorf("err: %+v", err) + return nil + } + dbconfig = common.DBConfig{ + Influxdb2ClientConfig: clientconfig, + Influxdb2DataConfig: dataconfig, + } } - case "openGemini": - clientconfig, err := json.Marshal(pptv.PushMethod.DBMethod.OpenGemini.OpenGeminiClientConfig) + } + // get pushMethod filed by grpc device instance + pushMethodName, err = getPushMethodFromGrpc(pptv) + if err != nil { + klog.Errorf("err: %+v", err) + return nil + } + switch pushMethodName { + case "http": + pushMethod, err = json.Marshal(pptv.PushMethod.Http) if err != nil { klog.Errorf("err: %+v", err) return nil } - dataconfig, err := json.Marshal(pptv.PushMethod.DBMethod.OpenGemini.OpenGeminiDataConfig) + case "mqtt": + pushMethod, err = json.Marshal(pptv.PushMethod.Mqtt) if err != nil { klog.Errorf("err: %+v", err) return nil } - dbconfig = common.DBConfig{ - OpenGeminiClientConfig: clientconfig, - OpenGeminiDataConfig: dataconfig, - } - } - } - - // get pushMethod filed by grpc device instance - pushMethodName, err := getPushMethodFromGrpc(pptv) - if err != nil { - klog.Errorf("err: %+v", err) - return nil - } - var pushMethod []byte - switch pushMethodName { - case "http": - pushMethod, err = json.Marshal(pptv.PushMethod.Http) - if err != nil { - klog.Errorf("err: %+v", err) - return nil - } - case "mqtt": - pushMethod, err = json.Marshal(pptv.PushMethod.Mqtt) - if err != nil { - klog.Errorf("err: %+v", err) - return nil } } // get the final Properties cur := common.DeviceProperty{ - Name: pptv.GetName(), - PropertyName: pptv.GetName(), - ModelName: device.Spec.DeviceModelReference, - CollectCycle: pptv.GetCollectCycle(), - ReportCycle: pptv.GetReportCycle(), - Protocol: protocolName, - Visitors: visitorConfig, + Name: pptv.GetName(), + PropertyName: pptv.GetName(), + ModelName: device.Spec.DeviceModelReference, + CollectCycle: pptv.GetCollectCycle(), + ReportCycle: pptv.GetReportCycle(), + ReportToCloud: pptv.GetReportToCloud(), + Protocol: protocolName, + Visitors: visitorConfig, PushMethod: common.PushMethodConfig{ MethodName: pushMethodName, MethodConfig: pushMethod, diff --git a/mappers/v1beta1-mapper/modbus/pkg/util/parse/parse.go b/mappers/kubeedge-v1.15.0/modbus/pkg/util/parse/parse.go similarity index 86% rename from mappers/v1beta1-mapper/modbus/pkg/util/parse/parse.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/util/parse/parse.go index 86951eb7..4f8b1273 100644 --- a/mappers/v1beta1-mapper/modbus/pkg/util/parse/parse.go +++ b/mappers/kubeedge-v1.15.0/modbus/pkg/util/parse/parse.go @@ -22,17 +22,15 @@ import ( "k8s.io/klog/v2" "github.com/kubeedge/modbus/pkg/common" - "github.com/kubeedge/modbus/pkg/config" - "github.com/kubeedge/modbus/pkg/util/grpcclient" + "github.com/kubeedge/modbus/pkg/grpcclient" ) var ErrEmptyData error = errors.New("device or device model list is empty") -func ParseByUsingRegister(cfg *config.Config, - devices map[string]*common.DeviceInstance, +func ParseByUsingRegister(devices map[string]*common.DeviceInstance, dms map[string]common.DeviceModel, protocols map[string]common.ProtocolConfig) error { - deviceList, deviceModelList, err := grpcclient.RegisterMapper(cfg, true) + deviceList, deviceModelList, err := grpcclient.RegisterMapper(true) if err != nil { return err } diff --git a/mappers/v1beta1-mapper/modbus/pkg/util/parse/type.go b/mappers/kubeedge-v1.15.0/modbus/pkg/util/parse/type.go similarity index 100% rename from mappers/v1beta1-mapper/modbus/pkg/util/parse/type.go rename to mappers/kubeedge-v1.15.0/modbus/pkg/util/parse/type.go diff --git a/mappers/v1beta1-mapper/modbus/resource/modbus-instance.yaml b/mappers/kubeedge-v1.15.0/modbus/resource/modbus-instance.yaml similarity index 100% rename from mappers/v1beta1-mapper/modbus/resource/modbus-instance.yaml rename to mappers/kubeedge-v1.15.0/modbus/resource/modbus-instance.yaml diff --git a/mappers/v1beta1-mapper/modbus/resource/modbus-model.yaml b/mappers/kubeedge-v1.15.0/modbus/resource/modbus-model.yaml similarity index 100% rename from mappers/v1beta1-mapper/modbus/resource/modbus-model.yaml rename to mappers/kubeedge-v1.15.0/modbus/resource/modbus-model.yaml diff --git a/mappers/v1beta1-mapper/modbus/data/dbmethod/openGemini/client.go b/mappers/v1beta1-mapper/modbus/data/dbmethod/openGemini/client.go deleted file mode 100644 index 81192c3e..00000000 --- a/mappers/v1beta1-mapper/modbus/data/dbmethod/openGemini/client.go +++ /dev/null @@ -1,48 +0,0 @@ -package opengemini - -import ( - "encoding/json" - _ "github.com/influxdata/influxdb1-client" // this is important because of the bug in go mod - client "github.com/influxdata/influxdb1-client/v2" - "github.com/kubeedge/modbus/pkg/common" -) - -type DataBaseConfig struct { - OpengeminiClientConfig *OpengeminiClientConfig `json:"opengeminiClientConfig,omitempty"` - OpengeminiDataConfig *OpengeminiDataConfig `json:"opengeminiDataConfig,omitempty"` -} - -type OpengeminiClientConfig struct { - URL string `json:"url,omitempty"` - Database string `json:"database,omitempty"` - RetentionPolicy string `json:"retentionPolicy,omitempty"` -} - -type OpengeminiDataConfig struct { - Measurement string `json:"measurement,omitempty"` - Tags map[string]string `json:"tags,omitempty"` - FieldKey string `json:"fieldKey,omitempty"` -} - -func NewDataBaseClient(clientConfig json.RawMessage, dataConfig json.RawMessage) (*DataBaseConfig, error) { - // TODO parse opengemini database config data - - return &DataBaseConfig{}, nil -} - -func (d *DataBaseConfig) InitDbClient() (client.Client, error) { - // TODO add opengemini database initialization code - - conf := client.HTTPConfig{} - return client.NewHTTPClient(conf) -} - -func (d *DataBaseConfig) CloseSession(cli client.Client) error { - // TODO add opengemini database close code - return nil -} - -func (d *DataBaseConfig) AddData(data *common.DataModel, cli client.Client) error { - // TODO add opengemini database data push code - return nil -} diff --git a/mappers/v1beta1-mapper/modbus/data/dbmethod/redis/client.go b/mappers/v1beta1-mapper/modbus/data/dbmethod/redis/client.go deleted file mode 100644 index 1b761b8e..00000000 --- a/mappers/v1beta1-mapper/modbus/data/dbmethod/redis/client.go +++ /dev/null @@ -1,48 +0,0 @@ -package redis - -import ( - "github.com/kubeedge/modbus/pkg/common" - "github.com/kubeedge/modbus/pkg/global" -) - -type DataBaseConfig struct { -} - -func NewDataBaseClient() (global.DataBaseClient, error) { - return &DataBaseConfig{}, nil -} - -func (d *DataBaseConfig) InitDbClient() error { - //TODO implement me - panic("implement me") -} - -func (d *DataBaseConfig) CloseSession() { - //TODO implement me - panic("implement me") -} - -func (d *DataBaseConfig) AddData(data *common.DataModel) { - //TODO implement me - panic("implement me") -} - -func (d *DataBaseConfig) GetDataByDeviceName(deviceName string) ([]*common.DataModel, error) { - //TODO implement me - panic("implement me") -} - -func (d *DataBaseConfig) GetPropertyDataByDeviceName(deviceName string, propertyData string) ([]*common.DataModel, error) { - //TODO implement me - panic("implement me") -} - -func (d *DataBaseConfig) GetDataByTimeRange(start int64, end int64) ([]*common.DataModel, error) { - //TODO implement me - panic("implement me") -} - -func (d *DataBaseConfig) DeleteDataByTimeRange(start int64, end int64) ([]*common.DataModel, error) { - //TODO implement me - panic("implement me") -}