summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/crd-samples/operations/imageprepulljob.yaml2
-rw-r--r--build/crds/devices/devices_v1beta1_device.yaml15
-rw-r--r--cloud/cmd/cloudcore/app/server.go8
-rw-r--r--cloud/pkg/cloudhub/dispatcher/message_dispatcher.go11
-rw-r--r--cloud/pkg/common/client/client.go9
-rw-r--r--cloud/pkg/csrapprovercontroller/csrapprover.go228
-rw-r--r--cloud/pkg/devicecontroller/controller/downstream.go20
-rw-r--r--cloud/pkg/devicecontroller/controller/upstream.go27
-rw-r--r--cloud/pkg/edgecontroller/controller/upstream.go96
-rw-r--r--common/constants/default.go5
-rw-r--r--docs/images/proposals/csrapprovecontroller.pngbin0 -> 143289 bytes
-rw-r--r--docs/images/proposals/inclusterconfig.pngbin0 -> 51038 bytes
-rw-r--r--docs/proposals/inclusterconfig.md114
-rw-r--r--edge/pkg/edgehub/edgehub.go3
-rw-r--r--edge/pkg/edgehub/edgehub_test.go5
-rw-r--r--edge/pkg/metamanager/client/ceritificatesigningrequest.go133
-rw-r--r--edge/pkg/metamanager/client/metaclient.go5
-rw-r--r--edge/pkg/metamanager/metaserver/certificate/certificates/v1/certificates_client.go42
-rw-r--r--edge/pkg/metamanager/metaserver/certificate/certificates/v1/certificatesigningrequest.go48
-rw-r--r--edge/pkg/metamanager/metaserver/certificate/clientset_bridge.go50
-rw-r--r--edge/pkg/metamanager/metaserver/certificate/manager.go149
-rw-r--r--edge/pkg/metamanager/metaserver/server.go184
-rw-r--r--edge/pkg/metamanager/process.go4
-rw-r--r--go.mod4
-rw-r--r--keadm/cmd/keadm/app/cmd/cloud/init.go19
-rw-r--r--keadm/cmd/keadm/app/cmd/helm/cloudcore.go20
-rw-r--r--manifests/charts/cloudcore/crds/devices_v1beta1_device.yaml15
-rw-r--r--manifests/charts/cloudcore/templates/rbac_cloudcore_feature.yaml14
-rw-r--r--pkg/apis/componentconfig/cloudcore/v1alpha1/default.go4
-rw-r--r--pkg/apis/componentconfig/cloudcore/v1alpha1/types.go9
-rw-r--r--pkg/apis/componentconfig/edgecore/v1alpha2/default.go1
-rw-r--r--pkg/apis/componentconfig/edgecore/v1alpha2/types.go3
-rw-r--r--pkg/apis/devices/v1beta1/device_instance_types.go15
-rw-r--r--pkg/apis/devices/v1beta1/zz_generated.deepcopy.go42
-rw-r--r--pkg/apis/dmi/v1beta1/api.pb.go888
-rw-r--r--pkg/apis/dmi/v1beta1/api.proto15
-rw-r--r--pkg/apis/dmi/v1beta1/api_grpc.pb.go2
-rw-r--r--pkg/util/dummy_device.go102
-rw-r--r--staging/src/github.com/kubeedge/beehive/pkg/core/model/message.go3
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/_template/mapper/data/dbmethod/mysql/client.go108
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/_template/mapper/data/dbmethod/mysql/handler.go73
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/_template/mapper/device/device.go10
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/_template/mapper/go.mod10
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/_template/mapper/go.sum6
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/go.mod16
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/go.sum28
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/pkg/common/configmaptype.go1
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/pkg/common/datamodel.go4
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/pkg/dmi-api/api.pb.go3572
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/pkg/dmi-api/api.proto395
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/pkg/dmi-api/api_grpc.pb.go559
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/pkg/httpserver/callback.go1
-rw-r--r--staging/src/github.com/kubeedge/mapper-framework/pkg/util/parse/grpc.go10
-rwxr-xr-xtests/scripts/keadm_compatibility_e2e.sh2
-rwxr-xr-xtests/scripts/keadm_e2e.sh2
-rw-r--r--vendor/k8s.io/client-go/util/certificate/OWNERS8
-rw-r--r--vendor/k8s.io/client-go/util/certificate/certificate_manager.go775
-rw-r--r--vendor/k8s.io/client-go/util/certificate/certificate_store.go318
-rw-r--r--vendor/modules.txt1
59 files changed, 3169 insertions, 5044 deletions
diff --git a/build/crd-samples/operations/imageprepulljob.yaml b/build/crd-samples/operations/imageprepulljob.yaml
index 041e83d26..69de6b5b1 100644
--- a/build/crd-samples/operations/imageprepulljob.yaml
+++ b/build/crd-samples/operations/imageprepulljob.yaml
@@ -8,7 +8,7 @@ spec:
imagePrePullTemplate:
images:
- busybox:latest
- nodes:
+ nodeNames:
- edgenode1 # Need to replaced with your own node name
timeoutSeconds: 300
retryTimes: 1
diff --git a/build/crds/devices/devices_v1beta1_device.yaml b/build/crds/devices/devices_v1beta1_device.yaml
index e360ad949..9602a5bbc 100644
--- a/build/crds/devices/devices_v1beta1_device.yaml
+++ b/build/crds/devices/devices_v1beta1_device.yaml
@@ -646,6 +646,21 @@ spec:
type: object
type: object
type: object
+ mysql:
+ properties:
+ mysqlClientConfig:
+ properties:
+ addr:
+ description: mysql address,like localhost:3306
+ type: string
+ database:
+ description: database name
+ type: string
+ userName:
+ description: user name
+ type: string
+ type: object
+ type: object
redis:
properties:
redisClientConfig:
diff --git a/cloud/cmd/cloudcore/app/server.go b/cloud/cmd/cloudcore/app/server.go
index c4a7a2388..4a0efbeb8 100644
--- a/cloud/cmd/cloudcore/app/server.go
+++ b/cloud/cmd/cloudcore/app/server.go
@@ -45,6 +45,7 @@ import (
"github.com/kubeedge/kubeedge/cloud/pkg/common/informers"
"github.com/kubeedge/kubeedge/cloud/pkg/common/modules"
"github.com/kubeedge/kubeedge/cloud/pkg/common/monitor"
+ "github.com/kubeedge/kubeedge/cloud/pkg/csrapprovercontroller"
"github.com/kubeedge/kubeedge/cloud/pkg/devicecontroller"
"github.com/kubeedge/kubeedge/cloud/pkg/dynamiccontroller"
"github.com/kubeedge/kubeedge/cloud/pkg/edgecontroller"
@@ -112,11 +113,16 @@ kubernetes controller which manages devices so that the device metadata/status d
updateCloudCoreConfigMap(config)
}
+ ctx := beehiveContext.GetContext()
+ if features.DefaultFeatureGate.Enabled(features.RequireAuthorization) {
+ go csrapprovercontroller.NewCSRApprover(client.GetKubeClient(), informers.GetInformersManager().GetKubeInformerFactory().Certificates().V1().CertificateSigningRequests()).
+ Run(5, ctx.Done())
+ }
+
gis := informers.GetInformersManager()
registerModules(config)
- ctx := beehiveContext.GetContext()
if config.Modules.IptablesManager == nil || config.Modules.IptablesManager.Enable && config.Modules.IptablesManager.Mode == v1alpha1.InternalMode {
// By default, IptablesManager manages tunnel port related iptables rules
// The internal mode will share the host network, forward to the stream port.
diff --git a/cloud/pkg/cloudhub/dispatcher/message_dispatcher.go b/cloud/pkg/cloudhub/dispatcher/message_dispatcher.go
index 18382f13b..344747eae 100644
--- a/cloud/pkg/cloudhub/dispatcher/message_dispatcher.go
+++ b/cloud/pkg/cloudhub/dispatcher/message_dispatcher.go
@@ -31,6 +31,7 @@ import (
"github.com/kubeedge/kubeedge/cloud/pkg/cloudhub/common"
"github.com/kubeedge/kubeedge/cloud/pkg/cloudhub/common/model"
"github.com/kubeedge/kubeedge/cloud/pkg/cloudhub/session"
+ "github.com/kubeedge/kubeedge/cloud/pkg/common/client"
"github.com/kubeedge/kubeedge/cloud/pkg/common/messagelayer"
"github.com/kubeedge/kubeedge/cloud/pkg/common/modules"
"github.com/kubeedge/kubeedge/cloud/pkg/synccontroller"
@@ -65,7 +66,7 @@ import (
// ------------------------------------------------------------------
// MessageDispatcher is responsible for the dispatch of upstream messages
-// (edge ​​to cloud) and downstream messages (cloud to edge)
+// (edge to cloud) and downstream messages (cloud to edge)
type MessageDispatcher interface {
// DispatchDownstream continuously reads the messages from cloudHub module,
// and according to the content of the message, the message is dispatched
@@ -188,6 +189,11 @@ func (md *messageDispatcher) DispatchUpstream(message *beehivemodel.Message, inf
message.GetOperation() == taskutil.TaskUpgrade:
beehivecontext.SendToGroup(modules.TaskManagerModuleGroup, *message)
+ case message.GetResource() == beehivemodel.ResourceTypeK8sCA:
+ respMsg := beehivemodel.NewMessage(message.GetID()).FillBody(string(client.GetK8sCA())).
+ BuildRouter(modules.CloudHubModuleName, "resource", fmt.Sprintf("node/%s/%s", info.NodeID, message.GetResource()), beehivemodel.ResponseOperation)
+ beehivecontext.Send(modules.CloudHubModuleName, *respMsg)
+
default:
err := md.PubToController(info, message)
if err != nil {
@@ -446,6 +452,8 @@ func noAckRequired(msg *beehivemodel.Message) bool {
return true
case strings.Contains(msgResource, beehivemodel.ResourceTypeServiceAccountToken):
return true
+ case strings.Contains(msgResource, beehivemodel.ResourceTypeK8sCA):
+ return true
case isVolumeOperation(msg.GetOperation()):
return true
case msg.Router.Operation == metaserver.ApplicationResp:
@@ -475,6 +483,7 @@ func noAckRequired(msg *beehivemodel.Message) bool {
resourceType == beehivemodel.ResourceTypeNodePatch ||
resourceType == beehivemodel.ResourceTypePodPatch ||
resourceType == beehivemodel.ResourceTypePodStatus ||
+ resourceType == beehivemodel.ResourceTypeCSR ||
(resourceType == beehivemodel.ResourceTypePod && msg.GetOperation() == beehivemodel.ResponseOperation) {
return true
}
diff --git a/cloud/pkg/common/client/client.go b/cloud/pkg/common/client/client.go
index 057ec1aa0..5caac1ccd 100644
--- a/cloud/pkg/common/client/client.go
+++ b/cloud/pkg/common/client/client.go
@@ -96,6 +96,15 @@ func GetAuthConfig() *rest.Config {
return authKubeConfig
}
+func GetK8sCA() []byte {
+ ca, err := os.ReadFile(KubeConfig.CAFile)
+ if err != nil {
+ klog.Errorf("read k8s CA failed, %v", err)
+ return nil
+ }
+ return ca
+}
+
type RestMapperFunc func() (meta.RESTMapper, error)
var DefaultGetRestMapper RestMapperFunc = GetRestMapper
diff --git a/cloud/pkg/csrapprovercontroller/csrapprover.go b/cloud/pkg/csrapprovercontroller/csrapprover.go
new file mode 100644
index 000000000..fab82a1d3
--- /dev/null
+++ b/cloud/pkg/csrapprovercontroller/csrapprover.go
@@ -0,0 +1,228 @@
+/*
+Copyright 2024 The Kubernetes 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 csrapprovercontroller
+
+import (
+ "context"
+ "crypto/x509"
+ "fmt"
+ "time"
+
+ "golang.org/x/time/rate"
+ certificatesv1 "k8s.io/api/certificates/v1"
+ corev1 "k8s.io/api/core/v1"
+ apierrors "k8s.io/apimachinery/pkg/api/errors"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ utilruntime "k8s.io/apimachinery/pkg/util/runtime"
+ "k8s.io/apimachinery/pkg/util/sets"
+ "k8s.io/apimachinery/pkg/util/wait"
+ certificatesinformers "k8s.io/client-go/informers/certificates/v1"
+ clientset "k8s.io/client-go/kubernetes"
+ certificateslisters "k8s.io/client-go/listers/certificates/v1"
+ "k8s.io/client-go/tools/cache"
+ "k8s.io/client-go/util/workqueue"
+ "k8s.io/klog/v2"
+ "k8s.io/kubernetes/pkg/apis/certificates"
+ "k8s.io/kubernetes/pkg/controller"
+)
+
+type csrRecognizer struct {
+ recognize func(csr *certificatesv1.CertificateSigningRequest, x509cr *x509.CertificateRequest) bool
+ successMessage string
+}
+
+type CSRApprover struct {
+ kubeClient clientset.Interface
+ queue workqueue.RateLimitingInterface
+
+ csrLister certificateslisters.CertificateSigningRequestLister
+ csrSynced cache.InformerSynced
+
+ recognizers []csrRecognizer
+}
+
+// NewCSRApprover creates a new NewCSRApprover
+func NewCSRApprover(client clientset.Interface, csrInformer certificatesinformers.CertificateSigningRequestInformer) *CSRApprover {
+ approver := &CSRApprover{
+ kubeClient: client,
+ queue: workqueue.NewRateLimitingQueueWithConfig(workqueue.NewMaxOfRateLimiter(
+ workqueue.NewItemExponentialFailureRateLimiter(200*time.Millisecond, 1000*time.Second),
+ &workqueue.BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(10), 100)},
+ ), workqueue.RateLimitingQueueConfig{Name: "certificate"}),
+ recognizers: recognizers(),
+ }
+
+ _, err := csrInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
+ AddFunc: func(obj interface{}) {
+ csr := obj.(*certificatesv1.CertificateSigningRequest)
+ klog.V(4).Infof("Adding certificate request %s", csr.Name)
+ approver.enqueueCertificateRequest(obj)
+ },
+ UpdateFunc: func(old, new interface{}) {
+ oldCSR := old.(*certificatesv1.CertificateSigningRequest)
+ klog.V(4).Infof("Updating certificate request %s", oldCSR.Name)
+ approver.enqueueCertificateRequest(new)
+ },
+ })
+ if err != nil {
+ klog.Fatalf("new CSR approver failed, add event handler err: %v", err)
+ }
+
+ approver.csrLister = csrInformer.Lister()
+ approver.csrSynced = csrInformer.Informer().HasSynced
+ return approver
+}
+
+func (ap *CSRApprover) Run(workers int, stopCh <-chan struct{}) {
+ defer utilruntime.HandleCrash()
+ defer ap.queue.ShutDown()
+
+ klog.Info("Start CSRApprover")
+ defer klog.Info("Shut down CSRApprover")
+
+ if !cache.WaitForNamedCacheSync("CSRApprover", stopCh, ap.csrSynced) {
+ return
+ }
+
+ for i := 0; i < workers; i++ {
+ go wait.Until(ap.worker, time.Second, stopCh)
+ }
+
+ <-stopCh
+}
+
+func (ap *CSRApprover) enqueueCertificateRequest(obj interface{}) {
+ key, err := controller.KeyFunc(obj)
+ if err != nil {
+ utilruntime.HandleError(fmt.Errorf("couldn't get key for object %+v: %v", obj, err))
+ return
+ }
+ ap.queue.Add(key)
+}
+
+func (ap *CSRApprover) worker() {
+ for ap.processNextWorkItem() {
+ }
+}
+
+func (ap *CSRApprover) processNextWorkItem() bool {
+ cKey, quit := ap.queue.Get()
+ if quit {
+ return false
+ }
+ defer ap.queue.Done(cKey)
+
+ if err := ap.syncFunc(cKey.(string)); err != nil {
+ ap.queue.AddRateLimited(cKey)
+ utilruntime.HandleError(fmt.Errorf("sync %v failed with: %v", cKey, err))
+ return true
+ }
+
+ ap.queue.Forget(cKey)
+ return true
+}
+
+func (ap *CSRApprover) syncFunc(key string) error {
+ startTime := time.Now()
+ defer func() {
+ klog.V(4).Infof("Finished syncing certificate request %s (%v)", key, time.Since(startTime))
+ }()
+
+ csr, err := ap.csrLister.Get(key)
+ if apierrors.IsNotFound(err) {
+ klog.Infof("csr %s has been deleted", key)
+ return nil
+ }
+ if err != nil {
+ return err
+ }
+
+ if len(csr.Status.Certificate) > 0 {
+ return nil
+ }
+ csr = csr.DeepCopy()
+ return ap.handle(csr)
+}
+
+func (ap *CSRApprover) handle(csr *certificatesv1.CertificateSigningRequest) error {
+ if approved, denied := GetCertApprovalCondition(&csr.Status); approved || denied {
+ return nil
+ }
+ x509cr, err := certificates.ParseCSR(csr.Spec.Request)
+ if err != nil {
+ return fmt.Errorf("unable to parse csr %s: %v", csr.Name, err)
+ }
+
+ for _, r := range ap.recognizers {
+ if !r.recognize(csr, x509cr) {
+ continue
+ }
+
+ appendApprovalCondition(csr, r.successMessage)
+ _, err = ap.kubeClient.CertificatesV1().CertificateSigningRequests().UpdateApproval(context.Background(), csr.Name, csr, metav1.UpdateOptions{})
+ if err != nil {
+ return fmt.Errorf("failed to update approval for csr %s: %v", csr.Name, err)
+ }
+ return nil
+ }
+ return nil
+}
+
+func GetCertApprovalCondition(status *certificatesv1.CertificateSigningRequestStatus) (approved, denied bool) {
+ for _, c := range status.Conditions {
+ if c.Type == certificatesv1.CertificateApproved {
+ approved = true
+ }
+ if c.Type == certificatesv1.CertificateDenied {
+ denied = true
+ }
+ }
+ return
+}
+
+func appendApprovalCondition(csr *certificatesv1.CertificateSigningRequest, message string) {
+ csr.Status.Conditions = append(csr.Status.Conditions, certificatesv1.CertificateSigningRequestCondition{
+ Type: certificatesv1.CertificateApproved,
+ Status: corev1.ConditionTrue,
+ Reason: "AutoApproved",
+ Message: message,
+ })
+}
+
+func recognizers() []csrRecognizer {
+ return []csrRecognizer{
+ {
+ recognize: isMetaServerServingCert,
+ successMessage: "Auto approving MetaServer serving certificate.",
+ },
+ }
+}
+
+func isMetaServerServingCert(csr *certificatesv1.CertificateSigningRequest, x509cr *x509.CertificateRequest) bool {
+ if csr.Spec.SignerName != certificatesv1.KubeletServingSignerName {
+ return false
+ }
+ return certificates.IsKubeletServingCSR(x509cr, usagesToSet(csr.Spec.Usages))
+}
+
+func usagesToSet(usages []certificatesv1.KeyUsage) sets.String {
+ result := sets.NewString()
+ for _, usages := range usages {
+ result.Insert(string(usages))
+ }
+ return result
+}
diff --git a/cloud/pkg/devicecontroller/controller/downstream.go b/cloud/pkg/devicecontroller/controller/downstream.go
index 20bc84ad1..adc3c3ac1 100644
--- a/cloud/pkg/devicecontroller/controller/downstream.go
+++ b/cloud/pkg/devicecontroller/controller/downstream.go
@@ -208,6 +208,9 @@ func isExistModel(deviceMap *sync.Map, device *v1beta1.Device) bool {
// If NodeName is updated, call add device for newNode, deleteDevice for old Node.
// If Spec is updated, send update message to edge
func (dc *DownstreamController) deviceUpdated(device *v1beta1.Device) {
+ if len(device.Status.Twins) > 0 {
+ removeTwinWithNameChanged(device)
+ }
deviceID := util.GetResourceID(device.Namespace, device.Name)
value, ok := dc.deviceManager.Device.Load(deviceID)
dc.deviceManager.Device.Store(deviceID, device)
@@ -417,3 +420,20 @@ func NewDownstreamController(crdInformerFactory crdinformers.SharedInformerFacto
}
return dc, nil
}
+
+// Remove twin with changed attribute names.
+func removeTwinWithNameChanged(device *v1beta1.Device) {
+ properties := device.Spec.Properties
+ twins := device.Status.Twins
+ newTwins := make([]v1beta1.Twin, 0, len(properties))
+ for _, twin := range twins {
+ twinName := twin.PropertyName
+ for _, property := range properties {
+ if property.Name == twinName {
+ newTwins = append(newTwins, twin)
+ break
+ }
+ }
+ }
+ device.Status.Twins = newTwins
+}
diff --git a/cloud/pkg/devicecontroller/controller/upstream.go b/cloud/pkg/devicecontroller/controller/upstream.go
index 46fea8db2..6f2298095 100644
--- a/cloud/pkg/devicecontroller/controller/upstream.go
+++ b/cloud/pkg/devicecontroller/controller/upstream.go
@@ -135,7 +135,7 @@ func (uc *UpstreamController) updateDeviceStatus() {
}
deviceStatus := &DeviceStatus{Status: cacheDevice.Status}
for twinName, twin := range msgTwin.Twin {
- deviceTwin := findTwinByName(twinName, deviceStatus.Status.Twins)
+ deviceTwin := findOrCreateTwinByName(twinName, cacheDevice.Spec.Properties, deviceStatus)
if deviceTwin != nil {
if twin.Actual != nil && twin.Actual.Value != nil {
reported := v1beta1.TwinProperty{}
@@ -226,10 +226,27 @@ func NewUpstreamController(dc *DownstreamController) (*UpstreamController, error
return uc, nil
}
-func findTwinByName(twinName string, twins []v1beta1.Twin) *v1beta1.Twin {
- for i := range twins {
- if twinName == twins[i].PropertyName {
- return &twins[i]
+func findOrCreateTwinByName(twinName string, properties []v1beta1.DeviceProperty, deviceStatus *DeviceStatus) *v1beta1.Twin {
+ for i := range properties {
+ if twinName == properties[i].Name {
+ twin := findTwinByName(twinName, deviceStatus)
+ if twin != nil {
+ return twin
+ }
+ twin = &v1beta1.Twin{
+ PropertyName: twinName,
+ }
+ deviceStatus.Status.Twins = append(deviceStatus.Status.Twins, *twin)
+ return twin
+ }
+ }
+ return nil
+}
+
+func findTwinByName(twinName string, deviceStatus *DeviceStatus) *v1beta1.Twin {
+ for i := range deviceStatus.Status.Twins {
+ if twinName == deviceStatus.Status.Twins[i].PropertyName {
+ return &deviceStatus.Status.Twins[i]
}
}
return nil
diff --git a/cloud/pkg/edgecontroller/controller/upstream.go b/cloud/pkg/edgecontroller/controller/upstream.go
index 0f982ab6d..48cd2d7e6 100644
--- a/cloud/pkg/edgecontroller/controller/upstream.go
+++ b/cloud/pkg/edgecontroller/controller/upstream.go
@@ -35,6 +35,7 @@ import (
"time"
authenticationv1 "k8s.io/api/authentication/v1"
+ certificatesv1 "k8s.io/api/certificates/v1"
coordinationv1 "k8s.io/api/coordination/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
@@ -99,24 +100,25 @@ type UpstreamController struct {
config v1alpha1.EdgeController
// message channel
- nodeStatusChan chan model.Message
- podStatusChan chan model.Message
- secretChan chan model.Message
- serviceAccountTokenChan chan model.Message
- configMapChan chan model.Message
- persistentVolumeChan chan model.Message
- persistentVolumeClaimChan chan model.Message
- volumeAttachmentChan chan model.Message
- queryNodeChan chan model.Message
- createNodeChan chan model.Message
- patchNodeChan chan model.Message
- updateNodeChan chan model.Message
- patchPodChan chan model.Message
- podDeleteChan chan model.Message
- ruleStatusChan chan model.Message
- createLeaseChan chan model.Message
- queryLeaseChan chan model.Message
- createPodChan chan model.Message
+ nodeStatusChan chan model.Message
+ podStatusChan chan model.Message
+ secretChan chan model.Message
+ serviceAccountTokenChan chan model.Message
+ configMapChan chan model.Message
+ persistentVolumeChan chan model.Message
+ persistentVolumeClaimChan chan model.Message
+ volumeAttachmentChan chan model.Message
+ queryNodeChan chan model.Message
+ createNodeChan chan model.Message
+ patchNodeChan chan model.Message
+ updateNodeChan chan model.Message
+ patchPodChan chan model.Message
+ podDeleteChan chan model.Message
+ ruleStatusChan chan model.Message
+ createLeaseChan chan model.Message
+ queryLeaseChan chan model.Message
+ createPodChan chan model.Message
+ certificasesSigningRequestChan chan model.Message
// lister
podLister corelisters.PodLister
@@ -186,6 +188,9 @@ func (uc *UpstreamController) Start() error {
for i := 0; i < int(uc.config.Load.CreatePodWorks); i++ {
go uc.createPod()
}
+ for i := 0; i < int(uc.config.Load.CertificateSigningRequestWorkers); i++ {
+ go uc.processCSR()
+ }
return nil
}
@@ -264,6 +269,8 @@ func (uc *UpstreamController) dispatchMessage() {
case model.QueryOperation:
uc.queryLeaseChan <- msg
}
+ case model.ResourceTypeCSR:
+ uc.certificasesSigningRequestChan <- msg
default:
klog.Errorf("message: %s, resource type: %s unsupported", msg.GetID(), resourceType)
}
@@ -638,6 +645,8 @@ func kubeClientGet(uc *UpstreamController, namespace string, name string, queryT
obj, err = uc.getServiceAccountToken(namespace, name, msg)
case model.ResourceTypeLease:
obj, err = uc.leaseLister.Leases(namespace).Get(name)
+ case model.ResourceTypeCSR:
+ obj, err = uc.kubeClient.CertificatesV1().CertificateSigningRequests().Get(context.Background(), name, metaV1.GetOptions{})
default:
err = stderrors.New("wrong query type")
}
@@ -1285,6 +1294,56 @@ func (uc *UpstreamController) queryLease() {
}
}
+func (uc *UpstreamController) processCSR() {
+ for {
+ select {
+ case <-beehiveContext.Done():
+ klog.Warning("stop processCSR")
+ return
+ case msg := <-uc.certificasesSigningRequestChan:
+ klog.V(4).Infof("message: %s, operation is: %s, and resource is: %s", msg.GetID(), msg.GetOperation(), msg.GetResource())
+ name, err := messagelayer.GetResourceName(msg)
+ if err != nil {
+ klog.Warningf("message: %s process failure, get resource name failed with error: %v", msg.GetID(), err)
+ continue
+ }
+
+ switch msg.GetOperation() {
+ case model.InsertOperation:
+ csr := &certificatesv1.CertificateSigningRequest{}
+ data, err := msg.GetContentData()
+ if err != nil {
+ klog.Warningf("message: %s process failure, get content data failed with error: %s", msg.GetID(), err)
+ continue
+ }
+
+ if err := json.Unmarshal(data, csr); err != nil {
+ klog.Warningf("message: %s process failure, unmarshal message content data with error: %s", msg.GetID(), err)
+ continue
+ }
+
+ csrResp, err := uc.kubeClient.CertificatesV1().CertificateSigningRequests().Create(context.Background(), csr, metaV1.CreateOptions{})
+ if err != nil {
+ klog.Errorf("create CertificateSigningRequests %s failed, error: %s", name, err)
+ }
+
+ resMsg := model.NewMessage(msg.GetID()).
+ FillBody(&edgeapi.ObjectResp{Object: csrResp, Err: err}).
+ BuildRouter(modules.EdgeControllerModuleName, constants.GroupResource, msg.GetResource(), model.ResponseOperation)
+ if err = uc.messageLayer.Response(*resMsg); err != nil {
+ klog.Warningf("Response message: %s failed, response failed with error: %v", msg.GetID(), err)
+ continue
+ }
+
+ klog.V(4).Infof("message: %s, create CertificateSigningRequests successfully, name: %s", msg.GetID(), name)
+
+ case model.QueryOperation:
+ queryInner(uc, msg, model.ResourceTypeCSR)
+ }
+ }
+ }
+}
+
func (uc *UpstreamController) unmarshalPodStatusMessage(msg model.Message) (ns string, podStatuses []edgeapi.PodStatusRequest) {
ns, err := messagelayer.GetNamespace(msg)
if err != nil {
@@ -1438,5 +1497,6 @@ func NewUpstreamController(config *v1alpha1.EdgeController, factory k8sinformer.
uc.createLeaseChan = make(chan model.Message, config.Buffer.CreateLease)
uc.queryLeaseChan = make(chan model.Message, config.Buffer.QueryLease)
uc.ruleStatusChan = make(chan model.Message, config.Buffer.UpdateNodeStatus)
+ uc.certificasesSigningRequestChan = make(chan model.Message, config.Buffer.CertificateSigningRequest)
return uc, nil
}
diff --git a/common/constants/default.go b/common/constants/default.go
index 5e0f57d72..43213372e 100644
--- a/common/constants/default.go
+++ b/common/constants/default.go
@@ -60,6 +60,7 @@ const (
// MetaManager
DefaultRemoteQueryTimeout = 60
DefaultMetaServerAddr = "127.0.0.1:10550"
+ DefaultDummyServerAddr = "169.254.30.10:10550"
// Config
DefaultKubeContentType = "application/vnd.kubernetes.protobuf"
@@ -84,7 +85,8 @@ const (
DefaultUpdateRuleStatusWorkers = 4
DefaultQueryLeaseWorkers = 100
DefaultServiceAccountTokenWorkers = 100
- CreatePodWorks = 4
+ DefaultCreatePodWorkers = 4
+ DefaultCertificateSigningRequestWorkers = 4
DefaultUpdatePodStatusBuffer = 1024
DefaultUpdateNodeStatusBuffer = 1024
@@ -100,6 +102,7 @@ const (
DefaultQueryLeaseBuffer = 1024
DefaultServiceAccountTokenBuffer = 1024
DefaultCreatePodBuffer = 1024
+ DefaultCertificateSigningRequestBuffer = 1024
DefaultPodEventBuffer = 1
DefaultConfigMapEventBuffer = 1
diff --git a/docs/images/proposals/csrapprovecontroller.png b/docs/images/proposals/csrapprovecontroller.png
new file mode 100644
index 000000000..5470c8ad2
--- /dev/null
+++ b/docs/images/proposals/csrapprovecontroller.png
Binary files differ
diff --git a/docs/images/proposals/inclusterconfig.png b/docs/images/proposals/inclusterconfig.png
new file mode 100644
index 000000000..9adf6cdf6
--- /dev/null
+++ b/docs/images/proposals/inclusterconfig.png
Binary files differ
diff --git a/docs/proposals/inclusterconfig.md b/docs/proposals/inclusterconfig.md
new file mode 100644
index 000000000..662b80bd2
--- /dev/null
+++ b/docs/proposals/inclusterconfig.md
@@ -0,0 +1,114 @@
+---
+title: Support Edge Pods Using InClusterConfig to Access Kube-APIServer
+authors:
+- "@Shelley-BaoYue"
+ approvers:
+ creation-date: 2024-04-08
+ last-updated: 2024-04-08
+ status: implementable
+---
+
+# Support Edge Pods Using InClusterConfig to Access Kube-APIServer
+
+## Motivation
+
+In native Kubernetes cluster, pods and Kube-APIServer are usually on the same network plane, and the network quality is good, so pods can directly access the Kube-APIServer through InClusterConfig mode. However, in edge scenario, edge pods and Kube-APIServer are in different network environment, there is no way to directly access using `KUBERNETES_SERVICE_HOST` and `KUBERNETES_SERVICE_PORT`. This proposal proposes an enhancement that will support edge pods using `InClusterConfig` to access Kube-APIServer natively.
+
+```go
+func InClusterConfig() (*Config, error) {
+ const (
+ tokenFile = "/var/run/secrets/kubernetes.io/serviceaccount/token"
+ rootCAFile = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
+ )
+ host, port := os.Getenv("KUBERNETES_SERVICE_HOST"), os.Getenv("KUBERNETES_SERVICE_PORT")
+ if len(host) == 0 || len(port) == 0 {
+ return nil, ErrNotInCluster
+ }
+...
+}
+```
+
+### Goals
+
+- Edge pods use `InClusterConfig` to access Kube-APIServer natively whether using hostNetworking.
+
+## Background and challenges
+
+- In KubeEdge, the request traffic for accessing Kube-APIServer is proxied through the MetaServer at edge. Users need to manually modify the Kube-APIServer address to MetaServer for edge pods. This is extremely inconvenient and we hope native Kubernetes applications can be deployed without modifications.
+- The certificates on the edge side are issued by CloudHub certificate module, while the CA and related certificates used by edge pods are issued by Kubernetes. Therefore, edge pods will report an authentication error when using the native certificate to access the MetaServer.
+
+## Design Details
+
+This proposal will be divided into three parts of the implementation to introduce the enhancement.
+
+### Issue native certificates for MetaServer from Kubernetes
+
+![InClusterConfig Design](../images/proposals/inclusterconfig.png)
+
+1. CloudHub http server adds interface `/k8s/ca.crt` for edge nodes to obtain Kubernetes CA certificate. When EdgeHub starts, it will visit this interface.
+
+2. After EdgeHub successfully connects to CloudHub, MetaServer initiates a CSR request and send the message to EdgeHub.
+
+```yaml
+apiVersion: certificates.k8s.io/v1
+kind: CertificateSigningRequest
+metadata:
+ name: metaserver-csr-edge-node
+spec:
+ request: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURSBSRVFVRVNULS0tLS0KTUlJQkdqQ0J3UUlCQURBM01SVXdFd1lEVlFRS0V3eHplWE4wWlcwNmJtOWtaWE14SGpBY0JnTlZCQU1URlhONQpjM1JsYlRwdWIyUmxPbVZrWjJVdGJtOWtaVEJaTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEEwSUFCTHZSCkJLa3c0cVpMb216aXNGVDhsNmJaU0I1Qm9DV0o5ejMvcTc1WTJNVXl0QTl2K2dSRVlsNkt5d1ByaGREdU12WFIKOWFnMlpCUzF1NmVMY3NlQ0lXU2dLREFtQmdrcWhraUc5dzBCQ1E0eEdUQVhNQlVHQTFVZEVRUU9NQXlIQkg4QQpBQUdIQktuK0ZBb3dDZ1lJS29aSXpqMEVBd0lEU0FBd1JRSWdaSVhkNVQ5SUw3dDNjdDAxb3ArQ1U3Y2d5eFhZCitvZkxWK2lvSEZObk1rRUNJUURhUzZpdWpuVFdhZ3dkOVozVXMvRnU5WFVyYVo1N3BpY3puRGgwM0haUkxBPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0tCg==
+ signerName: kubernetes.io/kubelet-serving
+ usages:
+ - digital signature
+ - key encipherment
+ - server auth
+```
+
+The main content of the request is as follows:
+```json
+{
+ "Subject":{
+ "Organization":[
+ "system:nodes"
+ ],
+ "CommonName":"system:node:nodeName",
+ },
+ "IPAddresses":[
+ "127.0.0.1",
+ "169.254.30.10"
+ ],
+}
+```
+
+3. EdgeHub forwards CSR request message to CloudHub through the websocket connection.
+
+4. CloudHub forwards CSR request message to EdgeController.
+
+5. EdgeController parsed CSR request message, reassemble into Kubernetes request and forward it to Kube-APIServer.
+
+6. Add `CSRApprovingController` component to auto-approve MetaServer CSR. More details are described in [CSRApprovingController](#CSRApprovingController).
+
+7. At the same time, after MetaServer creates CSR, it will wait for the CSR to be issued successfully. And then starts the server with the certificate Kubernetes issued.
+
+#### CSRApprovingController
+
+`CSRApprovingController` is responsible for dealing with CSR. When a new CSR was created, `CSRApprovingController` watch the event and first verify the CSR is valid and whether it was initiated by MetaServer. If the verification passes, it will auto-approve the CSR.
+
+![CSRApprovingController process](../images/proposals/csrapprovecontroller.png)
+
+### Non-hostNetwork edge pods access MetaServer
+
+MetaServer only listens on `127.0.0.1:10550` for proxying request, so pods with hostWork=false can not access MetaServer because traffic from `container network namespace` to `127.0.0.1` can not route to edge nodes.
+
+In this feature, MetaServer startup will add a dummy network interface to edge node and listen on this dummy network interface at the same time, so pods with hostWork=false can access MetaServer through this dummy interface.
+
+The default IP address of the dummy network interface is: `169.254.30.10`.
+
+### MetaServer env inject into edge pods.
+
+When Edge pods use `InClusterConfig` to access Kube-APIServer , It will assemble the URL address through the environment variables `KUBERNETES_SERVICE_HOST` and `KUBERNETES_SERVICE_PORT`. When EdgeCore starts edge pods, it will intercept and inject the address of the MetaServer listening on the dummy interface, so the traffic of the edge pod accessing Kube-APIServer can be proxyed to the MetaServer without perception.
+
+```go
+// add env for master service
+result = append(result, kubecontainer.EnvVar{Name: "KUBERNETES_SERVICE_HOST", Value: os.Getenv("METASERVER_DUMMY_IP")})
+result = append(result, kubecontainer.EnvVar{Name: "KUBERNETES_SERVICE_PORT", Value: os.Getenv("METASERVER_DUMMY_PORT")})
+``` \ No newline at end of file
diff --git a/edge/pkg/edgehub/edgehub.go b/edge/pkg/edgehub/edgehub.go
index bf63f1f9e..5bb3a341c 100644
--- a/edge/pkg/edgehub/edgehub.go
+++ b/edge/pkg/edgehub/edgehub.go
@@ -37,9 +37,8 @@ func GetCertSyncChannel() map[string]chan bool {
}
func NewCertSyncChannel() map[string]chan bool {
- certSync = make(map[string]chan bool, 2)
+ certSync = make(map[string]chan bool, 1)
certSync[modules.EdgeStreamModuleName] = make(chan bool, 1)
- certSync[modules.MetaManagerModuleName] = make(chan bool, 1)
return certSync
}
diff --git a/edge/pkg/edgehub/edgehub_test.go b/edge/pkg/edgehub/edgehub_test.go
index 9f572ef04..9361455ff 100644
--- a/edge/pkg/edgehub/edgehub_test.go
+++ b/edge/pkg/edgehub/edgehub_test.go
@@ -35,15 +35,12 @@ func TestGetCertSyncChannel(t *testing.T) {
func TestNewCertSyncChannel(t *testing.T) {
t.Run("NewCertSyncChannel()", func(t *testing.T) {
certSync := NewCertSyncChannel()
- if len(certSync) != 2 {
+ if len(certSync) != 1 {
t.Errorf("NewCertSyncChannel() returned unexpected results. size got = %d, size want = 2", len(certSync))
}
if _, ok := certSync["edgestream"]; !ok {
t.Error("NewCertSyncChannel() returned unexpected results. expected key edgestream to be present but it was not available.")
}
- if _, ok := certSync["metamanager"]; !ok {
- t.Error("NewCertSyncChannel() returned unexpected results. expected key metamanager to be present but it was not available.")
- }
})
}
diff --git a/edge/pkg/metamanager/client/ceritificatesigningrequest.go b/edge/pkg/metamanager/client/ceritificatesigningrequest.go
new file mode 100644
index 000000000..1a0d02643
--- /dev/null
+++ b/edge/pkg/metamanager/client/ceritificatesigningrequest.go
@@ -0,0 +1,133 @@
+/*
+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 client
+
+import (
+ "encoding/json"
+ "fmt"
+ "reflect"
+
+ v1 "k8s.io/api/certificates/v1"
+ apierrors "k8s.io/apimachinery/pkg/api/errors"
+
+ "github.com/kubeedge/beehive/pkg/core/model"
+ "github.com/kubeedge/kubeedge/edge/pkg/common/message"
+ "github.com/kubeedge/kubeedge/edge/pkg/common/modules"
+)
+
+// CertificateSigningRequestsGetter to get CertificateSigningRequestInterface
+type CertificateSigningRequestsGetter interface {
+ CertificateSigningRequests() CertificateSigningRequestInterface
+}
+
+// CertificateSigningRequestInterface is interface for client CertificateSigningRequests
+type CertificateSigningRequestInterface interface {
+ Create(*v1.CertificateSigningRequest) (*v1.CertificateSigningRequest, error)
+ Get(name string) (*v1.CertificateSigningRequest, error)
+}
+
+type certificateSigningRequests struct {
+ send SendInterface
+}
+
+// CertificateSigningRequestResp represents CertificateSigningRequest response from API-Server
+type CertificateSigningRequestResp struct {
+ Object *v1.CertificateSigningRequest
+ Err apierrors.StatusError
+}
+
+func newCertificateSigningRequests(s SendInterface) *certificateSigningRequests {
+ return &certificateSigningRequests{
+ send: s,
+ }
+}
+
+func (c *certificateSigningRequests) Create(csr *v1.CertificateSigningRequest) (*v1.CertificateSigningRequest, error) {
+ resource := fmt.Sprintf("%s/%s/%s", "default", model.ResourceTypeCSR, csr.Name)
+ csrMsg := message.BuildMsg(modules.MetaGroup, "", modules.EdgedModuleName, resource, model.InsertOperation, csr)
+ resp, err := c.send.SendSync(csrMsg)
+ if err != nil {
+ return nil, fmt.Errorf("create csr failed, err: %v", err)
+ }
+
+ content, err := resp.GetContentData()
+ if err != nil {
+ return nil, fmt.Errorf("parse message to csr failed, err: %v", err)
+ }
+
+ return handleCertificatesSigningRequestResp(content)
+}
+
+func (c *certificateSigningRequests) Get(name string) (*v1.CertificateSigningRequest, error) {
+ resource := fmt.Sprintf("%s/%s/%s", "default", model.ResourceTypeCSR, name)
+ csrMsg := message.BuildMsg(modules.MetaGroup, "", modules.EdgedModuleName, resource, model.QueryOperation, nil)
+ resp, err := c.send.SendSync(csrMsg)
+ if err != nil {
+ return nil, fmt.Errorf("get csr failed, err: %v", err)
+ }
+
+ content, err := resp.GetContentData()
+ if err != nil {
+ return nil, fmt.Errorf("parse message to csr failed, err: %v", err)
+ }
+
+ if resp.GetOperation() == model.ResponseOperation && resp.GetSource() == modules.MetaManagerModuleName {
+ return handleCertificateSigningRequestFromMetaDB(content)
+ }
+ return handleCertificateSigningRequestFromMetaManager(content)
+}
+
+func handleCertificateSigningRequestFromMetaDB(content []byte) (*v1.CertificateSigningRequest, error) {
+ var list []string
+ err := json.Unmarshal(content, &list)
+ if err != nil {
+ return nil, fmt.Errorf("unmarshal message to csr list from db failed, err: %v", err)
+ }
+ if len(list) != 1 {
+ return nil, fmt.Errorf("csr length from meta db is %d", len(list))
+ }
+
+ var csr v1.CertificateSigningRequest
+ err = json.Unmarshal([]byte(list[0]), &csr)
+ if err != nil {
+ return nil, fmt.Errorf("unmarshal message to csr from db failed, err: %v", err)
+ }
+
+ return &csr, nil
+}
+
+func handleCertificateSigningRequestFromMetaManager(content []byte) (*v1.CertificateSigningRequest, error) {
+ var csr v1.CertificateSigningRequest
+ err := json.Unmarshal(content, &csr)
+ if err != nil {
+ return nil, fmt.Errorf("unmarshal message to csr failed, err: %v", err)
+ }
+ return &csr, nil
+}
+
+func handleCertificatesSigningRequestResp(content []byte) (*v1.CertificateSigningRequest, error) {
+ var csrResp CertificateSigningRequestResp
+ err := json.Unmarshal(content, &csrResp)
+ if err != nil {
+ return nil, fmt.Errorf("unmarshal message to CertificateSigningRequestResp failed, err: %v", err)
+ }
+
+ if reflect.DeepEqual(csrResp.Err, apierrors.StatusError{}) {
+ return csrResp.Object, nil
+ }
+ return csrResp.Object, &csrResp.Err
+}
diff --git a/edge/pkg/metamanager/client/metaclient.go b/edge/pkg/metamanager/client/metaclient.go
index f6d0a7022..ec3bc60fd 100644
--- a/edge/pkg/metamanager/client/metaclient.go
+++ b/edge/pkg/metamanager/client/metaclient.go
@@ -30,6 +30,7 @@ type CoreInterface interface {
PersistentVolumeClaimsGetter
VolumeAttachmentsGetter
LeasesGetter
+ CertificateSigningRequestsGetter
}
type metaClient struct {
@@ -87,6 +88,10 @@ func (m *metaClient) Leases(namespace string) LeasesInterface {
return newLeases(namespace, m.send)
}
+func (m *metaClient) CertificateSigningRequests() CertificateSigningRequestInterface {
+ return newCertificateSigningRequests(m.send)
+}
+
// New creates new metaclient
func New() CoreInterface {
return &metaClient{
diff --git a/edge/pkg/metamanager/metaserver/certificate/certificates/v1/certificates_client.go b/edge/pkg/metamanager/metaserver/certificate/certificates/v1/certificates_client.go
new file mode 100644
index 000000000..ab743e74a
--- /dev/null
+++ b/edge/pkg/metamanager/metaserver/certificate/certificates/v1/certificates_client.go
@@ -0,0 +1,42 @@
+/*
+Copyright 2024 The Kubernetes 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.
+
+@CHANGELOG
+KubeEdge Authors: To make a bridge between kubeclient and metaclient,
+This file is derived from K8S client-go code with reduced set of methods
+Changes done are
+1. Package v1 got some functions from "k8s.io/client-go/kubernetes/typed/certificates/v1/fake/fake_certificates_client.go"
+and made some variant
+*/
+
+package v1
+
+import (
+ v1 "k8s.io/client-go/kubernetes/typed/certificates/v1"
+ fakev1 "k8s.io/client-go/kubernetes/typed/certificates/v1/fake"
+
+ "github.com/kubeedge/kubeedge/edge/pkg/metamanager/client"
+)
+
+type CertificateV1Bridge struct {
+ fakev1.FakeCertificatesV1
+ MetaClient client.CoreInterface
+}
+
+func (c *CertificateV1Bridge) CertificateSigningRequests() v1.CertificateSigningRequestInterface {
+ return &CertificateSigningRequestsBridge{fakev1.FakeCertificateSigningRequests{
+ Fake: &c.FakeCertificatesV1,
+ }, c.MetaClient}
+}
diff --git a/edge/pkg/metamanager/metaserver/certificate/certificates/v1/certificatesigningrequest.go b/edge/pkg/metamanager/metaserver/certificate/certificates/v1/certificatesigningrequest.go
new file mode 100644
index 000000000..c9261403d
--- /dev/null
+++ b/edge/pkg/metamanager/metaserver/certificate/certificates/v1/certificatesigningrequest.go
@@ -0,0 +1,48 @@
+/*
+Copyright 2024 The Kubernetes 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.
+
+@CHANGELOG
+KubeEdge Authors: To make a bridge between kubeclient and metaclient,
+This file is derived from K8S client-go code with reduced set of methods
+Changes done are
+1. Package v1 got some functions from "k8s.io/client-go/kubernetes/typed/certificates/v1/fake/fake_node.go"
+and made some variant
+*/
+
+package v1
+
+import (
+ "context"
+
+ v1 "k8s.io/api/certificates/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ fakecertificates "k8s.io/client-go/kubernetes/typed/certificates/v1/fake"
+
+ "github.com/kubeedge/kubeedge/edge/pkg/metamanager/client"
+)
+
+// CertificateSigningRequestsBridge implements CertificateSigningRequestInterface
+type CertificateSigningRequestsBridge struct {
+ fakecertificates.FakeCertificateSigningRequests
+ MetaClient client.CoreInterface
+}
+
+func (c *CertificateSigningRequestsBridge) Create(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.CreateOptions) (result *v1.CertificateSigningRequest, err error) {
+ return c.MetaClient.CertificateSigningRequests().Create(certificateSigningRequest)
+}
+
+func (c *CertificateSigningRequestsBridge) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CertificateSigningRequest, err error) {
+ return c.MetaClient.CertificateSigningRequests().Get(name)
+}
diff --git a/edge/pkg/metamanager/metaserver/certificate/clientset_bridge.go b/edge/pkg/metamanager/metaserver/certificate/clientset_bridge.go
new file mode 100644
index 000000000..94a2cae51
--- /dev/null
+++ b/edge/pkg/metamanager/metaserver/certificate/clientset_bridge.go
@@ -0,0 +1,50 @@
+/*
+Copyright 2024 The Kubernetes 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.
+
+@CHANGELOG
+KubeEdge Authors: To make a bridge between kubeclient and metaclient,
+This file is derived from K8S client-go code with reduced set of methods
+Changes done are
+1. Package kubeclientbridge got some functions from "k8s.io/client-go/kubernetes/fake/clientset_generated.go"
+and made some variant
+*/
+
+package certificate
+
+import (
+ clientset "k8s.io/client-go/kubernetes"
+ fakekube "k8s.io/client-go/kubernetes/fake"
+ v1 "k8s.io/client-go/kubernetes/typed/certificates/v1"
+ fakecertificatesv1 "k8s.io/client-go/kubernetes/typed/certificates/v1/fake"
+
+ "github.com/kubeedge/kubeedge/edge/pkg/metamanager/client"
+ kecertificates "github.com/kubeedge/kubeedge/edge/pkg/metamanager/metaserver/certificate/certificates/v1"
+)
+
+// NewSimpleClientset is new interface
+func NewSimpleClientset() clientset.Interface {
+ return &Clientset{*fakekube.NewSimpleClientset(), client.New()}
+}
+
+// Clientset extends Clientset
+type Clientset struct {
+ fakekube.Clientset
+ MetaClient client.CoreInterface
+}
+
+// CertificateV1 retrieves the CertificateV1Client
+func (c *Clientset) CertificatesV1() v1.CertificatesV1Interface {
+ return &kecertificates.CertificateV1Bridge{FakeCertificatesV1: fakecertificatesv1.FakeCertificatesV1{Fake: &c.Fake}, MetaClient: c.MetaClient}
+}
diff --git a/edge/pkg/metamanager/metaserver/certificate/manager.go b/edge/pkg/metamanager/metaserver/certificate/manager.go
new file mode 100644
index 000000000..a4c79737c
--- /dev/null
+++ b/edge/pkg/metamanager/metaserver/certificate/manager.go
@@ -0,0 +1,149 @@
+/*
+Copyright 2024 The Kubernetes 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 certificate
+
+import (
+ "context"
+ "crypto/tls"
+ "crypto/x509"
+ "crypto/x509/pkix"
+ "fmt"
+ "net"
+ "time"
+
+ certificates "k8s.io/api/certificates/v1"
+ "k8s.io/apimachinery/pkg/types"
+ "k8s.io/apimachinery/pkg/util/wait"
+ clientset "k8s.io/client-go/kubernetes"
+ "k8s.io/client-go/util/cert"
+ "k8s.io/client-go/util/certificate"
+ "k8s.io/klog/v2"
+
+ beehivecontext "github.com/kubeedge/beehive/pkg/core/context"
+ "github.com/kubeedge/beehive/pkg/core/model"
+ "github.com/kubeedge/kubeedge/edge/pkg/common/cloudconnection"
+ "github.com/kubeedge/kubeedge/edge/pkg/common/message"
+ "github.com/kubeedge/kubeedge/edge/pkg/common/modules"
+)
+
+const (
+ pairNamePrefix = "metaserver"
+
+ // CertificatesDir defines default certificate directory
+ CertificatesDir = "/etc/kubeedge/pki/metaserver"
+)
+
+type ServerCertificateManager struct {
+ certificate.Manager
+}
+
+func NewServerCertificateManager(
+ kubeClient clientset.Interface,
+ nodeName types.NodeName,
+ ips []net.IP,
+ certDirectory string) (*ServerCertificateManager, error) {
+ var clientsetFn certificate.ClientsetFunc
+ if kubeClient != nil {
+ clientsetFn = func(current *tls.Certificate) (clientset.Interface, error) {
+ return kubeClient, nil
+ }
+ }
+
+ certificateStore, err := certificate.NewFileStore(pairNamePrefix, certDirectory, certDirectory, "", "")
+ if err != nil {
+ return nil, fmt.Errorf("failed to initialize server certificate store: %v", err)
+ }
+
+ getTemplate := func() *x509.CertificateRequest {
+ if len(ips) == 0 {
+ return nil
+ }
+ return &x509.CertificateRequest{
+ Subject: pkix.Name{
+ CommonName: fmt.Sprintf("system:node:%s", nodeName),
+ Organization: []string{"system:nodes"},
+ },
+ IPAddresses: ips,
+ }
+ }
+
+ m, err := certificate.NewManager(&certificate.Config{
+ Name: fmt.Sprintf("metaserver-csr-%s", nodeName),
+ ClientsetFn: clientsetFn,
+ GetTemplate: getTemplate,
+ SignerName: certificates.KubeletServingSignerName,
+ Usages: []certificates.KeyUsage{
+ certificates.UsageDigitalSignature,
+ certificates.UsageKeyEncipherment,
+ certificates.UsageServerAuth,
+ },
+ CertificateStore: certificateStore,
+ })
+ if err != nil {
+ return nil, fmt.Errorf("failed to initialize server certificate manager: %v", err)
+ }
+
+ return &ServerCertificateManager{m}, nil
+}
+
+func (scm *ServerCertificateManager) ready() bool {
+ if currentCert := scm.Current(); currentCert != nil {
+ return true
+ }
+ return false
+}
+
+func (scm *ServerCertificateManager) WaitForCertReady() error {
+ return wait.PollUntilContextTimeout(context.Background(), 5*time.Second, 4*time.Minute, true, func(ctx context.Context) (bool, error) {
+ if scm.ready() {
+ return true, nil
+ }
+ return false, nil
+ })
+}
+
+func (scm *ServerCertificateManager) WaitForCAReady() error {
+ return wait.PollUntilContextTimeout(context.Background(), 5*time.Second, 4*time.Minute, true, func(ctx context.Context) (bool, error) {
+ if !cloudconnection.IsConnected() {
+ return false, nil
+ }
+ err := scm.getKubeAPIServerCA()
+ if err != nil {
+ klog.Errorf("get k8s CA failed, %v", err)
+ return false, err
+ }
+ return true, nil
+ })
+}
+
+func (scm *ServerCertificateManager) getKubeAPIServerCA() error {
+ msg := message.BuildMsg(modules.MetaGroup, "", modules.MetaManagerModuleName, model.ResourceTypeK8sCA, model.QueryOperation, nil)
+ resp, err := beehivecontext.SendSync(modules.EdgeHubModuleName, *msg, 1*time.Minute)
+ if err != nil {
+ return fmt.Errorf("send sync message %s failed: %v", msg.GetResource(), err)
+ }
+
+ content, err := resp.GetContentData()
+ if err != nil || content == nil {
+ return fmt.Errorf("parse message %s failed, err: %v", msg.GetResource(), err)
+ }
+
+ if err = cert.WriteCert(fmt.Sprintf("%s/ca.crt", CertificatesDir), content); err != nil {
+ return fmt.Errorf("failed to save k8s CA certificate, %v", err)
+ }
+ return nil
+}
diff --git a/edge/pkg/metamanager/metaserver/server.go b/edge/pkg/metamanager/metaserver/server.go
index 7bc1b9d49..739171e28 100644
--- a/edge/pkg/metamanager/metaserver/server.go
+++ b/edge/pkg/metamanager/metaserver/server.go
@@ -5,14 +5,17 @@ import (
"crypto/tls"
"crypto/x509"
"encoding/pem"
+ "errors"
"fmt"
+ "net"
"net/http"
"os"
"time"
- "k8s.io/apimachinery/pkg/api/errors"
+ apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
+ "k8s.io/apimachinery/pkg/types"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/sets"
utilwaitgroup "k8s.io/apimachinery/pkg/util/waitgroup"
@@ -31,15 +34,15 @@ import (
"k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac"
beehiveContext "github.com/kubeedge/beehive/pkg/core/context"
- "github.com/kubeedge/kubeedge/edge/pkg/common/modules"
"github.com/kubeedge/kubeedge/edge/pkg/edged/kubeclientbridge"
- "github.com/kubeedge/kubeedge/edge/pkg/edgehub"
"github.com/kubeedge/kubeedge/edge/pkg/metamanager/client"
"github.com/kubeedge/kubeedge/edge/pkg/metamanager/metaserver/auth"
+ "github.com/kubeedge/kubeedge/edge/pkg/metamanager/metaserver/certificate"
metaserverconfig "github.com/kubeedge/kubeedge/edge/pkg/metamanager/metaserver/config"
"github.com/kubeedge/kubeedge/edge/pkg/metamanager/metaserver/handlerfactory"
"github.com/kubeedge/kubeedge/edge/pkg/metamanager/metaserver/kubernetes/serializer"
kefeatures "github.com/kubeedge/kubeedge/pkg/features"
+ "github.com/kubeedge/kubeedge/pkg/util"
"github.com/kubeedge/kubeedge/pkg/util/pass-through"
)
@@ -52,6 +55,8 @@ type MetaServer struct {
NegotiatedSerializer runtime.NegotiatedSerializer
Factory *handlerfactory.Factory
Auth *metaServerAuth
+ // Handles Authentication Certificate
+ serverCeriticateManager *certificate.ServerCertificateManager
}
type metaServerAuth struct {
@@ -93,57 +98,6 @@ func NewMetaServer() *MetaServer {
return &ls
}
-func createTLSConfig() tls.Config {
- ca, err := os.ReadFile(metaserverconfig.Config.TLSCaFile)
- if err == nil {
- block, _ := pem.Decode(ca)
- ca = block.Bytes
- klog.Info("Succeed in loading CA certificate from local directory")
- }
- pool := x509.NewCertPool()
- ok := pool.AppendCertsFromPEM(pem.EncodeToMemory(&pem.Block{Type: certutil.CertificateBlockType, Bytes: ca}))
- if !ok {
- panic(fmt.Errorf("fail to load ca content"))
- }
- cert, err := os.ReadFile(metaserverconfig.Config.TLSCertFile)
- if err == nil {
- block, _ := pem.Decode(cert)
- cert = block.Bytes
- klog.Info("Succeed in loading certificate from local directory")
- }
- key, err := os.ReadFile(metaserverconfig.Config.TLSPrivateKeyFile)
- if err == nil {
- block, _ := pem.Decode(key)
- key = block.Bytes
- klog.Info("Succeed in loading private key from local directory")
- }
-
- certificate, err := tls.X509KeyPair(pem.EncodeToMemory(&pem.Block{Type: certutil.CertificateBlockType, Bytes: cert}), pem.EncodeToMemory(&pem.Block{Type: "PRIVATE KEY", Bytes: key}))
- if err != nil {
- panic(err)
- }
- return tls.Config{
- ClientCAs: pool,
- ClientAuth: tls.VerifyClientCertIfGiven,
- Certificates: []tls.Certificate{certificate},
- MinVersion: tls.VersionTLS12,
- }
-}
-
-// getCurrent returns current meta server certificate
-func (ls *MetaServer) getCurrent() (*tls.Certificate, error) {
- cert, err := tls.LoadX509KeyPair(metaserverconfig.Config.TLSCertFile, metaserverconfig.Config.TLSPrivateKeyFile)
- if err != nil {
- return nil, err
- }
- certs, err := x509.ParseCertificates(cert.Certificate[0])
- if err != nil {
- return nil, fmt.Errorf("unable to parse certificate data: %v", err)
- }
- cert.Leaf = certs[0]
- return &cert, nil
-}
-
func (ls *MetaServer) startHTTPServer(stopChan <-chan struct{}) {
h := ls.BuildBasicHandler()
h = BuildHandlerChain(h, ls)
@@ -168,21 +122,18 @@ func (ls *MetaServer) startHTTPServer(stopChan <-chan struct{}) {
beehiveContext.Cancel()
}
-func (ls *MetaServer) startHTTPSServer(stopChan <-chan struct{}) {
- _, err := ls.getCurrent()
+func (ls *MetaServer) startHTTPSServer(addr string, stopChan <-chan struct{}) {
+ tlsConfig, err := ls.makeTLSConfig()
if err != nil {
- // wait for cert created
- klog.Infof("[metaserver]waiting for cert created")
- <-edgehub.GetCertSyncChannel()[modules.MetaManagerModuleName]
+ panic(err)
}
h := ls.BuildBasicHandler()
h = BuildHandlerChain(h, ls)
- tlsConfig := createTLSConfig()
s := http.Server{
- Addr: metaserverconfig.Config.Server,
+ Addr: addr,
Handler: h,
- TLSConfig: &tlsConfig,
+ TLSConfig: tlsConfig,
}
go func() {
@@ -203,7 +154,12 @@ func (ls *MetaServer) startHTTPSServer(stopChan <-chan struct{}) {
func (ls *MetaServer) Start(stopChan <-chan struct{}) {
if kefeatures.DefaultFeatureGate.Enabled(kefeatures.RequireAuthorization) {
- ls.startHTTPSServer(stopChan)
+ err := ls.prepareServer()
+ if err != nil {
+ panic(err)
+ }
+ go ls.startHTTPSServer(metaserverconfig.Config.Server, stopChan)
+ go ls.startHTTPSServer(metaserverconfig.Config.DummyServer, stopChan)
} else {
ls.startHTTPServer(stopChan)
}
@@ -217,7 +173,7 @@ func (ls *MetaServer) BuildBasicHandler() http.Handler {
//klog.Infof("[metaserver]get a req(\nPath:%v; \nVerb:%v; \nHeader:%+v)", reqInfo.Path, reqInfo.Verb, req.Header)
if !ok {
err := fmt.Errorf("invalid request")
- responsewriters.ErrorNegotiated(errors.NewInternalError(err), ls.NegotiatedSerializer, schema.GroupVersion{}, w, req)
+ responsewriters.ErrorNegotiated(apierrors.NewInternalError(err), ls.NegotiatedSerializer, schema.GroupVersion{}, w, req)
return
}
@@ -237,7 +193,7 @@ func (ls *MetaServer) BuildBasicHandler() http.Handler {
ls.Factory.Patch(reqInfo).ServeHTTP(w, req)
default:
err := fmt.Errorf("unsupported req verb")
- responsewriters.ErrorNegotiated(errors.NewInternalError(err), ls.NegotiatedSerializer, schema.GroupVersion{}, w, req)
+ responsewriters.ErrorNegotiated(apierrors.NewInternalError(err), ls.NegotiatedSerializer, schema.GroupVersion{}, w, req)
}
return
}
@@ -248,7 +204,7 @@ func (ls *MetaServer) BuildBasicHandler() http.Handler {
}
err := fmt.Errorf("request[%s::%s] isn't supported", reqInfo.Path, reqInfo.Verb)
- responsewriters.ErrorNegotiated(errors.NewInternalError(err), ls.NegotiatedSerializer, schema.GroupVersion{}, w, req)
+ responsewriters.ErrorNegotiated(apierrors.NewInternalError(err), ls.NegotiatedSerializer, schema.GroupVersion{}, w, req)
})
}
@@ -266,3 +222,99 @@ func BuildHandlerChain(handler http.Handler, ls *MetaServer) http.Handler {
handler = genericfilters.WithPanicRecovery(handler, &apirequest.RequestInfoFactory{})
return handler
}
+
+func (ls *MetaServer) prepareServer() error {
+ err := setupDummyInterface()
+ if err != nil {
+ return fmt.Errorf("setup dummy interface err: %v", err)
+ }
+ certIPs, err := ls.getCertIPs()
+ if err != nil {
+ return fmt.Errorf("failed to get cert IP: %v", err)
+ }
+
+ certificateManager, err := certificate.NewServerCertificateManager(
+ certificate.NewSimpleClientset(),
+ types.NodeName(metaserverconfig.Config.NodeName),
+ certIPs,
+ certificate.CertificatesDir)
+ if err != nil {
+ return fmt.Errorf("failed to initialize certificate manager: %v", err)
+ }
+
+ err = certificateManager.WaitForCAReady()
+ if err != nil {
+ return fmt.Errorf("wait for CA ready failed: %v", err)
+ }
+
+ certificateManager.Start()
+ err = certificateManager.WaitForCertReady()
+ if err != nil {
+ return fmt.Errorf("wait for cert ready failed: %v", err)
+ }
+
+ ls.serverCeriticateManager = certificateManager
+ return nil
+}
+
+func (ls *MetaServer) getCertIPs() ([]net.IP, error) {
+ ip, _, err := net.SplitHostPort(metaserverconfig.Config.Server)
+ if err != nil {
+ return nil, err
+ }
+ dummyIP, _, err := net.SplitHostPort(metaserverconfig.Config.DummyServer)
+ if err != nil {
+ return nil, err
+ }
+ return []net.IP{net.ParseIP(ip), net.ParseIP(dummyIP)}, nil
+}
+
+func (ls *MetaServer) makeTLSConfig() (*tls.Config, error) {
+ ca, err := os.ReadFile(fmt.Sprintf("%s/ca.crt", certificate.CertificatesDir))
+ if err != nil {
+ return nil, fmt.Errorf("read CA failed: %v", err)
+ }
+
+ block, _ := pem.Decode(ca)
+ pool := x509.NewCertPool()
+ ok := pool.AppendCertsFromPEM(pem.EncodeToMemory(&pem.Block{Type: certutil.CertificateBlockType, Bytes: block.Bytes}))
+ if !ok {
+ return nil, errors.New("failed to load ca content")
+ }
+
+ return &tls.Config{
+ ClientCAs: pool,
+ MinVersion: tls.VersionTLS12,
+ ClientAuth: tls.VerifyClientCertIfGiven,
+ GetCertificate: func(info *tls.ClientHelloInfo) (*tls.Certificate, error) {
+ cert := ls.serverCeriticateManager.Current()
+ if cert == nil {
+ return nil, fmt.Errorf("no serving certificate available for the kubelet")
+ }
+ return cert, nil
+ },
+ }, nil
+}
+
+func setupDummyInterface() error {
+ dummyIP, dummyPort, err := net.SplitHostPort(metaserverconfig.Config.DummyServer)
+ if err != nil {
+ return err
+ }
+
+ if err := os.Setenv("METASERVER_DUMMY_IP", dummyIP); err != nil {
+ return err
+ }
+ if err := os.Setenv("METASERVER_DUMMY_PORT", dummyPort); err != nil {
+ return err
+ }
+
+ manager := util.NewDummyDeviceManager()
+ _, err = manager.EnsureDummyDevice("edge-dummy0")
+ if err != nil {
+ return err
+ }
+
+ _, err = manager.EnsureAddressBind(dummyIP, "edge-dummy0")
+ return err
+}
diff --git a/edge/pkg/metamanager/process.go b/edge/pkg/metamanager/process.go
index a11ceb5a5..6ab25e9e2 100644
--- a/edge/pkg/metamanager/process.go
+++ b/edge/pkg/metamanager/process.go
@@ -104,7 +104,9 @@ func requireRemoteQuery(resType string) bool {
resType == constants.ResourceTypeVolumeAttachment ||
resType == model.ResourceTypeNode ||
resType == model.ResourceTypeServiceAccountToken ||
- resType == model.ResourceTypeLease
+ resType == model.ResourceTypeLease ||
+ resType == model.ResourceTypeCSR ||
+ resType == model.ResourceTypeK8sCA
}
func msgDebugInfo(message *model.Message) string {
diff --git a/go.mod b/go.mod
index bffd4501c..41a4e18a2 100644
--- a/go.mod
+++ b/go.mod
@@ -61,7 +61,9 @@ require (
github.com/onsi/ginkgo/v2 v2.9.5
github.com/opencontainers/selinux v1.10.0
github.com/pkg/errors v0.9.1
+ github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852
go.opentelemetry.io/otel/trace v1.14.0
+ golang.org/x/sys v0.15.0
golang.org/x/text v0.14.0
gopkg.in/square/go-jose.v2 v2.6.0
gopkg.in/yaml.v3 v3.0.1
@@ -216,7 +218,6 @@ require (
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
- github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
github.com/vmware/govmomi v0.30.6 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
@@ -247,7 +248,6 @@ require (
golang.org/x/mod v0.14.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sync v0.5.0 // indirect
- golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/tools v0.16.1 // indirect
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
diff --git a/keadm/cmd/keadm/app/cmd/cloud/init.go b/keadm/cmd/keadm/app/cmd/cloud/init.go
index 00561fb85..e040070ce 100644
--- a/keadm/cmd/keadm/app/cmd/cloud/init.go
+++ b/keadm/cmd/keadm/app/cmd/cloud/init.go
@@ -21,11 +21,10 @@ import (
"github.com/blang/semver"
"github.com/spf13/cobra"
- "github.com/spf13/pflag"
"github.com/kubeedge/kubeedge/common/constants"
types "github.com/kubeedge/kubeedge/keadm/cmd/keadm/app/cmd/common"
- helm "github.com/kubeedge/kubeedge/keadm/cmd/keadm/app/cmd/helm"
+ "github.com/kubeedge/kubeedge/keadm/cmd/keadm/app/cmd/helm"
"github.com/kubeedge/kubeedge/keadm/cmd/keadm/app/cmd/util"
)
@@ -48,25 +47,19 @@ keadm init --advertise-address=127.0.0.1 --profile version=v%s --kube-config=/ro
// NewCloudInit represents the keadm init command for cloud component
func NewCloudInit() *cobra.Command {
opts := newInitOptions()
-
- tools := make(map[string]types.ToolsInstaller)
- flagVals := make(map[string]types.FlagData)
-
var cmd = &cobra.Command{
Use: "init",
Short: "Bootstraps cloud component. Checks and install (if required) the pre-requisites.",
Long: cloudInitLongDescription,
Example: fmt.Sprintf(cloudInitExample, types.DefaultKubeEdgeVersion),
RunE: func(cmd *cobra.Command, args []string) error {
- checkFlags := func(f *pflag.Flag) {
- util.AddToolVals(f, flagVals)
- }
- cmd.Flags().VisitAll(checkFlags)
- err := AddInit2ToolsList(tools, opts)
+ ver, err := util.GetCurrentVersion(opts.KubeEdgeVersion)
if err != nil {
- return err
+ return fmt.Errorf("keadm init failed: %v", err)
}
- return ExecuteInit(tools)
+ opts.KubeEdgeVersion = ver
+ tool := helm.NewCloudCoreHelmTool(opts.KubeConfig, opts.KubeEdgeVersion)
+ return tool.Install(opts)
},
}
diff --git a/keadm/cmd/keadm/app/cmd/helm/cloudcore.go b/keadm/cmd/keadm/app/cmd/helm/cloudcore.go
index 3717b3923..2372c71b6 100644
--- a/keadm/cmd/keadm/app/cmd/helm/cloudcore.go
+++ b/keadm/cmd/keadm/app/cmd/helm/cloudcore.go
@@ -105,9 +105,22 @@ func (c *CloudCoreHelmTool) Install(opts *types.InitOptions) error {
appendDefaultSets(opts.KubeEdgeVersion, opts.AdvertiseAddress, &opts.CloudInitUpdateBase)
// Load profile values, and merges the sets flag
- vals, err := MergeProfileValues(getValuesFile(opts.Profile), opts.GetValidSets())
- if err != nil {
- return err
+ var vals map[string]interface{}
+ var err error
+ if opts.Profile != "" {
+ // Load profile values, and merges the sets flag
+ vals, err = MergeProfileValues(getValuesFile(opts.Profile), opts.GetValidSets())
+ if err != nil {
+ return err
+ }
+ } else {
+ valueOpts := &Options{
+ Values: opts.GetValidSets(),
+ }
+ vals, err = valueOpts.MergeValues()
+ if err != nil {
+ return err
+ }
}
// TODO: think about how to support addons, and should we support addons?
@@ -138,6 +151,7 @@ func (c *CloudCoreHelmTool) Install(opts *types.InitOptions) error {
client.DryRun = opts.DryRun
client.CreateNamespace = defaultHelmCreateNs
client.ReleaseName = renderer.componentName
+ client.Namespace = constants.SystemNamespace
// If the flag force is true, don't wait for the command result of helm install
if !opts.Force {
client.Wait = defaultHelmWait
diff --git a/manifests/charts/cloudcore/crds/devices_v1beta1_device.yaml b/manifests/charts/cloudcore/crds/devices_v1beta1_device.yaml
index e360ad949..9602a5bbc 100644
--- a/manifests/charts/cloudcore/crds/devices_v1beta1_device.yaml
+++ b/manifests/charts/cloudcore/crds/devices_v1beta1_device.yaml
@@ -646,6 +646,21 @@ spec:
type: object
type: object
type: object
+ mysql:
+ properties:
+ mysqlClientConfig:
+ properties:
+ addr:
+ description: mysql address,like localhost:3306
+ type: string
+ database:
+ description: database name
+ type: string
+ userName:
+ description: user name
+ type: string
+ type: object
+ type: object
redis:
properties:
redisClientConfig:
diff --git a/manifests/charts/cloudcore/templates/rbac_cloudcore_feature.yaml b/manifests/charts/cloudcore/templates/rbac_cloudcore_feature.yaml
index f2fdb96d2..40d5df3a5 100644
--- a/manifests/charts/cloudcore/templates/rbac_cloudcore_feature.yaml
+++ b/manifests/charts/cloudcore/templates/rbac_cloudcore_feature.yaml
@@ -10,9 +10,19 @@ rules:
resources: ["serviceaccounts"]
verbs: ["list", "watch"]
- apiGroups: ["policy.kubeedge.io"]
- resources: ["serviceaccountaccesses"]
- verbs: ["list", "watch"]
+ resources: ["serviceaccountaccesses", "serviceaccountaccesses/status"]
+ verbs: ["list", "watch", "create", "update", "delete"]
- apiGroups: ["rbac.authorization.k8s.io"]
resources: ["roles", "clusterrolebindings", "rolebindings", "clusterroles"]
verbs: ["list", "watch"]
+- apiGroups: ["certificates.k8s.io"]
+ resources: ["certificatesigningrequests"]
+ verbs: ["create", "get", "list", "watch"]
+- apiGroups: ["certificates.k8s.io"]
+ resources: ["certificatesigningrequests/approval"]
+ verbs: ["update"]
+- apiGroups: ["certificates.k8s.io"]
+ resources: ["signers"]
+ resourceNames: ["kubernetes.io/kubelet-serving"]
+ verbs: ["approve"]
{{- end }}
diff --git a/pkg/apis/componentconfig/cloudcore/v1alpha1/default.go b/pkg/apis/componentconfig/cloudcore/v1alpha1/default.go
index 9e58cd38a..e8963577c 100644
--- a/pkg/apis/componentconfig/cloudcore/v1alpha1/default.go
+++ b/pkg/apis/componentconfig/cloudcore/v1alpha1/default.go
@@ -163,7 +163,8 @@ func getDefaultEdgeControllerLoad(nodeLimit int32) *EdgeControllerLoad {
QueryLeaseWorkers: constants.DefaultQueryLeaseWorkers,
UpdateRuleStatusWorkers: constants.DefaultUpdateRuleStatusWorkers,
ServiceAccountTokenWorkers: constants.DefaultServiceAccountTokenWorkers,
- CreatePodWorks: constants.CreatePodWorks,
+ CreatePodWorks: constants.DefaultCreatePodWorkers,
+ CertificateSigningRequestWorkers: constants.DefaultCertificateSigningRequestWorkers,
}
}
@@ -192,6 +193,7 @@ func getDefaultEdgeControllerBuffer(nodeLimit int32) *EdgeControllerBuffer {
QueryLease: constants.DefaultQueryLeaseBuffer,
ServiceAccountToken: constants.DefaultServiceAccountTokenBuffer,
CreatePod: constants.DefaultCreatePodBuffer,
+ CertificateSigningRequest: constants.DefaultCertificateSigningRequestBuffer,
}
}
diff --git a/pkg/apis/componentconfig/cloudcore/v1alpha1/types.go b/pkg/apis/componentconfig/cloudcore/v1alpha1/types.go
index db46c094b..b39ec3475 100644
--- a/pkg/apis/componentconfig/cloudcore/v1alpha1/types.go
+++ b/pkg/apis/componentconfig/cloudcore/v1alpha1/types.go
@@ -285,9 +285,12 @@ type EdgeControllerBuffer struct {
// ServiceAccount indicates the buffer of service account token
// default 1024
ServiceAccountToken int32 `json:"serviceAccountToken,omitempty"`
- // CreatePod indicates the buffer of patch pod
+ // CreatePod indicates the buffer of create pod
// default 1024
CreatePod int32 `json:"createPod,omitempty"`
+ // CertificateSigningRequest indicates the buffer of certificatesSigningRequest
+ // default 1024
+ CertificateSigningRequest int32 `json:"certificateSigningRequest,omitempty"`
}
// EdgeControllerLoad indicates the EdgeController load
@@ -343,8 +346,12 @@ type EdgeControllerLoad struct {
// ServiceAccountTokenWorkers indicates the load of service account token
// default 4
ServiceAccountTokenWorkers int32 `json:"ServiceAccountTokenWorkers,omitempty"`
+ // CreatePodWorks indicates the load of create pod
// default 4
CreatePodWorks int32 `json:"CreatePodWorks,omitempty"`
+ // CertificateSigningRequestWorkers indicates the load of CertificateSigningRequest
+ // default 4
+ CertificateSigningRequestWorkers int32 `json:"certificateSigningRequestWorkers,omitempty"`
}
// DeviceController indicates the device controller
diff --git a/pkg/apis/componentconfig/edgecore/v1alpha2/default.go b/pkg/apis/componentconfig/edgecore/v1alpha2/default.go
index f51a027a8..728cf3f52 100644
--- a/pkg/apis/componentconfig/edgecore/v1alpha2/default.go
+++ b/pkg/apis/componentconfig/edgecore/v1alpha2/default.go
@@ -133,6 +133,7 @@ func NewDefaultEdgeCoreConfig() (config *EdgeCoreConfig) {
TLSCertFile: constants.DefaultCertFile,
TLSPrivateKeyFile: constants.DefaultKeyFile,
ServiceAccountIssuers: []string{constants.DefaultServiceAccountIssuer},
+ DummyServer: constants.DefaultDummyServerAddr,
},
},
ServiceBus: &ServiceBus{
diff --git a/pkg/apis/componentconfig/edgecore/v1alpha2/types.go b/pkg/apis/componentconfig/edgecore/v1alpha2/types.go
index 5d05530b0..8c2d59cb0 100644
--- a/pkg/apis/componentconfig/edgecore/v1alpha2/types.go
+++ b/pkg/apis/componentconfig/edgecore/v1alpha2/types.go
@@ -1004,6 +1004,9 @@ type MetaServer struct {
ServiceAccountIssuers []string `json:"serviceAccountIssuers"`
APIAudiences []string `json:"apiAudiences"`
ServiceAccountKeyFiles []string `json:"serviceAccountKeyFiles"`
+ // DummyServer defines the IP address of dummy interface and port
+ // that MetaServer listen on for edge pods to connect, format: ip:port
+ DummyServer string `json:"dummyServer"`
}
// ServiceBus indicates the ServiceBus module config
diff --git a/pkg/apis/devices/v1beta1/device_instance_types.go b/pkg/apis/devices/v1beta1/device_instance_types.go
index 3c4f706bf..f00af8227 100644
--- a/pkg/apis/devices/v1beta1/device_instance_types.go
+++ b/pkg/apis/devices/v1beta1/device_instance_types.go
@@ -160,6 +160,8 @@ type DBMethodConfig struct {
Redis *DBMethodRedis `json:"redis,omitempty"`
// +optional
TDEngine *DBMethodTDEngine `json:"TDEngine,omitempty"`
+ // +optional
+ Mysql *DBMethodMySQL `json:"mysql,omitempty"`
}
type DBMethodInfluxdb2 struct {
@@ -230,6 +232,19 @@ type TDEngineClientConfig struct {
DBName string `json:"dbName,omitempty"`
}
+type DBMethodMySQL struct {
+ MySQLClientConfig *MySQLClientConfig `json:"mysqlClientConfig,omitempty"`
+}
+
+type MySQLClientConfig struct {
+ // mysql address,like localhost:3306
+ Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
+ // database name
+ Database string `protobuf:"bytes,2,opt,name=database,proto3" json:"database,omitempty"`
+ // user name
+ UserName string `protobuf:"bytes,3,opt,name=userName,proto3" json:"userName,omitempty"`
+}
+
type VisitorConfig struct {
// Required: name of customized protocol
ProtocolName string `json:"protocolName,omitempty"`
diff --git a/pkg/apis/devices/v1beta1/zz_generated.deepcopy.go b/pkg/apis/devices/v1beta1/zz_generated.deepcopy.go
index e6d69278f..2c042490c 100644
--- a/pkg/apis/devices/v1beta1/zz_generated.deepcopy.go
+++ b/pkg/apis/devices/v1beta1/zz_generated.deepcopy.go
@@ -44,6 +44,11 @@ func (in *DBMethodConfig) DeepCopyInto(out *DBMethodConfig) {
*out = new(DBMethodTDEngine)
(*in).DeepCopyInto(*out)
}
+ if in.Mysql != nil {
+ in, out := &in.Mysql, &out.Mysql
+ *out = new(DBMethodMySQL)
+ (*in).DeepCopyInto(*out)
+ }
return
}
@@ -84,6 +89,27 @@ func (in *DBMethodInfluxdb2) DeepCopy() *DBMethodInfluxdb2 {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DBMethodMySQL) DeepCopyInto(out *DBMethodMySQL) {
+ *out = *in
+ if in.MySQLClientConfig != nil {
+ in, out := &in.MySQLClientConfig, &out.MySQLClientConfig
+ *out = new(MySQLClientConfig)
+ **out = **in
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DBMethodMySQL.
+func (in *DBMethodMySQL) DeepCopy() *DBMethodMySQL {
+ if in == nil {
+ return nil
+ }
+ out := new(DBMethodMySQL)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DBMethodRedis) DeepCopyInto(out *DBMethodRedis) {
*out = *in
if in.RedisClientConfig != nil {
@@ -398,6 +424,22 @@ func (in *ModelProperty) DeepCopy() *ModelProperty {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MySQLClientConfig) DeepCopyInto(out *MySQLClientConfig) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLClientConfig.
+func (in *MySQLClientConfig) DeepCopy() *MySQLClientConfig {
+ if in == nil {
+ return nil
+ }
+ out := new(MySQLClientConfig)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ProtocolConfig) DeepCopyInto(out *ProtocolConfig) {
*out = *in
if in.ConfigData != nil {
diff --git a/pkg/apis/dmi/v1beta1/api.pb.go b/pkg/apis/dmi/v1beta1/api.pb.go
index db2a9fafc..831333fa1 100644
--- a/pkg/apis/dmi/v1beta1/api.pb.go
+++ b/pkg/apis/dmi/v1beta1/api.pb.go
@@ -19,17 +19,17 @@ Copyright 2023 The KubeEdge Authors.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.26.0
-// protoc v3.19.4
+// protoc-gen-go v1.32.0
+// protoc v3.6.1
// 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 +849,7 @@ type CustomizedValue struct {
unknownFields protoimpl.UnknownFields
// data is the customized value and it can be any form.
- 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"`
+ 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"`
}
func (x *CustomizedValue) Reset() {
@@ -884,7 +884,7 @@ func (*CustomizedValue) Descriptor() ([]byte, []int) {
return file_api_proto_rawDescGZIP(), []int{11}
}
-func (x *CustomizedValue) GetData() map[string]*anypb.Any {
+func (x *CustomizedValue) GetData() map[string]*any1.Any {
if x != nil {
return x.Data
}
@@ -1109,6 +1109,7 @@ type DBMethod struct {
Influxdb2 *DBMethodInfluxdb2 `protobuf:"bytes,1,opt,name=influxdb2,proto3" json:"influxdb2,omitempty"`
Redis *DBMethodRedis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"`
Tdengine *DBMethodTDEngine `protobuf:"bytes,3,opt,name=tdengine,proto3" json:"tdengine,omitempty"`
+ Mysql *DBMethodMySQL `protobuf:"bytes,4,opt,name=mysql,proto3" json:"mysql,omitempty"`
}
func (x *DBMethod) Reset() {
@@ -1164,6 +1165,13 @@ func (x *DBMethod) GetTdengine() *DBMethodTDEngine {
return nil
}
+func (x *DBMethod) GetMysql() *DBMethodMySQL {
+ if x != nil {
+ return x.Mysql
+ }
+ return nil
+}
+
type DBMethodInfluxdb2 struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -1578,6 +1586,119 @@ func (x *TDEngineClientConfig) GetDbname() string {
return ""
}
+type DBMethodMySQL struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ MysqlClientConfig *MySQLClientConfig `protobuf:"bytes,1,opt,name=mysqlClientConfig,proto3" json:"mysqlClientConfig,omitempty"`
+}
+
+func (x *DBMethodMySQL) Reset() {
+ *x = DBMethodMySQL{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_msgTypes[23]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *DBMethodMySQL) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DBMethodMySQL) ProtoMessage() {}
+
+func (x *DBMethodMySQL) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_msgTypes[23]
+ 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 DBMethodMySQL.ProtoReflect.Descriptor instead.
+func (*DBMethodMySQL) Descriptor() ([]byte, []int) {
+ return file_api_proto_rawDescGZIP(), []int{23}
+}
+
+func (x *DBMethodMySQL) GetMysqlClientConfig() *MySQLClientConfig {
+ if x != nil {
+ return x.MysqlClientConfig
+ }
+ return nil
+}
+
+type MySQLClientConfig struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // mysql address,like localhost:3306
+ Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
+ // database name
+ Database string `protobuf:"bytes,2,opt,name=database,proto3" json:"database,omitempty"`
+ // user name
+ UserName string `protobuf:"bytes,3,opt,name=userName,proto3" json:"userName,omitempty"`
+}
+
+func (x *MySQLClientConfig) Reset() {
+ *x = MySQLClientConfig{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_api_proto_msgTypes[24]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *MySQLClientConfig) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*MySQLClientConfig) ProtoMessage() {}
+
+func (x *MySQLClientConfig) ProtoReflect() protoreflect.Message {
+ mi := &file_api_proto_msgTypes[24]
+ 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 MySQLClientConfig.ProtoReflect.Descriptor instead.
+func (*MySQLClientConfig) Descriptor() ([]byte, []int) {
+ return file_api_proto_rawDescGZIP(), []int{24}
+}
+
+func (x *MySQLClientConfig) GetAddr() string {
+ if x != nil {
+ return x.Addr
+ }
+ return ""
+}
+
+func (x *MySQLClientConfig) GetDatabase() string {
+ if x != nil {
+ return x.Database
+ }
+ return ""
+}
+
+func (x *MySQLClientConfig) GetUserName() string {
+ if x != nil {
+ return x.UserName
+ }
+ return ""
+}
+
// MapperInfo is the information of mapper.
type MapperInfo struct {
state protoimpl.MessageState
@@ -1601,7 +1722,7 @@ type MapperInfo struct {
func (x *MapperInfo) Reset() {
*x = MapperInfo{}
if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[23]
+ mi := &file_api_proto_msgTypes[25]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1614,7 +1735,7 @@ func (x *MapperInfo) String() string {
func (*MapperInfo) ProtoMessage() {}
func (x *MapperInfo) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[23]
+ mi := &file_api_proto_msgTypes[25]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1627,7 +1748,7 @@ func (x *MapperInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use MapperInfo.ProtoReflect.Descriptor instead.
func (*MapperInfo) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{23}
+ return file_api_proto_rawDescGZIP(), []int{25}
}
func (x *MapperInfo) GetName() string {
@@ -1685,7 +1806,7 @@ type ReportDeviceStatusRequest struct {
func (x *ReportDeviceStatusRequest) Reset() {
*x = ReportDeviceStatusRequest{}
if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[24]
+ mi := &file_api_proto_msgTypes[26]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1698,7 +1819,7 @@ func (x *ReportDeviceStatusRequest) String() string {
func (*ReportDeviceStatusRequest) ProtoMessage() {}
func (x *ReportDeviceStatusRequest) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[24]
+ mi := &file_api_proto_msgTypes[26]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1711,7 +1832,7 @@ func (x *ReportDeviceStatusRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ReportDeviceStatusRequest.ProtoReflect.Descriptor instead.
func (*ReportDeviceStatusRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{24}
+ return file_api_proto_rawDescGZIP(), []int{26}
}
func (x *ReportDeviceStatusRequest) GetDeviceName() string {
@@ -1748,7 +1869,7 @@ type DeviceStatus struct {
func (x *DeviceStatus) Reset() {
*x = DeviceStatus{}
if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[25]
+ mi := &file_api_proto_msgTypes[27]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1761,7 +1882,7 @@ func (x *DeviceStatus) String() string {
func (*DeviceStatus) ProtoMessage() {}
func (x *DeviceStatus) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[25]
+ mi := &file_api_proto_msgTypes[27]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1774,7 +1895,7 @@ func (x *DeviceStatus) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeviceStatus.ProtoReflect.Descriptor instead.
func (*DeviceStatus) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{25}
+ return file_api_proto_rawDescGZIP(), []int{27}
}
func (x *DeviceStatus) GetTwins() []*Twin {
@@ -1801,7 +1922,7 @@ type Twin struct {
func (x *Twin) Reset() {
*x = Twin{}
if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[26]
+ mi := &file_api_proto_msgTypes[28]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1814,7 +1935,7 @@ func (x *Twin) String() string {
func (*Twin) ProtoMessage() {}
func (x *Twin) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[26]
+ mi := &file_api_proto_msgTypes[28]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1827,7 +1948,7 @@ func (x *Twin) ProtoReflect() protoreflect.Message {
// Deprecated: Use Twin.ProtoReflect.Descriptor instead.
func (*Twin) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{26}
+ return file_api_proto_rawDescGZIP(), []int{28}
}
func (x *Twin) GetPropertyName() string {
@@ -1866,7 +1987,7 @@ type TwinProperty struct {
func (x *TwinProperty) Reset() {
*x = TwinProperty{}
if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[27]
+ mi := &file_api_proto_msgTypes[29]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1879,7 +2000,7 @@ func (x *TwinProperty) String() string {
func (*TwinProperty) ProtoMessage() {}
func (x *TwinProperty) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[27]
+ mi := &file_api_proto_msgTypes[29]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1892,7 +2013,7 @@ func (x *TwinProperty) ProtoReflect() protoreflect.Message {
// Deprecated: Use TwinProperty.ProtoReflect.Descriptor instead.
func (*TwinProperty) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{27}
+ return file_api_proto_rawDescGZIP(), []int{29}
}
func (x *TwinProperty) GetValue() string {
@@ -1918,7 +2039,7 @@ type ReportDeviceStatusResponse struct {
func (x *ReportDeviceStatusResponse) Reset() {
*x = ReportDeviceStatusResponse{}
if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[28]
+ mi := &file_api_proto_msgTypes[30]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1931,7 +2052,7 @@ func (x *ReportDeviceStatusResponse) String() string {
func (*ReportDeviceStatusResponse) ProtoMessage() {}
func (x *ReportDeviceStatusResponse) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[28]
+ mi := &file_api_proto_msgTypes[30]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1944,7 +2065,7 @@ func (x *ReportDeviceStatusResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ReportDeviceStatusResponse.ProtoReflect.Descriptor instead.
func (*ReportDeviceStatusResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{28}
+ return file_api_proto_rawDescGZIP(), []int{30}
}
type RegisterDeviceRequest struct {
@@ -1958,7 +2079,7 @@ type RegisterDeviceRequest struct {
func (x *RegisterDeviceRequest) Reset() {
*x = RegisterDeviceRequest{}
if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[29]
+ mi := &file_api_proto_msgTypes[31]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1971,7 +2092,7 @@ func (x *RegisterDeviceRequest) String() string {
func (*RegisterDeviceRequest) ProtoMessage() {}
func (x *RegisterDeviceRequest) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[29]
+ mi := &file_api_proto_msgTypes[31]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1984,7 +2105,7 @@ func (x *RegisterDeviceRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use RegisterDeviceRequest.ProtoReflect.Descriptor instead.
func (*RegisterDeviceRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{29}
+ return file_api_proto_rawDescGZIP(), []int{31}
}
func (x *RegisterDeviceRequest) GetDevice() *Device {
@@ -2006,7 +2127,7 @@ type RegisterDeviceResponse struct {
func (x *RegisterDeviceResponse) Reset() {
*x = RegisterDeviceResponse{}
if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[30]
+ mi := &file_api_proto_msgTypes[32]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2019,7 +2140,7 @@ func (x *RegisterDeviceResponse) String() string {
func (*RegisterDeviceResponse) ProtoMessage() {}
func (x *RegisterDeviceResponse) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[30]
+ mi := &file_api_proto_msgTypes[32]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2032,7 +2153,7 @@ func (x *RegisterDeviceResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use RegisterDeviceResponse.ProtoReflect.Descriptor instead.
func (*RegisterDeviceResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{30}
+ return file_api_proto_rawDescGZIP(), []int{32}
}
func (x *RegisterDeviceResponse) GetDeviceName() string {
@@ -2060,7 +2181,7 @@ type CreateDeviceModelRequest struct {
func (x *CreateDeviceModelRequest) Reset() {
*x = CreateDeviceModelRequest{}
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)
}
@@ -2073,7 +2194,7 @@ func (x *CreateDeviceModelRequest) String() string {
func (*CreateDeviceModelRequest) ProtoMessage() {}
func (x *CreateDeviceModelRequest) 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 {
@@ -2086,7 +2207,7 @@ func (x *CreateDeviceModelRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateDeviceModelRequest.ProtoReflect.Descriptor instead.
func (*CreateDeviceModelRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{31}
+ return file_api_proto_rawDescGZIP(), []int{33}
}
func (x *CreateDeviceModelRequest) GetModel() *DeviceModel {
@@ -2108,7 +2229,7 @@ type CreateDeviceModelResponse struct {
func (x *CreateDeviceModelResponse) Reset() {
*x = CreateDeviceModelResponse{}
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)
}
@@ -2121,7 +2242,7 @@ func (x *CreateDeviceModelResponse) String() string {
func (*CreateDeviceModelResponse) ProtoMessage() {}
func (x *CreateDeviceModelResponse) 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 {
@@ -2134,7 +2255,7 @@ func (x *CreateDeviceModelResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateDeviceModelResponse.ProtoReflect.Descriptor instead.
func (*CreateDeviceModelResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{32}
+ return file_api_proto_rawDescGZIP(), []int{34}
}
func (x *CreateDeviceModelResponse) GetDeviceModelName() string {
@@ -2163,7 +2284,7 @@ type RemoveDeviceRequest struct {
func (x *RemoveDeviceRequest) Reset() {
*x = RemoveDeviceRequest{}
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)
}
@@ -2176,7 +2297,7 @@ func (x *RemoveDeviceRequest) String() string {
func (*RemoveDeviceRequest) ProtoMessage() {}
func (x *RemoveDeviceRequest) 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 {
@@ -2189,7 +2310,7 @@ func (x *RemoveDeviceRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use RemoveDeviceRequest.ProtoReflect.Descriptor instead.
func (*RemoveDeviceRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{33}
+ return file_api_proto_rawDescGZIP(), []int{35}
}
func (x *RemoveDeviceRequest) GetDeviceName() string {
@@ -2215,7 +2336,7 @@ type RemoveDeviceResponse struct {
func (x *RemoveDeviceResponse) Reset() {
*x = RemoveDeviceResponse{}
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)
}
@@ -2228,7 +2349,7 @@ func (x *RemoveDeviceResponse) String() string {
func (*RemoveDeviceResponse) ProtoMessage() {}
func (x *RemoveDeviceResponse) 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 {
@@ -2241,7 +2362,7 @@ func (x *RemoveDeviceResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use RemoveDeviceResponse.ProtoReflect.Descriptor instead.
func (*RemoveDeviceResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{34}
+ return file_api_proto_rawDescGZIP(), []int{36}
}
type RemoveDeviceModelRequest struct {
@@ -2256,7 +2377,7 @@ type RemoveDeviceModelRequest struct {
func (x *RemoveDeviceModelRequest) Reset() {
*x = RemoveDeviceModelRequest{}
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)
}
@@ -2269,7 +2390,7 @@ func (x *RemoveDeviceModelRequest) String() string {
func (*RemoveDeviceModelRequest) ProtoMessage() {}
func (x *RemoveDeviceModelRequest) 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 {
@@ -2282,7 +2403,7 @@ func (x *RemoveDeviceModelRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use RemoveDeviceModelRequest.ProtoReflect.Descriptor instead.
func (*RemoveDeviceModelRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{35}
+ return file_api_proto_rawDescGZIP(), []int{37}
}
func (x *RemoveDeviceModelRequest) GetModelName() string {
@@ -2308,7 +2429,7 @@ type RemoveDeviceModelResponse struct {
func (x *RemoveDeviceModelResponse) Reset() {
*x = RemoveDeviceModelResponse{}
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)
}
@@ -2321,7 +2442,7 @@ func (x *RemoveDeviceModelResponse) String() string {
func (*RemoveDeviceModelResponse) ProtoMessage() {}
func (x *RemoveDeviceModelResponse) 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 {
@@ -2334,7 +2455,7 @@ func (x *RemoveDeviceModelResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use RemoveDeviceModelResponse.ProtoReflect.Descriptor instead.
func (*RemoveDeviceModelResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{36}
+ return file_api_proto_rawDescGZIP(), []int{38}
}
type UpdateDeviceRequest struct {
@@ -2348,7 +2469,7 @@ type UpdateDeviceRequest struct {
func (x *UpdateDeviceRequest) Reset() {
*x = UpdateDeviceRequest{}
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)
}
@@ -2361,7 +2482,7 @@ func (x *UpdateDeviceRequest) String() string {
func (*UpdateDeviceRequest) ProtoMessage() {}
func (x *UpdateDeviceRequest) 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 {
@@ -2374,7 +2495,7 @@ func (x *UpdateDeviceRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateDeviceRequest.ProtoReflect.Descriptor instead.
func (*UpdateDeviceRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{37}
+ return file_api_proto_rawDescGZIP(), []int{39}
}
func (x *UpdateDeviceRequest) GetDevice() *Device {
@@ -2393,7 +2514,7 @@ type UpdateDeviceResponse struct {
func (x *UpdateDeviceResponse) Reset() {
*x = UpdateDeviceResponse{}
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)
}
@@ -2406,7 +2527,7 @@ func (x *UpdateDeviceResponse) String() string {
func (*UpdateDeviceResponse) ProtoMessage() {}
func (x *UpdateDeviceResponse) 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 {
@@ -2419,7 +2540,7 @@ func (x *UpdateDeviceResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateDeviceResponse.ProtoReflect.Descriptor instead.
func (*UpdateDeviceResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{38}
+ return file_api_proto_rawDescGZIP(), []int{40}
}
type UpdateDeviceModelRequest struct {
@@ -2433,7 +2554,7 @@ type UpdateDeviceModelRequest struct {
func (x *UpdateDeviceModelRequest) Reset() {
*x = UpdateDeviceModelRequest{}
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)
}
@@ -2446,7 +2567,7 @@ func (x *UpdateDeviceModelRequest) String() string {
func (*UpdateDeviceModelRequest) ProtoMessage() {}
func (x *UpdateDeviceModelRequest) 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 {
@@ -2459,7 +2580,7 @@ func (x *UpdateDeviceModelRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateDeviceModelRequest.ProtoReflect.Descriptor instead.
func (*UpdateDeviceModelRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{39}
+ return file_api_proto_rawDescGZIP(), []int{41}
}
func (x *UpdateDeviceModelRequest) GetModel() *DeviceModel {
@@ -2478,7 +2599,7 @@ type UpdateDeviceModelResponse struct {
func (x *UpdateDeviceModelResponse) Reset() {
*x = UpdateDeviceModelResponse{}
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)
}
@@ -2491,7 +2612,7 @@ func (x *UpdateDeviceModelResponse) String() string {
func (*UpdateDeviceModelResponse) ProtoMessage() {}
func (x *UpdateDeviceModelResponse) 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 {
@@ -2504,7 +2625,7 @@ func (x *UpdateDeviceModelResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateDeviceModelResponse.ProtoReflect.Descriptor instead.
func (*UpdateDeviceModelResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{40}
+ return file_api_proto_rawDescGZIP(), []int{42}
}
type GetDeviceRequest struct {
@@ -2519,7 +2640,7 @@ type GetDeviceRequest struct {
func (x *GetDeviceRequest) Reset() {
*x = GetDeviceRequest{}
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)
}
@@ -2532,7 +2653,7 @@ func (x *GetDeviceRequest) String() string {
func (*GetDeviceRequest) ProtoMessage() {}
func (x *GetDeviceRequest) 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 {
@@ -2545,7 +2666,7 @@ func (x *GetDeviceRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetDeviceRequest.ProtoReflect.Descriptor instead.
func (*GetDeviceRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{41}
+ return file_api_proto_rawDescGZIP(), []int{43}
}
func (x *GetDeviceRequest) GetDeviceName() string {
@@ -2573,7 +2694,7 @@ type GetDeviceResponse struct {
func (x *GetDeviceResponse) Reset() {
*x = GetDeviceResponse{}
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)
}
@@ -2586,7 +2707,7 @@ func (x *GetDeviceResponse) String() string {
func (*GetDeviceResponse) ProtoMessage() {}
func (x *GetDeviceResponse) 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 {
@@ -2599,7 +2720,7 @@ func (x *GetDeviceResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetDeviceResponse.ProtoReflect.Descriptor instead.
func (*GetDeviceResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{42}
+ return file_api_proto_rawDescGZIP(), []int{44}
}
func (x *GetDeviceResponse) GetDevice() *Device {
@@ -2754,7 +2875,7 @@ var file_api_proto_rawDesc = []byte{
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, 0xa9, 0x01, 0x0a, 0x08, 0x44, 0x42, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12,
+ 0x65, 0x64, 0x22, 0xd7, 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, 0x44, 0x42, 0x4d,
0x65, 0x74, 0x68, 0x6f, 0x64, 0x49, 0x6e, 0x66, 0x6c, 0x75, 0x78, 0x64, 0x62, 0x32, 0x52, 0x09,
@@ -2764,220 +2885,235 @@ var file_api_proto_rawDesc = []byte{
0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x12, 0x35, 0x0a, 0x08, 0x74, 0x64, 0x65, 0x6e, 0x67,
0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x76, 0x31, 0x62, 0x65,
0x74, 0x61, 0x31, 0x2e, 0x44, 0x42, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x54, 0x44, 0x45, 0x6e,
- 0x67, 0x69, 0x6e, 0x65, 0x52, 0x08, 0x74, 0x64, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 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, 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, 0x59, 0x0a, 0x0d, 0x44, 0x42, 0x4d, 0x65, 0x74, 0x68,
- 0x6f, 0x64, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x48, 0x0a, 0x11, 0x72, 0x65, 0x64, 0x69, 0x73,
- 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x64,
- 0x69, 0x73, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x11,
- 0x72, 0x65, 0x64, 0x69, 0x73, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69,
- 0x67, 0x22, 0x77, 0x0a, 0x11, 0x52, 0x65, 0x64, 0x69, 0x73, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74,
- 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x62, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f,
- 0x6f, 0x6c, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6f,
- 0x6f, 0x6c, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x6c,
- 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x69,
- 0x6e, 0x49, 0x64, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x73, 0x22, 0x65, 0x0a, 0x10, 0x44, 0x42,
- 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x54, 0x44, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x51,
- 0x0a, 0x14, 0x74, 0x64, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74,
- 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x76,
- 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x44, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x43,
- 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x14, 0x74, 0x64, 0x45,
- 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69,
- 0x67, 0x22, 0x42, 0x0a, 0x14, 0x54, 0x44, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x43, 0x6c, 0x69,
- 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64,
- 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x16, 0x0a,
- 0x06, 0x64, 0x62, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64,
- 0x62, 0x6e, 0x61, 0x6d, 0x65, 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, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
- 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73,
- 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18,
- 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12,
- 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c,
- 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61,
- 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22,
- 0xa4, 0x01, 0x0a, 0x19, 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, 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, 0x3d, 0x0a,
- 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e,
- 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0e, 0x72, 0x65,
- 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 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,
+ 0x67, 0x69, 0x6e, 0x65, 0x52, 0x08, 0x74, 0x64, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x2c,
+ 0x0a, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x42, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64,
+ 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x52, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 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, 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, 0x59, 0x0a, 0x0d, 0x44, 0x42, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64,
+ 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x48, 0x0a, 0x11, 0x72, 0x65, 0x64, 0x69, 0x73, 0x43, 0x6c,
+ 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x1a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73,
+ 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x11, 0x72, 0x65,
+ 0x64, 0x69, 0x73, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22,
+ 0x77, 0x0a, 0x11, 0x52, 0x65, 0x64, 0x69, 0x73, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f,
+ 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x62, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x6f, 0x6c,
+ 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6f, 0x6f, 0x6c,
+ 0x73, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x6c, 0x65, 0x43,
+ 0x6f, 0x6e, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x69, 0x6e, 0x49,
+ 0x64, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x73, 0x22, 0x65, 0x0a, 0x10, 0x44, 0x42, 0x4d, 0x65,
+ 0x74, 0x68, 0x6f, 0x64, 0x54, 0x44, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x51, 0x0a, 0x14,
+ 0x74, 0x64, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f,
+ 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x44, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x43, 0x6c, 0x69,
+ 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x14, 0x74, 0x64, 0x45, 0x6e, 0x67,
+ 0x69, 0x6e, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22,
+ 0x42, 0x0a, 0x14, 0x54, 0x44, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e,
+ 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x64,
+ 0x62, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x62, 0x6e,
+ 0x61, 0x6d, 0x65, 0x22, 0x59, 0x0a, 0x0d, 0x44, 0x42, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4d,
+ 0x79, 0x53, 0x51, 0x4c, 0x12, 0x48, 0x0a, 0x11, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x43, 0x6c, 0x69,
+ 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x1a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x43,
+ 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x11, 0x6d, 0x79, 0x73,
+ 0x71, 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x5f,
+ 0x0a, 0x11, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e,
+ 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 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, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18,
+ 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 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, 0x12, 0x1f, 0x0a, 0x0b,
+ 0x61, 0x70, 0x69, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28,
+ 0x09, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a,
+ 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64,
+ 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72,
+ 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0xa4, 0x01, 0x0a, 0x19, 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, 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, 0x3d, 0x0a, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x72,
+ 0x74, 0x65, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x15, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65,
+ 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64,
+ 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, 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,
+ 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, 0x46, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44,
+ 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,
+ 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, 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, 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, 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, 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,
+ 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 (
@@ -2992,7 +3128,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, 48)
var file_api_proto_goTypes = []interface{}{
(*MapperRegisterRequest)(nil), // 0: v1beta1.MapperRegisterRequest
(*MapperRegisterResponse)(nil), // 1: v1beta1.MapperRegisterResponse
@@ -3017,93 +3153,97 @@ var file_api_proto_goTypes = []interface{}{
(*RedisClientConfig)(nil), // 20: v1beta1.RedisClientConfig
(*DBMethodTDEngine)(nil), // 21: v1beta1.DBMethodTDEngine
(*TDEngineClientConfig)(nil), // 22: v1beta1.TDEngineClientConfig
- (*MapperInfo)(nil), // 23: v1beta1.MapperInfo
- (*ReportDeviceStatusRequest)(nil), // 24: v1beta1.ReportDeviceStatusRequest
- (*DeviceStatus)(nil), // 25: v1beta1.DeviceStatus
- (*Twin)(nil), // 26: v1beta1.Twin
- (*TwinProperty)(nil), // 27: v1beta1.TwinProperty
- (*ReportDeviceStatusResponse)(nil), // 28: v1beta1.ReportDeviceStatusResponse
- (*RegisterDeviceRequest)(nil), // 29: v1beta1.RegisterDeviceRequest
- (*RegisterDeviceResponse)(nil), // 30: v1beta1.RegisterDeviceResponse
- (*CreateDeviceModelRequest)(nil), // 31: v1beta1.CreateDeviceModelRequest
- (*CreateDeviceModelResponse)(nil), // 32: v1beta1.CreateDeviceModelResponse
- (*RemoveDeviceRequest)(nil), // 33: v1beta1.RemoveDeviceRequest
- (*RemoveDeviceResponse)(nil), // 34: v1beta1.RemoveDeviceResponse
- (*RemoveDeviceModelRequest)(nil), // 35: v1beta1.RemoveDeviceModelRequest
- (*RemoveDeviceModelResponse)(nil), // 36: v1beta1.RemoveDeviceModelResponse
- (*UpdateDeviceRequest)(nil), // 37: v1beta1.UpdateDeviceRequest
- (*UpdateDeviceResponse)(nil), // 38: v1beta1.UpdateDeviceResponse
- (*UpdateDeviceModelRequest)(nil), // 39: v1beta1.UpdateDeviceModelRequest
- (*UpdateDeviceModelResponse)(nil), // 40: v1beta1.UpdateDeviceModelResponse
- (*GetDeviceRequest)(nil), // 41: v1beta1.GetDeviceRequest
- (*GetDeviceResponse)(nil), // 42: v1beta1.GetDeviceResponse
- nil, // 43: v1beta1.CustomizedValue.DataEntry
- nil, // 44: v1beta1.Influxdb2DataConfig.TagEntry
- nil, // 45: v1beta1.TwinProperty.MetadataEntry
- (*anypb.Any)(nil), // 46: google.protobuf.Any
+ (*DBMethodMySQL)(nil), // 23: v1beta1.DBMethodMySQL
+ (*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
}
var file_api_proto_depIdxs = []int32{
- 23, // 0: v1beta1.MapperRegisterRequest.mapper:type_name -> v1beta1.MapperInfo
+ 25, // 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
- 25, // 7: v1beta1.Device.status:type_name -> v1beta1.DeviceStatus
+ 27, // 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
- 27, // 10: v1beta1.DeviceProperty.desired:type_name -> v1beta1.TwinProperty
+ 29, // 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
- 43, // 15: v1beta1.CustomizedValue.data:type_name -> v1beta1.CustomizedValue.DataEntry
+ 45, // 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.redis:type_name -> v1beta1.DBMethodRedis
21, // 21: v1beta1.DBMethod.tdengine:type_name -> v1beta1.DBMethodTDEngine
- 18, // 22: v1beta1.DBMethodInfluxdb2.influxdb2ClientConfig:type_name -> v1beta1.Influxdb2ClientConfig
- 17, // 23: v1beta1.DBMethodInfluxdb2.influxdb2DataConfig:type_name -> v1beta1.Influxdb2DataConfig
- 44, // 24: v1beta1.Influxdb2DataConfig.tag:type_name -> v1beta1.Influxdb2DataConfig.TagEntry
- 20, // 25: v1beta1.DBMethodRedis.redisClientConfig:type_name -> v1beta1.RedisClientConfig
- 22, // 26: v1beta1.DBMethodTDEngine.tdEngineClientConfig:type_name -> v1beta1.TDEngineClientConfig
- 25, // 27: v1beta1.ReportDeviceStatusRequest.reportedDevice:type_name -> v1beta1.DeviceStatus
- 26, // 28: v1beta1.DeviceStatus.twins:type_name -> v1beta1.Twin
- 27, // 29: v1beta1.Twin.observedDesired:type_name -> v1beta1.TwinProperty
- 27, // 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
- 24, // 39: v1beta1.DeviceManagerService.ReportDeviceStatus:input_type -> v1beta1.ReportDeviceStatusRequest
- 29, // 40: v1beta1.DeviceMapperService.RegisterDevice:input_type -> v1beta1.RegisterDeviceRequest
- 33, // 41: v1beta1.DeviceMapperService.RemoveDevice:input_type -> v1beta1.RemoveDeviceRequest
- 37, // 42: v1beta1.DeviceMapperService.UpdateDevice:input_type -> v1beta1.UpdateDeviceRequest
- 31, // 43: v1beta1.DeviceMapperService.CreateDeviceModel:input_type -> v1beta1.CreateDeviceModelRequest
- 35, // 44: v1beta1.DeviceMapperService.RemoveDeviceModel:input_type -> v1beta1.RemoveDeviceModelRequest
- 39, // 45: v1beta1.DeviceMapperService.UpdateDeviceModel:input_type -> v1beta1.UpdateDeviceModelRequest
- 41, // 46: v1beta1.DeviceMapperService.GetDevice:input_type -> v1beta1.GetDeviceRequest
- 1, // 47: v1beta1.DeviceManagerService.MapperRegister:output_type -> v1beta1.MapperRegisterResponse
- 28, // 48: v1beta1.DeviceManagerService.ReportDeviceStatus:output_type -> v1beta1.ReportDeviceStatusResponse
- 30, // 49: v1beta1.DeviceMapperService.RegisterDevice:output_type -> v1beta1.RegisterDeviceResponse
- 34, // 50: v1beta1.DeviceMapperService.RemoveDevice:output_type -> v1beta1.RemoveDeviceResponse
- 38, // 51: v1beta1.DeviceMapperService.UpdateDevice:output_type -> v1beta1.UpdateDeviceResponse
- 32, // 52: v1beta1.DeviceMapperService.CreateDeviceModel:output_type -> v1beta1.CreateDeviceModelResponse
- 36, // 53: v1beta1.DeviceMapperService.RemoveDeviceModel:output_type -> v1beta1.RemoveDeviceModelResponse
- 40, // 54: v1beta1.DeviceMapperService.UpdateDeviceModel:output_type -> v1beta1.UpdateDeviceModelResponse
- 42, // 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
+ 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
+ 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
+ 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
+ 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
+ 40, // [40:40] is the sub-list for extension type_name
+ 40, // [40:40] is the sub-list for extension extendee
+ 0, // [0:40] is the sub-list for field type_name
}
func init() { file_api_proto_init() }
@@ -3389,7 +3529,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*MapperInfo); i {
+ switch v := v.(*DBMethodMySQL); i {
case 0:
return &v.state
case 1:
@@ -3401,7 +3541,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*ReportDeviceStatusRequest); i {
+ switch v := v.(*MySQLClientConfig); i {
case 0:
return &v.state
case 1:
@@ -3413,7 +3553,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*DeviceStatus); i {
+ switch v := v.(*MapperInfo); i {
case 0:
return &v.state
case 1:
@@ -3425,7 +3565,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*Twin); i {
+ switch v := v.(*ReportDeviceStatusRequest); i {
case 0:
return &v.state
case 1:
@@ -3437,7 +3577,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*TwinProperty); i {
+ switch v := v.(*DeviceStatus); i {
case 0:
return &v.state
case 1:
@@ -3449,7 +3589,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*ReportDeviceStatusResponse); i {
+ switch v := v.(*Twin); i {
case 0:
return &v.state
case 1:
@@ -3461,7 +3601,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*RegisterDeviceRequest); i {
+ switch v := v.(*TwinProperty); i {
case 0:
return &v.state
case 1:
@@ -3473,7 +3613,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*RegisterDeviceResponse); i {
+ switch v := v.(*ReportDeviceStatusResponse); i {
case 0:
return &v.state
case 1:
@@ -3485,7 +3625,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*CreateDeviceModelRequest); i {
+ switch v := v.(*RegisterDeviceRequest); i {
case 0:
return &v.state
case 1:
@@ -3497,7 +3637,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*CreateDeviceModelResponse); i {
+ switch v := v.(*RegisterDeviceResponse); i {
case 0:
return &v.state
case 1:
@@ -3509,7 +3649,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*RemoveDeviceRequest); i {
+ switch v := v.(*CreateDeviceModelRequest); i {
case 0:
return &v.state
case 1:
@@ -3521,7 +3661,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*RemoveDeviceResponse); i {
+ switch v := v.(*CreateDeviceModelResponse); i {
case 0:
return &v.state
case 1:
@@ -3533,7 +3673,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*RemoveDeviceModelRequest); i {
+ switch v := v.(*RemoveDeviceRequest); i {
case 0:
return &v.state
case 1:
@@ -3545,7 +3685,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*RemoveDeviceModelResponse); i {
+ switch v := v.(*RemoveDeviceResponse); i {
case 0:
return &v.state
case 1:
@@ -3557,7 +3697,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*UpdateDeviceRequest); i {
+ switch v := v.(*RemoveDeviceModelRequest); i {
case 0:
return &v.state
case 1:
@@ -3569,7 +3709,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*UpdateDeviceResponse); i {
+ switch v := v.(*RemoveDeviceModelResponse); i {
case 0:
return &v.state
case 1:
@@ -3581,7 +3721,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*UpdateDeviceModelRequest); i {
+ switch v := v.(*UpdateDeviceRequest); i {
case 0:
return &v.state
case 1:
@@ -3593,7 +3733,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*UpdateDeviceModelResponse); i {
+ switch v := v.(*UpdateDeviceResponse); i {
case 0:
return &v.state
case 1:
@@ -3605,7 +3745,7 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*GetDeviceRequest); i {
+ switch v := v.(*UpdateDeviceModelRequest); i {
case 0:
return &v.state
case 1:
@@ -3617,6 +3757,30 @@ func file_api_proto_init() {
}
}
file_api_proto_msgTypes[42].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[43].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[44].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetDeviceResponse); i {
case 0:
return &v.state
@@ -3635,7 +3799,7 @@ func file_api_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_proto_rawDesc,
NumEnums: 0,
- NumMessages: 46,
+ NumMessages: 48,
NumExtensions: 0,
NumServices: 2,
},
diff --git a/pkg/apis/dmi/v1beta1/api.proto b/pkg/apis/dmi/v1beta1/api.proto
index 5bbff675c..843bf6070 100644
--- a/pkg/apis/dmi/v1beta1/api.proto
+++ b/pkg/apis/dmi/v1beta1/api.proto
@@ -251,6 +251,7 @@ message DBMethod{
DBMethodInfluxdb2 influxdb2 = 1;
DBMethodRedis redis = 2;
DBMethodTDEngine tdengine = 3;
+ DBMethodMySQL mysql = 4;
}
message DBMethodInfluxdb2{
@@ -303,6 +304,20 @@ message TDEngineClientConfig{
string dbname = 2;
}
+
+message DBMethodMySQL{
+ MySQLClientConfig mysqlClientConfig = 1;
+}
+
+message MySQLClientConfig{
+ //mysql address,like localhost:3306
+ string addr = 1;
+ //database name
+ string database = 2;
+ //user name
+ string userName = 3;
+}
+
// MapperInfo is the information of mapper.
message MapperInfo {
// name of the mapper.
diff --git a/pkg/apis/dmi/v1beta1/api_grpc.pb.go b/pkg/apis/dmi/v1beta1/api_grpc.pb.go
index 092fdb34f..f4c8437b2 100644
--- a/pkg/apis/dmi/v1beta1/api_grpc.pb.go
+++ b/pkg/apis/dmi/v1beta1/api_grpc.pb.go
@@ -18,7 +18,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
-// - protoc v3.19.4
+// - protoc v3.6.1
// source: api.proto
package v1beta1
diff --git a/pkg/util/dummy_device.go b/pkg/util/dummy_device.go
new file mode 100644
index 000000000..beb3f52e3
--- /dev/null
+++ b/pkg/util/dummy_device.go
@@ -0,0 +1,102 @@
+/*
+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 util
+
+import (
+ "fmt"
+ "net"
+
+ "github.com/vishvananda/netlink"
+ "golang.org/x/sys/unix"
+ "k8s.io/klog/v2"
+)
+
+type DummyDeviceManager struct {
+ netlink.Handle
+}
+
+func NewDummyDeviceManager() *DummyDeviceManager {
+ return &DummyDeviceManager{netlink.Handle{}}
+}
+
+// EnsureDummyDevice ensure dummy device exist
+func (d *DummyDeviceManager) EnsureDummyDevice(devName string) (bool, error) {
+ _, err := d.LinkByName(devName)
+ if err == nil {
+ // found dummy device
+ return true, nil
+ }
+ klog.Warningf("No dummy device %s, link it", devName)
+ dummy := &netlink.Dummy{
+ LinkAttrs: netlink.LinkAttrs{Name: devName},
+ }
+ return false, d.LinkAdd(dummy)
+}
+
+// DeleteDummyDevice delete dummy device.
+func (d *DummyDeviceManager) DeleteDummyDevice(devName string) error {
+ link, err := d.LinkByName(devName)
+ if err != nil {
+ _, ok := err.(netlink.LinkNotFoundError)
+ if ok {
+ return nil
+ }
+ return fmt.Errorf("failed to delete a non-exist dummy device %s: %v", devName, err)
+ }
+ dummy, ok := link.(*netlink.Dummy)
+ if !ok {
+ return fmt.Errorf("expect dummy device, got device type: %s", link.Type())
+ }
+ return d.LinkDel(dummy)
+}
+
+// ListBindAddress list all IP addresses which are bound in a given interface
+func (d *DummyDeviceManager) ListBindAddress(devName string) ([]string, error) {
+ dev, err := d.LinkByName(devName)
+ if err != nil {
+ return nil, fmt.Errorf("failed to get interface: %s, err: %v", devName, err)
+ }
+ addrs, err := d.AddrList(dev, 0)
+ if err != nil {
+ return nil, fmt.Errorf("failed to list bound address of interface %s, err: %v", devName, err)
+ }
+ var ips []string
+ for _, addr := range addrs {
+ ips = append(ips, addr.IP.String())
+ }
+ return ips, nil
+}
+
+// EnsureAddressBind checks if address is bound to the interface, if not, binds it. If the address is already bound, return true.
+func (d *DummyDeviceManager) EnsureAddressBind(address, devName string) (bool, error) {
+ dev, err := d.LinkByName(devName)
+ if err != nil {
+ return false, fmt.Errorf("failed to get interface: %s, err: %v", devName, err)
+ }
+ addr := net.ParseIP(address)
+ if addr == nil {
+ return false, fmt.Errorf("failed to parse ip address: %s", address)
+ }
+ if err := d.AddrAdd(dev, &netlink.Addr{IPNet: netlink.NewIPNet(addr)}); err != nil {
+ // "EEXIST" will be returned if the address is already bound to device
+ if err == unix.EEXIST {
+ return true, nil
+ }
+ return false, fmt.Errorf("failed to bind address %s to interface %s, err: %v", address, devName, err)
+ }
+ return false, nil
+}
diff --git a/staging/src/github.com/kubeedge/beehive/pkg/core/model/message.go b/staging/src/github.com/kubeedge/beehive/pkg/core/model/message.go
index 47404e4e3..57ce2a5e9 100644
--- a/staging/src/github.com/kubeedge/beehive/pkg/core/model/message.go
+++ b/staging/src/github.com/kubeedge/beehive/pkg/core/model/message.go
@@ -36,6 +36,9 @@ const (
ResourceTypeRuleStatus = "rulestatus"
ResourceTypeLease = "lease"
ResourceTypeSaAccess = "serviceaccountaccess"
+ ResourceTypeCSR = "certificatesigningrequest"
+
+ ResourceTypeK8sCA = "k8s/ca.crt"
)
// Message struct
diff --git a/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/data/dbmethod/mysql/client.go b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/data/dbmethod/mysql/client.go
new file mode 100644
index 000000000..e2e9a2598
--- /dev/null
+++ b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/data/dbmethod/mysql/client.go
@@ -0,0 +1,108 @@
+/*
+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 mysql
+
+import (
+ "database/sql"
+ "encoding/json"
+ "fmt"
+ "os"
+ "time"
+
+ _ "github.com/go-sql-driver/mysql"
+ "k8s.io/klog/v2"
+
+ "github.com/kubeedge/mapper-framework/pkg/common"
+)
+
+var (
+ DB *sql.DB
+)
+
+type DataBaseConfig struct {
+ MySQLClientConfig *MySQLClientConfig `json:"mysqlClientConfig"`
+}
+
+type MySQLClientConfig struct {
+ Addr string `json:"addr,omitempty"`
+ Database string `json:"database,omitempty"`
+ UserName string `json:"userName,omitempty"`
+}
+
+func NewDataBaseClient(config json.RawMessage) (*DataBaseConfig, error) {
+ configdata := new(MySQLClientConfig)
+ err := json.Unmarshal(config, configdata)
+ if err != nil {
+ return nil, err
+ }
+ return &DataBaseConfig{
+ MySQLClientConfig: configdata,
+ }, nil
+}
+
+func (d *DataBaseConfig) InitDbClient() error {
+ password := os.Getenv("PASSWORD")
+ usrName := d.MySQLClientConfig.UserName
+ addr := d.MySQLClientConfig.Addr
+ dataBase := d.MySQLClientConfig.Database
+ dataSourceName := fmt.Sprintf("%s:%s@tcp(%s)/%s", usrName, password, addr, dataBase)
+ var err error
+ DB, err = sql.Open("mysql", dataSourceName)
+ if err != nil {
+ return fmt.Errorf("connection to %s of mysql faild with err:%v", dataBase, err)
+ }
+
+ return nil
+}
+
+func (d *DataBaseConfig) CloseSession() {
+ err := DB.Close()
+ if err != nil {
+ klog.Errorf("close mysql failed with err:%v", err)
+ }
+}
+
+func (d *DataBaseConfig) AddData(data *common.DataModel) error {
+ deviceName := data.DeviceName
+ propertyName := data.PropertyName
+ namespace := data.Namespace
+ tableName := namespace + "/" + deviceName + "/" + propertyName
+ datatime := time.Unix(data.TimeStamp/1e3, 0).Format("2006-01-02 15:04:05")
+
+ createTable := fmt.Sprintf("CREATE TABLE IF NOT EXISTS `%s` (id INT AUTO_INCREMENT PRIMARY KEY, ts DATETIME NOT NULL,field TEXT)", tableName)
+ _, err := DB.Exec(createTable)
+ if err != nil {
+ return fmt.Errorf("create tabe into mysql failed with err:%v", err)
+ }
+
+ stmt, err := DB.Prepare(fmt.Sprintf("INSERT INTO `%s` (ts,field) VALUES (?,?)", tableName))
+ if err != nil {
+ return fmt.Errorf("prepare parament failed with err:%v", err)
+ }
+ defer func(stmt *sql.Stmt) {
+ err := stmt.Close()
+ if err != nil {
+ klog.Errorf("close mysql's statement failed with err:%v", err)
+ }
+ }(stmt)
+ _, err = stmt.Exec(datatime, data.Value)
+ if err != nil {
+ return fmt.Errorf("insert data into msyql failed with err:%v", err)
+ }
+
+ return nil
+}
diff --git a/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/data/dbmethod/mysql/handler.go b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/data/dbmethod/mysql/handler.go
new file mode 100644
index 000000000..d8b7afe80
--- /dev/null
+++ b/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/data/dbmethod/mysql/handler.go
@@ -0,0 +1,73 @@
+/*
+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 mysql
+
+import (
+ "context"
+ "time"
+
+ "k8s.io/klog/v2"
+
+ "github.com/kubeedge/Template/driver"
+ "github.com/kubeedge/mapper-framework/pkg/common"
+)
+
+func DataHandler(ctx context.Context, twin *common.Twin, client *driver.CustomizedClient, visitorConfig *driver.VisitorConfig, dataModel *common.DataModel) {
+ dbConfig, err := NewDataBaseClient(twin.Property.PushMethod.DBMethod.DBConfig.MySQLClientConfig)
+ if err != nil {
+ klog.Errorf("new database client error: %v", err)
+ return
+ }
+ err = dbConfig.InitDbClient()
+ if err != nil {
+ klog.Errorf("init redis database client err: %v", err)
+ return
+ }
+ reportCycle := time.Duration(twin.Property.ReportCycle)
+ if reportCycle == 0 {
+ reportCycle = common.DefaultReportCycle
+ }
+ 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)
+ if err != nil {
+ klog.Errorf("mysql database add data error: %v", err)
+ return
+ }
+ case <-ctx.Done():
+ dbConfig.CloseSession()
+ return
+ }
+ }
+ }()
+}
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 45f650a3a..be274770c 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
@@ -14,6 +14,7 @@ import (
"k8s.io/klog/v2"
dbInflux "github.com/kubeedge/Template/data/dbmethod/influxdb2"
+ dbMysql "github.com/kubeedge/Template/data/dbmethod/mysql"
dbRedis "github.com/kubeedge/Template/data/dbmethod/redis"
dbTdengine "github.com/kubeedge/Template/data/dbmethod/tdengine"
httpMethod "github.com/kubeedge/Template/data/publish/http"
@@ -137,12 +138,12 @@ func dataHandler(ctx context.Context, dev *driver.CustomizedDev) {
go twinData.Run(ctx)
// handle push method
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))
+ dataModel := common.NewDataModel(dev.Instance.Name, twin.Property.PropertyName, dev.Instance.Namespace, common.WithType(twin.ObservedDesired.Metadata.Type))
pushHandler(ctx, &twin, dev.CustomizedClient, &visitorConfig, dataModel)
}
// handle database
if twin.Property.PushMethod.DBMethod.DBMethodName != "" {
- dataModel := common.NewDataModel(dev.Instance.Name, twin.Property.PropertyName, common.WithType(twin.ObservedDesired.Metadata.Type))
+ dataModel := common.NewDataModel(dev.Instance.Name, twin.Property.PropertyName, dev.Instance.Namespace, common.WithType(twin.ObservedDesired.Metadata.Type))
dbHandler(ctx, &twin, dev.CustomizedClient, &visitorConfig, dataModel)
switch twin.Property.PushMethod.DBMethod.DBMethodName {
// TODO add more database
@@ -152,6 +153,8 @@ func dataHandler(ctx context.Context, dev *driver.CustomizedDev) {
dbRedis.DataHandler(ctx, &twin, dev.CustomizedClient, &visitorConfig, dataModel)
case "tdengine":
dbTdengine.DataHandler(ctx, &twin, dev.CustomizedClient, &visitorConfig, dataModel)
+ case "mysql":
+ dbMysql.DataHandler(ctx, &twin, dev.CustomizedClient, &visitorConfig, dataModel)
}
}
}
@@ -221,6 +224,9 @@ func dbHandler(ctx context.Context, twin *common.Twin, client *driver.Customized
case "tdengine":
dbTdengine.DataHandler(ctx, twin, client, visitorConfig, dataModel)
+
+ case "mysql":
+ dbMysql.DataHandler(ctx, twin, client, visitorConfig, dataModel)
}
}
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 69e3d6025..9f988757a 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
@@ -5,11 +5,12 @@ go 1.20
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 v1.16.0-beta.0
- github.com/kubeedge/mapper-framework v0.0.0-20240119021034-e7755b2f421c
+ github.com/kubeedge/kubeedge v0.0.0
+ github.com/kubeedge/mapper-framework v0.0.0
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
@@ -37,3 +38,8 @@ require (
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect
)
+
+replace (
+ github.com/kubeedge/kubeedge => ../../../../../../kubeedge
+ github.com/kubeedge/mapper-framework => ../mapper-framework
+)
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 23d3b42fd..7ce489094 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
@@ -19,6 +19,8 @@ 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-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=
@@ -43,10 +45,6 @@ github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/kubeedge/kubeedge v1.16.0-beta.0 h1:wMImL1r1PqwBCLCrZlEHJ83o+h4u2yFOABktHFDeDyQ=
-github.com/kubeedge/kubeedge v1.16.0-beta.0/go.mod h1:NbL/UWB68wuY5itB/0jMtDyI04Q+Iw2CJshOQz/WJS4=
-github.com/kubeedge/mapper-framework v0.0.0-20240119021034-e7755b2f421c h1:MgUJkEWzYl29dLDDLPshKEoUwqmJexCJlJTbLQQWneM=
-github.com/kubeedge/mapper-framework v0.0.0-20240119021034-e7755b2f421c/go.mod h1:at9JLS7mVPMBAvzlRMfn2E4p4ReoVv9/yQ2oYU86t00=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
diff --git a/staging/src/github.com/kubeedge/mapper-framework/go.mod b/staging/src/github.com/kubeedge/mapper-framework/go.mod
index 84b0d95fd..975af431a 100644
--- a/staging/src/github.com/kubeedge/mapper-framework/go.mod
+++ b/staging/src/github.com/kubeedge/mapper-framework/go.mod
@@ -6,11 +6,11 @@ require (
github.com/avast/retry-go v3.0.0+incompatible
github.com/golang/protobuf v1.5.3
github.com/gorilla/mux v1.8.0
- github.com/kubeedge/kubeedge v1.15.0-beta.0.0.20240118080528-4237f6f6805e
+ github.com/kubeedge/kubeedge v0.0.0
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace
- golang.org/x/net v0.17.0 // indirect
- google.golang.org/grpc v1.53.0
- google.golang.org/protobuf v1.30.0
+ golang.org/x/net v0.19.0 // indirect
+ google.golang.org/grpc v1.56.3
+ google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/klog/v2 v2.100.1
)
@@ -18,8 +18,10 @@ require (
require (
github.com/go-logr/logr v1.2.4 // indirect
github.com/kr/pretty v0.1.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
+ golang.org/x/sys v0.15.0 // indirect
+ golang.org/x/text v0.14.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
)
+
+replace github.com/kubeedge/kubeedge => ../../../../../../kubeedge
diff --git a/staging/src/github.com/kubeedge/mapper-framework/go.sum b/staging/src/github.com/kubeedge/mapper-framework/go.sum
index 123b25773..fec1fa95c 100644
--- a/staging/src/github.com/kubeedge/mapper-framework/go.sum
+++ b/staging/src/github.com/kubeedge/mapper-framework/go.sum
@@ -16,27 +16,25 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/kubeedge/kubeedge v1.15.0-beta.0.0.20240118080528-4237f6f6805e h1:SQD/Z9/z75tQpnZKGs179ugFywJH2tj0bAKlDh0M9Gs=
-github.com/kubeedge/kubeedge v1.15.0-beta.0.0.20240118080528-4237f6f6805e/go.mod h1:NbL/UWB68wuY5itB/0jMtDyI04Q+Iw2CJshOQz/WJS4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace h1:9PNP1jnUjRhfmGMlkXHjYPishpcw4jpSt/V/xYY3FMA=
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
-golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
-golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
-golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
-golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
-golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
+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/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 v0.0.0-20230306155012-7f2fa6fef1f4 h1:DdoeryqhaXp1LtT/emMP1BRJPHHKFi5akj/nbx/zNTA=
-google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s=
-google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc=
-google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw=
+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.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
-google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
+google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
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/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/staging/src/github.com/kubeedge/mapper-framework/pkg/common/configmaptype.go b/staging/src/github.com/kubeedge/mapper-framework/pkg/common/configmaptype.go
index c1018ec5f..4f444733c 100644
--- a/staging/src/github.com/kubeedge/mapper-framework/pkg/common/configmaptype.go
+++ b/staging/src/github.com/kubeedge/mapper-framework/pkg/common/configmaptype.go
@@ -94,6 +94,7 @@ type DBConfig struct {
Influxdb2DataConfig json.RawMessage `json:"influxdb2DataConfig"`
RedisClientConfig json.RawMessage `json:"redisClientConfig"`
TDEngineClientConfig json.RawMessage `json:"TDEngineClientConfig"`
+ MySQLClientConfig json.RawMessage `json:"mysqlClientConfig"`
}
// Metadata is the metadata for data.
diff --git a/staging/src/github.com/kubeedge/mapper-framework/pkg/common/datamodel.go b/staging/src/github.com/kubeedge/mapper-framework/pkg/common/datamodel.go
index effd2739d..9bbe0759d 100644
--- a/staging/src/github.com/kubeedge/mapper-framework/pkg/common/datamodel.go
+++ b/staging/src/github.com/kubeedge/mapper-framework/pkg/common/datamodel.go
@@ -5,6 +5,7 @@ type DataModel struct {
// TODO DataModel is standardized data, need add field
DeviceName string
PropertyName string
+ Namespace string
Value string
Type string
@@ -44,10 +45,11 @@ func WithTimeStamp(timeStamp int64) Option {
}
}
-func NewDataModel(deviceName string, propertyName string, options ...Option) *DataModel {
+func NewDataModel(deviceName string, propertyName string, namespace string, options ...Option) *DataModel {
dataModel := &DataModel{
DeviceName: deviceName,
PropertyName: propertyName,
+ Namespace: namespace,
TimeStamp: getTimestamp(),
}
for _, option := range options {
diff --git a/staging/src/github.com/kubeedge/mapper-framework/pkg/dmi-api/api.pb.go b/staging/src/github.com/kubeedge/mapper-framework/pkg/dmi-api/api.pb.go
deleted file mode 100644
index 1a89812c6..000000000
--- a/staging/src/github.com/kubeedge/mapper-framework/pkg/dmi-api/api.pb.go
+++ /dev/null
@@ -1,3572 +0,0 @@
-/*
-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. DO NOT EDIT.
-// versions:
-// protoc-gen-go v1.31.0
-// protoc v3.20.3
-// source: api.proto
-
-package v1beta1
-
-import (
- "google.golang.org/grpc"
- 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"
-)
-
-const (
- // Verify that this generated code is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
- // Verify that runtime/protoimpl is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
-)
-
-type MapperRegisterRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // The flag to show how device manager returns.
- // True means device manager should return the device list in the response.
- // False means device manager should just return nothing.
- WithData bool `protobuf:"varint,1,opt,name=withData,proto3" json:"withData,omitempty"`
- // Mapper information to be registered to the device manager.
- Mapper *MapperInfo `protobuf:"bytes,2,opt,name=mapper,proto3" json:"mapper,omitempty"`
-}
-
-func (x *MapperRegisterRequest) Reset() {
- *x = MapperRegisterRequest{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[0]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *MapperRegisterRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*MapperRegisterRequest) ProtoMessage() {}
-
-func (x *MapperRegisterRequest) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[0]
- 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 MapperRegisterRequest.ProtoReflect.Descriptor instead.
-func (*MapperRegisterRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{0}
-}
-
-func (x *MapperRegisterRequest) GetWithData() bool {
- if x != nil {
- return x.WithData
- }
- return false
-}
-
-func (x *MapperRegisterRequest) GetMapper() *MapperInfo {
- if x != nil {
- return x.Mapper
- }
- return nil
-}
-
-type MapperRegisterResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // List of device models which the mapper maintains.
- ModelList []*DeviceModel `protobuf:"bytes,1,rep,name=modelList,proto3" json:"modelList,omitempty"`
- // List of devices which the mapper maintains.
- DeviceList []*Device `protobuf:"bytes,2,rep,name=deviceList,proto3" json:"deviceList,omitempty"`
-}
-
-func (x *MapperRegisterResponse) Reset() {
- *x = MapperRegisterResponse{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[1]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *MapperRegisterResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*MapperRegisterResponse) ProtoMessage() {}
-
-func (x *MapperRegisterResponse) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[1]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use MapperRegisterResponse.ProtoReflect.Descriptor instead.
-func (*MapperRegisterResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{1}
-}
-
-func (x *MapperRegisterResponse) GetModelList() []*DeviceModel {
- if x != nil {
- return x.ModelList
- }
- return nil
-}
-
-func (x *MapperRegisterResponse) GetDeviceList() []*Device {
- if x != nil {
- return x.DeviceList
- }
- return nil
-}
-
-// DeviceModel specifies the information of a device model.
-type DeviceModel struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // Name of a device model.
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Specification of a device model.
- Spec *DeviceModelSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"`
-}
-
-func (x *DeviceModel) Reset() {
- *x = DeviceModel{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[2]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *DeviceModel) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*DeviceModel) ProtoMessage() {}
-
-func (x *DeviceModel) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[2]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use DeviceModel.ProtoReflect.Descriptor instead.
-func (*DeviceModel) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{2}
-}
-
-func (x *DeviceModel) GetName() string {
- if x != nil {
- return x.Name
- }
- return ""
-}
-
-func (x *DeviceModel) GetSpec() *DeviceModelSpec {
- if x != nil {
- return x.Spec
- }
- return nil
-}
-
-// DeviceModelSpec is the specification of a device model.
-type DeviceModelSpec struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // The properties provided by the device of this device model.
- Properties []*ModelProperty `protobuf:"bytes,1,rep,name=properties,proto3" json:"properties,omitempty"`
- // The commands executed by the device of this device model.
- Commands []*DeviceCommand `protobuf:"bytes,2,rep,name=commands,proto3" json:"commands,omitempty"`
-}
-
-func (x *DeviceModelSpec) Reset() {
- *x = DeviceModelSpec{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[3]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *DeviceModelSpec) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*DeviceModelSpec) ProtoMessage() {}
-
-func (x *DeviceModelSpec) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[3]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use DeviceModelSpec.ProtoReflect.Descriptor instead.
-func (*DeviceModelSpec) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{3}
-}
-
-func (x *DeviceModelSpec) GetProperties() []*ModelProperty {
- if x != nil {
- return x.Properties
- }
- return nil
-}
-
-func (x *DeviceModelSpec) GetCommands() []*DeviceCommand {
- if x != nil {
- return x.Commands
- }
- return nil
-}
-
-// ModelProperty is the property of a device.
-type ModelProperty struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // The name of this property.
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // The description of this property.
- Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
- // The specific type of this property.
- Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
- // The access mode of this property, ReadOnly or ReadWrite.
- AccessMode string `protobuf:"bytes,4,opt,name=accessMode,proto3" json:"accessMode,omitempty"`
- // The minimum value of this property.
- Minimum string `protobuf:"bytes,5,opt,name=minimum,proto3" json:"minimum,omitempty"`
- // The maximum value of this property.
- Maximum string `protobuf:"bytes,6,opt,name=maximum,proto3" json:"maximum,omitempty"`
- // The unit of this property.
- Unit string `protobuf:"bytes,7,opt,name=unit,proto3" json:"unit,omitempty"`
-}
-
-func (x *ModelProperty) Reset() {
- *x = ModelProperty{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[4]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *ModelProperty) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ModelProperty) ProtoMessage() {}
-
-func (x *ModelProperty) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[4]
- 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 ModelProperty.ProtoReflect.Descriptor instead.
-func (*ModelProperty) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{4}
-}
-
-func (x *ModelProperty) GetName() string {
- if x != nil {
- return x.Name
- }
- return ""
-}
-
-func (x *ModelProperty) GetDescription() string {
- if x != nil {
- return x.Description
- }
- return ""
-}
-
-func (x *ModelProperty) GetType() string {
- if x != nil {
- return x.Type
- }
- return ""
-}
-
-func (x *ModelProperty) GetAccessMode() string {
- if x != nil {
- return x.AccessMode
- }
- return ""
-}
-
-func (x *ModelProperty) GetMinimum() string {
- if x != nil {
- return x.Minimum
- }
- return ""
-}
-
-func (x *ModelProperty) GetMaximum() string {
- if x != nil {
- return x.Maximum
- }
- return ""
-}
-
-func (x *ModelProperty) GetUnit() string {
- if x != nil {
- return x.Unit
- }
- return ""
-}
-
-// DeviceCommond is the description of a command which the device supports.
-type DeviceCommand struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // Name of the command.
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Url of the command to access.
- Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
- // Method of the command.
- Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"`
- // Status code list which the command can return.
- StatusCode []string `protobuf:"bytes,4,rep,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
- // Parameter list which the command carries.
- Parameters []string `protobuf:"bytes,5,rep,name=parameters,proto3" json:"parameters,omitempty"`
- // Response examples of the command.
- Response []byte `protobuf:"bytes,6,opt,name=response,proto3" json:"response,omitempty"`
-}
-
-func (x *DeviceCommand) Reset() {
- *x = DeviceCommand{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[5]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *DeviceCommand) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*DeviceCommand) ProtoMessage() {}
-
-func (x *DeviceCommand) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[5]
- 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 DeviceCommand.ProtoReflect.Descriptor instead.
-func (*DeviceCommand) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{5}
-}
-
-func (x *DeviceCommand) GetName() string {
- if x != nil {
- return x.Name
- }
- return ""
-}
-
-func (x *DeviceCommand) GetUrl() string {
- if x != nil {
- return x.Url
- }
- return ""
-}
-
-func (x *DeviceCommand) GetMethod() string {
- if x != nil {
- return x.Method
- }
- return ""
-}
-
-func (x *DeviceCommand) GetStatusCode() []string {
- if x != nil {
- return x.StatusCode
- }
- return nil
-}
-
-func (x *DeviceCommand) GetParameters() []string {
- if x != nil {
- return x.Parameters
- }
- return nil
-}
-
-func (x *DeviceCommand) GetResponse() []byte {
- if x != nil {
- return x.Response
- }
- return nil
-}
-
-// Device is the description of a device instance.
-type Device struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // Name of the device.
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Specification of the device.
- Spec *DeviceSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"`
- // Status of the device.
- Status *DeviceStatus `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
-}
-
-func (x *Device) Reset() {
- *x = Device{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[6]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *Device) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Device) ProtoMessage() {}
-
-func (x *Device) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[6]
- 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 Device.ProtoReflect.Descriptor instead.
-func (*Device) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{6}
-}
-
-func (x *Device) GetName() string {
- if x != nil {
- return x.Name
- }
- return ""
-}
-
-func (x *Device) GetSpec() *DeviceSpec {
- if x != nil {
- return x.Spec
- }
- return nil
-}
-
-func (x *Device) GetStatus() *DeviceStatus {
- if x != nil {
- return x.Status
- }
- return nil
-}
-
-// DeviceSpec is the specification of the device.
-type DeviceSpec struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // The device model which the device references.
- DeviceModelReference string `protobuf:"bytes,1,opt,name=deviceModelReference,proto3" json:"deviceModelReference,omitempty"`
- // The specific config of the protocol to access to the device.
- Protocol *ProtocolConfig `protobuf:"bytes,2,opt,name=protocol,proto3" json:"protocol,omitempty"`
- // List of properties which describe the device properties.
- Properties []*DeviceProperty `protobuf:"bytes,3,rep,name=properties,proto3" json:"properties,omitempty"`
-}
-
-func (x *DeviceSpec) Reset() {
- *x = DeviceSpec{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[7]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *DeviceSpec) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*DeviceSpec) ProtoMessage() {}
-
-func (x *DeviceSpec) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[7]
- 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 DeviceSpec.ProtoReflect.Descriptor instead.
-func (*DeviceSpec) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{7}
-}
-
-func (x *DeviceSpec) GetDeviceModelReference() string {
- if x != nil {
- return x.DeviceModelReference
- }
- return ""
-}
-
-func (x *DeviceSpec) GetProtocol() *ProtocolConfig {
- if x != nil {
- return x.Protocol
- }
- return nil
-}
-
-func (x *DeviceSpec) GetProperties() []*DeviceProperty {
- if x != nil {
- return x.Properties
- }
- return nil
-}
-
-// DeviceProperty describes the specifics all the properties of the device.
-type DeviceProperty struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // The device property name to be accessed. It must be unique.
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // the desired value of the property configured by device manager.
- Desired *TwinProperty `protobuf:"bytes,2,opt,name=desired,proto3" json:"desired,omitempty"`
- // Visitors are intended to be consumed by device mappers which connect to devices
- // and collect data / perform actions on the device.
- Visitors *VisitorConfig `protobuf:"bytes,3,opt,name=visitors,proto3" json:"visitors,omitempty"`
- // Define how frequent mapper will report the value.
- ReportCycle int64 `protobuf:"varint,4,opt,name=reportCycle,proto3" json:"reportCycle,omitempty"`
- // Define how frequent mapper will collect from device.
- CollectCycle int64 `protobuf:"varint,5,opt,name=collectCycle,proto3" json:"collectCycle,omitempty"`
- // whether be reported to the cloud
- ReportToCloud bool `protobuf:"varint,6,opt,name=reportToCloud,proto3" json:"reportToCloud,omitempty"`
- // PushMethod represents the protocol used to push data,
- PushMethod *PushMethod `protobuf:"bytes,7,opt,name=pushMethod,proto3" json:"pushMethod,omitempty"`
-}
-
-func (x *DeviceProperty) Reset() {
- *x = DeviceProperty{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[8]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *DeviceProperty) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*DeviceProperty) ProtoMessage() {}
-
-func (x *DeviceProperty) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[8]
- 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 DeviceProperty.ProtoReflect.Descriptor instead.
-func (*DeviceProperty) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{8}
-}
-
-func (x *DeviceProperty) GetName() string {
- if x != nil {
- return x.Name
- }
- return ""
-}
-
-func (x *DeviceProperty) GetDesired() *TwinProperty {
- if x != nil {
- return x.Desired
- }
- return nil
-}
-
-func (x *DeviceProperty) GetVisitors() *VisitorConfig {
- if x != nil {
- return x.Visitors
- }
- return nil
-}
-
-func (x *DeviceProperty) GetReportCycle() int64 {
- if x != nil {
- return x.ReportCycle
- }
- return 0
-}
-
-func (x *DeviceProperty) GetCollectCycle() int64 {
- if x != nil {
- return x.CollectCycle
- }
- return 0
-}
-
-func (x *DeviceProperty) GetReportToCloud() bool {
- if x != nil {
- return x.ReportToCloud
- }
- return false
-}
-
-func (x *DeviceProperty) GetPushMethod() *PushMethod {
- if x != nil {
- return x.PushMethod
- }
- return nil
-}
-
-// ProtocolConfig is the specific config of the protocol to access to the device.
-type ProtocolConfig struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // the name of the customized protocol.
- ProtocolName string `protobuf:"bytes,1,opt,name=protocolName,proto3" json:"protocolName,omitempty"`
- // the config data of the customized protocol.
- ConfigData *CustomizedValue `protobuf:"bytes,2,opt,name=configData,proto3" json:"configData,omitempty"`
-}
-
-func (x *ProtocolConfig) Reset() {
- *x = ProtocolConfig{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[9]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *ProtocolConfig) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ProtocolConfig) ProtoMessage() {}
-
-func (x *ProtocolConfig) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[9]
- 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 ProtocolConfig.ProtoReflect.Descriptor instead.
-func (*ProtocolConfig) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{9}
-}
-
-func (x *ProtocolConfig) GetProtocolName() string {
- if x != nil {
- return x.ProtocolName
- }
- return ""
-}
-
-func (x *ProtocolConfig) GetConfigData() *CustomizedValue {
- if x != nil {
- return x.ConfigData
- }
- return nil
-}
-
-// the visitor to collect the properties of the device of customized protocol.
-type VisitorConfig struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // the name of the customized protocol.
- ProtocolName string `protobuf:"bytes,1,opt,name=protocolName,proto3" json:"protocolName,omitempty"`
- // the config data of the customized protocol.
- ConfigData *CustomizedValue `protobuf:"bytes,2,opt,name=configData,proto3" json:"configData,omitempty"`
-}
-
-func (x *VisitorConfig) Reset() {
- *x = VisitorConfig{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[10]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *VisitorConfig) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*VisitorConfig) ProtoMessage() {}
-
-func (x *VisitorConfig) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[10]
- 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 VisitorConfig.ProtoReflect.Descriptor instead.
-func (*VisitorConfig) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{10}
-}
-
-func (x *VisitorConfig) GetProtocolName() string {
- if x != nil {
- return x.ProtocolName
- }
- return ""
-}
-
-func (x *VisitorConfig) GetConfigData() *CustomizedValue {
- if x != nil {
- return x.ConfigData
- }
- return nil
-}
-
-// CustomizedValue is the customized value for developers.
-type CustomizedValue struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // data is the customized value and it can be any form.
- 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() {
- *x = CustomizedValue{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[11]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *CustomizedValue) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CustomizedValue) ProtoMessage() {}
-
-func (x *CustomizedValue) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[11]
- 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 CustomizedValue.ProtoReflect.Descriptor instead.
-func (*CustomizedValue) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{11}
-}
-
-func (x *CustomizedValue) GetData() map[string]*anypb.Any {
- if x != nil {
- return x.Data
- }
- return nil
-}
-
-type PushMethod struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- 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"`
-}
-
-func (x *PushMethod) Reset() {
- *x = PushMethod{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[12]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *PushMethod) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*PushMethod) ProtoMessage() {}
-
-func (x *PushMethod) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[12]
- 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 PushMethod.ProtoReflect.Descriptor instead.
-func (*PushMethod) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{12}
-}
-
-func (x *PushMethod) GetHttp() *PushMethodHTTP {
- if x != nil {
- return x.Http
- }
- return nil
-}
-
-func (x *PushMethod) GetMqtt() *PushMethodMQTT {
- if x != nil {
- return x.Mqtt
- }
- return nil
-}
-
-func (x *PushMethod) GetDBMethod() *DBMethod {
- if x != nil {
- return x.DBMethod
- }
- return nil
-}
-
-type PushMethodHTTP struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"`
- Port int64 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`
- Requestpath string `protobuf:"bytes,3,opt,name=requestpath,proto3" json:"requestpath,omitempty"`
- Timeout int64 `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"`
-}
-
-func (x *PushMethodHTTP) Reset() {
- *x = PushMethodHTTP{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[13]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *PushMethodHTTP) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*PushMethodHTTP) ProtoMessage() {}
-
-func (x *PushMethodHTTP) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[13]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use PushMethodHTTP.ProtoReflect.Descriptor instead.
-func (*PushMethodHTTP) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{13}
-}
-
-func (x *PushMethodHTTP) GetHostname() string {
- if x != nil {
- return x.Hostname
- }
- return ""
-}
-
-func (x *PushMethodHTTP) GetPort() int64 {
- if x != nil {
- return x.Port
- }
- return 0
-}
-
-func (x *PushMethodHTTP) GetRequestpath() string {
- if x != nil {
- return x.Requestpath
- }
- return ""
-}
-
-func (x *PushMethodHTTP) GetTimeout() int64 {
- if x != nil {
- return x.Timeout
- }
- return 0
-}
-
-type PushMethodMQTT struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // broker address, like mqtt://127.0.0.1:1883
- Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
- // publish topic for mqtt
- Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"`
- // qos of mqtt publish param
- Qos int32 `protobuf:"varint,3,opt,name=qos,proto3" json:"qos,omitempty"`
- // Is the message retained
- Retained bool `protobuf:"varint,4,opt,name=retained,proto3" json:"retained,omitempty"`
-}
-
-func (x *PushMethodMQTT) Reset() {
- *x = PushMethodMQTT{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[14]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *PushMethodMQTT) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*PushMethodMQTT) ProtoMessage() {}
-
-func (x *PushMethodMQTT) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[14]
- 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 PushMethodMQTT.ProtoReflect.Descriptor instead.
-func (*PushMethodMQTT) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{14}
-}
-
-func (x *PushMethodMQTT) GetAddress() string {
- if x != nil {
- return x.Address
- }
- return ""
-}
-
-func (x *PushMethodMQTT) GetTopic() string {
- if x != nil {
- return x.Topic
- }
- return ""
-}
-
-func (x *PushMethodMQTT) GetQos() int32 {
- if x != nil {
- return x.Qos
- }
- return 0
-}
-
-func (x *PushMethodMQTT) GetRetained() bool {
- if x != nil {
- return x.Retained
- }
- return false
-}
-
-type DBMethod struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // the config of database .
- Influxdb2 *DBMethodInfluxdb2 `protobuf:"bytes,1,opt,name=influxdb2,proto3" json:"influxdb2,omitempty"`
- Redis *DBMethodRedis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"`
- Tdengine *DBMethodTDEngine `protobuf:"bytes,3,opt,name=tdengine,proto3" json:"tdengine,omitempty"`
-}
-
-func (x *DBMethod) Reset() {
- *x = DBMethod{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[15]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *DBMethod) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*DBMethod) ProtoMessage() {}
-
-func (x *DBMethod) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[15]
- 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 DBMethod.ProtoReflect.Descriptor instead.
-func (*DBMethod) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{15}
-}
-
-func (x *DBMethod) GetInfluxdb2() *DBMethodInfluxdb2 {
- if x != nil {
- return x.Influxdb2
- }
- return nil
-}
-
-func (x *DBMethod) GetRedis() *DBMethodRedis {
- if x != nil {
- return x.Redis
- }
- return nil
-}
-
-func (x *DBMethod) GetTdengine() *DBMethodTDEngine {
- if x != nil {
- return x.Tdengine
- }
- return nil
-}
-
-type DBMethodInfluxdb2 struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // the config of influx database.
- Influxdb2ClientConfig *Influxdb2ClientConfig `protobuf:"bytes,1,opt,name=influxdb2ClientConfig,proto3" json:"influxdb2ClientConfig,omitempty"`
- Influxdb2DataConfig *Influxdb2DataConfig `protobuf:"bytes,2,opt,name=influxdb2DataConfig,proto3" json:"influxdb2DataConfig,omitempty"`
-}
-
-func (x *DBMethodInfluxdb2) Reset() {
- *x = DBMethodInfluxdb2{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[16]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *DBMethodInfluxdb2) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*DBMethodInfluxdb2) ProtoMessage() {}
-
-func (x *DBMethodInfluxdb2) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[16]
- 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 DBMethodInfluxdb2.ProtoReflect.Descriptor instead.
-func (*DBMethodInfluxdb2) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{16}
-}
-
-func (x *DBMethodInfluxdb2) GetInfluxdb2ClientConfig() *Influxdb2ClientConfig {
- if x != nil {
- return x.Influxdb2ClientConfig
- }
- return nil
-}
-
-func (x *DBMethodInfluxdb2) GetInfluxdb2DataConfig() *Influxdb2DataConfig {
- if x != nil {
- return x.Influxdb2DataConfig
- }
- return nil
-}
-
-type Influxdb2DataConfig struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // data config when push data to influx
- Measurement string `protobuf:"bytes,1,opt,name=measurement,proto3" json:"measurement,omitempty"`
- Tag map[string]string `protobuf:"bytes,2,rep,name=tag,proto3" json:"tag,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 *Influxdb2DataConfig) Reset() {
- *x = Influxdb2DataConfig{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[17]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *Influxdb2DataConfig) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Influxdb2DataConfig) ProtoMessage() {}
-
-func (x *Influxdb2DataConfig) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[17]
- 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 Influxdb2DataConfig.ProtoReflect.Descriptor instead.
-func (*Influxdb2DataConfig) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{17}
-}
-
-func (x *Influxdb2DataConfig) GetMeasurement() string {
- if x != nil {
- return x.Measurement
- }
- return ""
-}
-
-func (x *Influxdb2DataConfig) GetTag() map[string]string {
- if x != nil {
- return x.Tag
- }
- return nil
-}
-
-func (x *Influxdb2DataConfig) GetFieldKey() string {
- if x != nil {
- return x.FieldKey
- }
- return ""
-}
-
-type Influxdb2ClientConfig struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // influx database url
- Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
- // usr org in influx database
- Org string `protobuf:"bytes,2,opt,name=org,proto3" json:"org,omitempty"`
- // usr bucket in influx database
- Bucket string `protobuf:"bytes,3,opt,name=bucket,proto3" json:"bucket,omitempty"`
-}
-
-func (x *Influxdb2ClientConfig) Reset() {
- *x = Influxdb2ClientConfig{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[18]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *Influxdb2ClientConfig) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Influxdb2ClientConfig) ProtoMessage() {}
-
-func (x *Influxdb2ClientConfig) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[18]
- 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 Influxdb2ClientConfig.ProtoReflect.Descriptor instead.
-func (*Influxdb2ClientConfig) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{18}
-}
-
-func (x *Influxdb2ClientConfig) GetUrl() string {
- if x != nil {
- return x.Url
- }
- return ""
-}
-
-func (x *Influxdb2ClientConfig) GetOrg() string {
- if x != nil {
- return x.Org
- }
- return ""
-}
-
-func (x *Influxdb2ClientConfig) GetBucket() string {
- if x != nil {
- return x.Bucket
- }
- return ""
-}
-
-type DBMethodRedis struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // data config when push data to redis
- RedisClientConfig *RedisClientConfig `protobuf:"bytes,1,opt,name=redisClientConfig,proto3" json:"redisClientConfig,omitempty"`
-}
-
-func (x *DBMethodRedis) Reset() {
- *x = DBMethodRedis{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[19]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *DBMethodRedis) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*DBMethodRedis) ProtoMessage() {}
-
-func (x *DBMethodRedis) 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 DBMethodRedis.ProtoReflect.Descriptor instead.
-func (*DBMethodRedis) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{19}
-}
-
-func (x *DBMethodRedis) GetRedisClientConfig() *RedisClientConfig {
- if x != nil {
- return x.RedisClientConfig
- }
- return nil
-}
-
-type RedisClientConfig struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // redis address
- Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
- // number of redis db
- Db int32 `protobuf:"varint,2,opt,name=db,proto3" json:"db,omitempty"`
- // number of redis poolsize
- Poolsize int32 `protobuf:"varint,3,opt,name=poolsize,proto3" json:"poolsize,omitempty"`
- // number of redis minidleconns
- MinIdleConns int32 `protobuf:"varint,4,opt,name=minIdleConns,proto3" json:"minIdleConns,omitempty"`
-}
-
-func (x *RedisClientConfig) Reset() {
- *x = RedisClientConfig{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[20]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *RedisClientConfig) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*RedisClientConfig) ProtoMessage() {}
-
-func (x *RedisClientConfig) 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 RedisClientConfig.ProtoReflect.Descriptor instead.
-func (*RedisClientConfig) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{20}
-}
-
-func (x *RedisClientConfig) GetAddr() string {
- if x != nil {
- return x.Addr
- }
- return ""
-}
-
-func (x *RedisClientConfig) GetDb() int32 {
- if x != nil {
- return x.Db
- }
- return 0
-}
-
-func (x *RedisClientConfig) GetPoolsize() int32 {
- if x != nil {
- return x.Poolsize
- }
- return 0
-}
-
-func (x *RedisClientConfig) GetMinIdleConns() int32 {
- if x != nil {
- return x.MinIdleConns
- }
- return 0
-}
-
-type DBMethodTDEngine struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // data config when push data to tdengine
- TdEngineClientConfig *TDEngineClientConfig `protobuf:"bytes,1,opt,name=tdEngineClientConfig,proto3" json:"tdEngineClientConfig,omitempty"`
-}
-
-func (x *DBMethodTDEngine) Reset() {
- *x = DBMethodTDEngine{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[21]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *DBMethodTDEngine) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*DBMethodTDEngine) ProtoMessage() {}
-
-func (x *DBMethodTDEngine) 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 DBMethodTDEngine.ProtoReflect.Descriptor instead.
-func (*DBMethodTDEngine) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{21}
-}
-
-func (x *DBMethodTDEngine) GetTdEngineClientConfig() *TDEngineClientConfig {
- if x != nil {
- return x.TdEngineClientConfig
- }
- return nil
-}
-
-type TDEngineClientConfig struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // tdengine address,like 127.0.0.1:6041
- Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
- // tdengine database name
- Dbname string `protobuf:"bytes,2,opt,name=dbname,proto3" json:"dbname,omitempty"`
-}
-
-func (x *TDEngineClientConfig) Reset() {
- *x = TDEngineClientConfig{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[22]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *TDEngineClientConfig) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*TDEngineClientConfig) ProtoMessage() {}
-
-func (x *TDEngineClientConfig) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[22]
- 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 TDEngineClientConfig.ProtoReflect.Descriptor instead.
-func (*TDEngineClientConfig) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{22}
-}
-
-func (x *TDEngineClientConfig) GetAddr() string {
- if x != nil {
- return x.Addr
- }
- return ""
-}
-
-func (x *TDEngineClientConfig) GetDbname() string {
- if x != nil {
- return x.Dbname
- }
- return ""
-}
-
-// MapperInfo is the information of mapper.
-type MapperInfo struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // name of the mapper.
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // version of the mapper.
- Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
- // api version of the mapper.
- ApiVersion string `protobuf:"bytes,3,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"`
- // the protocol of the mapper.
- Protocol string `protobuf:"bytes,4,opt,name=protocol,proto3" json:"protocol,omitempty"`
- // the address of the mapper. it is a unix domain socket of grpc.
- Address []byte `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"`
- // the state of the mapper.
- State string `protobuf:"bytes,6,opt,name=state,proto3" json:"state,omitempty"`
-}
-
-func (x *MapperInfo) Reset() {
- *x = MapperInfo{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[23]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *MapperInfo) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*MapperInfo) ProtoMessage() {}
-
-func (x *MapperInfo) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[23]
- 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 MapperInfo.ProtoReflect.Descriptor instead.
-func (*MapperInfo) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{23}
-}
-
-func (x *MapperInfo) GetName() string {
- if x != nil {
- return x.Name
- }
- return ""
-}
-
-func (x *MapperInfo) GetVersion() string {
- if x != nil {
- return x.Version
- }
- return ""
-}
-
-func (x *MapperInfo) GetApiVersion() string {
- if x != nil {
- return x.ApiVersion
- }
- return ""
-}
-
-func (x *MapperInfo) GetProtocol() string {
- if x != nil {
- return x.Protocol
- }
- return ""
-}
-
-func (x *MapperInfo) GetAddress() []byte {
- if x != nil {
- return x.Address
- }
- return nil
-}
-
-func (x *MapperInfo) GetState() string {
- if x != nil {
- return x.State
- }
- return ""
-}
-
-type ReportDeviceStatusRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- DeviceName string `protobuf:"bytes,1,opt,name=deviceName,proto3" json:"deviceName,omitempty"`
- ReportedDevice *DeviceStatus `protobuf:"bytes,2,opt,name=reportedDevice,proto3" json:"reportedDevice,omitempty"`
-}
-
-func (x *ReportDeviceStatusRequest) Reset() {
- *x = ReportDeviceStatusRequest{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[24]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *ReportDeviceStatusRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ReportDeviceStatusRequest) ProtoMessage() {}
-
-func (x *ReportDeviceStatusRequest) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[24]
- 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 ReportDeviceStatusRequest.ProtoReflect.Descriptor instead.
-func (*ReportDeviceStatusRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{24}
-}
-
-func (x *ReportDeviceStatusRequest) GetDeviceName() string {
- if x != nil {
- return x.DeviceName
- }
- return ""
-}
-
-func (x *ReportDeviceStatusRequest) GetReportedDevice() *DeviceStatus {
- if x != nil {
- return x.ReportedDevice
- }
- return nil
-}
-
-// DeviceStatus is the status of the device.
-type DeviceStatus struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // the device twins of the device.
- Twins []*Twin `protobuf:"bytes,1,rep,name=twins,proto3" json:"twins,omitempty"`
-}
-
-func (x *DeviceStatus) Reset() {
- *x = DeviceStatus{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[25]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *DeviceStatus) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*DeviceStatus) ProtoMessage() {}
-
-func (x *DeviceStatus) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[25]
- 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 DeviceStatus.ProtoReflect.Descriptor instead.
-func (*DeviceStatus) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{25}
-}
-
-func (x *DeviceStatus) GetTwins() []*Twin {
- if x != nil {
- return x.Twins
- }
- return nil
-}
-
-// Twin is the digital model of a device. It contains a series of properties.
-type Twin struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // the name of the property.
- PropertyName string `protobuf:"bytes,1,opt,name=propertyName,proto3" json:"propertyName,omitempty"`
- // the observedDesired value of the property configured by mapper.
- ObservedDesired *TwinProperty `protobuf:"bytes,2,opt,name=observedDesired,proto3" json:"observedDesired,omitempty"`
- // the reported value of the property from the real device.
- Reported *TwinProperty `protobuf:"bytes,3,opt,name=reported,proto3" json:"reported,omitempty"`
-}
-
-func (x *Twin) Reset() {
- *x = Twin{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[26]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *Twin) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*Twin) ProtoMessage() {}
-
-func (x *Twin) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[26]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use Twin.ProtoReflect.Descriptor instead.
-func (*Twin) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{26}
-}
-
-func (x *Twin) GetPropertyName() string {
- if x != nil {
- return x.PropertyName
- }
- return ""
-}
-
-func (x *Twin) GetObservedDesired() *TwinProperty {
- if x != nil {
- return x.ObservedDesired
- }
- return nil
-}
-
-func (x *Twin) GetReported() *TwinProperty {
- if x != nil {
- return x.Reported
- }
- return nil
-}
-
-// TwinProperty is the specification of the property.
-type TwinProperty struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // the value of the property.
- Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
- // the metadata to describe this property.
- Metadata map[string]string `protobuf:"bytes,2,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
-}
-
-func (x *TwinProperty) Reset() {
- *x = TwinProperty{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[27]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *TwinProperty) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*TwinProperty) ProtoMessage() {}
-
-func (x *TwinProperty) 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 TwinProperty.ProtoReflect.Descriptor instead.
-func (*TwinProperty) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{27}
-}
-
-func (x *TwinProperty) GetValue() string {
- if x != nil {
- return x.Value
- }
- return ""
-}
-
-func (x *TwinProperty) GetMetadata() map[string]string {
- if x != nil {
- return x.Metadata
- }
- return nil
-}
-
-type ReportDeviceStatusResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-}
-
-func (x *ReportDeviceStatusResponse) Reset() {
- *x = ReportDeviceStatusResponse{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[28]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *ReportDeviceStatusResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ReportDeviceStatusResponse) ProtoMessage() {}
-
-func (x *ReportDeviceStatusResponse) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[28]
- 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 ReportDeviceStatusResponse.ProtoReflect.Descriptor instead.
-func (*ReportDeviceStatusResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{28}
-}
-
-type RegisterDeviceRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Device *Device `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"`
-}
-
-func (x *RegisterDeviceRequest) Reset() {
- *x = RegisterDeviceRequest{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[29]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *RegisterDeviceRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*RegisterDeviceRequest) ProtoMessage() {}
-
-func (x *RegisterDeviceRequest) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[29]
- 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 RegisterDeviceRequest.ProtoReflect.Descriptor instead.
-func (*RegisterDeviceRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{29}
-}
-
-func (x *RegisterDeviceRequest) GetDevice() *Device {
- if x != nil {
- return x.Device
- }
- return nil
-}
-
-type RegisterDeviceResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- DeviceName string `protobuf:"bytes,1,opt,name=deviceName,proto3" json:"deviceName,omitempty"`
-}
-
-func (x *RegisterDeviceResponse) Reset() {
- *x = RegisterDeviceResponse{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[30]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *RegisterDeviceResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*RegisterDeviceResponse) ProtoMessage() {}
-
-func (x *RegisterDeviceResponse) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[30]
- 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 RegisterDeviceResponse.ProtoReflect.Descriptor instead.
-func (*RegisterDeviceResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{30}
-}
-
-func (x *RegisterDeviceResponse) GetDeviceName() string {
- if x != nil {
- return x.DeviceName
- }
- return ""
-}
-
-type CreateDeviceModelRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Model *DeviceModel `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
-}
-
-func (x *CreateDeviceModelRequest) Reset() {
- *x = CreateDeviceModelRequest{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[31]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *CreateDeviceModelRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CreateDeviceModelRequest) ProtoMessage() {}
-
-func (x *CreateDeviceModelRequest) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[31]
- 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 CreateDeviceModelRequest.ProtoReflect.Descriptor instead.
-func (*CreateDeviceModelRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{31}
-}
-
-func (x *CreateDeviceModelRequest) GetModel() *DeviceModel {
- if x != nil {
- return x.Model
- }
- return nil
-}
-
-type CreateDeviceModelResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- DeviceModelName string `protobuf:"bytes,1,opt,name=deviceModelName,proto3" json:"deviceModelName,omitempty"`
-}
-
-func (x *CreateDeviceModelResponse) Reset() {
- *x = CreateDeviceModelResponse{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[32]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *CreateDeviceModelResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*CreateDeviceModelResponse) ProtoMessage() {}
-
-func (x *CreateDeviceModelResponse) 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 CreateDeviceModelResponse.ProtoReflect.Descriptor instead.
-func (*CreateDeviceModelResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{32}
-}
-
-func (x *CreateDeviceModelResponse) GetDeviceModelName() string {
- if x != nil {
- return x.DeviceModelName
- }
- return ""
-}
-
-type RemoveDeviceRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- DeviceName string `protobuf:"bytes,1,opt,name=deviceName,proto3" json:"deviceName,omitempty"`
-}
-
-func (x *RemoveDeviceRequest) Reset() {
- *x = RemoveDeviceRequest{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[33]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *RemoveDeviceRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*RemoveDeviceRequest) ProtoMessage() {}
-
-func (x *RemoveDeviceRequest) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[33]
- 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 RemoveDeviceRequest.ProtoReflect.Descriptor instead.
-func (*RemoveDeviceRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{33}
-}
-
-func (x *RemoveDeviceRequest) GetDeviceName() string {
- if x != nil {
- return x.DeviceName
- }
- return ""
-}
-
-type RemoveDeviceResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-}
-
-func (x *RemoveDeviceResponse) Reset() {
- *x = RemoveDeviceResponse{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[34]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *RemoveDeviceResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*RemoveDeviceResponse) ProtoMessage() {}
-
-func (x *RemoveDeviceResponse) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[34]
- 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 RemoveDeviceResponse.ProtoReflect.Descriptor instead.
-func (*RemoveDeviceResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{34}
-}
-
-type RemoveDeviceModelRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- ModelName string `protobuf:"bytes,1,opt,name=modelName,proto3" json:"modelName,omitempty"`
-}
-
-func (x *RemoveDeviceModelRequest) Reset() {
- *x = RemoveDeviceModelRequest{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[35]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *RemoveDeviceModelRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*RemoveDeviceModelRequest) ProtoMessage() {}
-
-func (x *RemoveDeviceModelRequest) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[35]
- 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 RemoveDeviceModelRequest.ProtoReflect.Descriptor instead.
-func (*RemoveDeviceModelRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{35}
-}
-
-func (x *RemoveDeviceModelRequest) GetModelName() string {
- if x != nil {
- return x.ModelName
- }
- return ""
-}
-
-type RemoveDeviceModelResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-}
-
-func (x *RemoveDeviceModelResponse) Reset() {
- *x = RemoveDeviceModelResponse{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[36]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *RemoveDeviceModelResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*RemoveDeviceModelResponse) ProtoMessage() {}
-
-func (x *RemoveDeviceModelResponse) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[36]
- 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 RemoveDeviceModelResponse.ProtoReflect.Descriptor instead.
-func (*RemoveDeviceModelResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{36}
-}
-
-type UpdateDeviceRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Device *Device `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"`
-}
-
-func (x *UpdateDeviceRequest) Reset() {
- *x = UpdateDeviceRequest{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[37]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *UpdateDeviceRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*UpdateDeviceRequest) ProtoMessage() {}
-
-func (x *UpdateDeviceRequest) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[37]
- 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 UpdateDeviceRequest.ProtoReflect.Descriptor instead.
-func (*UpdateDeviceRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{37}
-}
-
-func (x *UpdateDeviceRequest) GetDevice() *Device {
- if x != nil {
- return x.Device
- }
- return nil
-}
-
-type UpdateDeviceResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-}
-
-func (x *UpdateDeviceResponse) Reset() {
- *x = UpdateDeviceResponse{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[38]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *UpdateDeviceResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*UpdateDeviceResponse) ProtoMessage() {}
-
-func (x *UpdateDeviceResponse) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[38]
- 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 UpdateDeviceResponse.ProtoReflect.Descriptor instead.
-func (*UpdateDeviceResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{38}
-}
-
-type UpdateDeviceModelRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Model *DeviceModel `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
-}
-
-func (x *UpdateDeviceModelRequest) Reset() {
- *x = UpdateDeviceModelRequest{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[39]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *UpdateDeviceModelRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*UpdateDeviceModelRequest) ProtoMessage() {}
-
-func (x *UpdateDeviceModelRequest) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[39]
- 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 UpdateDeviceModelRequest.ProtoReflect.Descriptor instead.
-func (*UpdateDeviceModelRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{39}
-}
-
-func (x *UpdateDeviceModelRequest) GetModel() *DeviceModel {
- if x != nil {
- return x.Model
- }
- return nil
-}
-
-type UpdateDeviceModelResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-}
-
-func (x *UpdateDeviceModelResponse) Reset() {
- *x = UpdateDeviceModelResponse{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[40]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *UpdateDeviceModelResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*UpdateDeviceModelResponse) ProtoMessage() {}
-
-func (x *UpdateDeviceModelResponse) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[40]
- 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 UpdateDeviceModelResponse.ProtoReflect.Descriptor instead.
-func (*UpdateDeviceModelResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{40}
-}
-
-type GetDeviceRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- DeviceName string `protobuf:"bytes,1,opt,name=deviceName,proto3" json:"deviceName,omitempty"`
-}
-
-func (x *GetDeviceRequest) Reset() {
- *x = GetDeviceRequest{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[41]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *GetDeviceRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*GetDeviceRequest) ProtoMessage() {}
-
-func (x *GetDeviceRequest) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[41]
- 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 GetDeviceRequest.ProtoReflect.Descriptor instead.
-func (*GetDeviceRequest) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{41}
-}
-
-func (x *GetDeviceRequest) GetDeviceName() string {
- if x != nil {
- return x.DeviceName
- }
- return ""
-}
-
-type GetDeviceResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Device *Device `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"`
-}
-
-func (x *GetDeviceResponse) Reset() {
- *x = GetDeviceResponse{}
- if protoimpl.UnsafeEnabled {
- mi := &file_api_proto_msgTypes[42]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *GetDeviceResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*GetDeviceResponse) ProtoMessage() {}
-
-func (x *GetDeviceResponse) ProtoReflect() protoreflect.Message {
- mi := &file_api_proto_msgTypes[42]
- 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 GetDeviceResponse.ProtoReflect.Descriptor instead.
-func (*GetDeviceResponse) Descriptor() ([]byte, []int) {
- return file_api_proto_rawDescGZIP(), []int{42}
-}
-
-func (x *GetDeviceResponse) GetDevice() *Device {
- if x != nil {
- return x.Device
- }
- return nil
-}
-
-var File_api_proto protoreflect.FileDescriptor
-
-var file_api_proto_rawDesc = []byte{
- 0x0a, 0x09, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x76, 0x31, 0x62,
- 0x65, 0x74, 0x61, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
- 0x60, 0x0a, 0x15, 0x4d, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65,
- 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x77, 0x69, 0x74, 0x68,
- 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x77, 0x69, 0x74, 0x68,
- 0x44, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x06, 0x6d, 0x61, 0x70, 0x70, 0x65, 0x72, 0x18, 0x02,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d,
- 0x61, 0x70, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x6d, 0x61, 0x70, 0x70, 0x65,
- 0x72, 0x22, 0x7d, 0x0a, 0x16, 0x4d, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73,
- 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x6d,
- 0x6f, 0x64, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 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, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x12,
- 0x2f, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20,
- 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65,
- 0x76, 0x69, 0x63, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74,
- 0x22, 0x4f, 0x0a, 0x0b, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12,
- 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
- 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x18, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69,
- 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65,
- 0x63, 0x22, 0x7d, 0x0a, 0x0f, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c,
- 0x53, 0x70, 0x65, 0x63, 0x12, 0x36, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69,
- 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
- 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79,
- 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x08,
- 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16,
- 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43,
- 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73,
- 0x22, 0xc1, 0x01, 0x0a, 0x0d, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72,
- 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
- 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73,
- 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
- 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a,
- 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07,
- 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d,
- 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75,
- 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d,
- 0x12, 0x12, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
- 0x75, 0x6e, 0x69, 0x74, 0x22, 0xaa, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43,
- 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72,
- 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06,
- 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65,
- 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63,
- 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75,
- 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74,
- 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d,
- 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
- 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
- 0x65, 0x22, 0x74, 0x0a, 0x06, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e,
- 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
- 0x27, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e,
- 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x70,
- 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x2d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74,
- 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
- 0x61, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52,
- 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xae, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69,
- 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x32, 0x0a, 0x14, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65,
- 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65,
- 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x08, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x76,
- 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x43,
- 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12,
- 0x37, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20,
- 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65,
- 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x0a, 0x70, 0x72,
- 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xaa, 0x02, 0x0a, 0x0e, 0x44, 0x65, 0x76,
- 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e,
- 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
- 0x2f, 0x0a, 0x07, 0x64, 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, 0x07, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, 0x64,
- 0x12, 0x32, 0x0a, 0x08, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x69, 0x73,
- 0x69, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x76, 0x69, 0x73, 0x69,
- 0x74, 0x6f, 0x72, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x79,
- 0x63, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x65, 0x70, 0x6f, 0x72,
- 0x74, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63,
- 0x74, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x6f,
- 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x43, 0x79, 0x63, 0x6c, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x72, 0x65,
- 0x70, 0x6f, 0x72, 0x74, 0x54, 0x6f, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28,
- 0x08, 0x52, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x6f, 0x43, 0x6c, 0x6f, 0x75, 0x64,
- 0x12, 0x33, 0x0a, 0x0a, 0x70, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x07,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50,
- 0x75, 0x73, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x0a, 0x70, 0x75, 0x73, 0x68, 0x4d,
- 0x65, 0x74, 0x68, 0x6f, 0x64, 0x22, 0x6e, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,
- 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x63, 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63,
- 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x18, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d,
- 0x69, 0x7a, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69,
- 0x67, 0x44, 0x61, 0x74, 0x61, 0x22, 0x6d, 0x0a, 0x0d, 0x56, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72,
- 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,
- 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f,
- 0x6e, 0x66, 0x69, 0x67, 0x44, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18,
- 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x69,
- 0x7a, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
- 0x44, 0x61, 0x74, 0x61, 0x22, 0x98, 0x01, 0x0a, 0x0f, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x69,
- 0x7a, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
- 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31,
- 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65,
- 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61,
- 0x1a, 0x4d, 0x0a, 0x09, 0x44, 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,
- 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14,
- 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
- 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22,
- 0x95, 0x01, 0x0a, 0x0a, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x2b,
- 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x76,
- 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f,
- 0x64, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x2b, 0x0a, 0x04, 0x6d,
- 0x71, 0x74, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x76, 0x31, 0x62, 0x65,
- 0x74, 0x61, 0x31, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4d, 0x51,
- 0x54, 0x54, 0x52, 0x04, 0x6d, 0x71, 0x74, 0x74, 0x12, 0x2d, 0x0a, 0x08, 0x64, 0x62, 0x4d, 0x65,
- 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x76, 0x31, 0x62,
- 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x42, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x08, 0x64,
- 0x62, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x22, 0x7c, 0x0a, 0x0e, 0x50, 0x75, 0x73, 0x68, 0x4d,
- 0x65, 0x74, 0x68, 0x6f, 0x64, 0x48, 0x54, 0x54, 0x50, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73,
- 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73,
- 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20,
- 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
- 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x70, 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x74,
- 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x74, 0x69,
- 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x6e, 0x0a, 0x0e, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x74,
- 0x68, 0x6f, 0x64, 0x4d, 0x51, 0x54, 0x54, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65,
- 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73,
- 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
- 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, 0xa9, 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,
- 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, 0x2c, 0x0a, 0x05,
- 0x72, 0x65, 0x64, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x76, 0x31,
- 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x42, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65,
- 0x64, 0x69, 0x73, 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x12, 0x35, 0x0a, 0x08, 0x74, 0x64,
- 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x76,
- 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x42, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x54,
- 0x44, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x52, 0x08, 0x74, 0x64, 0x65, 0x6e, 0x67, 0x69, 0x6e,
- 0x65, 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, 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, 0x59, 0x0a, 0x0d, 0x44, 0x42, 0x4d,
- 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x48, 0x0a, 0x11, 0x72, 0x65,
- 0x64, 0x69, 0x73, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e,
- 0x52, 0x65, 0x64, 0x69, 0x73, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69,
- 0x67, 0x52, 0x11, 0x72, 0x65, 0x64, 0x69, 0x73, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f,
- 0x6e, 0x66, 0x69, 0x67, 0x22, 0x77, 0x0a, 0x11, 0x52, 0x65, 0x64, 0x69, 0x73, 0x43, 0x6c, 0x69,
- 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64,
- 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x0e, 0x0a,
- 0x02, 0x64, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x62, 0x12, 0x1a, 0x0a,
- 0x08, 0x70, 0x6f, 0x6f, 0x6c, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52,
- 0x08, 0x70, 0x6f, 0x6f, 0x6c, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x69, 0x6e,
- 0x49, 0x64, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
- 0x0c, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x73, 0x22, 0x65, 0x0a,
- 0x10, 0x44, 0x42, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x54, 0x44, 0x45, 0x6e, 0x67, 0x69, 0x6e,
- 0x65, 0x12, 0x51, 0x0a, 0x14, 0x74, 0x64, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x43, 0x6c, 0x69,
- 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x1d, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x44, 0x45, 0x6e, 0x67, 0x69,
- 0x6e, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x14,
- 0x74, 0x64, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f,
- 0x6e, 0x66, 0x69, 0x67, 0x22, 0x42, 0x0a, 0x14, 0x54, 0x44, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65,
- 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04,
- 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72,
- 0x12, 0x16, 0x0a, 0x06, 0x64, 0x62, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x06, 0x64, 0x62, 0x6e, 0x61, 0x6d, 0x65, 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, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x65, 0x72,
- 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56,
- 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,
- 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,
- 0x6f, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20,
- 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05,
- 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61,
- 0x74, 0x65, 0x22, 0x7a, 0x0a, 0x19, 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, 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,
- 0x3d, 0x0a, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63,
- 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
- 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0e,
- 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x44, 0x65, 0x76, 0x69, 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, 0x38, 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, 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, 0x45, 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, 0x22, 0x35, 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, 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, 0x38, 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, 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, 0x32, 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, 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, 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, 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 (
- file_api_proto_rawDescOnce sync.Once
- file_api_proto_rawDescData = file_api_proto_rawDesc
-)
-
-func file_api_proto_rawDescGZIP() []byte {
- file_api_proto_rawDescOnce.Do(func() {
- file_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_proto_rawDescData)
- })
- return file_api_proto_rawDescData
-}
-
-var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 46)
-var file_api_proto_goTypes = []interface{}{
- (*MapperRegisterRequest)(nil), // 0: v1beta1.MapperRegisterRequest
- (*MapperRegisterResponse)(nil), // 1: v1beta1.MapperRegisterResponse
- (*DeviceModel)(nil), // 2: v1beta1.DeviceModel
- (*DeviceModelSpec)(nil), // 3: v1beta1.DeviceModelSpec
- (*ModelProperty)(nil), // 4: v1beta1.ModelProperty
- (*DeviceCommand)(nil), // 5: v1beta1.DeviceCommand
- (*Device)(nil), // 6: v1beta1.Device
- (*DeviceSpec)(nil), // 7: v1beta1.DeviceSpec
- (*DeviceProperty)(nil), // 8: v1beta1.DeviceProperty
- (*ProtocolConfig)(nil), // 9: v1beta1.ProtocolConfig
- (*VisitorConfig)(nil), // 10: v1beta1.VisitorConfig
- (*CustomizedValue)(nil), // 11: v1beta1.CustomizedValue
- (*PushMethod)(nil), // 12: v1beta1.PushMethod
- (*PushMethodHTTP)(nil), // 13: v1beta1.PushMethodHTTP
- (*PushMethodMQTT)(nil), // 14: v1beta1.PushMethodMQTT
- (*DBMethod)(nil), // 15: v1beta1.DBMethod
- (*DBMethodInfluxdb2)(nil), // 16: v1beta1.DBMethodInfluxdb2
- (*Influxdb2DataConfig)(nil), // 17: v1beta1.Influxdb2DataConfig
- (*Influxdb2ClientConfig)(nil), // 18: v1beta1.Influxdb2ClientConfig
- (*DBMethodRedis)(nil), // 19: v1beta1.DBMethodRedis
- (*RedisClientConfig)(nil), // 20: v1beta1.RedisClientConfig
- (*DBMethodTDEngine)(nil), // 21: v1beta1.DBMethodTDEngine
- (*TDEngineClientConfig)(nil), // 22: v1beta1.TDEngineClientConfig
- (*MapperInfo)(nil), // 23: v1beta1.MapperInfo
- (*ReportDeviceStatusRequest)(nil), // 24: v1beta1.ReportDeviceStatusRequest
- (*DeviceStatus)(nil), // 25: v1beta1.DeviceStatus
- (*Twin)(nil), // 26: v1beta1.Twin
- (*TwinProperty)(nil), // 27: v1beta1.TwinProperty
- (*ReportDeviceStatusResponse)(nil), // 28: v1beta1.ReportDeviceStatusResponse
- (*RegisterDeviceRequest)(nil), // 29: v1beta1.RegisterDeviceRequest
- (*RegisterDeviceResponse)(nil), // 30: v1beta1.RegisterDeviceResponse
- (*CreateDeviceModelRequest)(nil), // 31: v1beta1.CreateDeviceModelRequest
- (*CreateDeviceModelResponse)(nil), // 32: v1beta1.CreateDeviceModelResponse
- (*RemoveDeviceRequest)(nil), // 33: v1beta1.RemoveDeviceRequest
- (*RemoveDeviceResponse)(nil), // 34: v1beta1.RemoveDeviceResponse
- (*RemoveDeviceModelRequest)(nil), // 35: v1beta1.RemoveDeviceModelRequest
- (*RemoveDeviceModelResponse)(nil), // 36: v1beta1.RemoveDeviceModelResponse
- (*UpdateDeviceRequest)(nil), // 37: v1beta1.UpdateDeviceRequest
- (*UpdateDeviceResponse)(nil), // 38: v1beta1.UpdateDeviceResponse
- (*UpdateDeviceModelRequest)(nil), // 39: v1beta1.UpdateDeviceModelRequest
- (*UpdateDeviceModelResponse)(nil), // 40: v1beta1.UpdateDeviceModelResponse
- (*GetDeviceRequest)(nil), // 41: v1beta1.GetDeviceRequest
- (*GetDeviceResponse)(nil), // 42: v1beta1.GetDeviceResponse
- nil, // 43: v1beta1.CustomizedValue.DataEntry
- nil, // 44: v1beta1.Influxdb2DataConfig.TagEntry
- nil, // 45: v1beta1.TwinProperty.MetadataEntry
- (*anypb.Any)(nil), // 46: google.protobuf.Any
-}
-var file_api_proto_depIdxs = []int32{
- 23, // 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
- 25, // 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
- 27, // 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
- 43, // 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.redis:type_name -> v1beta1.DBMethodRedis
- 21, // 21: v1beta1.DBMethod.tdengine:type_name -> v1beta1.DBMethodTDEngine
- 18, // 22: v1beta1.DBMethodInfluxdb2.influxdb2ClientConfig:type_name -> v1beta1.Influxdb2ClientConfig
- 17, // 23: v1beta1.DBMethodInfluxdb2.influxdb2DataConfig:type_name -> v1beta1.Influxdb2DataConfig
- 44, // 24: v1beta1.Influxdb2DataConfig.tag:type_name -> v1beta1.Influxdb2DataConfig.TagEntry
- 20, // 25: v1beta1.DBMethodRedis.redisClientConfig:type_name -> v1beta1.RedisClientConfig
- 22, // 26: v1beta1.DBMethodTDEngine.tdEngineClientConfig:type_name -> v1beta1.TDEngineClientConfig
- 25, // 27: v1beta1.ReportDeviceStatusRequest.reportedDevice:type_name -> v1beta1.DeviceStatus
- 26, // 28: v1beta1.DeviceStatus.twins:type_name -> v1beta1.Twin
- 27, // 29: v1beta1.Twin.observedDesired:type_name -> v1beta1.TwinProperty
- 27, // 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
- 24, // 39: v1beta1.DeviceManagerService.ReportDeviceStatus:input_type -> v1beta1.ReportDeviceStatusRequest
- 29, // 40: v1beta1.DeviceMapperService.RegisterDevice:input_type -> v1beta1.RegisterDeviceRequest
- 33, // 41: v1beta1.DeviceMapperService.RemoveDevice:input_type -> v1beta1.RemoveDeviceRequest
- 37, // 42: v1beta1.DeviceMapperService.UpdateDevice:input_type -> v1beta1.UpdateDeviceRequest
- 31, // 43: v1beta1.DeviceMapperService.CreateDeviceModel:input_type -> v1beta1.CreateDeviceModelRequest
- 35, // 44: v1beta1.DeviceMapperService.RemoveDeviceModel:input_type -> v1beta1.RemoveDeviceModelRequest
- 39, // 45: v1beta1.DeviceMapperService.UpdateDeviceModel:input_type -> v1beta1.UpdateDeviceModelRequest
- 41, // 46: v1beta1.DeviceMapperService.GetDevice:input_type -> v1beta1.GetDeviceRequest
- 1, // 47: v1beta1.DeviceManagerService.MapperRegister:output_type -> v1beta1.MapperRegisterResponse
- 28, // 48: v1beta1.DeviceManagerService.ReportDeviceStatus:output_type -> v1beta1.ReportDeviceStatusResponse
- 30, // 49: v1beta1.DeviceMapperService.RegisterDevice:output_type -> v1beta1.RegisterDeviceResponse
- 34, // 50: v1beta1.DeviceMapperService.RemoveDevice:output_type -> v1beta1.RemoveDeviceResponse
- 38, // 51: v1beta1.DeviceMapperService.UpdateDevice:output_type -> v1beta1.UpdateDeviceResponse
- 32, // 52: v1beta1.DeviceMapperService.CreateDeviceModel:output_type -> v1beta1.CreateDeviceModelResponse
- 36, // 53: v1beta1.DeviceMapperService.RemoveDeviceModel:output_type -> v1beta1.RemoveDeviceModelResponse
- 40, // 54: v1beta1.DeviceMapperService.UpdateDeviceModel:output_type -> v1beta1.UpdateDeviceModelResponse
- 42, // 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
-}
-
-func init() { file_api_proto_init() }
-func file_api_proto_init() {
- if File_api_proto != nil {
- return
- }
- if !protoimpl.UnsafeEnabled {
- file_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*MapperRegisterRequest); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*MapperRegisterResponse); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*DeviceModel); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*DeviceModelSpec); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*ModelProperty); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*DeviceCommand); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*Device); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*DeviceSpec); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*DeviceProperty); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*ProtocolConfig); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*VisitorConfig); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*CustomizedValue); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*PushMethod); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*PushMethodHTTP); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*PushMethodMQTT); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*DBMethod); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*DBMethodInfluxdb2); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*Influxdb2DataConfig); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*Influxdb2ClientConfig); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*DBMethodRedis); 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.(*RedisClientConfig); 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.(*DBMethodTDEngine); 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.(*TDEngineClientConfig); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*MapperInfo); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*ReportDeviceStatusRequest); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*DeviceStatus); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*Twin); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*TwinProperty); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*ReportDeviceStatusResponse); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*RegisterDeviceRequest); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*RegisterDeviceResponse); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*CreateDeviceModelRequest); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*CreateDeviceModelResponse); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*RemoveDeviceRequest); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*RemoveDeviceResponse); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*RemoveDeviceModelRequest); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*RemoveDeviceModelResponse); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*UpdateDeviceRequest); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*UpdateDeviceResponse); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*UpdateDeviceModelRequest); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_api_proto_msgTypes[40].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[41].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[42].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*GetDeviceResponse); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- }
- type x struct{}
- out := protoimpl.TypeBuilder{
- File: protoimpl.DescBuilder{
- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_api_proto_rawDesc,
- NumEnums: 0,
- NumMessages: 46,
- NumExtensions: 0,
- NumServices: 2,
- },
- GoTypes: file_api_proto_goTypes,
- DependencyIndexes: file_api_proto_depIdxs,
- MessageInfos: file_api_proto_msgTypes,
- }.Build()
- File_api_proto = out.File
- file_api_proto_rawDesc = nil
- file_api_proto_goTypes = nil
- file_api_proto_depIdxs = nil
-}
-
-func NewMapperClient(cc grpc.ClientConnInterface) DeviceMapperServiceClient {
- return &deviceMapperServiceClient{cc}
-}
-
-func NewDeviceManageClient(cc grpc.ClientConnInterface) DeviceManagerServiceClient {
- return &deviceManagerServiceClient{cc}
-}
diff --git a/staging/src/github.com/kubeedge/mapper-framework/pkg/dmi-api/api.proto b/staging/src/github.com/kubeedge/mapper-framework/pkg/dmi-api/api.proto
deleted file mode 100644
index ae112e773..000000000
--- a/staging/src/github.com/kubeedge/mapper-framework/pkg/dmi-api/api.proto
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
-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
-syntax = "proto3";
-
-//option go_package = "path;name";
-option go_package = "./;v1beta1";
-package v1beta1;
-
-import "google/protobuf/any.proto";
-
-// DeviceManagerService defines the public APIS for remote device management.
-// The server is implemented by the module of device manager in edgecore
-// and the client is implemented by the device mapper for upstreaming.
-// The mapper should register itself to the device manager when it is online
-// to get the list of devices. And then the mapper can report the device status to the device manager.
-service DeviceManagerService {
- // MapperRegister registers the information of the mapper to device manager
- // when the mapper is online. Device manager returns the list of devices and device models which
- // this mapper should manage.
- rpc MapperRegister(MapperRegisterRequest) returns (MapperRegisterResponse) {}
- // ReportDeviceStatus reports the status of devices to device manager.
- // 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) {}
-}
-
-// DeviceMapperService defines the public APIS for remote device management.
-// The server is implemented by the device mapper
-// and the client is implemented by the module of device manager in edgecore for downstreaming.
-// The device manager can manage the device life cycle through these interfaces provided by DeviceMapperService.
-// When device manager gets a message of device management from cloudcore, it should call the corresponding grpc interface
-// to make the mapper maintain the list of device information.
-service DeviceMapperService {
- // RegisterDevice registers a device to the device mapper.
- // Device manager registers a device instance with the information of device
- // to the mapper through the interface of RegisterDevice.
- // When the mapper gets the request of register with device information,
- // it should add the device to the device list and connect to the real physical device via the specific protocol.
- rpc RegisterDevice(RegisterDeviceRequest) returns (RegisterDeviceResponse) {}
- // RemoveDevice unregisters a device to the device mapper.
- // Device manager unregisters a device instance with the name of device
- // to the mapper through the interface of RemoveDevice.
- // When the mapper gets the request of unregister with device name,
- // it should remove the device from the device list and disconnect to the real physical device.
- rpc RemoveDevice(RemoveDeviceRequest) returns (RemoveDeviceResponse) {}
- // UpdateDevice updates a device to the device mapper
- // Device manager updates the information of a device used by the mapper
- // through the interface of UpdateDevice.
- // The information of a device includes the meta data and the status data of a device.
- // When the mapper gets the request of updating with the information of a device,
- // it should update the device of the device list and connect to the real physical device via the updated information.
- rpc UpdateDevice(UpdateDeviceRequest) returns (UpdateDeviceResponse) {}
- // CreateDeviceModel creates a device model to the device mapper.
- // Device manager sends the information of device model to the mapper
- // through the interface of CreateDeviceModel.
- // When the mapper gets the request of creating with the information of device model,
- // it should create a new device model to the list of device models.
- rpc CreateDeviceModel(CreateDeviceModelRequest) returns (CreateDeviceModelResponse) {}
- // RemoveDeviceModel remove a device model to the device mapper.
- // Device manager sends the name of device model to the mapper
- // through the interface of RemoveDeviceModel.
- // When the mapper gets the request of removing with the name of device model,
- // it should remove the device model to the list of device models.
- rpc RemoveDeviceModel(RemoveDeviceModelRequest) returns (RemoveDeviceModelResponse) {}
- // UpdateDeviceModel update a device model to the device mapper.
- // Device manager sends the information of device model to the mapper
- // through the interface of UpdateDeviceModel.
- // When the mapper gets the request of updating with the information of device model,
- // it should update the device model to the list of device models.
- rpc UpdateDeviceModel(UpdateDeviceModelRequest) returns (UpdateDeviceModelResponse) {}
- // GetDevice get the information of a device from the device mapper.
- // Device sends the request of querying device information with the device name to the mapper
- // through the interface of GetDevice.
- // When the mapper gets the request of querying with the device name,
- // it should return the device information.
- rpc GetDevice(GetDeviceRequest) returns (GetDeviceResponse) {}
-}
-
-message MapperRegisterRequest {
- // The flag to show how device manager returns.
- // True means device manager should return the device list in the response.
- // False means device manager should just return nothing.
- bool withData = 1;
- // Mapper information to be registered to the device manager.
- MapperInfo mapper = 2;
-}
-
-message MapperRegisterResponse {
- // List of device models which the mapper maintains.
- repeated DeviceModel modelList = 1;
- // List of devices which the mapper maintains.
- repeated Device deviceList = 2;
-}
-
-// DeviceModel specifies the information of a device model.
-message DeviceModel {
- // Name of a device model.
- string name = 1;
- // Specification of a device model.
- DeviceModelSpec spec = 2;
-}
-
-// DeviceModelSpec is the specification of a device model.
-message DeviceModelSpec {
- // The properties provided by the device of this device model.
- repeated ModelProperty properties = 1;
- // The commands executed by the device of this device model.
- repeated DeviceCommand commands = 2;
-}
-
-// ModelProperty is the property of a device.
-message ModelProperty {
- // The name of this property.
- string name = 1;
- // The description of this property.
- string description = 2;
- // The specific type of this property.
- string type = 3;
- // The access mode of this property, ReadOnly or ReadWrite.
- string accessMode = 4;
- // The minimum value of this property.
- string minimum = 5;
- // The maximum value of this property.
- string maximum = 6;
- // The unit of this property.
- string unit = 7;
-}
-
-// DeviceCommond is the description of a command which the device supports.
-message DeviceCommand {
- // Name of the command.
- string name = 1;
- // Url of the command to access.
- string url = 2;
- // Method of the command.
- string method = 3;
- // Status code list which the command can return.
- repeated string status_code = 4;
- // Parameter list which the command carries.
- repeated string parameters = 5;
- // Response examples of the command.
- bytes response = 6;
-}
-
-// Device is the description of a device instance.
-message Device {
- // Name of the device.
- string name = 1;
- // Specification of the device.
- DeviceSpec spec = 2;
- // Status of the device.
- DeviceStatus status = 3;
-}
-
-// DeviceSpec is the specification of the device.
-message DeviceSpec {
- // The device model which the device references.
- string deviceModelReference = 1;
- // The specific config of the protocol to access to the device.
- ProtocolConfig protocol = 2;
- // List of properties which describe the device properties.
- repeated DeviceProperty properties = 3;
-}
-
-// DeviceProperty describes the specifics all the properties of the device.
-message DeviceProperty {
- // The device property name to be accessed. It must be unique.
- string name = 1;
- // the desired value of the property configured by device manager.
- TwinProperty desired = 2;
- // Visitors are intended to be consumed by device mappers which connect to devices
- // and collect data / perform actions on the device.
- VisitorConfig visitors = 3;
- // Define how frequent mapper will report the value.
- int64 reportCycle = 4;
- // Define how frequent mapper will collect from device.
- int64 collectCycle = 5;
- // whether be reported to the cloud
- bool reportToCloud = 6;
- // PushMethod represents the protocol used to push data,
- PushMethod pushMethod = 7;
-}
-
-// ProtocolConfig is the specific config of the protocol to access to the device.
-message ProtocolConfig {
- // the name of the customized protocol.
- string protocolName = 1;
- // the config data of the customized protocol.
- CustomizedValue configData = 2;
-}
-
-// the visitor to collect the properties of the device of customized protocol.
-message VisitorConfig {
- // the name of the customized protocol.
- string protocolName = 1;
- // the config data of the customized protocol.
- CustomizedValue configData = 2;
-}
-
-// CustomizedValue is the customized value for developers.
-message CustomizedValue {
- // data is the customized value and it can be any form.
- map<string, google.protobuf.Any> data = 1;
-}
-
-message PushMethod {
- PushMethodHTTP http = 1;
- PushMethodMQTT mqtt = 2;
- DBMethod dbMethod = 3;
-}
-
-message PushMethodHTTP {
- string hostname = 1;
- int64 port = 2;
- string requestpath = 3;
- int64 timeout = 4;
-}
-
-message PushMethodMQTT {
- // broker address, like mqtt://127.0.0.1:1883
- string address = 1;
- // publish topic for mqtt
- string topic = 2;
- // qos of mqtt publish param
- int32 qos = 3;
- // Is the message retained
- bool retained = 4;
-}
-
-message DBMethod{
- // the config of database .
- DBMethodInfluxdb2 influxdb2 = 1;
- DBMethodRedis redis = 2;
- DBMethodTDEngine tdengine = 3;
-}
-
-message DBMethodInfluxdb2{
- // the config of influx database.
- Influxdb2ClientConfig influxdb2ClientConfig = 1;
- Influxdb2DataConfig influxdb2DataConfig = 2;
-}
-
-message Influxdb2DataConfig{
- // data config when push data to influx
- string measurement = 1;
- map<string, string> tag = 2;
- string fieldKey = 3;
-}
-
-message Influxdb2ClientConfig{
- // influx database url
- string url = 1;
- // usr org in influx database
- string org = 2;
- // usr bucket in influx database
- string bucket = 3;
-}
-
-message DBMethodRedis{
- // data config when push data to redis
- RedisClientConfig redisClientConfig = 1;
-}
-
-message RedisClientConfig{
- // redis address
- string addr = 1;
- // number of redis db
- int32 db = 2;
- // number of redis poolsize
- int32 poolsize = 3;
- // number of redis minidleconns
- int32 minIdleConns =4;
-}
-
-message DBMethodTDEngine{
- // data config when push data to tdengine
- TDEngineClientConfig tdEngineClientConfig = 1;
-}
-
-message TDEngineClientConfig{
- // tdengine address,like 127.0.0.1:6041
- string addr = 1;
- // tdengine database name
- string dbname = 2;
-}
-
-// MapperInfo is the information of mapper.
-message MapperInfo {
- // name of the mapper.
- string name = 1;
- // version of the mapper.
- string version = 2;
- // api version of the mapper.
- string api_version = 3;
- // the protocol of the mapper.
- string protocol = 4;
- // the address of the mapper. it is a unix domain socket of grpc.
- bytes address = 5;
- // the state of the mapper.
- string state = 6;
-}
-
-message ReportDeviceStatusRequest {
- string deviceName = 1;
- DeviceStatus reportedDevice = 2;
-}
-
-// DeviceStatus is the status of the device.
-message DeviceStatus {
- // the device twins of the device.
- repeated Twin twins = 1;
-}
-
-// Twin is the digital model of a device. It contains a series of properties.
-message Twin {
- // the name of the property.
- string propertyName = 1;
- // the observedDesired value of the property configured by mapper.
- TwinProperty observedDesired = 2;
- // the reported value of the property from the real device.
- TwinProperty reported = 3;
-}
-
-// TwinProperty is the specification of the property.
-message TwinProperty {
- // the value of the property.
- string value = 1;
- // the metadata to describe this property.
- map<string, string> metadata = 2;
-}
-
-message ReportDeviceStatusResponse {}
-
-message RegisterDeviceRequest {
- Device device = 1;
-}
-
-message RegisterDeviceResponse {
- string deviceName = 1;
-}
-
-message CreateDeviceModelRequest {
- DeviceModel model = 1;
-}
-
-message CreateDeviceModelResponse {
- string deviceModelName = 1;
-}
-
-message RemoveDeviceRequest {
- string deviceName = 1;
-}
-
-message RemoveDeviceResponse {}
-
-message RemoveDeviceModelRequest {
- string modelName = 1;
-}
-
-message RemoveDeviceModelResponse {}
-
-message UpdateDeviceRequest {
- Device device = 1;
-}
-
-message UpdateDeviceResponse {}
-
-message UpdateDeviceModelRequest {
- DeviceModel model = 1;
-}
-
-message UpdateDeviceModelResponse {}
-
-message GetDeviceRequest {
- string deviceName = 1;
-}
-
-message GetDeviceResponse {
- Device device = 1;
-}
diff --git a/staging/src/github.com/kubeedge/mapper-framework/pkg/dmi-api/api_grpc.pb.go b/staging/src/github.com/kubeedge/mapper-framework/pkg/dmi-api/api_grpc.pb.go
deleted file mode 100644
index 8d37c66a9..000000000
--- a/staging/src/github.com/kubeedge/mapper-framework/pkg/dmi-api/api_grpc.pb.go
+++ /dev/null
@@ -1,559 +0,0 @@
-//
-//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.
-// versions:
-// - protoc-gen-go-grpc v1.3.0
-// - protoc v3.20.3
-// source: api.proto
-
-package v1beta1
-
-import (
- context "context"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
-)
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-// 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.
-type DeviceManagerServiceClient interface {
- // MapperRegister registers the information of the mapper to device manager
- // when the mapper is online. Device manager returns the list of devices and device models which
- // this mapper should manage.
- MapperRegister(ctx context.Context, in *MapperRegisterRequest, opts ...grpc.CallOption) (*MapperRegisterResponse, error)
- // ReportDeviceStatus reports the status of devices to device manager.
- // 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)
-}
-
-type deviceManagerServiceClient struct {
- cc grpc.ClientConnInterface
-}
-
-func NewDeviceManagerServiceClient(cc grpc.ClientConnInterface) DeviceManagerServiceClient {
- return &deviceManagerServiceClient{cc}
-}
-
-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...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-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...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// DeviceManagerServiceServer is the server API for DeviceManagerService service.
-// All implementations must embed UnimplementedDeviceManagerServiceServer
-// for forward compatibility
-type DeviceManagerServiceServer interface {
- // MapperRegister registers the information of the mapper to device manager
- // when the mapper is online. Device manager returns the list of devices and device models which
- // this mapper should manage.
- MapperRegister(context.Context, *MapperRegisterRequest) (*MapperRegisterResponse, error)
- // ReportDeviceStatus reports the status of devices to device manager.
- // 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)
- mustEmbedUnimplementedDeviceManagerServiceServer()
-}
-
-// UnimplementedDeviceManagerServiceServer must be embedded to have forward compatible implementations.
-type UnimplementedDeviceManagerServiceServer struct {
-}
-
-func (UnimplementedDeviceManagerServiceServer) MapperRegister(context.Context, *MapperRegisterRequest) (*MapperRegisterResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method MapperRegister not implemented")
-}
-func (UnimplementedDeviceManagerServiceServer) ReportDeviceStatus(context.Context, *ReportDeviceStatusRequest) (*ReportDeviceStatusResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method ReportDeviceStatus not implemented")
-}
-func (UnimplementedDeviceManagerServiceServer) mustEmbedUnimplementedDeviceManagerServiceServer() {}
-
-// UnsafeDeviceManagerServiceServer may be embedded to opt out of forward compatibility for this service.
-// Use of this interface is not recommended, as added methods to DeviceManagerServiceServer will
-// result in compilation errors.
-type UnsafeDeviceManagerServiceServer interface {
- mustEmbedUnimplementedDeviceManagerServiceServer()
-}
-
-func RegisterDeviceManagerServiceServer(s grpc.ServiceRegistrar, srv DeviceManagerServiceServer) {
- s.RegisterService(&DeviceManagerService_ServiceDesc, srv)
-}
-
-func _DeviceManagerService_MapperRegister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(MapperRegisterRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(DeviceManagerServiceServer).MapperRegister(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: DeviceManagerService_MapperRegister_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(DeviceManagerServiceServer).MapperRegister(ctx, req.(*MapperRegisterRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _DeviceManagerService_ReportDeviceStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ReportDeviceStatusRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(DeviceManagerServiceServer).ReportDeviceStatus(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: DeviceManagerService_ReportDeviceStatus_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(DeviceManagerServiceServer).ReportDeviceStatus(ctx, req.(*ReportDeviceStatusRequest))
- }
- 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)
-var DeviceManagerService_ServiceDesc = grpc.ServiceDesc{
- ServiceName: "v1beta1.DeviceManagerService",
- HandlerType: (*DeviceManagerServiceServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "MapperRegister",
- Handler: _DeviceManagerService_MapperRegister_Handler,
- },
- {
- MethodName: "ReportDeviceStatus",
- Handler: _DeviceManagerService_ReportDeviceStatus_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.
-type DeviceMapperServiceClient interface {
- // RegisterDevice registers a device to the device mapper.
- // Device manager registers a device instance with the information of device
- // to the mapper through the interface of RegisterDevice.
- // When the mapper gets the request of register with device information,
- // it should add the device to the device list and connect to the real physical device via the specific protocol.
- RegisterDevice(ctx context.Context, in *RegisterDeviceRequest, opts ...grpc.CallOption) (*RegisterDeviceResponse, error)
- // RemoveDevice unregisters a device to the device mapper.
- // Device manager unregisters a device instance with the name of device
- // to the mapper through the interface of RemoveDevice.
- // When the mapper gets the request of unregister with device name,
- // it should remove the device from the device list and disconnect to the real physical device.
- RemoveDevice(ctx context.Context, in *RemoveDeviceRequest, opts ...grpc.CallOption) (*RemoveDeviceResponse, error)
- // UpdateDevice updates a device to the device mapper
- // Device manager updates the information of a device used by the mapper
- // through the interface of UpdateDevice.
- // The information of a device includes the meta data and the status data of a device.
- // When the mapper gets the request of updating with the information of a device,
- // it should update the device of the device list and connect to the real physical device via the updated information.
- UpdateDevice(ctx context.Context, in *UpdateDeviceRequest, opts ...grpc.CallOption) (*UpdateDeviceResponse, error)
- // CreateDeviceModel creates a device model to the device mapper.
- // Device manager sends the information of device model to the mapper
- // through the interface of CreateDeviceModel.
- // When the mapper gets the request of creating with the information of device model,
- // it should create a new device model to the list of device models.
- CreateDeviceModel(ctx context.Context, in *CreateDeviceModelRequest, opts ...grpc.CallOption) (*CreateDeviceModelResponse, error)
- // RemoveDeviceModel remove a device model to the device mapper.
- // Device manager sends the name of device model to the mapper
- // through the interface of RemoveDeviceModel.
- // When the mapper gets the request of removing with the name of device model,
- // it should remove the device model to the list of device models.
- RemoveDeviceModel(ctx context.Context, in *RemoveDeviceModelRequest, opts ...grpc.CallOption) (*RemoveDeviceModelResponse, error)
- // UpdateDeviceModel update a device model to the device mapper.
- // Device manager sends the information of device model to the mapper
- // through the interface of UpdateDeviceModel.
- // When the mapper gets the request of updating with the information of device model,
- // it should update the device model to the list of device models.
- UpdateDeviceModel(ctx context.Context, in *UpdateDeviceModelRequest, opts ...grpc.CallOption) (*UpdateDeviceModelResponse, error)
- // GetDevice get the information of a device from the device mapper.
- // Device sends the request of querying device information with the device name to the mapper
- // through the interface of GetDevice.
- // When the mapper gets the request of querying with the device name,
- // it should return the device information.
- GetDevice(ctx context.Context, in *GetDeviceRequest, opts ...grpc.CallOption) (*GetDeviceResponse, error)
-}
-
-type deviceMapperServiceClient struct {
- cc grpc.ClientConnInterface
-}
-
-func NewDeviceMapperServiceClient(cc grpc.ClientConnInterface) DeviceMapperServiceClient {
- return &deviceMapperServiceClient{cc}
-}
-
-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...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-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...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-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...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-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...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-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...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-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...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-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...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// DeviceMapperServiceServer is the server API for DeviceMapperService service.
-// All implementations must embed UnimplementedDeviceMapperServiceServer
-// for forward compatibility
-type DeviceMapperServiceServer interface {
- // RegisterDevice registers a device to the device mapper.
- // Device manager registers a device instance with the information of device
- // to the mapper through the interface of RegisterDevice.
- // When the mapper gets the request of register with device information,
- // it should add the device to the device list and connect to the real physical device via the specific protocol.
- RegisterDevice(context.Context, *RegisterDeviceRequest) (*RegisterDeviceResponse, error)
- // RemoveDevice unregisters a device to the device mapper.
- // Device manager unregisters a device instance with the name of device
- // to the mapper through the interface of RemoveDevice.
- // When the mapper gets the request of unregister with device name,
- // it should remove the device from the device list and disconnect to the real physical device.
- RemoveDevice(context.Context, *RemoveDeviceRequest) (*RemoveDeviceResponse, error)
- // UpdateDevice updates a device to the device mapper
- // Device manager updates the information of a device used by the mapper
- // through the interface of UpdateDevice.
- // The information of a device includes the meta data and the status data of a device.
- // When the mapper gets the request of updating with the information of a device,
- // it should update the device of the device list and connect to the real physical device via the updated information.
- UpdateDevice(context.Context, *UpdateDeviceRequest) (*UpdateDeviceResponse, error)
- // CreateDeviceModel creates a device model to the device mapper.
- // Device manager sends the information of device model to the mapper
- // through the interface of CreateDeviceModel.
- // When the mapper gets the request of creating with the information of device model,
- // it should create a new device model to the list of device models.
- CreateDeviceModel(context.Context, *CreateDeviceModelRequest) (*CreateDeviceModelResponse, error)
- // RemoveDeviceModel remove a device model to the device mapper.
- // Device manager sends the name of device model to the mapper
- // through the interface of RemoveDeviceModel.
- // When the mapper gets the request of removing with the name of device model,
- // it should remove the device model to the list of device models.
- RemoveDeviceModel(context.Context, *RemoveDeviceModelRequest) (*RemoveDeviceModelResponse, error)
- // UpdateDeviceModel update a device model to the device mapper.
- // Device manager sends the information of device model to the mapper
- // through the interface of UpdateDeviceModel.
- // When the mapper gets the request of updating with the information of device model,
- // it should update the device model to the list of device models.
- UpdateDeviceModel(context.Context, *UpdateDeviceModelRequest) (*UpdateDeviceModelResponse, error)
- // GetDevice get the information of a device from the device mapper.
- // Device sends the request of querying device information with the device name to the mapper
- // through the interface of GetDevice.
- // When the mapper gets the request of querying with the device name,
- // it should return the device information.
- GetDevice(context.Context, *GetDeviceRequest) (*GetDeviceResponse, error)
- mustEmbedUnimplementedDeviceMapperServiceServer()
-}
-
-// UnimplementedDeviceMapperServiceServer must be embedded to have forward compatible implementations.
-type UnimplementedDeviceMapperServiceServer struct {
-}
-
-func (UnimplementedDeviceMapperServiceServer) RegisterDevice(context.Context, *RegisterDeviceRequest) (*RegisterDeviceResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method RegisterDevice not implemented")
-}
-func (UnimplementedDeviceMapperServiceServer) RemoveDevice(context.Context, *RemoveDeviceRequest) (*RemoveDeviceResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method RemoveDevice not implemented")
-}
-func (UnimplementedDeviceMapperServiceServer) UpdateDevice(context.Context, *UpdateDeviceRequest) (*UpdateDeviceResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method UpdateDevice not implemented")
-}
-func (UnimplementedDeviceMapperServiceServer) CreateDeviceModel(context.Context, *CreateDeviceModelRequest) (*CreateDeviceModelResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method CreateDeviceModel not implemented")
-}
-func (UnimplementedDeviceMapperServiceServer) RemoveDeviceModel(context.Context, *RemoveDeviceModelRequest) (*RemoveDeviceModelResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method RemoveDeviceModel not implemented")
-}
-func (UnimplementedDeviceMapperServiceServer) UpdateDeviceModel(context.Context, *UpdateDeviceModelRequest) (*UpdateDeviceModelResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method UpdateDeviceModel not implemented")
-}
-func (UnimplementedDeviceMapperServiceServer) GetDevice(context.Context, *GetDeviceRequest) (*GetDeviceResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method GetDevice not implemented")
-}
-func (UnimplementedDeviceMapperServiceServer) mustEmbedUnimplementedDeviceMapperServiceServer() {}
-
-// UnsafeDeviceMapperServiceServer may be embedded to opt out of forward compatibility for this service.
-// Use of this interface is not recommended, as added methods to DeviceMapperServiceServer will
-// result in compilation errors.
-type UnsafeDeviceMapperServiceServer interface {
- mustEmbedUnimplementedDeviceMapperServiceServer()
-}
-
-func RegisterDeviceMapperServiceServer(s grpc.ServiceRegistrar, srv DeviceMapperServiceServer) {
- s.RegisterService(&DeviceMapperService_ServiceDesc, srv)
-}
-
-func _DeviceMapperService_RegisterDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(RegisterDeviceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(DeviceMapperServiceServer).RegisterDevice(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: DeviceMapperService_RegisterDevice_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(DeviceMapperServiceServer).RegisterDevice(ctx, req.(*RegisterDeviceRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _DeviceMapperService_RemoveDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(RemoveDeviceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(DeviceMapperServiceServer).RemoveDevice(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: DeviceMapperService_RemoveDevice_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(DeviceMapperServiceServer).RemoveDevice(ctx, req.(*RemoveDeviceRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _DeviceMapperService_UpdateDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UpdateDeviceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(DeviceMapperServiceServer).UpdateDevice(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: DeviceMapperService_UpdateDevice_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(DeviceMapperServiceServer).UpdateDevice(ctx, req.(*UpdateDeviceRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _DeviceMapperService_CreateDeviceModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(CreateDeviceModelRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(DeviceMapperServiceServer).CreateDeviceModel(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: DeviceMapperService_CreateDeviceModel_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(DeviceMapperServiceServer).CreateDeviceModel(ctx, req.(*CreateDeviceModelRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _DeviceMapperService_RemoveDeviceModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(RemoveDeviceModelRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(DeviceMapperServiceServer).RemoveDeviceModel(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: DeviceMapperService_RemoveDeviceModel_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(DeviceMapperServiceServer).RemoveDeviceModel(ctx, req.(*RemoveDeviceModelRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _DeviceMapperService_UpdateDeviceModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UpdateDeviceModelRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(DeviceMapperServiceServer).UpdateDeviceModel(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: DeviceMapperService_UpdateDeviceModel_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(DeviceMapperServiceServer).UpdateDeviceModel(ctx, req.(*UpdateDeviceModelRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _DeviceMapperService_GetDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetDeviceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(DeviceMapperServiceServer).GetDevice(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: DeviceMapperService_GetDevice_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(DeviceMapperServiceServer).GetDevice(ctx, req.(*GetDeviceRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-// DeviceMapperService_ServiceDesc is the grpc.ServiceDesc for DeviceMapperService service.
-// It's only intended for direct use with grpc.RegisterService,
-// and not to be introspected or modified (even as a copy)
-var DeviceMapperService_ServiceDesc = grpc.ServiceDesc{
- ServiceName: "v1beta1.DeviceMapperService",
- HandlerType: (*DeviceMapperServiceServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "RegisterDevice",
- Handler: _DeviceMapperService_RegisterDevice_Handler,
- },
- {
- MethodName: "RemoveDevice",
- Handler: _DeviceMapperService_RemoveDevice_Handler,
- },
- {
- MethodName: "UpdateDevice",
- Handler: _DeviceMapperService_UpdateDevice_Handler,
- },
- {
- MethodName: "CreateDeviceModel",
- Handler: _DeviceMapperService_CreateDeviceModel_Handler,
- },
- {
- MethodName: "RemoveDeviceModel",
- Handler: _DeviceMapperService_RemoveDeviceModel_Handler,
- },
- {
- MethodName: "UpdateDeviceModel",
- Handler: _DeviceMapperService_UpdateDeviceModel_Handler,
- },
- {
- MethodName: "GetDevice",
- Handler: _DeviceMapperService_GetDevice_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "api.proto",
-}
diff --git a/staging/src/github.com/kubeedge/mapper-framework/pkg/httpserver/callback.go b/staging/src/github.com/kubeedge/mapper-framework/pkg/httpserver/callback.go
index ac9d90308..ed85a7986 100644
--- a/staging/src/github.com/kubeedge/mapper-framework/pkg/httpserver/callback.go
+++ b/staging/src/github.com/kubeedge/mapper-framework/pkg/httpserver/callback.go
@@ -33,6 +33,7 @@ func (rs *RestServer) DeviceRead(writer http.ResponseWriter, request *http.Reque
Data: common.NewDataModel(
deviceName,
propertyName,
+ deviceNamespace,
common.WithValue(res),
common.WithType(dataType),
),
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 90c1a9876..0377da069 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
@@ -145,6 +145,16 @@ func buildPropertiesFromGrpc(device *dmiapi.Device) []common.DeviceProperty {
dbconfig = common.DBConfig{
TDEngineClientConfig: clientConfig,
}
+ case pptv.PushMethod.DBMethod.Mysql != nil:
+ dbMethodName = "mysql"
+ clientConfig, err := json.Marshal(pptv.PushMethod.DBMethod.Mysql.MysqlClientConfig)
+ if err != nil {
+ klog.Errorf("mysql config err: %+v", err)
+ return nil
+ }
+ dbconfig = common.DBConfig{
+ MySQLClientConfig: clientConfig,
+ }
default:
klog.Errorf("get DBMethod err: Unsupported database type")
}
diff --git a/tests/scripts/keadm_compatibility_e2e.sh b/tests/scripts/keadm_compatibility_e2e.sh
index beeada334..71b69bd72 100755
--- a/tests/scripts/keadm_compatibility_e2e.sh
+++ b/tests/scripts/keadm_compatibility_e2e.sh
@@ -77,7 +77,7 @@ function start_kubeedge() {
export MASTER_IP=`kubectl get node test-control-plane -o jsonpath={.status.addresses[0].address}`
export KUBECONFIG=$HOME/.kube/config
docker run --rm kubeedge/installation-package:$IMAGE_TAG cat /usr/local/bin/keadm > /usr/local/bin/keadm && chmod +x /usr/local/bin/keadm
- /usr/local/bin/keadm init --advertise-address=$MASTER_IP --profile version=$CLOUD_EDGE_VERSION --set cloudCore.service.enable=false --kube-config=$KUBECONFIG --force
+ /usr/local/bin/keadm init --advertise-address=$MASTER_IP --profile version --set cloudCore.service.enable=false --kube-config=$KUBECONFIG --force
# ensure tokensecret is generated
while true; do
diff --git a/tests/scripts/keadm_e2e.sh b/tests/scripts/keadm_e2e.sh
index cc0e188ab..a34ff890b 100755
--- a/tests/scripts/keadm_e2e.sh
+++ b/tests/scripts/keadm_e2e.sh
@@ -75,7 +75,7 @@ function start_kubeedge() {
export MASTER_IP=`kubectl get node test-control-plane -o jsonpath={.status.addresses[0].address}`
export KUBECONFIG=$HOME/.kube/config
docker run --rm kubeedge/installation-package:$IMAGE_TAG cat /usr/local/bin/keadm > /usr/local/bin/keadm && chmod +x /usr/local/bin/keadm
- /usr/local/bin/keadm init --advertise-address=$MASTER_IP --profile version=$KUBEEDGE_VERSION --set cloudCore.service.enable=false --kube-config=$KUBECONFIG --force
+ /usr/local/bin/keadm init --advertise-address=$MASTER_IP --profile version --set cloudCore.service.enable=false --kube-config=$KUBECONFIG --force
# ensure tokensecret is generated
while true; do
diff --git a/vendor/k8s.io/client-go/util/certificate/OWNERS b/vendor/k8s.io/client-go/util/certificate/OWNERS
new file mode 100644
index 000000000..3c3b94c58
--- /dev/null
+++ b/vendor/k8s.io/client-go/util/certificate/OWNERS
@@ -0,0 +1,8 @@
+# See the OWNERS docs at https://go.k8s.io/owners
+
+approvers:
+ - sig-auth-certificates-approvers
+reviewers:
+ - sig-auth-certificates-reviewers
+labels:
+ - sig/auth
diff --git a/vendor/k8s.io/client-go/util/certificate/certificate_manager.go b/vendor/k8s.io/client-go/util/certificate/certificate_manager.go
new file mode 100644
index 000000000..b290961ea
--- /dev/null
+++ b/vendor/k8s.io/client-go/util/certificate/certificate_manager.go
@@ -0,0 +1,775 @@
+/*
+Copyright 2017 The Kubernetes 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 certificate
+
+import (
+ "context"
+ "crypto/ecdsa"
+ "crypto/elliptic"
+ cryptorand "crypto/rand"
+ "crypto/rsa"
+ "crypto/tls"
+ "crypto/x509"
+ "encoding/pem"
+ "errors"
+ "fmt"
+ "reflect"
+ "sync"
+ "time"
+
+ "k8s.io/klog/v2"
+
+ certificates "k8s.io/api/certificates/v1"
+ apierrors "k8s.io/apimachinery/pkg/api/errors"
+ utilruntime "k8s.io/apimachinery/pkg/util/runtime"
+ "k8s.io/apimachinery/pkg/util/sets"
+ "k8s.io/apimachinery/pkg/util/wait"
+ clientset "k8s.io/client-go/kubernetes"
+ "k8s.io/client-go/util/cert"
+ "k8s.io/client-go/util/certificate/csr"
+ "k8s.io/client-go/util/keyutil"
+)
+
+var (
+ // certificateWaitTimeout controls the amount of time we wait for certificate
+ // approval in one iteration.
+ certificateWaitTimeout = 15 * time.Minute
+
+ kubeletServingUsagesWithEncipherment = []certificates.KeyUsage{
+ // https://tools.ietf.org/html/rfc5280#section-4.2.1.3
+ //
+ // Digital signature allows the certificate to be used to verify
+ // digital signatures used during TLS negotiation.
+ certificates.UsageDigitalSignature,
+ // KeyEncipherment allows the cert/key pair to be used to encrypt
+ // keys, including the symmetric keys negotiated during TLS setup
+ // and used for data transfer.
+ certificates.UsageKeyEncipherment,
+ // ServerAuth allows the cert to be used by a TLS server to
+ // authenticate itself to a TLS client.
+ certificates.UsageServerAuth,
+ }
+ kubeletServingUsagesNoEncipherment = []certificates.KeyUsage{
+ // https://tools.ietf.org/html/rfc5280#section-4.2.1.3
+ //
+ // Digital signature allows the certificate to be used to verify
+ // digital signatures used during TLS negotiation.
+ certificates.UsageDigitalSignature,
+ // ServerAuth allows the cert to be used by a TLS server to
+ // authenticate itself to a TLS client.
+ certificates.UsageServerAuth,
+ }
+ DefaultKubeletServingGetUsages = func(privateKey interface{}) []certificates.KeyUsage {
+ switch privateKey.(type) {
+ case *rsa.PrivateKey:
+ return kubeletServingUsagesWithEncipherment
+ default:
+ return kubeletServingUsagesNoEncipherment
+ }
+ }
+ kubeletClientUsagesWithEncipherment = []certificates.KeyUsage{
+ // https://tools.ietf.org/html/rfc5280#section-4.2.1.3
+ //
+ // Digital signature allows the certificate to be used to verify
+ // digital signatures used during TLS negotiation.
+ certificates.UsageDigitalSignature,
+ // KeyEncipherment allows the cert/key pair to be used to encrypt
+ // keys, including the symmetric keys negotiated during TLS setup
+ // and used for data transfer.
+ certificates.UsageKeyEncipherment,
+ // ClientAuth allows the cert to be used by a TLS client to
+ // authenticate itself to the TLS server.
+ certificates.UsageClientAuth,
+ }
+ kubeletClientUsagesNoEncipherment = []certificates.KeyUsage{
+ // https://tools.ietf.org/html/rfc5280#section-4.2.1.3
+ //
+ // Digital signature allows the certificate to be used to verify
+ // digital signatures used during TLS negotiation.
+ certificates.UsageDigitalSignature,
+ // ClientAuth allows the cert to be used by a TLS client to
+ // authenticate itself to the TLS server.
+ certificates.UsageClientAuth,
+ }
+ DefaultKubeletClientGetUsages = func(privateKey interface{}) []certificates.KeyUsage {
+ switch privateKey.(type) {
+ case *rsa.PrivateKey:
+ return kubeletClientUsagesWithEncipherment
+ default:
+ return kubeletClientUsagesNoEncipherment
+ }
+ }
+)
+
+// Manager maintains and updates the certificates in use by this certificate
+// manager. In the background it communicates with the API server to get new
+// certificates for certificates about to expire.
+type Manager interface {
+ // Start the API server status sync loop.
+ Start()
+ // Stop the cert manager loop.
+ Stop()
+ // Current returns the currently selected certificate from the
+ // certificate manager, as well as the associated certificate and key data
+ // in PEM format.
+ Current() *tls.Certificate
+ // ServerHealthy returns true if the manager is able to communicate with
+ // the server. This allows a caller to determine whether the cert manager
+ // thinks it can potentially talk to the API server. The cert manager may
+ // be very conservative and only return true if recent communication has
+ // occurred with the server.
+ ServerHealthy() bool
+}
+
+// Config is the set of configuration parameters available for a new Manager.
+type Config struct {
+ // ClientsetFn will be used to create a clientset for
+ // creating/fetching new certificate requests generated when a key rotation occurs.
+ // The function will never be invoked in parallel.
+ // It is passed the current client certificate if one exists.
+ ClientsetFn ClientsetFunc
+ // Template is the CertificateRequest that will be used as a template for
+ // generating certificate signing requests for all new keys generated as
+ // part of rotation. It follows the same rules as the template parameter of
+ // crypto.x509.CreateCertificateRequest in the Go standard libraries.
+ Template *x509.CertificateRequest
+ // GetTemplate returns the CertificateRequest that will be used as a template for
+ // generating certificate signing requests for all new keys generated as
+ // part of rotation. It follows the same rules as the template parameter of
+ // crypto.x509.CreateCertificateRequest in the Go standard libraries.
+ // If no template is available, nil may be returned, and no certificate will be requested.
+ // If specified, takes precedence over Template.
+ GetTemplate func() *x509.CertificateRequest
+ // SignerName is the name of the certificate signer that should sign certificates
+ // generated by the manager.
+ SignerName string
+ // RequestedCertificateLifetime is the requested lifetime length for certificates generated by the manager.
+ // Optional.
+ // This will set the spec.expirationSeconds field on the CSR. Controlling the lifetime of
+ // the issued certificate is not guaranteed as the signer may choose to ignore the request.
+ RequestedCertificateLifetime *time.Duration
+ // Usages is the types of usages that certificates generated by the manager
+ // can be used for. It is mutually exclusive with GetUsages.
+ Usages []certificates.KeyUsage
+ // GetUsages is dynamic way to get the types of usages that certificates generated by the manager
+ // can be used for. If Usages is not nil, GetUsages has to be nil, vice versa.
+ // It is mutually exclusive with Usages.
+ GetUsages func(privateKey interface{}) []certificates.KeyUsage
+ // CertificateStore is a persistent store where the current cert/key is
+ // kept and future cert/key pairs will be persisted after they are
+ // generated.
+ CertificateStore Store
+ // BootstrapCertificatePEM is the certificate data that will be returned
+ // from the Manager if the CertificateStore doesn't have any cert/key pairs
+ // currently available and has not yet had a chance to get a new cert/key
+ // pair from the API. If the CertificateStore does have a cert/key pair,
+ // this will be ignored. If there is no cert/key pair available in the
+ // CertificateStore, as soon as Start is called, it will request a new
+ // cert/key pair from the CertificateSigningRequestClient. This is intended
+ // to allow the first boot of a component to be initialized using a
+ // generic, multi-use cert/key pair which will be quickly replaced with a
+ // unique cert/key pair.
+ BootstrapCertificatePEM []byte
+ // BootstrapKeyPEM is the key data that will be returned from the Manager
+ // if the CertificateStore doesn't have any cert/key pairs currently
+ // available. If the CertificateStore does have a cert/key pair, this will
+ // be ignored. If the bootstrap cert/key pair are used, they will be
+ // rotated at the first opportunity, possibly well in advance of expiring.
+ // This is intended to allow the first boot of a component to be
+ // initialized using a generic, multi-use cert/key pair which will be
+ // quickly replaced with a unique cert/key pair.
+ BootstrapKeyPEM []byte `datapolicy:"security-key"`
+ // CertificateRotation will record a metric showing the time in seconds
+ // that certificates lived before being rotated. This metric is a histogram
+ // because there is value in keeping a history of rotation cadences. It
+ // allows one to setup monitoring and alerting of unexpected rotation
+ // behavior and track trends in rotation frequency.
+ CertificateRotation Histogram
+ // CertifcateRenewFailure will record a metric that keeps track of
+ // certificate renewal failures.
+ CertificateRenewFailure Counter
+ // Name is an optional string that will be used when writing log output
+ // or returning errors from manager methods. If not set, SignerName will
+ // be used, if SignerName is not set, if Usages includes client auth the
+ // name will be "client auth", otherwise the value will be "server".
+ Name string
+ // Logf is an optional function that log output will be sent to from the
+ // certificate manager. If not set it will use klog.V(2)
+ Logf func(format string, args ...interface{})
+}
+
+// Store is responsible for getting and updating the current certificate.
+// Depending on the concrete implementation, the backing store for this
+// behavior may vary.
+type Store interface {
+ // Current returns the currently selected certificate, as well as the
+ // associated certificate and key data in PEM format. If the Store doesn't
+ // have a cert/key pair currently, it should return a NoCertKeyError so
+ // that the Manager can recover by using bootstrap certificates to request
+ // a new cert/key pair.
+ Current() (*tls.Certificate, error)
+ // Update accepts the PEM data for the cert/key pair and makes the new
+ // cert/key pair the 'current' pair, that will be returned by future calls
+ // to Current().
+ Update(cert, key []byte) (*tls.Certificate, error)
+}
+
+// Gauge will record the remaining lifetime of the certificate each time it is
+// updated.
+type Gauge interface {
+ Set(float64)
+}
+
+// Histogram will record the time a rotated certificate was used before being
+// rotated.
+type Histogram interface {
+ Observe(float64)
+}
+
+// Counter will wrap a counter with labels
+type Counter interface {
+ Inc()
+}
+
+// NoCertKeyError indicates there is no cert/key currently available.
+type NoCertKeyError string
+
+// ClientsetFunc returns a new clientset for discovering CSR API availability and requesting CSRs.
+// It is passed the current certificate if one is available and valid.
+type ClientsetFunc func(current *tls.Certificate) (clientset.Interface, error)
+
+func (e *NoCertKeyError) Error() string { return string(*e) }
+
+type manager struct {
+ getTemplate func() *x509.CertificateRequest
+
+ // lastRequestLock guards lastRequestCancel and lastRequest
+ lastRequestLock sync.Mutex
+ lastRequestCancel context.CancelFunc
+ lastRequest *x509.CertificateRequest
+
+ dynamicTemplate bool
+ signerName string
+ requestedCertificateLifetime *time.Duration
+ getUsages func(privateKey interface{}) []certificates.KeyUsage
+ forceRotation bool
+
+ certStore Store
+
+ certificateRotation Histogram
+ certificateRenewFailure Counter
+
+ // the following variables must only be accessed under certAccessLock
+ certAccessLock sync.RWMutex
+ cert *tls.Certificate
+ serverHealth bool
+
+ // the clientFn must only be accessed under the clientAccessLock
+ clientAccessLock sync.Mutex
+ clientsetFn ClientsetFunc
+ stopCh chan struct{}
+ stopped bool
+
+ // Set to time.Now but can be stubbed out for testing
+ now func() time.Time
+
+ name string
+ logf func(format string, args ...interface{})
+}
+
+// NewManager returns a new certificate manager. A certificate manager is
+// responsible for being the authoritative source of certificates in the
+// Kubelet and handling updates due to rotation.
+func NewManager(config *Config) (Manager, error) {
+ cert, forceRotation, err := getCurrentCertificateOrBootstrap(
+ config.CertificateStore,
+ config.BootstrapCertificatePEM,
+ config.BootstrapKeyPEM)
+ if err != nil {
+ return nil, err
+ }
+
+ getTemplate := config.GetTemplate
+ if getTemplate == nil {
+ getTemplate = func() *x509.CertificateRequest { return config.Template }
+ }
+
+ if config.GetUsages != nil && config.Usages != nil {
+ return nil, errors.New("cannot specify both GetUsages and Usages")
+ }
+ if config.GetUsages == nil && config.Usages == nil {
+ return nil, errors.New("either GetUsages or Usages should be specified")
+ }
+ var getUsages func(interface{}) []certificates.KeyUsage
+ if config.GetUsages != nil {
+ getUsages = config.GetUsages
+ } else {
+ getUsages = func(interface{}) []certificates.KeyUsage { return config.Usages }
+ }
+ m := manager{
+ stopCh: make(chan struct{}),
+ clientsetFn: config.ClientsetFn,
+ getTemplate: getTemplate,
+ dynamicTemplate: config.GetTemplate != nil,
+ signerName: config.SignerName,
+ requestedCertificateLifetime: config.RequestedCertificateLifetime,
+ getUsages: getUsages,
+ certStore: config.CertificateStore,
+ cert: cert,
+ forceRotation: forceRotation,
+ certificateRotation: config.CertificateRotation,
+ certificateRenewFailure: config.CertificateRenewFailure,
+ now: time.Now,
+ }
+
+ name := config.Name
+ if len(name) == 0 {
+ name = m.signerName
+ }
+ if len(name) == 0 {
+ usages := getUsages(nil)
+ switch {
+ case hasKeyUsage(usages, certificates.UsageClientAuth):
+ name = string(certificates.UsageClientAuth)
+ default:
+ name = "certificate"
+ }
+ }
+
+ m.name = name
+ m.logf = config.Logf
+ if m.logf == nil {
+ m.logf = func(format string, args ...interface{}) { klog.V(2).Infof(format, args...) }
+ }
+
+ return &m, nil
+}
+
+// Current returns the currently selected certificate from the certificate
+// manager. This can be nil if the manager was initialized without a
+// certificate and has not yet received one from the
+// CertificateSigningRequestClient, or if the current cert has expired.
+func (m *manager) Current() *tls.Certificate {
+ m.certAccessLock.RLock()
+ defer m.certAccessLock.RUnlock()
+ if m.cert != nil && m.cert.Leaf != nil && m.now().After(m.cert.Leaf.NotAfter) {
+ m.logf("%s: Current certificate is expired", m.name)
+ return nil
+ }
+ return m.cert
+}
+
+// ServerHealthy returns true if the cert manager believes the server
+// is currently alive.
+func (m *manager) ServerHealthy() bool {
+ m.certAccessLock.RLock()
+ defer m.certAccessLock.RUnlock()
+ return m.serverHealth
+}
+
+// Stop terminates the manager.
+func (m *manager) Stop() {
+ m.clientAccessLock.Lock()
+ defer m.clientAccessLock.Unlock()
+ if m.stopped {
+ return
+ }
+ close(m.stopCh)
+ m.stopped = true
+}
+
+// Start will start the background work of rotating the certificates.
+func (m *manager) Start() {
+ // Certificate rotation depends on access to the API server certificate
+ // signing API, so don't start the certificate manager if we don't have a
+ // client.
+ if m.clientsetFn == nil {
+ m.logf("%s: Certificate rotation is not enabled, no connection to the apiserver", m.name)
+ return
+ }
+ m.logf("%s: Certificate rotation is enabled", m.name)
+
+ templateChanged := make(chan struct{})
+ go wait.Until(func() {
+ deadline := m.nextRotationDeadline()
+ if sleepInterval := deadline.Sub(m.now()); sleepInterval > 0 {
+ m.logf("%s: Waiting %v for next certificate rotation", m.name, sleepInterval)
+
+ timer := time.NewTimer(sleepInterval)
+ defer timer.Stop()
+
+ select {
+ case <-timer.C:
+ // unblock when deadline expires
+ case <-templateChanged:
+ _, lastRequestTemplate := m.getLastRequest()
+ if reflect.DeepEqual(lastRequestTemplate, m.getTemplate()) {
+ // if the template now matches what we last requested, restart the rotation deadline loop
+ return
+ }
+ m.logf("%s: Certificate template changed, rotating", m.name)
+ }
+ }
+
+ // Don't enter rotateCerts and trigger backoff if we don't even have a template to request yet
+ if m.getTemplate() == nil {
+ return
+ }
+
+ backoff := wait.Backoff{
+ Duration: 2 * time.Second,
+ Factor: 2,
+ Jitter: 0.1,
+ Steps: 5,
+ }
+ if err := wait.ExponentialBackoff(backoff, m.rotateCerts); err != nil {
+ utilruntime.HandleError(fmt.Errorf("%s: Reached backoff limit, still unable to rotate certs: %v", m.name, err))
+ wait.PollInfinite(32*time.Second, m.rotateCerts)
+ }
+ }, time.Second, m.stopCh)
+
+ if m.dynamicTemplate {
+ go wait.Until(func() {
+ // check if the current template matches what we last requested
+ lastRequestCancel, lastRequestTemplate := m.getLastRequest()
+
+ if !m.certSatisfiesTemplate() && !reflect.DeepEqual(lastRequestTemplate, m.getTemplate()) {
+ // if the template is different, queue up an interrupt of the rotation deadline loop.
+ // if we've requested a CSR that matches the new template by the time the interrupt is handled, the interrupt is disregarded.
+ if lastRequestCancel != nil {
+ // if we're currently waiting on a submitted request that no longer matches what we want, stop waiting
+ lastRequestCancel()
+ }
+ select {
+ case templateChanged <- struct{}{}:
+ case <-m.stopCh:
+ }
+ }
+ }, time.Second, m.stopCh)
+ }
+}
+
+func getCurrentCertificateOrBootstrap(
+ store Store,
+ bootstrapCertificatePEM []byte,
+ bootstrapKeyPEM []byte) (cert *tls.Certificate, shouldRotate bool, errResult error) {
+
+ currentCert, err := store.Current()
+ if err == nil {
+ // if the current cert is expired, fall back to the bootstrap cert
+ if currentCert.Leaf != nil && time.Now().Before(currentCert.Leaf.NotAfter) {
+ return currentCert, false, nil
+ }
+ } else {
+ if _, ok := err.(*NoCertKeyError); !ok {
+ return nil, false, err
+ }
+ }
+
+ if bootstrapCertificatePEM == nil || bootstrapKeyPEM == nil {
+ return nil, true, nil
+ }
+
+ bootstrapCert, err := tls.X509KeyPair(bootstrapCertificatePEM, bootstrapKeyPEM)
+ if err != nil {
+ return nil, false, err
+ }
+ if len(bootstrapCert.Certificate) < 1 {
+ return nil, false, fmt.Errorf("no cert/key data found")
+ }
+
+ certs, err := x509.ParseCertificates(bootstrapCert.Certificate[0])
+ if err != nil {
+ return nil, false, fmt.Errorf("unable to parse certificate data: %v", err)
+ }
+ if len(certs) < 1 {
+ return nil, false, fmt.Errorf("no cert data found")
+ }
+ bootstrapCert.Leaf = certs[0]
+
+ if _, err := store.Update(bootstrapCertificatePEM, bootstrapKeyPEM); err != nil {
+ utilruntime.HandleError(fmt.Errorf("unable to set the cert/key pair to the bootstrap certificate: %v", err))
+ }
+
+ return &bootstrapCert, true, nil
+}
+
+func (m *manager) getClientset() (clientset.Interface, error) {
+ current := m.Current()
+ m.clientAccessLock.Lock()
+ defer m.clientAccessLock.Unlock()
+ return m.clientsetFn(current)
+}
+
+// RotateCerts is exposed for testing only and is not a part of the public interface.
+// Returns true if it changed the cert, false otherwise. Error is only returned in
+// exceptional cases.
+func (m *manager) RotateCerts() (bool, error) {
+ return m.rotateCerts()
+}
+
+// rotateCerts attempts to request a client cert from the server, wait a reasonable
+// period of time for it to be signed, and then update the cert on disk. If it cannot
+// retrieve a cert, it will return false. It will only return error in exceptional cases.
+// This method also keeps track of "server health" by interpreting the responses it gets
+// from the server on the various calls it makes.
+// TODO: return errors, have callers handle and log them correctly
+func (m *manager) rotateCerts() (bool, error) {
+ m.logf("%s: Rotating certificates", m.name)
+
+ template, csrPEM, keyPEM, privateKey, err := m.generateCSR()
+ if err != nil {
+ utilruntime.HandleError(fmt.Errorf("%s: Unable to generate a certificate signing request: %v", m.name, err))
+ if m.certificateRenewFailure != nil {
+ m.certificateRenewFailure.Inc()
+ }
+ return false, nil
+ }
+
+ // request the client each time
+ clientSet, err := m.getClientset()
+ if err != nil {
+ utilruntime.HandleError(fmt.Errorf("%s: Unable to load a client to request certificates: %v", m.name, err))
+ if m.certificateRenewFailure != nil {
+ m.certificateRenewFailure.Inc()
+ }
+ return false, nil
+ }
+
+ getUsages := m.getUsages
+ if m.getUsages == nil {
+ getUsages = DefaultKubeletClientGetUsages
+ }
+ usages := getUsages(privateKey)
+ // Call the Certificate Signing Request API to get a certificate for the
+ // new private key
+ reqName, reqUID, err := csr.RequestCertificate(clientSet, csrPEM, m.name, m.signerName, m.requestedCertificateLifetime, usages, privateKey)
+ if err != nil {
+ utilruntime.HandleError(fmt.Errorf("%s: Failed while requesting a signed certificate from the control plane: %v", m.name, err))
+ if m.certificateRenewFailure != nil {
+ m.certificateRenewFailure.Inc()
+ }
+ return false, m.updateServerError(err)
+ }
+
+ ctx, cancel := context.WithTimeout(context.Background(), certificateWaitTimeout)
+ defer cancel()
+
+ // Once we've successfully submitted a CSR for this template, record that we did so
+ m.setLastRequest(cancel, template)
+
+ // Wait for the certificate to be signed. This interface and internal timout
+ // is a remainder after the old design using raw watch wrapped with backoff.
+ crtPEM, err := csr.WaitForCertificateForEdge(ctx, clientSet, reqName, reqUID)
+ if err != nil {
+ utilruntime.HandleError(fmt.Errorf("%s: certificate request was not signed: %v", m.name, err))
+ if m.certificateRenewFailure != nil {
+ m.certificateRenewFailure.Inc()
+ }
+ return false, nil
+ }
+
+ cert, err := m.certStore.Update(crtPEM, keyPEM)
+ if err != nil {
+ utilruntime.HandleError(fmt.Errorf("%s: Unable to store the new cert/key pair: %v", m.name, err))
+ if m.certificateRenewFailure != nil {
+ m.certificateRenewFailure.Inc()
+ }
+ return false, nil
+ }
+
+ if old := m.updateCached(cert); old != nil && m.certificateRotation != nil {
+ m.certificateRotation.Observe(m.now().Sub(old.Leaf.NotBefore).Seconds())
+ }
+
+ return true, nil
+}
+
+// Check that the current certificate on disk satisfies the requests from the
+// current template.
+//
+// Note that extra items in the certificate's SAN or orgs that don't exist in
+// the template will not trigger a renewal.
+//
+// Requires certAccessLock to be locked.
+func (m *manager) certSatisfiesTemplateLocked() bool {
+ if m.cert == nil {
+ return false
+ }
+
+ if template := m.getTemplate(); template != nil {
+ if template.Subject.CommonName != m.cert.Leaf.Subject.CommonName {
+ m.logf("%s: Current certificate CN (%s) does not match requested CN (%s)", m.name, m.cert.Leaf.Subject.CommonName, template.Subject.CommonName)
+ return false
+ }
+
+ currentDNSNames := sets.NewString(m.cert.Leaf.DNSNames...)
+ desiredDNSNames := sets.NewString(template.DNSNames...)
+ missingDNSNames := desiredDNSNames.Difference(currentDNSNames)
+ if len(missingDNSNames) > 0 {
+ m.logf("%s: Current certificate is missing requested DNS names %v", m.name, missingDNSNames.List())
+ return false
+ }
+
+ currentIPs := sets.NewString()
+ for _, ip := range m.cert.Leaf.IPAddresses {
+ currentIPs.Insert(ip.String())
+ }
+ desiredIPs := sets.NewString()
+ for _, ip := range template.IPAddresses {
+ desiredIPs.Insert(ip.String())
+ }
+ missingIPs := desiredIPs.Difference(currentIPs)
+ if len(missingIPs) > 0 {
+ m.logf("%s: Current certificate is missing requested IP addresses %v", m.name, missingIPs.List())
+ return false
+ }
+
+ currentOrgs := sets.NewString(m.cert.Leaf.Subject.Organization...)
+ desiredOrgs := sets.NewString(template.Subject.Organization...)
+ missingOrgs := desiredOrgs.Difference(currentOrgs)
+ if len(missingOrgs) > 0 {
+ m.logf("%s: Current certificate is missing requested orgs %v", m.name, missingOrgs.List())
+ return false
+ }
+ }
+
+ return true
+}
+
+func (m *manager) certSatisfiesTemplate() bool {
+ m.certAccessLock.RLock()
+ defer m.certAccessLock.RUnlock()
+ return m.certSatisfiesTemplateLocked()
+}
+
+// nextRotationDeadline returns a value for the threshold at which the
+// current certificate should be rotated, 80%+/-10% of the expiration of the
+// certificate.
+func (m *manager) nextRotationDeadline() time.Time {
+ // forceRotation is not protected by locks
+ if m.forceRotation {
+ m.forceRotation = false
+ return m.now()
+ }
+
+ m.certAccessLock.RLock()
+ defer m.certAccessLock.RUnlock()
+
+ if !m.certSatisfiesTemplateLocked() {
+ return m.now()
+ }
+
+ notAfter := m.cert.Leaf.NotAfter
+ totalDuration := float64(notAfter.Sub(m.cert.Leaf.NotBefore))
+ deadline := m.cert.Leaf.NotBefore.Add(jitteryDuration(totalDuration))
+
+ m.logf("%s: Certificate expiration is %v, rotation deadline is %v", m.name, notAfter, deadline)
+ return deadline
+}
+
+// jitteryDuration uses some jitter to set the rotation threshold so each node
+// will rotate at approximately 70-90% of the total lifetime of the
+// certificate. With jitter, if a number of nodes are added to a cluster at
+// approximately the same time (such as cluster creation time), they won't all
+// try to rotate certificates at the same time for the rest of the life of the
+// cluster.
+//
+// This function is represented as a variable to allow replacement during testing.
+var jitteryDuration = func(totalDuration float64) time.Duration {
+ return wait.Jitter(time.Duration(totalDuration), 0.2) - time.Duration(totalDuration*0.3)
+}
+
+// updateCached sets the most recent retrieved cert and returns the old cert.
+// It also sets the server as assumed healthy.
+func (m *manager) updateCached(cert *tls.Certificate) *tls.Certificate {
+ m.certAccessLock.Lock()
+ defer m.certAccessLock.Unlock()
+ m.serverHealth = true
+ old := m.cert
+ m.cert = cert
+ return old
+}
+
+// updateServerError takes an error returned by the server and infers
+// the health of the server based on the error. It will return nil if
+// the error does not require immediate termination of any wait loops,
+// and otherwise it will return the error.
+func (m *manager) updateServerError(err error) error {
+ m.certAccessLock.Lock()
+ defer m.certAccessLock.Unlock()
+ switch {
+ case apierrors.IsUnauthorized(err):
+ // SSL terminating proxies may report this error instead of the master
+ m.serverHealth = true
+ case apierrors.IsUnexpectedServerError(err):
+ // generally indicates a proxy or other load balancer problem, rather than a problem coming
+ // from the master
+ m.serverHealth = false
+ default:
+ // Identify known errors that could be expected for a cert request that
+ // indicate everything is working normally
+ m.serverHealth = apierrors.IsNotFound(err) || apierrors.IsForbidden(err)
+ }
+ return nil
+}
+
+func (m *manager) generateCSR() (template *x509.CertificateRequest, csrPEM []byte, keyPEM []byte, key interface{}, err error) {
+ // Generate a new private key.
+ privateKey, err := ecdsa.GenerateKey(elliptic.P256(), cryptorand.Reader)
+ if err != nil {
+ return nil, nil, nil, nil, fmt.Errorf("%s: unable to generate a new private key: %v", m.name, err)
+ }
+ der, err := x509.MarshalECPrivateKey(privateKey)
+ if err != nil {
+ return nil, nil, nil, nil, fmt.Errorf("%s: unable to marshal the new key to DER: %v", m.name, err)
+ }
+
+ keyPEM = pem.EncodeToMemory(&pem.Block{Type: keyutil.ECPrivateKeyBlockType, Bytes: der})
+
+ template = m.getTemplate()
+ if template == nil {
+ return nil, nil, nil, nil, fmt.Errorf("%s: unable to create a csr, no template available", m.name)
+ }
+ csrPEM, err = cert.MakeCSRFromTemplate(privateKey, template)
+ if err != nil {
+ return nil, nil, nil, nil, fmt.Errorf("%s: unable to create a csr from the private key: %v", m.name, err)
+ }
+ return template, csrPEM, keyPEM, privateKey, nil
+}
+
+func (m *manager) getLastRequest() (context.CancelFunc, *x509.CertificateRequest) {
+ m.lastRequestLock.Lock()
+ defer m.lastRequestLock.Unlock()
+ return m.lastRequestCancel, m.lastRequest
+}
+
+func (m *manager) setLastRequest(cancel context.CancelFunc, r *x509.CertificateRequest) {
+ m.lastRequestLock.Lock()
+ defer m.lastRequestLock.Unlock()
+ m.lastRequestCancel = cancel
+ m.lastRequest = r
+}
+
+func hasKeyUsage(usages []certificates.KeyUsage, usage certificates.KeyUsage) bool {
+ for _, u := range usages {
+ if u == usage {
+ return true
+ }
+ }
+ return false
+}
diff --git a/vendor/k8s.io/client-go/util/certificate/certificate_store.go b/vendor/k8s.io/client-go/util/certificate/certificate_store.go
new file mode 100644
index 000000000..e7ed58ee8
--- /dev/null
+++ b/vendor/k8s.io/client-go/util/certificate/certificate_store.go
@@ -0,0 +1,318 @@
+/*
+Copyright 2017 The Kubernetes 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 certificate
+
+import (
+ "crypto/tls"
+ "crypto/x509"
+ "encoding/pem"
+ "fmt"
+ "os"
+ "path/filepath"
+ "time"
+
+ certutil "k8s.io/client-go/util/cert"
+ "k8s.io/klog/v2"
+)
+
+const (
+ keyExtension = ".key"
+ certExtension = ".crt"
+ pemExtension = ".pem"
+ currentPair = "current"
+ updatedPair = "updated"
+)
+
+type fileStore struct {
+ pairNamePrefix string
+ certDirectory string
+ keyDirectory string
+ certFile string
+ keyFile string
+}
+
+// FileStore is a store that provides certificate retrieval as well as
+// the path on disk of the current PEM.
+type FileStore interface {
+ Store
+ // CurrentPath returns the path on disk of the current certificate/key
+ // pair encoded as PEM files.
+ CurrentPath() string
+}
+
+// NewFileStore returns a concrete implementation of a Store that is based on
+// storing the cert/key pairs in a single file per pair on disk in the
+// designated directory. When starting up it will look for the currently
+// selected cert/key pair in:
+//
+// 1. ${certDirectory}/${pairNamePrefix}-current.pem - both cert and key are in the same file.
+// 2. ${certFile}, ${keyFile}
+// 3. ${certDirectory}/${pairNamePrefix}.crt, ${keyDirectory}/${pairNamePrefix}.key
+//
+// The first one found will be used. If rotation is enabled, future cert/key
+// updates will be written to the ${certDirectory} directory and
+// ${certDirectory}/${pairNamePrefix}-current.pem will be created as a soft
+// link to the currently selected cert/key pair.
+func NewFileStore(
+ pairNamePrefix string,
+ certDirectory string,
+ keyDirectory string,
+ certFile string,
+ keyFile string) (FileStore, error) {
+
+ s := fileStore{
+ pairNamePrefix: pairNamePrefix,
+ certDirectory: certDirectory,
+ keyDirectory: keyDirectory,
+ certFile: certFile,
+ keyFile: keyFile,
+ }
+ if err := s.recover(); err != nil {
+ return nil, err
+ }
+ return &s, nil
+}
+
+// CurrentPath returns the path to the current version of these certificates.
+func (s *fileStore) CurrentPath() string {
+ return filepath.Join(s.certDirectory, s.filename(currentPair))
+}
+
+// recover checks if there is a certificate rotation that was interrupted while
+// progress, and if so, attempts to recover to a good state.
+func (s *fileStore) recover() error {
+ // If the 'current' file doesn't exist, continue on with the recovery process.
+ currentPath := filepath.Join(s.certDirectory, s.filename(currentPair))
+ if exists, err := fileExists(currentPath); err != nil {
+ return err
+ } else if exists {
+ return nil
+ }
+
+ // If the 'updated' file exists, and it is a symbolic link, continue on
+ // with the recovery process.
+ updatedPath := filepath.Join(s.certDirectory, s.filename(updatedPair))
+ if fi, err := os.Lstat(updatedPath); err != nil {
+ if os.IsNotExist(err) {
+ return nil
+ }
+ return err
+ } else if fi.Mode()&os.ModeSymlink != os.ModeSymlink {
+ return fmt.Errorf("expected %q to be a symlink but it is a file", updatedPath)
+ }
+
+ // Move the 'updated' symlink to 'current'.
+ if err := os.Rename(updatedPath, currentPath); err != nil {
+ return fmt.Errorf("unable to rename %q to %q: %v", updatedPath, currentPath, err)
+ }
+ return nil
+}
+
+func (s *fileStore) Current() (*tls.Certificate, error) {
+ pairFile := filepath.Join(s.certDirectory, s.filename(currentPair))
+ if pairFileExists, err := fileExists(pairFile); err != nil {
+ return nil, err
+ } else if pairFileExists {
+ klog.Infof("Loading cert/key pair from %q.", pairFile)
+ return loadFile(pairFile)
+ }
+
+ certFileExists, err := fileExists(s.certFile)
+ if err != nil {
+ return nil, err
+ }
+ keyFileExists, err := fileExists(s.keyFile)
+ if err != nil {
+ return nil, err
+ }
+ if certFileExists && keyFileExists {
+ klog.Infof("Loading cert/key pair from (%q, %q).", s.certFile, s.keyFile)
+ return loadX509KeyPair(s.certFile, s.keyFile)
+ }
+
+ c := filepath.Join(s.certDirectory, s.pairNamePrefix+certExtension)
+ k := filepath.Join(s.keyDirectory, s.pairNamePrefix+keyExtension)
+ certFileExists, err = fileExists(c)
+ if err != nil {
+ return nil, err
+ }
+ keyFileExists, err = fileExists(k)
+ if err != nil {
+ return nil, err
+ }
+ if certFileExists && keyFileExists {
+ klog.Infof("Loading cert/key pair from (%q, %q).", c, k)
+ return loadX509KeyPair(c, k)
+ }
+
+ noKeyErr := NoCertKeyError(
+ fmt.Sprintf("no cert/key files read at %q, (%q, %q) or (%q, %q)",
+ pairFile,
+ s.certFile,
+ s.keyFile,
+ s.certDirectory,
+ s.keyDirectory))
+ return nil, &noKeyErr
+}
+
+func loadFile(pairFile string) (*tls.Certificate, error) {
+ // LoadX509KeyPair knows how to parse combined cert and private key from
+ // the same file.
+ cert, err := tls.LoadX509KeyPair(pairFile, pairFile)
+ if err != nil {
+ return nil, fmt.Errorf("could not convert data from %q into cert/key pair: %v", pairFile, err)
+ }
+ certs, err := x509.ParseCertificates(cert.Certificate[0])
+ if err != nil {
+ return nil, fmt.Errorf("unable to parse certificate data: %v", err)
+ }
+ cert.Leaf = certs[0]
+ return &cert, nil
+}
+
+func (s *fileStore) Update(certData, keyData []byte) (*tls.Certificate, error) {
+ ts := time.Now().Format("2006-01-02-15-04-05")
+ pemFilename := s.filename(ts)
+
+ if err := os.MkdirAll(s.certDirectory, 0755); err != nil {
+ return nil, fmt.Errorf("could not create directory %q to store certificates: %v", s.certDirectory, err)
+ }
+ certPath := filepath.Join(s.certDirectory, pemFilename)
+
+ f, err := os.OpenFile(certPath, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 0600)
+ if err != nil {
+ return nil, fmt.Errorf("could not open %q: %v", certPath, err)
+ }
+ defer f.Close()
+
+ // First cert is leaf, remainder are intermediates
+ certs, err := certutil.ParseCertsPEM(certData)
+ if err != nil {
+ return nil, fmt.Errorf("invalid certificate data: %v", err)
+ }
+ for _, c := range certs {
+ pem.Encode(f, &pem.Block{Type: "CERTIFICATE", Bytes: c.Raw})
+ }
+
+ keyBlock, _ := pem.Decode(keyData)
+ if keyBlock == nil {
+ return nil, fmt.Errorf("invalid key data")
+ }
+ pem.Encode(f, keyBlock)
+
+ cert, err := loadFile(certPath)
+ if err != nil {
+ return nil, err
+ }
+
+ if err := s.updateSymlink(certPath); err != nil {
+ return nil, err
+ }
+ return cert, nil
+}
+
+// updateSymLink updates the current symlink to point to the file that is
+// passed it. It will fail if there is a non-symlink file exists where the
+// symlink is expected to be.
+func (s *fileStore) updateSymlink(filename string) error {
+ // If the 'current' file either doesn't exist, or is already a symlink,
+ // proceed. Otherwise, this is an unrecoverable error.
+ currentPath := filepath.Join(s.certDirectory, s.filename(currentPair))
+ currentPathExists := false
+ if fi, err := os.Lstat(currentPath); err != nil {
+ if !os.IsNotExist(err) {
+ return err
+ }
+ } else if fi.Mode()&os.ModeSymlink != os.ModeSymlink {
+ return fmt.Errorf("expected %q to be a symlink but it is a file", currentPath)
+ } else {
+ currentPathExists = true
+ }
+
+ // If the 'updated' file doesn't exist, proceed. If it exists but it is a
+ // symlink, delete it. Otherwise, this is an unrecoverable error.
+ updatedPath := filepath.Join(s.certDirectory, s.filename(updatedPair))
+ if fi, err := os.Lstat(updatedPath); err != nil {
+ if !os.IsNotExist(err) {
+ return err
+ }
+ } else if fi.Mode()&os.ModeSymlink != os.ModeSymlink {
+ return fmt.Errorf("expected %q to be a symlink but it is a file", updatedPath)
+ } else {
+ if err := os.Remove(updatedPath); err != nil {
+ return fmt.Errorf("unable to remove %q: %v", updatedPath, err)
+ }
+ }
+
+ // Check that the new cert/key pair file exists to avoid rotating to an
+ // invalid cert/key.
+ if filenameExists, err := fileExists(filename); err != nil {
+ return err
+ } else if !filenameExists {
+ return fmt.Errorf("file %q does not exist so it can not be used as the currently selected cert/key", filename)
+ }
+
+ // Ensure the source path is absolute to ensure the symlink target is
+ // correct when certDirectory is a relative path.
+ filename, err := filepath.Abs(filename)
+ if err != nil {
+ return err
+ }
+
+ // Create the 'updated' symlink pointing to the requested file name.
+ if err := os.Symlink(filename, updatedPath); err != nil {
+ return fmt.Errorf("unable to create a symlink from %q to %q: %v", updatedPath, filename, err)
+ }
+
+ // Replace the 'current' symlink.
+ if currentPathExists {
+ if err := os.Remove(currentPath); err != nil {
+ return fmt.Errorf("unable to remove %q: %v", currentPath, err)
+ }
+ }
+ if err := os.Rename(updatedPath, currentPath); err != nil {
+ return fmt.Errorf("unable to rename %q to %q: %v", updatedPath, currentPath, err)
+ }
+ return nil
+}
+
+func (s *fileStore) filename(qualifier string) string {
+ return s.pairNamePrefix + "-" + qualifier + pemExtension
+}
+
+func loadX509KeyPair(certFile, keyFile string) (*tls.Certificate, error) {
+ cert, err := tls.LoadX509KeyPair(certFile, keyFile)
+ if err != nil {
+ return nil, err
+ }
+ certs, err := x509.ParseCertificates(cert.Certificate[0])
+ if err != nil {
+ return nil, fmt.Errorf("unable to parse certificate data: %v", err)
+ }
+ cert.Leaf = certs[0]
+ return &cert, nil
+}
+
+// FileExists checks if specified file exists.
+func fileExists(filename string) (bool, error) {
+ if _, err := os.Stat(filename); os.IsNotExist(err) {
+ return false, nil
+ } else if err != nil {
+ return false, err
+ }
+ return true, nil
+}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 7597d743a..b0b614d7a 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -1992,6 +1992,7 @@ k8s.io/client-go/tools/watch
k8s.io/client-go/transport
k8s.io/client-go/transport/spdy
k8s.io/client-go/util/cert
+k8s.io/client-go/util/certificate
k8s.io/client-go/util/certificate/csr
k8s.io/client-go/util/connrotation
k8s.io/client-go/util/exec