diff --git a/.code.yml b/.code.yml index 194a46dd43..5110f1373e 100644 --- a/.code.yml +++ b/.code.yml @@ -14,13 +14,6 @@ source: auto_generate_source: # 自动生成代码文件的正则表达式,若无统一标识格式,可以指定具体目录,样例可参考test_source举例 filepath_regex: - - ".*.pb.go" - - ".*.pb.micro.go" - - ".*.pb.validate.go" - - ".*.pb.gw.go" - - ".*.gen.go" - - ".*docs.go" - - ".*/bcs-common/pkg/third_party/.*" - ".*/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/core/scale_up.go" - ".*/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/simulator/drain.go" - ".*/bcs-runtime/bcs-k8s/bcs-component/bcs-gamedeployment-operator/pkg/apis/.*" @@ -32,8 +25,6 @@ source: - ".*/bcs-runtime/bcs-k8s/bcs-component/bcs-gamestatefulset-operator/pkg/clientset/.*" - ".*/bcs-runtime/bcs-k8s/bcs-component/bcs-gamestatefulset-operator/pkg/informers/.*" - ".*/bcs-runtime/bcs-k8s/bcs-component/bcs-gamestatefulset-operator/pkg/listers/.*" - - ".*/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/go.mod" - - ".*/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/go.mod" - ".*/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-csi-tencentcloud/driver/cbs/controller.go" - ".*/bcs-runtime/bcs-k8s/kubedeprecated/.*" - ".*/bcs-runtime/bcs-k8s/kubernetes/.*" @@ -42,17 +33,6 @@ source: - ".*/bcs-runtime/bcs-mesos/kubebkbcsv2/.*" - ".*/bcs-runtime/bcs-mesos/pkg/.*" - ".*/bcs-runtime/bcs-k8s/bcs-network/api/.*" - - ".*/bcs-runtime/bcs-k8s/bcs-network/bcs-cloud-netagent/.*" - - ".*/bcs-runtime/bcs-k8s/bcs-network/bcs-cloud-netcontroller/.*" - - ".*/bcs-runtime/bcs-k8s/bcs-network/bcs-cloudnetwork/.*" - - ".*/bcs-runtime/bcs-k8s/bcs-network/bcs-ipmasq-cidrsync/.*" - - ".*/bcs-runtime/bcs-k8s/bcs-network/bcs-ipres-webhook/.*" - - ".*/bcs-runtime/bcs-k8s/bcs-network/bcs-networkpolicy/.*" - - ".*/bcs-runtime/bcs-k8s/bcs-network/internal/.*" - - ".*/bcs-runtime/bcs-k8s/bcs-network/pkg/.*" - - ".*/bcs-runtime/bcs-k8s/bcs-network/qcloud-eip/.*" - - ".*/bcs-runtime/bcs-k8s/bcs-network/third-party/.*" - - ".*/bcs-services/bcs-data-manager/go.mod" - ".*/bcs-services/bcs-clb-controller/apis/.*" - ".*/bcs-services/bcs-clb-controller/client/.*" - ".*/bcs-services/bcs-log-manager/app/api/proto/.*" @@ -63,18 +43,18 @@ source: - ".*/bcs-services/bcs-mesh-manager/api/.*" - ".*/bcs-services/bcs-mesh-manager/proto/.*" - ".*/bcs-services/bcs-mesh-manager/third_party/.*" - - ".*/bcs-services/bcs-alert-manager/pkg/proto/alertmanager/.*" - - ".*/bcs-services/bcs-alert-manager/pkg/third_party/.*" - ".*/bcs-services/bcs-cluster-manager/api/.*" - ".*/bcs-services/bcs-cluster-manager/third_party/.*" - - ".*/bcs-services/bcs-cluster-manager/internal/cloudprovider/component/.*" - ".*/bcs-services/bcs-resource-manager/proto/.*" - ".*/bcs-services/bcs-resource-manager/third_party/.*" - ".*/bcs-services/bcs-project-manager/proto/.*" - ".*/bcs-services/bcs-project-manager/third_party/.*" + - ".*/bcs-services/bcs-project-manager/internal/component/clustermanager/clustermanager.pb.go" - ".*/bcs-services/cluster-resources/pkg/resource/example/manifest/config/simple_secret.yaml" + - ".*/bcs-services/cluster-resources/proto/cluster-resources/cluster-resources.pb.validate.go" - ".*/bmsf-configuration/internal/protocol/.*" - ".*/bcs-runtime/bcs-mesos/bmsf-mesh/pkg/.*" + - ".*/bcs-runtime/bcs-k8s/bcs-network/.*" - ".*/bcs-runtime/bcs-k8s/bcs-component/cluster-autoscaler/.*" - ".*/bcs-ui/backend/templatesets/legacy_apps/configuration/yaml_mode/manifests/Secret.yaml" - ".*/bcs-ui/backend/resources/examples/manifests/configs/simple_secret.yaml" @@ -84,6 +64,7 @@ source: - ".*/bcs-services/bcs-project-manager/proto/.*" - ".*/bcs-services/bcs-helm-manager/proto/.*" - ".*/bcs-services/bcs-nodegroup-manager/pkg/resourcemgr/proto/.*" + - ".*/bcs-services/bcs-project-manager/internal/component/clustermanager/clustermanager.pb.go" - ".*/bcs-runtime/bcs-mesos/bcs-clb-controller/.*" - ".*/bcs-runtime/bcs-mesos/bcs-container-executor/.*" - ".*/bcs-runtime/bcs-mesos/bcs-dns/.*" @@ -94,6 +75,7 @@ source: - ".*/bcs-runtime/bcs-mesos/bcs-scheduler/.*" - ".*/bcs-services/bcs-storage/pkg/proto/.*" - ".*/bcs-services/cluster-resources/proto/.*" + - ".*/bcs-services/bcs-bscp/.*pb.*" # 提供产品代码库中直接以源码形式存在的第三方代码目录或代码文件名的正则表达。 # 此处备注的第三方代码在后续统计代码量环节会被排除,若代码库中不存在需要排除的第三方代码,该项配置标识可为空 @@ -113,4 +95,4 @@ source: - ".*/bcs-services/bcs-data-manager/third_party/.*" - ".*/bcs-services/bcs-alert-manager/pkg/third_party/protoc-gen-swagger/.*" - ".*/bcs-services/cluster-resources/third_party/protoc-gen-swagger/.*" - - ".*/bcs-runtime/bcs-k8s/bcs-component/bcs-vcluster-plugins/pkg/apis/bk-log-sidecar/.*" + - ".*/bcs-runtime/bcs-k8s/bcs-component/bcs-vcluster-plugins/pkg/apis/bk-log-sidecar/.*" \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index ab036342cb..deb00afef6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,3 @@ -.code.yml merge=ours bcs-scenarios/kourse/go.mod merge=ours bcs-scenarios/kourse/Makefile merge=ours bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/server/init.go merge=ours diff --git a/.gitignore b/.gitignore index 2f8d5d8dab..d445df5d42 100644 --- a/.gitignore +++ b/.gitignore @@ -135,5 +135,4 @@ bcs-ui/support-files/iam/ **/build.yml build.yml # bscp 软连接 -bcs-services/bscp.io -.vscode \ No newline at end of file +bcs-services/bscp.io \ No newline at end of file diff --git a/Makefile b/Makefile index 68dc32f79d..6ed72be642 100644 --- a/Makefile +++ b/Makefile @@ -412,9 +412,9 @@ cluster-manager:pre alert-manager:pre mkdir -p ${PACKAGEPATH}/bcs-services/bcs-alert-manager/swagger cp -R ${BCS_CONF_SERVICES_PATH}/bcs-alert-manager/* ${PACKAGEPATH}/bcs-services/bcs-alert-manager - cp -R ${BCS_SERVICES_PATH}/bcs-alert-manager/pkg/third_party/swagger-ui ${PACKAGEPATH}/bcs-services/bcs-alert-manager/swagger/swagger-ui - cp ${BCS_SERVICES_PATH}/bcs-alert-manager/pkg/proto/alertmanager/alertmanager.swagger.json ${PACKAGEPATH}/bcs-services/bcs-alert-manager/swagger/alertmanager.swagger.json - cd ${BCS_SERVICES_PATH}/bcs-alert-manager/ && go mod tidy -compat=1.17 && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-alert-manager/bcs-alert-manager ./main.go + cp -R ./bcs-services/bcs-alert-manager/pkg/third_party/swagger-ui ${PACKAGEPATH}/bcs-services/bcs-alert-manager/swagger/swagger-ui + cp ./bcs-services/bcs-alert-manager/pkg/proto/alertmanager/alertmanager.swagger.json ${PACKAGEPATH}/bcs-services/bcs-alert-manager/swagger/alertmanager.swagger.json + cd ./bcs-services/bcs-alert-manager/ && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-alert-manager/bcs-alert-manager ./main.go project-manager:pre mkdir -p ${PACKAGEPATH}/bcs-services/bcs-project-manager/swagger diff --git a/bcs-common/common/RegisterDiscover/interface.go b/bcs-common/common/RegisterDiscover/interface.go index 3167553870..1c1f272ced 100644 --- a/bcs-common/common/RegisterDiscover/interface.go +++ b/bcs-common/common/RegisterDiscover/interface.go @@ -25,10 +25,10 @@ type RegDiscvServer interface { RegisterAndWatch(key string, data []byte) error // Discover server from the registe-discover service platform Discover(key string) (<-chan *DiscoverEvent, error) - // DiscoverNodes xx + // DiscoverNodes TODO // discover nodes from path DiscoverNodes(path string) (*DiscoverEvent, error) - // DiscoverNodesV2 xx + // DiscoverNodesV2 TODO // discover nodes from path v2 DiscoverNodesV2(path string) (*DiscoverEvent, error) } diff --git a/bcs-common/common/RegisterDiscover/zkregdiscv.go b/bcs-common/common/RegisterDiscover/zkregdiscv.go index 2e082b9a84..7ced8b369e 100644 --- a/bcs-common/common/RegisterDiscover/zkregdiscv.go +++ b/bcs-common/common/RegisterDiscover/zkregdiscv.go @@ -118,12 +118,12 @@ func (zkRD *ZkRegDiscv) Discover(path string) (<-chan *DiscoverEvent, error) { env := make(chan *DiscoverEvent, 1) - go zkRD.loopDiscover(discvCtx, path, env) + go zkRD.loopDiscover(path, discvCtx, env) return env, nil } -func (zkRD *ZkRegDiscv) loopDiscover(discvCtx context.Context, path string, env chan *DiscoverEvent) { +func (zkRD *ZkRegDiscv) loopDiscover(path string, discvCtx context.Context, env chan *DiscoverEvent) { for { discvEnv := &DiscoverEvent{ Err: nil, diff --git a/bcs-common/common/atomicfile.go b/bcs-common/common/atomicfile.go index c5203bdb6b..3a3ce7bb57 100644 --- a/bcs-common/common/atomicfile.go +++ b/bcs-common/common/atomicfile.go @@ -38,8 +38,8 @@ func AtomicFileNew(path string, mode os.FileMode) (*AtomicFile, error) { return nil, err } if err := os.Chmod(f.Name(), mode); err != nil { - _ = f.Close() - _ = os.Remove(f.Name()) + f.Close() + os.Remove(f.Name()) return nil, err } return &AtomicFile{File: f, path: path}, nil @@ -48,7 +48,7 @@ func AtomicFileNew(path string, mode os.FileMode) (*AtomicFile, error) { // Close the file replacing the configured file. func (f *AtomicFile) Close() error { if err := f.File.Close(); err != nil { - _ = os.Remove(f.File.Name()) + os.Remove(f.File.Name()) return err } if err := os.Rename(f.Name(), f.path); err != nil { diff --git a/bcs-common/common/blog/glog/glog.go b/bcs-common/common/blog/glog/glog.go index 08d4d00f50..86a66b0046 100644 --- a/bcs-common/common/blog/glog/glog.go +++ b/bcs-common/common/blog/glog/glog.go @@ -1,16 +1,3 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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. - * - */ - // Go support for leveled logs, analogous to https://code.google.com/p/google-glog/ // // Copyright 2013 Google Inc. All Rights Reserved. @@ -81,6 +68,7 @@ // "glob" pattern and N is a V level. For instance, // -vmodule=gopher*=3 // sets the V level to 3 in all Go files whose names begin "gopher". +// package glog import ( @@ -266,16 +254,13 @@ func (m *modulePat) match(file string) bool { if m.literal { return file == m.pattern } - match, err := filepath.Match(m.pattern, file) - if err != nil { - return false - } + match, _ := filepath.Match(m.pattern, file) return match } // String 用于打印 func (m *moduleSpec) String() string { - // Lock because the type is not atomic. Note: clean this up. + // Lock because the type is not atomic. TODO: clean this up. logging.mu.Lock() defer logging.mu.Unlock() var b bytes.Buffer @@ -283,10 +268,7 @@ func (m *moduleSpec) String() string { if i > 0 { b.WriteRune(',') } - _, err := fmt.Fprintf(&b, "%s=%d", f.pattern, f.level) - if err != nil { - fmt.Println(err.Error()) - } + fmt.Fprintf(&b, "%s=%d", f.pattern, f.level) } return b.String() } @@ -323,7 +305,7 @@ func (m *moduleSpec) Set(value string) error { if v == 0 { continue // Ignore. It's harmless but no point in paying the overhead. } - // Note: check syntax of filter? + // TODO: check syntax of filter? filter = append(filter, modulePat{pattern, isLiteral(pattern), Level(v)}) } logging.mu.Lock() @@ -365,7 +347,7 @@ func (t *traceLocation) match(file string, line int) bool { // String 用于打印 func (t *traceLocation) String() string { - // Lock because the type is not atomic. Note: clean this up. + // Lock because the type is not atomic. TODO: clean this up. logging.mu.Lock() defer logging.mu.Unlock() return fmt.Sprintf("%s:%d", t.file, t.line) @@ -423,12 +405,8 @@ func init() { logging.stderrThreshold = errorLog logging.toStderr = false logging.alsoToStderr = false - if err := logging.vmodule.Set(""); err != nil { - fmt.Println(err.Error()) - } - if err := logging.traceLocation.Set(""); err != nil { - fmt.Println(err.Error()) - } + _ = logging.vmodule.Set("") + _ = logging.traceLocation.Set("") logging.setVState(0, nil, false) go logging.flushDaemon() @@ -443,7 +421,7 @@ func Flush() { type loggingT struct { // Boolean flags. Not handled atomically because the flag.Value interface // does not let us avoid the =true, and that shorthand is necessary for - // compatibility. Note: does this matter enough to fix? Seems unlikely. + // compatibility. TODO: does this matter enough to fix? Seems unlikely. toStderr bool // The -logtostderr flag. alsoToStderr bool // The -alsologtostderr flag. @@ -599,7 +577,7 @@ func (l *loggingT) formatHeader(s severity, file string, line int) *buffer { buf.tmp[14] = '.' buf.nDigits(6, 15, now.Nanosecond()/1000, '0') buf.tmp[21] = ' ' - buf.nDigits(7, 22, pid, ' ') // Note: should be TID + buf.nDigits(7, 22, pid, ' ') // TODO: should be TID buf.tmp[29] = ' ' buf.Write(buf.tmp[:30]) buf.WriteString(file) @@ -850,7 +828,7 @@ func (sb *syncBuffer) Sync() error { // Write 用于常见IO func (sb *syncBuffer) Write(p []byte) (n int, err error) { if sb.nbytes+uint64(len(p)) >= MaxSize() { - if err = sb.rotateFile(time.Now()); err != nil { + if err := sb.rotateFile(time.Now()); err != nil { sb.logger.exit(err) } } @@ -859,7 +837,7 @@ func (sb *syncBuffer) Write(p []byte) (n int, err error) { if err != nil { sb.logger.exit(err) } - return n, err + return } // rotateFile closes the syncBuffer's file and starts a new one. @@ -1026,13 +1004,9 @@ type Verbose bool // The returned value is a boolean of type Verbose, which implements Info, Infoln // and Infof. These methods will write to the Info log if called. // Thus, one may write either -// // if glog.V(2) { glog.Info("log this") } -// // or -// // glog.V(2).Info("log this") -// // The second form is shorter but the first is cheaper if logging is off because it does // not evaluate its arguments. // diff --git a/bcs-common/common/blog/glog/glog_file.go b/bcs-common/common/blog/glog/glog_file.go index 979141d374..043188c83a 100644 --- a/bcs-common/common/blog/glog/glog_file.go +++ b/bcs-common/common/blog/glog/glog_file.go @@ -1,16 +1,3 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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. - * - */ - // Go support for leveled logs, analogous to https://code.google.com/p/google-glog/ // // Copyright 2013 Google Inc. All Rights Reserved. @@ -118,7 +105,7 @@ func (lk *logKeeper) add(tag string, newBlock *fileBlock) (ok bool) { for lk.total[tag] > MaxNum() { lk.remove(tag) } - return ok + return } func (lk *logKeeper) remove(tag string) (ok bool) { @@ -126,11 +113,11 @@ func (lk *logKeeper) remove(tag string) (ok bool) { if !ok || lk.total[tag] == 0 { return } - _ = lk.removeFile(block.name) + lk.removeFile(block.name) lk.head[tag] = block.next block = nil // for GC lk.total[tag]-- - return ok + return } func (lk *logKeeper) removeFile(name string) error { @@ -178,7 +165,7 @@ func (lk *logKeeper) load() { lk.tail[tag] = fb lk.total[tag]++ } else { - _ = lk.removeFile(block.name) + lk.removeFile(block.name) } } } diff --git a/bcs-common/common/conf/types.go b/bcs-common/common/conf/types.go index 0ded031cea..65bf087613 100644 --- a/bcs-common/common/conf/types.go +++ b/bcs-common/common/conf/types.go @@ -26,7 +26,7 @@ import ( "github.com/Tencent/bk-bcs/bcs-common/common/codec" "github.com/Tencent/bk-bcs/bcs-common/common/util" - "github.com/bitly/go-simplejson" + simplejson "github.com/bitly/go-simplejson" "github.com/spf13/pflag" ) @@ -256,7 +256,7 @@ func wrapFieldFlag(fs *pflag.FlagSet, field reflect.StructField, fieldV reflect. flagUsage := field.Tag.Get("usage") flagShortHand := field.Tag.Get("short") - unsafePtr := unsafe.Pointer(fieldV.UnsafeAddr()) // nolint + unsafePtr := unsafe.Pointer(fieldV.UnsafeAddr()) switch field.Type.Kind() { case reflect.String: fs.StringVarP((*string)(unsafePtr), flagName, flagShortHand, flagValue, flagUsage) diff --git a/bcs-common/common/encrypt/des.go b/bcs-common/common/encrypt/des.go index 6a2c5002be..24d24ed673 100644 --- a/bcs-common/common/encrypt/des.go +++ b/bcs-common/common/encrypt/des.go @@ -16,7 +16,7 @@ package encrypt import ( "bytes" "crypto/cipher" - "crypto/des" // nolint + "crypto/des" "encoding/base64" "github.com/Tencent/bk-bcs/bcs-common/common/static" @@ -44,7 +44,7 @@ func PKCS5UnPadding(origData []byte) []byte { // DesEncryptToBase encrypt with priKey simply, out base64 string func DesEncryptToBase(src []byte) ([]byte, error) { if len(priKey) != 0 { - block, err := des.NewTripleDESCipher([]byte(priKey)) // nolint + block, err := des.NewTripleDESCipher([]byte(priKey)) if err != nil { return nil, err } @@ -62,7 +62,7 @@ func DesEncryptToBase(src []byte) ([]byte, error) { func DesDecryptFromBase(src []byte) ([]byte, error) { if len(priKey) != 0 { ori, _ := base64.StdEncoding.DecodeString(string(src)) - block, err := des.NewTripleDESCipher([]byte(priKey)) // nolint + block, err := des.NewTripleDESCipher([]byte(priKey)) if err != nil { return nil, err } diff --git a/bcs-common/common/errorCode.go b/bcs-common/common/errorCode.go index 53ec9381a8..e7dc1c80a5 100644 --- a/bcs-common/common/errorCode.go +++ b/bcs-common/common/errorCode.go @@ -193,7 +193,7 @@ const ( BcsErrMesosDriverNoVersionId = AdditionErrorCode + 232 BcsErrMesosDriverNoVersionIdStr = "no version id" BcsErrMesosDriverSendMsgUnknowType = AdditionErrorCode + 233 - BcsErrMesosDriverSendMsgUnknowTypeStr = "unknown the message type" + BcsErrMesosDriverSendMsgUnknowTypeStr = "unkown the message type" BcsErrMesosDriverHttpFilterFailed = AdditionErrorCode + 234 BcsErrMesosDriverHttpFilterFailedStr = "bcs auth check no authority" diff --git a/bcs-common/common/http/header.go b/bcs-common/common/http/header.go index f22d11d5e7..cb1eb923bf 100644 --- a/bcs-common/common/http/header.go +++ b/bcs-common/common/http/header.go @@ -14,12 +14,12 @@ package http const ( - // HEADER_APPID xx + // HEADER_APPID TODO HEADER_APPID = "Bcs-Api-AppId" - // HEADER_APPCODE xx + // HEADER_APPCODE TODO HEADER_APPCODE = "Bcs-Api-AppCode" - // HEADER_APPTOKEN xx - HEADER_APPTOKEN = "Bcs-Api-AppToken" // nolint - // HEADER_OPERATOR xx + // HEADER_APPTOKEN TODO + HEADER_APPTOKEN = "Bcs-Api-AppToken" + // HEADER_OPERATOR TODO HEADER_OPERATOR = "Bcs-Api-Operator" ) diff --git a/bcs-common/common/http/httpclient/client.go b/bcs-common/common/http/httpclient/client.go index 0c158eda31..1ef9e7d481 100644 --- a/bcs-common/common/http/httpclient/client.go +++ b/bcs-common/common/http/httpclient/client.go @@ -27,8 +27,8 @@ import ( "github.com/Tencent/bk-bcs/bcs-common/common/ssl" ) -// HttpResponse define the information of the http response -type HttpResponse struct { +// HttpRespone define the information of the http respone +type HttpRespone struct { Reply []byte StatusCode int Status string @@ -174,27 +174,27 @@ func (client *HttpClient) PATCH(url string, header http.Header, data []byte) ([] } // Get wraps http Get method -func (client *HttpClient) Get(url string, header http.Header, data []byte) (*HttpResponse, error) { +func (client *HttpClient) Get(url string, header http.Header, data []byte) (*HttpRespone, error) { return client.RequestEx(url, "GET", header, data) } // Post wraps http Post method -func (client *HttpClient) Post(url string, header http.Header, data []byte) (*HttpResponse, error) { +func (client *HttpClient) Post(url string, header http.Header, data []byte) (*HttpRespone, error) { return client.RequestEx(url, "POST", header, data) } // Delete wraps http Delete method -func (client *HttpClient) Delete(url string, header http.Header, data []byte) (*HttpResponse, error) { +func (client *HttpClient) Delete(url string, header http.Header, data []byte) (*HttpRespone, error) { return client.RequestEx(url, "DELETE", header, data) } // Put wraps http Put method -func (client *HttpClient) Put(url string, header http.Header, data []byte) (*HttpResponse, error) { +func (client *HttpClient) Put(url string, header http.Header, data []byte) (*HttpRespone, error) { return client.RequestEx(url, "PUT", header, data) } // Patch wraps http Patch method -func (client *HttpClient) Patch(url string, header http.Header, data []byte) (*HttpResponse, error) { +func (client *HttpClient) Patch(url string, header http.Header, data []byte) (*HttpRespone, error) { return client.RequestEx(url, "PATCH", header, data) } @@ -205,10 +205,10 @@ func (client *HttpClient) Request(url, method string, header http.Header, data [ } // RequestEx do http request, old version -func (client *HttpClient) RequestEx(url, method string, header http.Header, data []byte) (*HttpResponse, error) { +func (client *HttpClient) RequestEx(url, method string, header http.Header, data []byte) (*HttpRespone, error) { var req *http.Request var errReq error - httpRsp := &HttpResponse{ + httpRsp := &HttpRespone{ Reply: nil, StatusCode: http.StatusInternalServerError, Status: "Internal Server Error", diff --git a/bcs-common/common/http/respone.go b/bcs-common/common/http/respone.go index b22e697b73..43cc892673 100644 --- a/bcs-common/common/http/respone.go +++ b/bcs-common/common/http/respone.go @@ -137,5 +137,5 @@ func addExtraField(s []byte, extra map[string]interface{}) (r []byte, err error) } } err = codec.EncJson(jsn, &r) - return r, err + return } diff --git a/bcs-common/common/metric/floatOrStr.go b/bcs-common/common/metric/floatOrStr.go index 5f46cd46a6..457a7d6ebb 100644 --- a/bcs-common/common/metric/floatOrStr.go +++ b/bcs-common/common/metric/floatOrStr.go @@ -43,9 +43,9 @@ func FormFloatOrString(val interface{}) (*FloatOrString, error) { type ValueType string const ( - // Float xx + // Float TODO Float ValueType = "Float" - // String xx + // String TODO String ValueType = "String" ) diff --git a/bcs-common/common/ssl/ssl.go b/bcs-common/common/ssl/ssl.go index b052eb9b81..347677b137 100644 --- a/bcs-common/common/ssl/ssl.go +++ b/bcs-common/common/ssl/ssl.go @@ -25,7 +25,7 @@ import ( // ClientTslConfNoVerity xxx func ClientTslConfNoVerity() *tls.Config { return &tls.Config{ - InsecureSkipVerify: true, // nolint + InsecureSkipVerify: true, } } @@ -56,7 +56,7 @@ func ClientTslConfVerity(caFile, certFile, keyFile, passwd string) (*tls.Config, } conf := &tls.Config{ - InsecureSkipVerify: true, // nolint + InsecureSkipVerify: true, RootCAs: caPool, Certificates: []tls.Certificate{*cert}, } @@ -136,8 +136,7 @@ func loadCertificates(certFile, keyFile, passwd string) (*tls.Certificate, error return nil, fmt.Errorf("decode private key failed") } - var priDecrPem []byte - priDecrPem, err = x509.DecryptPEMBlock(priPem, []byte(passwd)) + priDecrPem, err := x509.DecryptPEMBlock(priPem, []byte(passwd)) if err != nil { return nil, err } diff --git a/bcs-common/common/storage/watch/sdk.go b/bcs-common/common/storage/watch/sdk.go index 4f0c33ad81..1cbbea85c5 100644 --- a/bcs-common/common/storage/watch/sdk.go +++ b/bcs-common/common/storage/watch/sdk.go @@ -123,7 +123,7 @@ func (w *Watcher) Connect(storageURL []string) (err error) { w.closed = false w.nextSignal, w.receiveSignal = make(chan struct{}), make(chan struct{}) go w.watching() - return err + return } // connect : Try to connect the url list, if they are all unreachable, then return diff --git a/bcs-common/common/tcp/listener/listener_test.go b/bcs-common/common/tcp/listener/listener_test.go index 046ac36353..577d471942 100644 --- a/bcs-common/common/tcp/listener/listener_test.go +++ b/bcs-common/common/tcp/listener/listener_test.go @@ -68,8 +68,8 @@ func index(w http.ResponseWriter, r *http.Request) { _, _ = fmt.Fprint(w, string(res)) } -// TestAddListener 测试AddListener -func TestAddListener(t *testing.T) { +// TestDualStackListener_AddListener 测试AddListener +func TestDualStackListener_AddListener(t *testing.T) { dualStackListener := NewDualStackListener() defer dualStackListener.Close() err := dualStackListener.AddListener(IPv4, Port) @@ -84,8 +84,8 @@ func TestAddListener(t *testing.T) { } } -// TestAcceptToHttpServer 测试http server使用 -func TestAcceptToHttpServer(t *testing.T) { +// TestDualStackListener_AcceptToHttpServer 测试http server使用 +func TestDualStackListener_AcceptToHttpServer(t *testing.T) { // 创建双栈 dualStackListener := NewDualStackListener() err := dualStackListener.AddListener(IPv4, Port) @@ -112,8 +112,8 @@ func TestAcceptToHttpServer(t *testing.T) { } } -// TestAcceptToIPv6Server1 测试IPv6 server使用 -func TestAcceptToIPv6Server1(t *testing.T) { +// TestDualStackListener_AcceptToIPv6Server1 测试IPv6 server使用 +func TestDualStackListener_AcceptToIPv6Server1(t *testing.T) { // 创建双栈 dualStackListener := NewDualStackListener() err := dualStackListener.AddListener(IPv4, Port) @@ -140,8 +140,8 @@ func TestAcceptToIPv6Server1(t *testing.T) { } } -// TestAcceptToIPv6Server2 测试IPv6 server使用 -func TestAcceptToIPv6Server2(t *testing.T) { +// TestDualStackListener_AcceptToIPv6Server2 测试IPv6 server使用 +func TestDualStackListener_AcceptToIPv6Server2(t *testing.T) { // 创建双栈 dualStackListener := NewDualStackListener() err := dualStackListener.AddListener(IPv4, Port) @@ -211,8 +211,8 @@ func getTLSFiles() (certFile, keyFile string) { return certfile.Name(), keyfile.Name() } -// TestAcceptToIPv6ServerTLS1 -func TestAcceptToIPv6ServerTLS1(t *testing.T) { +// TestDualStackListener_AcceptToIPv6ServerTLS1 +func TestDualStackListener_AcceptToIPv6ServerTLS1(t *testing.T) { tt = t //handler := http.NewServeMux() @@ -252,8 +252,8 @@ func TestAcceptToIPv6ServerTLS1(t *testing.T) { } } -// TestAcceptToIPv6ServerTLS2 -func TestAcceptToIPv6ServerTLS2(t *testing.T) { +// TestDualStackListener_AcceptToIPv6ServerTLS2 +func TestDualStackListener_AcceptToIPv6ServerTLS2(t *testing.T) { tt = t //handler := http.NewServeMux() @@ -292,8 +292,8 @@ func TestAcceptToIPv6ServerTLS2(t *testing.T) { } } -// TestClose 测试Close -func TestClose(t *testing.T) { +// TestDualStackListener_Close 测试Close +func TestDualStackListener_Close(t *testing.T) { // 创建双栈 dualStackListener := NewDualStackListener() err := dualStackListener.AddListener(IPv4, Port) @@ -331,8 +331,8 @@ func TestClose(t *testing.T) { } } -// TestAddr 测试Addr -func TestAddr(t *testing.T) { +// TestDualStackListener_Addr 测试Addr +func TestDualStackListener_Addr(t *testing.T) { // 创建双栈 dualStackListener := NewDualStackListener() err := dualStackListener.AddListener(IPv4, Port) @@ -360,7 +360,7 @@ func (gs *GreeterServer) SayHello(ctx context.Context, request *helloworld.Hello return &helloworld.HelloReply{Message: "hello " + value}, nil } -func TestGrpcServer(t *testing.T) { +func TestDualStackListener_GrpcServer(t *testing.T) { tt = t dualStackListener := NewDualStackListener() err := dualStackListener.AddListener(IPv4, Port) @@ -408,12 +408,12 @@ func gRPCRequest(ip string) { tt.Log(reply) } -func TestGrpcClientIPv4(t *testing.T) { +func TestDualStackListener_GrpcClientIPv4(t *testing.T) { tt = t gRPCRequest(net.JoinHostPort(IPv4, Port)) } -func TestGrpcClientIPv6(t *testing.T) { +func TestDualStackListener_GrpcClientIPv6(t *testing.T) { tt = t gRPCRequest(net.JoinHostPort(IPv6, Port)) } diff --git a/bcs-common/common/tcp/protocol/protocol.go b/bcs-common/common/tcp/protocol/protocol.go index 8595c98361..92dc3c832d 100644 --- a/bcs-common/common/tcp/protocol/protocol.go +++ b/bcs-common/common/tcp/protocol/protocol.go @@ -36,7 +36,7 @@ type MsgHead struct { // HeadLength 获取协议头长度 func HeadLength() int { - return int(unsafe.Sizeof(MsgHead{})) // nolint + return int(unsafe.Sizeof(MsgHead{})) } // ConvertToMsgHead 将字节数组 转换为协议头 diff --git a/bcs-common/common/types/endpoint.go b/bcs-common/common/types/endpoint.go index 656874707d..cff7499a84 100644 --- a/bcs-common/common/types/endpoint.go +++ b/bcs-common/common/types/endpoint.go @@ -29,7 +29,7 @@ type Endpoint struct { Ports []ContainerPort `json:"ports,omitempty"` } -// TargetRef reference for endpoint +// TargetRef referrence for endpoint type TargetRef struct { Kind string `json:"kind"` ID string `json:"id"` diff --git a/bcs-common/common/types/resource.go b/bcs-common/common/types/resource.go index 39a80492c2..d5dcae219f 100644 --- a/bcs-common/common/types/resource.go +++ b/bcs-common/common/types/resource.go @@ -112,7 +112,7 @@ type ExtendedResource struct { Value float64 // Capacity, extended resource total value Capacity float64 - // device plugin socket address, example: /data/bcs/cpuset.socket + // device plugin socket address, exmaple: /data/bcs/cpuset.socket Socket string } diff --git a/bcs-common/common/types/secret.go b/bcs-common/common/types/secret.go index 13c25e7e9c..a4b066edaf 100644 --- a/bcs-common/common/types/secret.go +++ b/bcs-common/common/types/secret.go @@ -23,19 +23,19 @@ type SecretDataItem struct { type BcsSecretType string const ( - // BcsSecretTypeOpaque xx + // BcsSecretTypeOpaque TODO BcsSecretTypeOpaque BcsSecretType = "Opaque" - // BcsSecretTypeServiceAccountToken xx - BcsSecretTypeServiceAccountToken BcsSecretType = "kubernetes.io/service-account-token" // nolint - // BcsSecretTypeDockercfg xx + // BcsSecretTypeServiceAccountToken TODO + BcsSecretTypeServiceAccountToken BcsSecretType = "kubernetes.io/service-account-token" + // BcsSecretTypeDockercfg TODO BcsSecretTypeDockercfg BcsSecretType = "kubernetes.io/dockercfg" - // BcsSecretTypeDockerConfigJson xx + // BcsSecretTypeDockerConfigJson TODO BcsSecretTypeDockerConfigJson BcsSecretType = "kubernetes.io/dockerconfigjson" - // BcsSecretTypeBasicAuth xx + // BcsSecretTypeBasicAuth TODO BcsSecretTypeBasicAuth BcsSecretType = "kubernetes.io/basic-auth" - // BcsSecretTypeSSHAuth xx + // BcsSecretTypeSSHAuth TODO BcsSecretTypeSSHAuth BcsSecretType = "kubernetes.io/ssh-auth" - // BcsSecretTypeTLS xx + // BcsSecretTypeTLS TODO BcsSecretTypeTLS BcsSecretType = "kubernetes.io/tls" ) diff --git a/bcs-common/common/types/serverInfo.go b/bcs-common/common/types/serverInfo.go index 086832c687..6b1e6d88ab 100644 --- a/bcs-common/common/types/serverInfo.go +++ b/bcs-common/common/types/serverInfo.go @@ -184,7 +184,7 @@ type BcsUserMgrServInfo struct { ServerInfo } -// NetworkDetectionServInfo network-detection server information +// NetworkDetectionServInfo netwrok-detection server information type NetworkDetectionServInfo struct { ServerInfo } diff --git a/bcs-common/common/types/status.go b/bcs-common/common/types/status.go index 9ca9805542..313378a5fb 100644 --- a/bcs-common/common/types/status.go +++ b/bcs-common/common/types/status.go @@ -44,7 +44,7 @@ type BcsReplicaControllerStatus struct { BuildedInstance int `json:"buildedInstance"` // RunningInstance is the number of running status instance RunningInstance int `json:"runningInstance"` - // CreateTime is the date and time of beginning to create ReplicaController + // CreateTime is the date and time of begining to create ReplicaController CreateTime time.Time `json:"createTime"` // LastUpdateTime is the date and time when ReplicaController status change LastUpdateTime time.Time `json:"lastUpdateTime,omitempty"` diff --git a/bcs-common/common/types/storage.go b/bcs-common/common/types/storage.go index 4e33632217..5612cd498b 100644 --- a/bcs-common/common/types/storage.go +++ b/bcs-common/common/types/storage.go @@ -157,7 +157,7 @@ func (render *BcsStorageRenderIf) GetData() (dc *DeployConfig, err error) { if err = codec.DecJson(tmp, dc); err != nil { return } - return dc, err + return } // BcsStorageAlarmIf define storage alarm interface data interaction diff --git a/bcs-common/common/version/version.go b/bcs-common/common/version/version.go index db9317da96..55331298fb 100644 --- a/bcs-common/common/version/version.go +++ b/bcs-common/common/version/version.go @@ -19,7 +19,7 @@ import ( "runtime" ) -// BcsVersion describes version +// BcsVersion discribes version // BcsTag show the git tag for this version // BcsBuildTime show the compile time var ( diff --git a/bcs-common/common/websocketDialer/metrics/session_metrics.go b/bcs-common/common/websocketDialer/metrics/session_metrics.go index 22752664d7..a39f914141 100644 --- a/bcs-common/common/websocketDialer/metrics/session_metrics.go +++ b/bcs-common/common/websocketDialer/metrics/session_metrics.go @@ -66,7 +66,7 @@ var ( Namespace: "bcs_api", Subsystem: "session_server", Name: "total_transmit_bytes", - Help: "Total bytes transmitted", + Help: "Total bytes transmited", }, []string{"clientkey"}, ) @@ -77,7 +77,7 @@ var ( Namespace: "bcs_api", Subsystem: "session_server", Name: "total_transmit_error_bytes", - Help: "Total error bytes transmitted", + Help: "Total error bytes transmited", }, []string{"clientkey"}, ) diff --git a/bcs-common/common/zkclient/zkclient.go b/bcs-common/common/zkclient/zkclient.go index 3f07edde44..21a28cdc9b 100644 --- a/bcs-common/common/zkclient/zkclient.go +++ b/bcs-common/common/zkclient/zkclient.go @@ -427,8 +427,7 @@ func (z *ZkClient) GetAll2Json(path string) (string, error) { } if len(childs) <= 0 { - var ctx string - ctx, err = z.Get(path) + ctx, err := z.Get(path) if err != nil { // blog.Warn("fail to get value from path(%s), err:%s", path, err.Error()) return "", err diff --git a/bcs-common/pkg/auth/iam/iam_test.go b/bcs-common/pkg/auth/iam/iam_test.go index 44d6cc5b4a..fbdd712ba3 100644 --- a/bcs-common/pkg/auth/iam/iam_test.go +++ b/bcs-common/pkg/auth/iam/iam_test.go @@ -72,7 +72,7 @@ func TestIamClient_CreateGradeManagers(t *testing.T) { authScopes = append(authScopes, BuildAuthorizationScope(SysProject, []ActionID{ ProjectView, ProjectEdit, ProjectDelete, }, []LevelResource{ - { + LevelResource{ Type: string(SysProject), ID: "xxx", Name: "xxx", @@ -164,7 +164,7 @@ func TestIamClient_AddUserGroupMembers(t *testing.T) { t.Log("success") } -func TestDeleteUserGroupMembers(t *testing.T) { +func TestIamClient_DeleteUserGroupMembers(t *testing.T) { cli, err := newIAMClient() if err != nil { t.Fatalf("newIAMClient failed: %v", err) @@ -181,7 +181,7 @@ func TestDeleteUserGroupMembers(t *testing.T) { t.Log("success") } -func TestCreateUserGroupPolicies(t *testing.T) { +func TestIamClient_CreateUserGroupPolicies(t *testing.T) { cli, err := newIAMClient() if err != nil { t.Fatalf("newIAMClient failed: %v", err) @@ -211,7 +211,7 @@ func TestCreateUserGroupPolicies(t *testing.T) { t.Log("success") } -func TestIsAllowedWithoutResource(t *testing.T) { +func TestIamClient_IsAllowedWithoutResource(t *testing.T) { cli, err := newIAMClient() if err != nil { t.Fatalf("newIAMClient failed: %v", err) @@ -231,7 +231,7 @@ func TestIsAllowedWithoutResource(t *testing.T) { t.Log(allow) } -func TestIsAllowedWithResource(t *testing.T) { +func TestIamClient_IsAllowedWithResource(t *testing.T) { cli, err := newIAMClient() if err != nil { t.Fatalf("newIAMClient failed: %v", err) @@ -280,7 +280,7 @@ func TestIsAllowedWithResource(t *testing.T) { t.Log(allow) } -func TestBatchResourceIsAllowed(t *testing.T) { +func TestIamClient_BatchResourceIsAllowed(t *testing.T) { cli, err := newIAMClient() if err != nil { t.Fatalf("newIAMClient failed: %v", err) @@ -323,7 +323,7 @@ func TestBatchResourceIsAllowed(t *testing.T) { t.Log(permission) // map[BCS-K8S-15200:true BCS-K8S-15201:true] } -func TestResourceMultiAllowed(t *testing.T) { +func TestIamClient_ResourceMultiActionsAllowed(t *testing.T) { cli, err := newIAMClient() if err != nil { t.Fatalf("newIAMClient failed: %v", err) @@ -360,7 +360,7 @@ type Resource struct { ResourceID string } -func TestBatchResourceMultiAllowed(t *testing.T) { +func TestIamClient_BatchResourceMultiActionsAllowed(t *testing.T) { cli, err := newIAMClient() if err != nil { t.Fatalf("newIAMClient failed: %v", err) @@ -511,7 +511,7 @@ func TestIamClient_GetApplyURL(t *testing.T) { t.Log(url) } -func TestAuthResourceCreatorPerm(t *testing.T) { +func TestIamClient_AuthResourceCreatorPerm(t *testing.T) { cli, err := newIAMClient() if err != nil { t.Fatalf("newIAMClient failed: %v", err) diff --git a/bcs-common/pkg/bcsapi/client.go b/bcs-common/pkg/bcsapi/client.go index 5a9cc342cf..757f46c142 100644 --- a/bcs-common/pkg/bcsapi/client.go +++ b/bcs-common/pkg/bcsapi/client.go @@ -79,7 +79,7 @@ func (a *Authentication) RequireTransportSecurity() bool { return !a.Insecure } -// NewTokenAuth implementations of grpc credentials interface +// NewTokenAuth impelmentation of grpc credentials interface func NewTokenAuth(t string) *GrpcTokenAuth { return &GrpcTokenAuth{ Token: t, diff --git a/bcs-common/pkg/bcsapi/helmmanager/bcs-helm-manager.pb.micro.go b/bcs-common/pkg/bcsapi/helmmanager/bcs-helm-manager.pb.micro.go index 45e3cdceda..c439b85316 100644 --- a/bcs-common/pkg/bcsapi/helmmanager/bcs-helm-manager.pb.micro.go +++ b/bcs-common/pkg/bcsapi/helmmanager/bcs-helm-manager.pb.micro.go @@ -1,4 +1,4 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. +s// Code generated by protoc-gen-micro. DO NOT EDIT. // source: bcs-helm-manager.proto package helmmanager diff --git a/bcs-common/pkg/bcsapi/netservice.go b/bcs-common/pkg/bcsapi/netservice.go index f32c0a7795..9d4c09c646 100644 --- a/bcs-common/pkg/bcsapi/netservice.go +++ b/bcs-common/pkg/bcsapi/netservice.go @@ -40,8 +40,7 @@ const ( envVarNameNetservice = "NETSVR_ADDR" ) -// Netservice define http client for bcs-netservice. The interface used to operate -// netservice with the crud of pool. +// Netservice define http client for bcs-netservice type Netservice interface { RegisterPool(pool *types.NetPool) error UpdatePool(pool *types.NetPool) error @@ -58,8 +57,7 @@ type Netservice interface { TransferIPAttr(input *types.TranIPAttrInput) error } -// NetserviceCli netservice http client, will handle all operations with netservice -// It can be used as the cli to handle every operation of netservice +// NetserviceCli netservice http client type NetserviceCli struct { httpClientTimeout int tlsConfig *tls.Config @@ -68,7 +66,7 @@ type NetserviceCli struct { random *rand.Rand } -// NewNetserviceCli create new client for netservice cli +// NewNetserviceCli create new client func NewNetserviceCli() *NetserviceCli { return &NetserviceCli{ httpClientTimeout: 3, @@ -104,8 +102,7 @@ func (nc *NetserviceCli) SetHosts(svrs []string) { nc.netSvrs = svrs } -// GetNetService get netservice server addresses from zookeeper or from envs. It -// will return error if netservice not exist. +// GetNetService get netservice server addresses from zookeeper or from envs func (nc *NetserviceCli) GetNetService(zkHost []string) error { // get netservice addresses from env netSvrStr := os.Getenv(envVarNameNetservice) @@ -152,8 +149,7 @@ func (nc *NetserviceCli) GetNetService(zkHost []string) error { return nil } -// RegisterPool register pool info to bcs-netservice, will register pool info to netservice -// The pool inf will be saved in store. +// RegisterPool register pool info to bcs-netservice func (nc *NetserviceCli) RegisterPool(pool *types.NetPool) error { if len(pool.Cluster) == 0 { return fmt.Errorf("lost cluster info") @@ -200,8 +196,7 @@ func (nc *NetserviceCli) RegisterPool(pool *types.NetPool) error { return nil } -// UpdatePool update pool info, will update pool information to netservice -// will update poll info to store. +// UpdatePool update pool info func (nc *NetserviceCli) UpdatePool(pool *types.NetPool) error { if len(pool.Cluster) == 0 { return fmt.Errorf("lost cluster info") @@ -250,7 +245,7 @@ func (nc *NetserviceCli) UpdatePool(pool *types.NetPool) error { return nil } -// GetPool get pool info from netservice, will return pool information from netservice +// GetPool get pool info from netservice func (nc *NetserviceCli) GetPool(cluster, net string) ([]*types.NetPool, error) { if len(cluster) == 0 || len(net) == 0 { return nil, fmt.Errorf("Lost cluster or network segment in request") @@ -296,7 +291,7 @@ func (nc *NetserviceCli) GetPool(cluster, net string) ([]*types.NetPool, error) return netRes.Pool, nil } -// ListAllPool list all pools, it will return all pools from netservice +// ListAllPool list all pools func (nc *NetserviceCli) ListAllPool() ([]*types.NetPool, error) { if len(nc.netSvrs) == 0 { return nil, fmt.Errorf("no available bcs-netservice") @@ -339,7 +334,7 @@ func (nc *NetserviceCli) ListAllPool() ([]*types.NetPool, error) { return netRes.Pool, nil } -// ListAllPoolWithCluster list all pool with cluster, it will list all pools by clusterid +// ListAllPoolWithCluster list all pool with cluster func (nc *NetserviceCli) ListAllPoolWithCluster(cluster string) ([]*types.NetPool, error) { if len(nc.netSvrs) == 0 { return nil, fmt.Errorf("no available bcs-netservice") @@ -383,7 +378,7 @@ func (nc *NetserviceCli) ListAllPoolWithCluster(cluster string) ([]*types.NetPoo return netRes.Pool, nil } -// DeletePool delete pool, it will delete pool by cluster and net info +// DeletePool delete pool func (nc *NetserviceCli) DeletePool(cluster, net string) error { if len(cluster) == 0 || len(net) == 0 { return fmt.Errorf("neither cluster nor net can be empty") @@ -420,7 +415,6 @@ func (nc *NetserviceCli) DeletePool(cluster, net string) error { } // RegisterHost register host info to bcs-netservice -// It will register host to netservice func (nc *NetserviceCli) RegisterHost(host *types.HostInfo) error { if len(nc.netSvrs) == 0 { return fmt.Errorf("no available bcs-netservice") @@ -463,7 +457,6 @@ func (nc *NetserviceCli) RegisterHost(host *types.HostInfo) error { } // DeleteHost when host has container or any ip belongs to the host is active, it can't be deleted -// It will delete hosts from netservice func (nc *NetserviceCli) DeleteHost(host string, ips []string) error { if len(nc.netSvrs) == 0 { return fmt.Errorf("no available bcs-netservice") @@ -513,7 +506,7 @@ func (nc *NetserviceCli) DeleteHost(host string, ips []string) error { return fmt.Errorf(hostRes.Message) } -// GetHostInfo Get host info by host ip address. It will get host info from netservice +// GetHostInfo Get host info by host ip address func (nc *NetserviceCli) GetHostInfo(host string, timeout int) (*types.HostInfo, error) { if len(host) == 0 { return nil, fmt.Errorf("host ip address lost") @@ -567,7 +560,7 @@ func (nc *NetserviceCli) GetHostInfo(host string, timeout int) (*types.HostInfo, return nil, fmt.Errorf("get host info all netservice failed, %s", lastErr) } -// LeaseIPAddr lease one ip address from bcs-netservice. It will lease ip address from netservice +// LeaseIPAddr lease one ip address from bcs-netservice func (nc *NetserviceCli) LeaseIPAddr(lease *types.IPLease, timeout int) (*types.IPInfo, error) { // create net request request := &types.NetRequest{ @@ -627,6 +620,7 @@ func (nc *NetserviceCli) LeaseIPAddr(lease *types.IPLease, timeout int) (*types. ipInfo := response.Info[0] // check if response ip addr is what we need if lease.IPAddr != "" && lease.IPAddr != ipInfo.IPAddr { + // todo(DeveloperJim): Get unexpect ip address, need to release return nil, fmt.Errorf("lease ip addr expect ipaddr %s, but got %s", lease.IPAddr, ipInfo.IPAddr) } if len(ipInfo.Gateway) == 0 || ipInfo.Mask == 0 { @@ -637,8 +631,7 @@ func (nc *NetserviceCli) LeaseIPAddr(lease *types.IPLease, timeout int) (*types. return nil, fmt.Errorf("lease ip addr all netservice failed, %s", lastErr) } -// ReleaseIPAddr release ip address to bcs-netservice. It will release the ip address -// from netservice +// ReleaseIPAddr release ip address to bcs-netservice func (nc *NetserviceCli) ReleaseIPAddr(release *types.IPRelease, ipInfo *types.IPInfo, timeout int) error { // create net request request := &types.NetRequest{ @@ -739,7 +732,7 @@ func (nc *NetserviceCli) UpdateIPInstance(inst *types.IPInst) error { return fmt.Errorf(res.Message) } -// TransferIPAttr transfer ip attribution. It will transfer the ip status for source to target status +// TransferIPAttr transfer ip attribution func (nc *NetserviceCli) TransferIPAttr(input *types.TranIPAttrInput) error { if input == nil { return fmt.Errorf("input can not be nil") diff --git a/bcs-common/pkg/bcsapi/netservice/pools.go b/bcs-common/pkg/bcsapi/netservice/pools.go index 36648db975..ff35300659 100644 --- a/bcs-common/pkg/bcsapi/netservice/pools.go +++ b/bcs-common/pkg/bcsapi/netservice/pools.go @@ -16,11 +16,11 @@ package netservice import "strings" const ( - // IPStatus_RESERVED the reserved status of ip + // IPStatus_RESERVED TODO IPStatus_RESERVED = "reserved" - // IPStatus_ACTIVE the active status of ip + // IPStatus_ACTIVE TODO IPStatus_ACTIVE = "active" - // IPStatus_AVAILABLE the available status of ip + // IPStatus_AVAILABLE TODO IPStatus_AVAILABLE = "available" ) @@ -162,26 +162,26 @@ type SSLInfo struct { type NetType int const ( - // RequestType_POOL pool type + // RequestType_POOL TODO RequestType_POOL NetType = 1 - // RequestType_HOST host type + // RequestType_HOST TODO RequestType_HOST NetType = 2 - // RequestType_LEASE lease type + // RequestType_LEASE TODO RequestType_LEASE NetType = 3 - // RequestType_RELEASE release type + // RequestType_RELEASE TODO RequestType_RELEASE NetType = 4 - // ResponseType_POOL poll type + // ResponseType_POOL TODO ResponseType_POOL NetType = 5 - // ResponseType_HOST host type + // ResponseType_HOST TODO ResponseType_HOST NetType = 6 - // ResponseType_LEASE lease type + // ResponseType_LEASE TODO ResponseType_LEASE NetType = 7 - // ResponseType_RELEASE release type + // ResponseType_RELEASE TODO ResponseType_RELEASE NetType = 8 - // ResponseType_PSTATIC pstatic type + // ResponseType_PSTATIC TODO ResponseType_PSTATIC NetType = 9 - // ResponseType_VIRTUALIP virtualip type + // ResponseType_VIRTUALIP TODO ResponseType_VIRTUALIP NetType = 10 ) @@ -248,9 +248,9 @@ type ResourceResponse struct { // ///////////////////////////////////////////////////////////// const ( - // ALL_IP_FAILED all ip failed + // ALL_IP_FAILED TODO ALL_IP_FAILED int = 1 - // SOME_IP_FAILED some ip failed + // SOME_IP_FAILED TODO SOME_IP_FAILED int = 2 ) diff --git a/bcs-common/pkg/bcsapi/storage.go b/bcs-common/pkg/bcsapi/storage.go index 2231532723..a65c839d91 100644 --- a/bcs-common/pkg/bcsapi/storage.go +++ b/bcs-common/pkg/bcsapi/storage.go @@ -37,10 +37,10 @@ const ( // Storage interface definition for bcs-storage type Storage interface { - // QueryMesosTaskgroup query mesos task groups + // QueryMesosTaskgroup TODO // search all taskgroup by clusterID QueryMesosTaskgroup(cluster string) ([]*storage.Taskgroup, error) - // QueryK8SPod query k8s pods + // QueryK8SPod TODO // query all pod information in specified cluster QueryK8SPod(cluster, namespace string) ([]*storage.Pod, error) // GetIPPoolDetailInfo get all underlay ip information diff --git a/bcs-common/pkg/bcsapi/storage/ipinfo.go b/bcs-common/pkg/bcsapi/storage/ipinfo.go index 86e228c234..b8f4edfa03 100644 --- a/bcs-common/pkg/bcsapi/storage/ipinfo.go +++ b/bcs-common/pkg/bcsapi/storage/ipinfo.go @@ -13,6 +13,29 @@ package storage +/* + { + "active": [ + "127.0.0.2" + ], + "available": [ + "127.0.0.3", + ], + "cluster": "BCS-MESOS-00001", + "created": "2018-11-21 15:01:35", + "gateway": "127.0.0.1", + "hosts": [ + "127.0.0.1" + ], + "mask": 21, + "net": "127.0.0.0", + "reserved": [ + "127.0.0.245" + ], + "update": "2018-11-21 15:01:35" + } +*/ + // IPPoolDetailResponse response from storage type IPPoolDetailResponse struct { ID string `json:"_id"` diff --git a/bcs-common/pkg/bcsapi/storage/object.go b/bcs-common/pkg/bcsapi/storage/object.go index 1cc22c17ab..190dfc4168 100644 --- a/bcs-common/pkg/bcsapi/storage/object.go +++ b/bcs-common/pkg/bcsapi/storage/object.go @@ -1,31 +1,16 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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 storage import ( - "time" - - appv1 "k8s.io/api/apps/v1" - autoscalingv1 "k8s.io/api/autoscaling/v1" - corev1 "k8s.io/api/core/v1" - storagev1 "k8s.io/api/storage/v1" - commtypes "github.com/Tencent/bk-bcs/bcs-common/common/types" gdv1alpha1 "github.com/Tencent/bk-bcs/bcs-common/pkg/bcsapi/storage/tkex/gamedeployment/v1alpha1" gsv1alpha1 "github.com/Tencent/bk-bcs/bcs-common/pkg/bcsapi/storage/tkex/gamestatefulset/v1alpha1" gpav1alpha1 "github.com/Tencent/bk-bcs/bcs-common/pkg/bcsapi/storage/tkex/generalpodautoscaler/v1alpha1" schedtype "github.com/Tencent/bk-bcs/bcs-common/pkg/scheduler/types" + appv1 "k8s.io/api/apps/v1" + autoscalingv1 "k8s.io/api/autoscaling/v1" + corev1 "k8s.io/api/core/v1" + storagev1 "k8s.io/api/storage/v1" + "time" ) // Namespace is k8s namespace diff --git a/bcs-common/pkg/bcsapi/storage/tkex/gamedeployment/v1alpha1/gamedeployment.go b/bcs-common/pkg/bcsapi/storage/tkex/gamedeployment/v1alpha1/gamedeployment.go index d65bcc119f..a893ba91c8 100644 --- a/bcs-common/pkg/bcsapi/storage/tkex/gamedeployment/v1alpha1/gamedeployment.go +++ b/bcs-common/pkg/bcsapi/storage/tkex/gamedeployment/v1alpha1/gamedeployment.go @@ -16,12 +16,11 @@ package gamedeployment import ( + hookv1alpha1 "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/common/bcs-hook/apis/tkex/v1alpha1" + "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/common/update/inplaceupdate" core "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - - hookv1alpha1 "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/common/bcs-hook/apis/tkex/v1alpha1" - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/common/update/inplaceupdate" ) const ( diff --git a/bcs-common/pkg/bcsapi/storage/tkex/gamestatefulset/v1alpha1/gamestatefulset.go b/bcs-common/pkg/bcsapi/storage/tkex/gamestatefulset/v1alpha1/gamestatefulset.go index 668af10f5a..c3a0d655df 100644 --- a/bcs-common/pkg/bcsapi/storage/tkex/gamestatefulset/v1alpha1/gamestatefulset.go +++ b/bcs-common/pkg/bcsapi/storage/tkex/gamestatefulset/v1alpha1/gamestatefulset.go @@ -16,12 +16,11 @@ package gamestatefulset import ( + hookv1alpha1 "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/common/bcs-hook/apis/tkex/v1alpha1" + "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/common/update/inplaceupdate" core "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - - hookv1alpha1 "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/common/bcs-hook/apis/tkex/v1alpha1" - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/common/update/inplaceupdate" ) const ( @@ -182,6 +181,7 @@ type GameStatefulSetSpec struct { // These are replicas in the sense that they are instantiations of the // same Template, but individual replicas also have a consistent identity. // If unspecified, defaults to 1. + // TODO: Consider a rename of this field. // +kubebuilder:default=1 // +optional Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` @@ -205,6 +205,7 @@ type GameStatefulSetSpec struct { // this list must have at least one matching (by name) volumeMount in one // container in the template. A claim in this list takes precedence over // any volumes in the template, with the same name. + // TODO: Define the behavior if a claim already exists with the same name. // +optional VolumeClaimTemplates []core.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty" protobuf:"bytes,4,rep,name=volumeClaimTemplates"` diff --git a/bcs-common/pkg/bcsapi/test/storage_test.go b/bcs-common/pkg/bcsapi/test/storage_test.go index 714603db25..71fc535296 100644 --- a/bcs-common/pkg/bcsapi/test/storage_test.go +++ b/bcs-common/pkg/bcsapi/test/storage_test.go @@ -1,13 +1,12 @@ package test import ( - "testing" - "github.com/Tencent/bk-bcs/bcs-common/common/ssl" "github.com/Tencent/bk-bcs/bcs-common/pkg/bcsapi" + "testing" ) -func TestStorageCli_QueryK8SGameDeployment(t *testing.T) { // nolint +func TestStorageCli_QueryK8SGameDeployment(t *testing.T) { tlsconfig, err := ssl.ClientTslConfVerity( "xxx", "xxx", diff --git a/bcs-common/pkg/bcsmonitor/client_test.go b/bcs-common/pkg/bcsmonitor/client_test.go index e949a58e6c..37d0ec04ba 100644 --- a/bcs-common/pkg/bcsmonitor/client_test.go +++ b/bcs-common/pkg/bcsmonitor/client_test.go @@ -13,11 +13,10 @@ package bcsmonitor import ( + "github.com/stretchr/testify/assert" "net/http" "testing" "time" - - "github.com/stretchr/testify/assert" ) var ( @@ -245,7 +244,7 @@ func TestBcsMonitorClient_QueryRange(t *testing.T) { } } -func TestClientQueryRangeByPost(t *testing.T) { +func TestBcsMonitorClient_QueryRangeByPost(t *testing.T) { type fields struct { opts BcsMonitorClientOpt defaultHeader http.Header diff --git a/bcs-common/pkg/esb/apigateway/alert/client.go b/bcs-common/pkg/esb/apigateway/alert/client.go index f63ed98c9d..e1c9a88ca9 100644 --- a/bcs-common/pkg/esb/apigateway/alert/client.go +++ b/bcs-common/pkg/esb/apigateway/alert/client.go @@ -39,27 +39,26 @@ type Config struct { } // Client bk-saas alert client definition, alert message sending details: -// -// { -// "startsAt": "2020-04-14T12:31:00.124Z",(required) -// "endsAt": "2020-04-14T12:31:00.124Z",(required) -// "annotations": { -// "uuid": "cee84faf-7ee3-11ea-xxx", -// "message": "this is alert" (required) -// }, -// "labels": { -// "alert_type": "Error", (required) -// "cluster_id": "BCS-K8S-00000", (required) -// "namespace": "myns", -// "ip": "127.0.0.11", -// "module_name": "scheduler" -// } +// { +// "startsAt": "2020-04-14T12:31:00.124Z",(required) +// "endsAt": "2020-04-14T12:31:00.124Z",(required) +// "annotations": { +// "uuid": "cee84faf-7ee3-11ea-xxx", +// "message": "this is alert" (required) +// }, +// "labels": { +// "alert_type": "Error", (required) +// "cluster_id": "BCS-K8S-00000", (required) +// "namespace": "myns", +// "ip": "127.0.0.11", +// "module_name": "scheduler" // } +// } type Client interface { - // SendServiceAlert xx + // SendServiceAlert TODO // for bcs-servie modules SendServiceAlert(module string, message string) error - // SendClusterAlert xx + // SendClusterAlert TODO // for cluster bcs modules SendClusterAlert(cluster string, module string, message string) error SendCustomAlert(annotation, label map[string]string) error diff --git a/bcs-common/pkg/esb/client/client.go b/bcs-common/pkg/esb/client/client.go index 35fe2a4838..a4824112f0 100644 --- a/bcs-common/pkg/esb/client/client.go +++ b/bcs-common/pkg/esb/client/client.go @@ -46,7 +46,7 @@ type Credential map[string]interface{} // RESTClient client with metrics, ratelimit and type RESTClient struct { - // Note: change to golang http client, because HttpClient does not have context + // TODO: change to golang http client, because HttpClient does not have context httpCli *httpclient.HttpClient tlsConf *tls.Config throttle throttle.RateLimiter diff --git a/bcs-common/pkg/esb/cmdbv3/cmdb.go b/bcs-common/pkg/esb/cmdbv3/cmdb.go index 4ac4f10a10..deb3ee1389 100644 --- a/bcs-common/pkg/esb/cmdbv3/cmdb.go +++ b/bcs-common/pkg/esb/cmdbv3/cmdb.go @@ -22,18 +22,18 @@ import ( // ClientInterface client interface for cmdb type ClientInterface interface { - // CreatePod xx + // CreatePod TODO // container server CreatePod(bizID int64, data *CreatePod) (*CreatedOneOptionResult, error) CreateManyPod(bizID int64, data *CreateManyPod) (*CreatedManyOptionResult, error) UpdatePod(bizID int64, data *UpdatePod) (*UpdatedOptionResult, error) DeletePod(bizID int64, data *DeletePod) (*DeletedOptionResult, error) ListClusterPods(bizID int64, clusterID string) (*ListPodsResult, error) - // SearchBusinessTopoWithStatistics xx + // SearchBusinessTopoWithStatistics TODO // topo server SearchBusinessTopoWithStatistics(bizID int64) (*SearchBusinessTopoWithStatisticsResult, error) - // ESBSearchBusiness xx + // ESBSearchBusiness TODO // interfaces through esb // 如果是通过ESB的请求,所有的参数都在post请求体中 ESBSearchBusiness(username string, condition map[string]interface{}) (*ESBSearchBusinessResult, error) diff --git a/bcs-common/pkg/kubehelm/interface.go b/bcs-common/pkg/kubehelm/interface.go index 86ebc132ed..9b5b269235 100644 --- a/bcs-common/pkg/kubehelm/interface.go +++ b/bcs-common/pkg/kubehelm/interface.go @@ -108,7 +108,7 @@ func (f *InstallFlags) ParseParameters() string { // KubeHelm kube helm interface type KubeHelm interface { - // InstallChart xx + // InstallChart TODO // install // setParam --set hub=docker.io/istio tag=1.5.4 InstallChart(inf InstallFlags, glf GlobalFlags) error diff --git a/bcs-common/pkg/loadbalance/types.go b/bcs-common/pkg/loadbalance/types.go index 8e001eaebf..1c28815a00 100644 --- a/bcs-common/pkg/loadbalance/types.go +++ b/bcs-common/pkg/loadbalance/types.go @@ -15,7 +15,6 @@ package loadbalance import ( "encoding/json" - "fmt" ) // NewPtrExportService create default ExportService @@ -46,13 +45,8 @@ type ExportPort struct { // DeepCopy copy src to dst by json func DeepCopy(src, dst *ExportService) { - dataBytes, err := json.Marshal(src) - if err != nil { - fmt.Println(err.Error()) - } - if err = json.Unmarshal(dataBytes, dst); err != nil { - fmt.Println(err.Error()) - } + dataBytes, _ := json.Marshal(src) + json.Unmarshal(dataBytes, dst) } // ExportService info to hold export service diff --git a/bcs-common/pkg/master/etcd.go b/bcs-common/pkg/master/etcd.go index d186917354..ad9d482737 100644 --- a/bcs-common/pkg/master/etcd.go +++ b/bcs-common/pkg/master/etcd.go @@ -30,7 +30,7 @@ func (e *EtcdMaster) Init() error { func (e *EtcdMaster) Finit() { } -// Register registry information to storage +// Register registery information to storage func (e *EtcdMaster) Register() error { return nil diff --git a/bcs-common/pkg/master/master.go b/bcs-common/pkg/master/master.go index f38c68f48c..f4ce7a6f0f 100644 --- a/bcs-common/pkg/master/master.go +++ b/bcs-common/pkg/master/master.go @@ -21,7 +21,7 @@ import bcstypes "github.com/Tencent/bk-bcs/bcs-common/common/types" type Master interface { Init() error // init stage, like create connection Finit() // finit, release resource - Register() error // registry information to storage + Register() error // registery information to storage Clean() error // clean self node IsMaster() bool // check if self is master or not CheckSelfNode() (bool, error) // check self node exist, and data correct diff --git a/bcs-common/pkg/master/zookeeper.go b/bcs-common/pkg/master/zookeeper.go index 8dcfbe3bc6..1cd7f2acfc 100644 --- a/bcs-common/pkg/master/zookeeper.go +++ b/bcs-common/pkg/master/zookeeper.go @@ -86,7 +86,7 @@ func (zk *ZookeeperMaster) Finit() { zk.client = nil } -// Register registry information to storage +// Register registery information to storage func (zk *ZookeeperMaster) Register() error { if err := zk.createSelfNode(); err != nil { return err diff --git a/bcs-common/pkg/meta/object.go b/bcs-common/pkg/meta/object.go index 80600de83b..64232badf1 100644 --- a/bcs-common/pkg/meta/object.go +++ b/bcs-common/pkg/meta/object.go @@ -48,9 +48,9 @@ type List interface { } const ( - // NamespaceIndex xx + // NamespaceIndex TODO NamespaceIndex string = "namespace" - // ApplicationIndex xx + // ApplicationIndex TODO // only taskgroup has the application index ApplicationIndex string = "application" ) diff --git a/bcs-common/pkg/module-discovery/interface.go b/bcs-common/pkg/module-discovery/interface.go index b3c5a68e3a..f4a1a654c4 100644 --- a/bcs-common/pkg/module-discovery/interface.go +++ b/bcs-common/pkg/module-discovery/interface.go @@ -15,18 +15,18 @@ package modulediscovery // ModuleDiscovery bkbcs module discovery interface difinition type ModuleDiscovery interface { - // GetModuleServers xx + // GetModuleServers TODO // module: types.BCS_MODULE_SCHEDULER... // list all servers // if mesos-apiserver/k8s-apiserver module={module}/clusterid, for examples: mesosdriver/BCS-TESTBCSTEST01-10001 GetModuleServers(module string) ([]interface{}, error) - // GetRandModuleServer xx + // GetRandModuleServer TODO // get random one server // if mesos-apiserver/k8s-apiserver module={module}/clusterid, for examples: mesosdriver/BCS-TESTBCSTEST01-10001 GetRandModuleServer(moduleName string) (interface{}, error) - // RegisterEventFunc xx + // RegisterEventFunc TODO // register event handle function RegisterEventFunc(handleFunc EventHandleFunc) diff --git a/bcs-common/pkg/odm/drivers/db.go b/bcs-common/pkg/odm/drivers/db.go index b89dcf98a4..6ba69e1d08 100644 --- a/bcs-common/pkg/odm/drivers/db.go +++ b/bcs-common/pkg/odm/drivers/db.go @@ -148,13 +148,13 @@ type Table interface { // CreateIndex create index CreateIndex(ctx context.Context, index Index) error - // DropIndex xx + // DropIndex TODO DropIndex(ctx context.Context, indexName string) error - // HasIndex xx + // HasIndex TODO HasIndex(ctx context.Context, indexName string) (bool, error) - // Indexes xx + // Indexes TODO Indexes(ctx context.Context) ([]Index, error) // Find get find object diff --git a/bcs-common/pkg/odm/drivers/mongo/mongo.go b/bcs-common/pkg/odm/drivers/mongo/mongo.go index 5164f8ca08..6ed4576ac2 100644 --- a/bcs-common/pkg/odm/drivers/mongo/mongo.go +++ b/bcs-common/pkg/odm/drivers/mongo/mongo.go @@ -423,7 +423,7 @@ func (f *Finder) WithLimit(limit int64) drivers.Find { return f } -// WithDatabaseOptions set readPreference of find +// WithReadPreference set readPreference of find func (f *Finder) WithDatabaseOptions(opt interface{}) drivers.Find { if dbOpt, ok := opt.(*mopt.DatabaseOptions); ok { f.databaseOptions = dbOpt diff --git a/bcs-common/pkg/otel/examples/jaeger/multi-process/client/main.go b/bcs-common/pkg/otel/examples/jaeger/multi-process/client/main.go index 4bdc6a8dfb..e64436a7cc 100644 --- a/bcs-common/pkg/otel/examples/jaeger/multi-process/client/main.go +++ b/bcs-common/pkg/otel/examples/jaeger/multi-process/client/main.go @@ -72,10 +72,6 @@ func makeRequest(ctx context.Context) { Transport: otelhttp.NewTransport(http.DefaultTransport), } req, err := http.NewRequestWithContext(ctx, "GET", "http://localhost:9090/", nil) - if err != nil { - fmt.Printf("new request failed, err:%v\n", err) - return - } resp, err := client.Do(req) defer resp.Body.Close() if err != nil { diff --git a/bcs-common/pkg/otel/examples/unified/client/main.go b/bcs-common/pkg/otel/examples/unified/client/main.go index 8dbcf32622..03bccd1584 100644 --- a/bcs-common/pkg/otel/examples/unified/client/main.go +++ b/bcs-common/pkg/otel/examples/unified/client/main.go @@ -30,7 +30,6 @@ import ( "go.opentelemetry.io/otel/attribute" otelmetric "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/propagation" - oteltrace "go.opentelemetry.io/otel/trace" ) const ( @@ -61,13 +60,26 @@ func main() { if err != nil { log.Fatal(err) } + meter := mp.Meter("demo-client-meter") + // labels represent additional key-value descriptors that can be bound to a // metric observer or recorder. commonLabels := []attribute.KeyValue{ attribute.String("endpoint", "http_client"), attribute.String("bar", "foo"), } + requestLatency := otelmetric.Must(meter).NewFloat64Histogram( + "demo_client/request_latency", + otelmetric.WithDescription("The latency of requests processed"), + ) + + requestCount := otelmetric.Must(meter). + NewInt64Counter( + "demo_client/request_counts", + otelmetric.WithDescription("The number of requests processed"), + ) + // start a http service for exposing metrics http.Handle("/", exp) go func() { @@ -82,13 +94,11 @@ func main() { attribute.String("endpoint", "http_client"), }, } - // init trace option var traceOp []trace.Option traceOp = append(traceOp, trace.TracerSwitch(traceOpts.TracingSwitch)) traceOp = append(traceOp, trace.ResourceAttrs(traceOpts.ResourceAttrs)) traceOp = append(traceOp, trace.ExporterURL(traceOpts.ExporterURL)) - // init tracer provider tp, err := trace.InitTracerProvider(traceOpts.ServiceName, traceOp...) tracer := tp.Tracer(tracerName) otel.SetTextMapPropagator(propagation.TraceContext{}) @@ -108,25 +118,9 @@ func main() { } }(ctx) - do(ctx, tracer, commonLabels, mp) -} - -func do(ctx context.Context, tracer oteltrace.Tracer, commonLabels []attribute.KeyValue, mp otelmetric.MeterProvider) { - meter := mp.Meter("demo-client-meter") - requestLatency := otelmetric.Must(meter).NewFloat64Histogram( - "demo_client/request_latency", - otelmetric.WithDescription("The latency of requests processed"), - ) - - requestCount := otelmetric.Must(meter). - NewInt64Counter( - "demo_client/request_counts", - otelmetric.WithDescription("The number of requests processed"), - ) for { startTime := time.Now() - var span oteltrace.Span - ctx, span = tracer.Start(ctx, "Execute Request") + ctx, span := tracer.Start(ctx, "Execute Request") log.Printf("traceID:%v, spanID:%v", span.SpanContext().TraceID().String(), span.SpanContext().SpanID().String()) commonLabels2 := append(commonLabels, @@ -151,11 +145,7 @@ func makeRequest(ctx context.Context) { Transport: otelhttp.NewTransport(http.DefaultTransport), } req, err := http.NewRequestWithContext(ctx, "GET", "http://localhost:9090/", nil) - if err != nil { - fmt.Printf("new request failed, err:%v\n", err) - return - } - _, span := utils.Tracer(tracerName).Start(ctx, "HTTP DO") + ctx, span := utils.Tracer(tracerName).Start(ctx, "HTTP DO") log.Printf("traceID:%v, spanID:%v", span.SpanContext().TraceID().String(), span.SpanContext().SpanID().String()) resp, err := client.Do(req) diff --git a/bcs-common/pkg/otel/trace/tracer.go b/bcs-common/pkg/otel/trace/tracer.go index 68c532d004..56054e4123 100644 --- a/bcs-common/pkg/otel/trace/tracer.go +++ b/bcs-common/pkg/otel/trace/tracer.go @@ -36,11 +36,11 @@ import ( var ( // errSwitchType switch type error - errSwitchType = errors.New("error switch type, please input: [on or off]") + errSwitchType error = errors.New("error switch type, please input: [on or off]") // errTracingType tracing type error - errTracingType = errors.New("error tracing type, please input: [zipkin or jaeger]") + errTracingType error = errors.New("error tracing type, please input: [zipkin or jaeger]") // errServiceName for service name is null - errServiceName = errors.New("error service name is null") + errServiceName error = errors.New("error service name is null") ) const ( @@ -159,7 +159,7 @@ func InitTracingProvider(serviceName string, opt ...Option) (func(context.Contex resource.WithAttributes(defaultOptions.ResourceAttrs...), ) if err != nil { - return nil, fmt.Errorf("failed to create resource: %s", err.Error()) + return nil, fmt.Errorf("failed to create resource: %w", err) } // If the OpenTelemetry Collector is running on a local cluster (minikube or @@ -175,13 +175,13 @@ func InitTracingProvider(serviceName string, opt ...Option) (func(context.Contex grpc.WithBlock(), ) if err != nil { - return nil, fmt.Errorf("failed to create gRPC connection to collector: %s", err.Error()) + return nil, fmt.Errorf("failed to create gRPC connection to collector: %w", err) } // Set up a trace exporter traceExporter, err := otlptracegrpc.New(ctx, otlptracegrpc.WithGRPCConn(conn)) if err != nil { - return nil, fmt.Errorf("failed to create trace exporter: %s", err.Error()) + return nil, fmt.Errorf("failed to create trace exporter: %w", err) } // Register the trace exporter with a TracerProvider, using a batch diff --git a/bcs-common/pkg/qcloud/clbv2/cvm.go b/bcs-common/pkg/qcloud/clbv2/cvm.go index 9d61f5f184..fa3566b851 100644 --- a/bcs-common/pkg/qcloud/clbv2/cvm.go +++ b/bcs-common/pkg/qcloud/clbv2/cvm.go @@ -74,7 +74,7 @@ type PlaceMent struct { ProjectID int `json:"ProjectId,omitempty"` } -// VPCRef VirtualPrivateCloud reference +// VPCRef VirtualPrivateCloud referrence type VPCRef struct { VpcID string `json:"VpcId"` SubnetID string `json:"SubnetId"` diff --git a/bcs-common/pkg/qcloud/clbv2/meta.go b/bcs-common/pkg/qcloud/clbv2/meta.go index 53bb4c6ecc..70df7afbee 100644 --- a/bcs-common/pkg/qcloud/clbv2/meta.go +++ b/bcs-common/pkg/qcloud/clbv2/meta.go @@ -78,7 +78,7 @@ func (l GroupList) EncodeValues(key string, urlv *url.Values) error { // param method: http method, GET or POST // param url: qcloud request url // param obj: object to encode, -// example data before hamcSHA1 : "GETcvm.api.qcloud.com/v2/index.php?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Nonce=11886&Region=ap-guangzhou&SecretId=xxxxxxxxxx&SignatureMethod=HmacSHA1&Timestamp=1465185768" // nolint +// example data before hamcSHA1 : "GETcvm.api.qcloud.com/v2/index.php?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Nonce=11886&Region=ap-guangzhou&SecretId=xxxxxxxxxx&SignatureMethod=HmacSHA1&Timestamp=1465185768" func Signature(key, method, url string, obj interface{}) (string, error) { if obj == nil { return "", fmt.Errorf("Can not signature nil object") diff --git a/bcs-common/pkg/qcloud/clbv2/qcloudif.go b/bcs-common/pkg/qcloud/clbv2/qcloudif.go index e48b4bfd78..d58db100fd 100644 --- a/bcs-common/pkg/qcloud/clbv2/qcloudif.go +++ b/bcs-common/pkg/qcloud/clbv2/qcloudif.go @@ -22,7 +22,7 @@ import ( type APIInterface interface { DescribeLoadBalanceTaskResult(input *DescribeLoadBalancersTaskResultInput) (*DescribeLoadBalancersTaskResultOutput, error) - // CreateLoadBalance will create load balancer + // CreateLoadBalance TODO // clb v2 CreateLoadBalance(input *CreateLBInput) (*CreateLBOutput, error) DescribeLoadBalance(input *DescribeLBInput) (*DescribeLBOutput, error) @@ -51,7 +51,7 @@ type APIInterface interface { DeleteRules(input *DeleteForwardLBListenerRulesInput) (*DeleteForwardLBListenerRulesOutput, error) ModifyRuleDomain(input *ModifyForwardLBRulesDomainInput) (*ModifyForwardLBRulesDomainOutput, error) ModifyRuleProbe(input *ModifyLoadBalancerRulesProbeInput) (*ModifyLoadBalancerRulesProbeOutput, error) - // DescribeCVMInstance will describe cvm instance + // DescribeCVMInstance TODO // cvm DescribeCVMInstance(input *DescribeCVMInstanceInput) (*DescribeCVMInstanceOutput, error) DescribeCVMInstanceV3(input *DescribeCVMInstanceV3Input) (*DescribeCVMInstanceV3Output, error) diff --git a/bcs-common/pkg/reflector/reflector.go b/bcs-common/pkg/reflector/reflector.go index d6bf48addd..04e329c963 100644 --- a/bcs-common/pkg/reflector/reflector.go +++ b/bcs-common/pkg/reflector/reflector.go @@ -194,7 +194,7 @@ func (r *Reflector) handleWatch(cxt context.Context) { case watch.EventDeleted: r.processDeletion(&event) case watch.EventErr: - // some unexpected err occurred, but channel & watach is still work + // some unexpected err occured, but channel & watach is still work blog.V(3).Infof("Reflector %s catch some data err in watch.Event channel, keep watch running", r.name) } } diff --git a/bcs-common/pkg/scheduler/schetypes/application.go b/bcs-common/pkg/scheduler/schetypes/application.go index d4920323bb..c8361fe4ce 100644 --- a/bcs-common/pkg/scheduler/schetypes/application.go +++ b/bcs-common/pkg/scheduler/schetypes/application.go @@ -105,7 +105,7 @@ const ( TASK_STATUS_RESTARTING = "Restarting" - TASK_STATUS_UNKNOWN = "Unknown" + TASK_STATUS_UNKOWN = "Unknown" ) // taskgroup status diff --git a/bcs-common/pkg/scheduler/schetypes/container.go b/bcs-common/pkg/scheduler/schetypes/container.go index 16a51e478b..8e2eb34f38 100644 --- a/bcs-common/pkg/scheduler/schetypes/container.go +++ b/bcs-common/pkg/scheduler/schetypes/container.go @@ -19,17 +19,17 @@ import ( ) const ( - // ContainerStatus_PAUSED paused status + // ContainerStatus_PAUSED TODO ContainerStatus_PAUSED = "paused" - // ContainerStatus_RESTARTING restarting status + // ContainerStatus_RESTARTING TODO ContainerStatus_RESTARTING = "restarting" - // ContainerStatus_RUNNING running status + // ContainerStatus_RUNNING TODO ContainerStatus_RUNNING = "running" - // ContainerStatus_DEAD dead status + // ContainerStatus_DEAD TODO ContainerStatus_DEAD = "dead" - // ContainerStatus_CREATED created status + // ContainerStatus_CREATED TODO ContainerStatus_CREATED = "created" - // ContainerStatus_EXITED exited status + // ContainerStatus_EXITED TODO ContainerStatus_EXITED = "exited" ) diff --git a/bcs-common/pkg/scheduler/schetypes/message.go b/bcs-common/pkg/scheduler/schetypes/message.go index b8dd009757..7bef1b81b2 100644 --- a/bcs-common/pkg/scheduler/schetypes/message.go +++ b/bcs-common/pkg/scheduler/schetypes/message.go @@ -289,8 +289,8 @@ func (x Secret_Type) Enum() *Secret_Type { type TaskFail_Reason int32 const ( - // TaskFail_UNKNOWN xxx - TaskFail_UNKNOWN TaskFail_Reason = 0 + // TaskFail_UNKOWN xxx + TaskFail_UNKOWN TaskFail_Reason = 0 // TaskFail_IP_SHORT xxx TaskFail_IP_SHORT TaskFail_Reason = 1 // TaskFail_IP_USED xxx diff --git a/bcs-common/pkg/scheduler/schetypes/metrics.go b/bcs-common/pkg/scheduler/schetypes/metrics.go index 878bdf0acb..b2804a7fa2 100644 --- a/bcs-common/pkg/scheduler/schetypes/metrics.go +++ b/bcs-common/pkg/scheduler/schetypes/metrics.go @@ -14,11 +14,11 @@ package types const ( - // MetricsNamespaceScheduler bkbcs namespace + // MetricsNamespaceScheduler TODO // namespace MetricsNamespaceScheduler = "bkbcs" - // MetricsSubsystemScheduler scheduler namespace + // MetricsSubsystemScheduler TODO // subsystem MetricsSubsystemScheduler = "scheduler" ) diff --git a/bcs-common/pkg/scheduler/types/application.go b/bcs-common/pkg/scheduler/types/application.go index 5132aa9b55..e752e44178 100644 --- a/bcs-common/pkg/scheduler/types/application.go +++ b/bcs-common/pkg/scheduler/types/application.go @@ -14,10 +14,9 @@ package types import ( - "time" - "github.com/Tencent/bk-bcs/bcs-common/pkg/scheduler/mesosproto/mesos" mesos_master "github.com/Tencent/bk-bcs/bcs-common/pkg/scheduler/mesosproto/mesos/master" + "time" commtypes "github.com/Tencent/bk-bcs/bcs-common/common/types" // "fmt" @@ -66,7 +65,7 @@ const ( APP_STATUS_ERROR = "Error" APP_STATUS_OPERATING = "Operating" APP_STATUS_ROLLINGUPDATE = "RollingUpdate" - APP_STATUS_UNKNOWN = "Unknown" + APP_STATUS_UNKOWN = "Unknown" APP_STATUS_ABNORMAL = "Abnormal" ) @@ -84,7 +83,7 @@ const ( TASK_STATUS_RESTARTING = "Restarting" - TASK_STATUS_UNKNOWN = "Unknown" + TASK_STATUS_UNKOWN = "Unknown" ) // taskgroup status diff --git a/bcs-common/pkg/scheduler/types/message.go b/bcs-common/pkg/scheduler/types/message.go index 14c437b730..f61fcdc312 100644 --- a/bcs-common/pkg/scheduler/types/message.go +++ b/bcs-common/pkg/scheduler/types/message.go @@ -214,8 +214,8 @@ func (x Secret_Type) Enum() *Secret_Type { type TaskFail_Reason int32 const ( - // TaskFail_UNKNOWN xxx - TaskFail_UNKNOWN TaskFail_Reason = 0 + // TaskFail_UNKOWN xxx + TaskFail_UNKOWN TaskFail_Reason = 0 // TaskFail_IP_SHORT xxx TaskFail_IP_SHORT TaskFail_Reason = 1 // TaskFail_IP_USED xxx diff --git a/bcs-common/pkg/storage/etcd/client.go b/bcs-common/pkg/storage/etcd/client.go index d5fbdef512..b8f11b4d24 100644 --- a/bcs-common/pkg/storage/etcd/client.go +++ b/bcs-common/pkg/storage/etcd/client.go @@ -234,7 +234,7 @@ func (s *Storage) List(cxt context.Context, key string, selector storage.Selecto return objs, nil } -// Close storage connection, clean resource +// Close storage conenction, clean resource func (s *Storage) Close() { blog.V(3).Infof("etcd storage %s exit.", s.pathPrefix) s.client.Close() diff --git a/bcs-common/pkg/storage/http/client.go b/bcs-common/pkg/storage/http/client.go index 43d937075d..aac3e46808 100644 --- a/bcs-common/pkg/storage/http/client.go +++ b/bcs-common/pkg/storage/http/client.go @@ -20,17 +20,16 @@ import ( "encoding/json" "errors" "fmt" + "github.com/Tencent/bk-bcs/bcs-common/common/blog" + "github.com/Tencent/bk-bcs/bcs-common/pkg/meta" + "github.com/Tencent/bk-bcs/bcs-common/pkg/storage" + "github.com/Tencent/bk-bcs/bcs-common/pkg/watch" "io/ioutil" "math/rand" syshttp "net/http" "strings" "time" - "github.com/Tencent/bk-bcs/bcs-common/common/blog" - "github.com/Tencent/bk-bcs/bcs-common/pkg/meta" - "github.com/Tencent/bk-bcs/bcs-common/pkg/storage" - "github.com/Tencent/bk-bcs/bcs-common/pkg/watch" - "golang.org/x/net/context" ) @@ -227,13 +226,12 @@ func (s *Client) Delete(ctx context.Context, key string) (obj meta.Object, err e // * if key empty, watch all data // * if key is namespace, watch all data under namespace // * if key is namespace/name, watch detail data -// watch is Stopped when any error occure, close event channel immediately +// watch is Stopped when any error occure, close event channel immediatly // param cxt: context for background running, not used, only reserved now // param version: data version, not used, reserved // param selector: labels selector // return: -// -// watch: watch implementation for changing event, need to Stop manually +// watch: watch implementation for changing event, need to Stop manually func (s *Client) Watch(cxt context.Context, key, version string, selector storage.Selector) (watch.Interface, error) { if len(key) == 0 || strings.HasSuffix(key, "/") { return nil, fmt.Errorf("error key formate") @@ -391,7 +389,7 @@ func (s *Client) List(cxt context.Context, key string, selector storage.Selector return objs, nil } -// Close storage connection, clean resource +// Close storage conenction, clean resource func (s *Client) Close() { blog.V(3).Infof("http api event storage %v exit.", s.servers) } @@ -447,7 +445,7 @@ func (e *Watch) eventProxy() { blog.V(3).Infof("http watch is asked stopped") return } - // reading all data from response connection + // reading all data from repsonse connection rawStr, err := buf.ReadSlice('\n') if err != nil { blog.V(3).Infof("http watch %s read continue response failed, %s", e.url, err) @@ -460,7 +458,7 @@ func (e *Watch) eventProxy() { return } if watchRes.Code != 0 { - // Note(DeveloperJim): error code classification for recovery + // todo(DeveloperJim): error code classification for recovery blog.V(3).Infof("http watch %s failed, code: %d, message: %s", e.url, watchRes.Code, watchRes.Message) return } diff --git a/bcs-common/pkg/storage/interface.go b/bcs-common/pkg/storage/interface.go index 62d949bffb..030f23df14 100644 --- a/bcs-common/pkg/storage/interface.go +++ b/bcs-common/pkg/storage/interface.go @@ -15,7 +15,6 @@ package storage import ( "errors" - "github.com/Tencent/bk-bcs/bcs-common/pkg/meta" "github.com/Tencent/bk-bcs/bcs-common/pkg/watch" @@ -50,7 +49,7 @@ type Storage interface { // param selector: filter for origin data in storage, nil means no filter // return watch.Interface: interface instance for watch Watch(ctx context.Context, key, version string, selector Selector) (watch.Interface, error) - // WatchList xx + // WatchList TODO // Watch begin to watch all items under key directory // param ctx: reserved // param key: specified key for watching @@ -69,6 +68,6 @@ type Storage interface { // param ignoreNotFound: no error returns when setting true even nil object // param selector: filter for origin data in storage, nil means no filter List(ctx context.Context, key string, selector Selector) (objs []meta.Object, err error) - // Close storage connection, clean resource + // Close storage conenction, clean resource Close() } diff --git a/bcs-common/pkg/storage/zookeeper/nsclient.go b/bcs-common/pkg/storage/zookeeper/nsclient.go index 1e9f8f3008..6fd1252fcf 100644 --- a/bcs-common/pkg/storage/zookeeper/nsclient.go +++ b/bcs-common/pkg/storage/zookeeper/nsclient.go @@ -16,15 +16,14 @@ package zookeeper import ( "context" "fmt" - "path" - "strings" - "time" - "github.com/Tencent/bk-bcs/bcs-common/common/blog" "github.com/Tencent/bk-bcs/bcs-common/common/zkclient" "github.com/Tencent/bk-bcs/bcs-common/pkg/meta" "github.com/Tencent/bk-bcs/bcs-common/pkg/storage" "github.com/Tencent/bk-bcs/bcs-common/pkg/watch" + "path" + "strings" + "time" ) // ZkConfig only data type node config @@ -215,13 +214,12 @@ func (s *NSClient) Delete(ctx context.Context, key string) (obj meta.Object, err // * if key empty, watch all data // * if key is namespace, watch all data under namespace // * if key is namespace/name, watch detail data -// watch is Stopped when any error occure, close event channel immediately +// watch is Stopped when any error occure, close event channel immediatly // param cxt: context for background running, not used, only reserved now // param version: data version, not used, reserved // param selector: labels selector // return: -// -// watch: watch implementation for changing event, need to Stop manually +// watch: watch implementation for changing event, need to Stop manually func (s *NSClient) Watch(cxt context.Context, key, version string, selector storage.Selector) (watch.Interface, error) { if strings.HasSuffix(key, "/") { return nil, fmt.Errorf("error key formate") @@ -341,13 +339,13 @@ func (s *NSClient) List(cxt context.Context, key string, selector storage.Select return outs, nil } -// Close storage connection, clean resource +// Close storage conenction, clean resource func (s *NSClient) Close() { blog.V(3).Infof("zookeeper event storage %s exit.", s.prefixPath) s.client.Close() } -// getLeafNode recursive get all leaf nodes, pay more attention +// getLeafNode recursive get all leaf nodes, pay more attension func (s *NSClient) getLeafNode(node string) ([]string, error) { if len(node) == 0 { return nil, fmt.Errorf("empty node") diff --git a/bcs-common/pkg/storage/zookeeper/podclient.go b/bcs-common/pkg/storage/zookeeper/podclient.go index ef65119d24..9e15e0a2a7 100644 --- a/bcs-common/pkg/storage/zookeeper/podclient.go +++ b/bcs-common/pkg/storage/zookeeper/podclient.go @@ -15,15 +15,14 @@ package zookeeper import ( "fmt" - "path" - "strings" - "time" - "github.com/Tencent/bk-bcs/bcs-common/common/blog" "github.com/Tencent/bk-bcs/bcs-common/common/zkclient" "github.com/Tencent/bk-bcs/bcs-common/pkg/meta" "github.com/Tencent/bk-bcs/bcs-common/pkg/storage" "github.com/Tencent/bk-bcs/bcs-common/pkg/watch" + "path" + "strings" + "time" "golang.org/x/net/context" ) @@ -247,13 +246,12 @@ func (s *PodClient) recursiveDelete(p string) error { // * if key empty, watch all data // * if key is namespace, watch all data under namespace // * if key is namespace/name, watch detail data based-on application -// watch is Stopped when any error occure, close event channel immediately +// watch is Stopped when any error occure, close event channel immediatly // param cxt: context for background running, not used, only reserved now // param version: data version, not used, reserved // param selector: selector for target object data // return: -// -// watch: watch implementation for changing event, need to Stop manually +// watch: watch implementation for changing event, need to Stop manually func (s *PodClient) Watch(cxt context.Context, key, version string, selector storage.Selector) (watch.Interface, error) { if strings.HasSuffix(key, "/") { @@ -388,7 +386,7 @@ func (s *PodClient) List(cxt context.Context, key string, selector storage.Selec return outs, nil } -// Close storage connection, clean resource +// Close storage conenction, clean resource // warnning: if you want to Close client, you have better close Watch first func (s *PodClient) Close() { blog.V(3).Infof("podclient zookeeper event storage %s exit.", s.prefixPath) diff --git a/bcs-common/pkg/storage/zookeeper/util.go b/bcs-common/pkg/storage/zookeeper/util.go index 0fbffc17c0..a2a8803fcc 100644 --- a/bcs-common/pkg/storage/zookeeper/util.go +++ b/bcs-common/pkg/storage/zookeeper/util.go @@ -15,13 +15,12 @@ package zookeeper import ( "fmt" - "path" - "sync" - "time" - "github.com/Tencent/bk-bcs/bcs-common/common/blog" "github.com/Tencent/bk-bcs/bcs-common/common/zkclient" "github.com/Tencent/bk-bcs/bcs-common/pkg/watch" + "path" + "sync" + "time" "golang.org/x/net/context" ) @@ -35,7 +34,7 @@ import ( // defaultWatchCheckPeriod = 60 // ) -// PushWatchEventFn function to dispatch event +// PushWatchEventFn function to dispath event // param EventType: zk event type // param string: event path, especially for delete event // param []byte: detail data for object, nil when it's deletion @@ -87,7 +86,7 @@ type Node struct { selfpath string // node absolute path config *Layer // node config allConfig map[int]*Layer // next layer configuration - parent NodeWatch // parent node for reference + parent NodeWatch // parent node for refference client *zkclient.ZkClient // zookeeper client childrenLock sync.Mutex // lock for map children map[string]NodeWatch // all children's watch diff --git a/bcs-common/pkg/watch/interface.go b/bcs-common/pkg/watch/interface.go index c1bfba5514..bc86fde34c 100644 --- a/bcs-common/pkg/watch/interface.go +++ b/bcs-common/pkg/watch/interface.go @@ -29,7 +29,7 @@ const ( EventUpdated EventType = "UPDATED" // EventDeleted deleted event EventDeleted EventType = "DELETED" - // EventErr error event for watch, error occurred, but watch still works + // EventErr error event for watch, error occured, but watch still works EventErr EventType = "ERROR" // DefaultChannelBuffer buffer for watch event channel DefaultChannelBuffer = 128 @@ -39,7 +39,7 @@ const ( type Interface interface { // Stop watch channel Stop() - // WatchEvent xx + // WatchEvent TODO // get watch events, if watch stopped/error, watch must close // channel and exit, watch user must read channel like // e, ok := <-channel diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/cmd/app.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/cmd/app.go index e4db120eab..94e75d33e5 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/cmd/app.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/cmd/app.go @@ -17,6 +17,9 @@ import ( "context" "errors" "fmt" + "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/health" + ipvsConfig "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/ipvs/config" + "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/utils" "net/http" "net/http/pprof" "os" @@ -25,10 +28,6 @@ import ( "syscall" "time" - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/health" - ipvsConfig "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/ipvs/config" - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/utils" - "github.com/gorilla/mux" "github.com/prometheus/client_golang/prometheus/promhttp" @@ -229,9 +228,6 @@ func (pm *ProxyManager) syncDeleteLvsRealServers() error { return ErrProxyManagerNotInited } healthCheck, err := health.NewHealthConfig(pm.options.HealthCheck.HealthScheme, pm.options.HealthCheck.HealthPath) - if err != nil { - return err - } rsList, err := pm.lvsProxy.ListRealServer() if err != nil { return err diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/ipvs_tools/main.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/ipvs_tools/main.go index ac0ad9a7f8..05c7bf4ebb 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/ipvs_tools/main.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/ipvs_tools/main.go @@ -16,11 +16,10 @@ package main import ( "flag" "fmt" - "log" - "os" - ipvsConfig "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/ipvs/config" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/utils" + "log" + "os" ) const ( @@ -116,15 +115,7 @@ func initFunc() { return } scheduler, err := care.lvs.GetScheduler() - if err != nil { - log.Printf("lvs[%s] get scheduler failed: %v", opts.virtualServer, err) - return - } vs, err := care.lvs.GetVirtualServer() - if err != nil { - log.Printf("lvs[%s] get virtual server failed: %v", opts.virtualServer, err) - return - } rs, err := care.lvs.ListRealServer() if err != nil { log.Println("init failed") diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/health/health_check.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/health/health_check.go index f3a32bb6a4..e8bd5225a4 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/health/health_check.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/health/health_check.go @@ -74,7 +74,6 @@ func (hc *HealthConfig) IsHTTPAPIHealth(addr string, port uint32) bool { } http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{ - // NOCC:gas/tls(设计如此) InsecureSkipVerify: true, } url := fmt.Sprintf("%s://%s:%d%s", hc.Shem, addr, port, hc.Path) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/ipvs/exec/exec.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/ipvs/exec/exec.go index da35389de0..b793860a06 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/ipvs/exec/exec.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/ipvs/exec/exec.go @@ -189,12 +189,10 @@ func (cmd *cmdWrapper) Stop() { return } - // NOCC:gas/error(设计如此) _ = c.Process.Signal(syscall.SIGTERM) time.AfterFunc(10*time.Second, func() { if !c.ProcessState.Exited() { - // NOCC:gas/error(设计如此) _ = c.Process.Signal(syscall.SIGKILL) } }) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/utils/utils.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/utils/utils.go index 16b733de46..41ffd632b3 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/utils/utils.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/utils/utils.go @@ -17,15 +17,14 @@ package utils import ( "bufio" "fmt" + "github.com/Tencent/bk-bcs/bcs-common/common/blog" + "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/ipvs" "log" "net" "os" "os/exec" "strconv" "strings" - - "github.com/Tencent/bk-bcs/bcs-common/common/blog" - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/pkg/ipvs" ) const ( @@ -111,7 +110,6 @@ func WriteToFile(filePath string, content string) error { // SetIpvsStartup xxx func SetIpvsStartup(ipvsPersistDir string, toolPath string) error { command := "chmod +x /etc/rc.d/rc.local" - // NOCC:(gas/subprocess) 设计如此 cmd := exec.Command("/bin/sh", "-c", command) output, err := cmd.Output() if err != nil { diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cc-agent/app/node-info.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cc-agent/app/node-info.go index 986df12563..c2952526d1 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cc-agent/app/node-info.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cc-agent/app/node-info.go @@ -27,34 +27,34 @@ import ( ) const ( - // IdcId idc id + // IdcId TODO IdcId = "bcs_idc_id" - // IdcName idc name + // IdcName TODO IdcName = "bcs_idc_name" - // IdcUnitId idc unit id + // IdcUnitId TODO IdcUnitId = "bcs_idc_unit_id" - // IdcUnitName idc unit name + // IdcUnitName TODO IdcUnitName = "bcs_idc_unit_name" - // Rack rack + // Rack TODO Rack = "bcs_rack" - // SvrTypeName server type name + // SvrTypeName TODO SvrTypeName = "bcs_svr_type_name" - // CvmRegion cvm region + // CvmRegion TODO CvmRegion = "bcs_cvm_region" - // CvmZone cvm zone + // CvmZone TODO CvmZone = "bcs_cvm_zone" - // LabelOfIdcId label of idc id + // LabelOfIdcId TODO LabelOfIdcId = "bkbcs.tencent.com/idc-id" - // LabelOfIdcName label of idc name + // LabelOfIdcName TODO LabelOfIdcName = "bkbcs.tencent.com/idc-name" - // LabelOfIdcUnitId label of idc unit id + // LabelOfIdcUnitId TODO LabelOfIdcUnitId = "bkbcs.tencent.com/idc-unit-id" - // LabelOfIdcUnitName label of idc unit name + // LabelOfIdcUnitName TODO LabelOfIdcUnitName = "bkbcs.tencent.com/idc-unit-name" - // LabelOfRack label of rack + // LabelOfRack TODO LabelOfRack = "bkbcs.tencent.com/rack" - // LabelOfSvrTypeName label of server type name + // LabelOfSvrTypeName TODO LabelOfSvrTypeName = "bkbcs.tencent.com/svr-type-name" ) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/Makefile b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/Makefile index 16a9047162..e832cc5900 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/Makefile +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/Makefile @@ -27,7 +27,7 @@ build: clean clean: rm -f bcs-cluster-autoscaler - rm -r -f hyper/ + rm -r hyper/ make-image: ifdef BASEIMAGE diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/cloudprovider/bcs/cloud_provider.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/cloudprovider/bcs/cloud_provider.go index 816feae2f5..f84ce7130e 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/cloudprovider/bcs/cloud_provider.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/cloudprovider/bcs/cloud_provider.go @@ -79,12 +79,12 @@ func BuildCloudProvider(opts scalingconfig.Options, do cloudprovider.NodeGroupDi } } - // err := client.SyncParams(opts) - // if err != nil { - // klog.Warningf("Failed to sync parameters: %v", err) - // } else { - // klog.Infof("Sync parameters successfully") - // } + err := client.SyncParams(opts) + if err != nil { + klog.Warningf("Failed to sync parameters: %v", err) + } else { + klog.Infof("Sync parameters successfully") + } metricsinternal.RegisterScaleTask() cloudProvider, err := BuildBcsCloudProvider(cache, client, do, rl) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/cloudprovider/bcs/clustermanager/clustermanager.pb.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/cloudprovider/bcs/clustermanager/clustermanager.pb.go index 1bf8907508..734415ec43 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/cloudprovider/bcs/clustermanager/clustermanager.pb.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/cloudprovider/bcs/clustermanager/clustermanager.pb.go @@ -1,16 +1,3 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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 clustermanager // NodeGroup 节点池定义 diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/cloudprovider/bcs/clustermanager/nodepool_test.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/cloudprovider/bcs/clustermanager/nodepool_test.go index 5d84113ad1..51813bdd4e 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/cloudprovider/bcs/clustermanager/nodepool_test.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/cloudprovider/bcs/clustermanager/nodepool_test.go @@ -460,11 +460,11 @@ func TestNodePoolClient_GetNodes(t *testing.T) { res := ListNodesInGroupResponse{ Code: 0, Data: []*Node{ - { + &Node{ NodeID: "n1", NodeGroupID: "test1", }, - { + &Node{ NodeID: "n2", NodeGroupID: "test1", }, @@ -516,11 +516,11 @@ func TestNodePoolClient_GetNodes(t *testing.T) { np: "test1", }, want: []*Node{ - { + &Node{ NodeID: "n1", NodeGroupID: "test1", }, - { + &Node{ NodeID: "n2", NodeGroupID: "test1", }, @@ -601,15 +601,15 @@ func TestNodePoolClient_GetAutoScalingNodes(t *testing.T) { res := ListNodesInGroupResponse{ Code: 0, Data: []*Node{ - { + &Node{ NodeID: "n1", NodeGroupID: "test1", }, - { + &Node{ NodeID: "n2", NodeGroupID: "test1", }, - { + &Node{ NodeID: "n3", NodeGroupID: "", }, @@ -663,11 +663,11 @@ func TestNodePoolClient_GetAutoScalingNodes(t *testing.T) { np: "test1", }, want: []*Node{ - { + &Node{ NodeID: "n1", NodeGroupID: "test1", }, - { + &Node{ NodeID: "n2", NodeGroupID: "test1", }, @@ -722,7 +722,7 @@ func TestNodePoolClient_GetNode(t *testing.T) { res := GetNodeResponse{ Code: 0, Data: []*Node{ - { + &Node{ NodeID: "n1", NodeGroupID: "test1", }, diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/filter_out_schedulable.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/filter_out_schedulable.go index 0ecaaec40d..e3e634b614 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/filter_out_schedulable.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/filter_out_schedulable.go @@ -33,7 +33,6 @@ import ( type filterOutSchedulablePodListProcessor struct{} // NewFilterOutSchedulablePodListProcessor creates a PodListProcessor filtering out schedulable pods -// NOCC:golint/ret(设计如此),tosa/fn_length(设计如此) func NewFilterOutSchedulablePodListProcessor() pods.PodListProcessor { return &filterOutSchedulablePodListProcessor{} } diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/scale_down.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/scale_down.go index 6402d7de1b..3e69b14a5b 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/scale_down.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/scale_down.go @@ -1516,7 +1516,7 @@ func hasDelayDeletionAnnotation(node *apiv1.Node) bool { } func hasNoScaleDownAnnotation(node *apiv1.Node) bool { - return node.Annotations[ScaleDownDisabledKey] == valueTrue + return node.Annotations[ScaleDownDisabledKey] == "true" } const ( @@ -1554,7 +1554,7 @@ func filterOutMasters(nodes []*apiv1.Node, pods []*apiv1.Pod) []*apiv1.Node { func hasGameServer(pods []*apiv1.Pod) bool { for _, pod := range pods { - if pod.GetAnnotations()[drain.PodSafeToEvictKey] == valueTrue { + if pod.GetAnnotations()[drain.PodSafeToEvictKey] == "true" { continue } ctlRef := metav1.GetControllerOf(pod) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/scale_up.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/scale_up.go index 8ad7b853b5..4163aaf509 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/scale_up.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/scale_up.go @@ -47,7 +47,6 @@ type scaleUpResourcesDelta map[string]int64 // due to errors talking to cloud provider const scaleUpLimitUnknown = math.MaxInt64 -// computeScaleUpResourcesLeftLimits computes the resource limits of scale up func computeScaleUpResourcesLeftLimits( cp cloudprovider.CloudProvider, nodeGroups []cloudprovider.NodeGroup, @@ -106,7 +105,6 @@ func computeScaleUpResourcesLeftLimits( return resultScaleUpLimits, nil } -// calculateScaleUpCoresMemoryTotal calculate the total cores and memory func calculateScaleUpCoresMemoryTotal( nodeGroups []cloudprovider.NodeGroup, nodeInfos map[string]*schedulernodeinfo.NodeInfo, @@ -140,7 +138,6 @@ func calculateScaleUpCoresMemoryTotal( return coresTotal, memoryTotal, nil } -// calculateScaleUpGpusTotal calculate the total gpu func calculateScaleUpGpusTotal( GPULabel string, nodeGroups []cloudprovider.NodeGroup, @@ -190,7 +187,6 @@ func computeBelowMax(total int64, max int64) int64 { return 0 } -// computeScaleUpResourcesDelta compute scale up resources delta func computeScaleUpResourcesDelta(cp cloudprovider.CloudProvider, nodeInfo *schedulernodeinfo.NodeInfo, nodeGroup cloudprovider.NodeGroup, resourceLimiter *cloudprovider.ResourceLimiter) (scaleUpResourcesDelta, errors.AutoscalerError) { @@ -212,18 +208,15 @@ func computeScaleUpResourcesDelta(cp cloudprovider.CloudProvider, nodeInfo *sche return resultScaleUpDelta, nil } -// scaleUpLimitsCheckResult the check result of scale up limits type scaleUpLimitsCheckResult struct { exceeded bool exceededResources []string } -// scaleUpLimitsNotExceeded returns the result that limits not exceed func scaleUpLimitsNotExceeded() scaleUpLimitsCheckResult { return scaleUpLimitsCheckResult{false, []string{}} } -// checkScaleUpDeltaWithinLimits check whether the scale up delta is within limits func (limits *scaleUpResourcesLimits) checkScaleUpDeltaWithinLimits( delta scaleUpResourcesDelta) scaleUpLimitsCheckResult { exceededResources := sets.NewString() @@ -242,17 +235,15 @@ func (limits *scaleUpResourcesLimits) checkScaleUpDeltaWithinLimits( return scaleUpLimitsNotExceeded() } -// getNodeInfoCoresAndMemory returns the cores and memory of nodeInfo func getNodeInfoCoresAndMemory(nodeInfo *schedulernodeinfo.NodeInfo) (int64, int64) { return getNodeCoresAndMemory(nodeInfo.Node()) } -// skippedReasons contains the skipped reason type skippedReasons struct { message []string } -// Reasons returns the specific reason +// Reasons xxx func (sr *skippedReasons) Reasons() []string { return sr.message } @@ -263,7 +254,6 @@ var ( notReadyReason = &skippedReasons{[]string{"not ready for scale-up"}} ) -// maxResourceLimitReached returns the reason of max resource limit reached func maxResourceLimitReached(resources []string) *skippedReasons { return &skippedReasons{[]string{fmt.Sprintf("max cluster %s limit reached", strings.Join(resources, ", "))}} } @@ -395,7 +385,6 @@ func ScaleUp(context *contextinternal.Context, processors *ca_processors.Autosca ConsideredNodeGroups: nodeGroups}, nil } -// generateUpcomingNodes returns the nodeInfos of upcoming nodes func generateUpcomingNodes(clusterStateRegistry *clusterstate.ClusterStateRegistry, nodeInfos map[string]*schedulernodeinfo.NodeInfo) ([]*schedulernodeinfo.NodeInfo, error) { upcomingNodes := make([]*schedulernodeinfo.NodeInfo, 0) @@ -411,7 +400,6 @@ func generateUpcomingNodes(clusterStateRegistry *clusterstate.ClusterStateRegist return upcomingNodes, nil } -// checkNodeGroupScalable check whether the nodegroup is scalable func checkNodeGroupScalable(context *contextinternal.Context, nodeGroup cloudprovider.NodeGroup, clusterStateRegistry *clusterstate.ClusterStateRegistry, nodeInfos map[string]*schedulernodeinfo.NodeInfo, resourceLimiter *cloudprovider.ResourceLimiter, @@ -478,7 +466,6 @@ func checkNodeGroupScalable(context *contextinternal.Context, return skippedNodeGroups, checkErr } -// checkPodsSchedulable check whether the pods can be scheduled func checkPodsSchedulable(nodeGroup cloudprovider.NodeGroup, podsPredicatePassingCheckFunctions podsPredicatePassingCheckFunctions, skippedNodeGroups map[string]status.Reasons, @@ -526,7 +513,6 @@ func checkPodsSchedulable(nodeGroup cloudprovider.NodeGroup, return option, skippedNodeGroups, podsRemainUnschedulable, nil } -// optimizeBestOption generates the best scale up options func optimizeBestOption(context *contextinternal.Context, processors *ca_processors.AutoscalingProcessors, clusterStateRegistry *clusterstate.ClusterStateRegistry, daemonSets []*appsv1.DaemonSet, nodeInfos map[string]*schedulernodeinfo.NodeInfo, ignoredTaints taintKeySet, @@ -654,7 +640,6 @@ func optimizeBestOption(context *contextinternal.Context, processors *ca_process nil } -// renewNodeInfos renew nodeInfos func renewNodeInfos(context *contextinternal.Context, nodeInfos map[string]*schedulernodeinfo.NodeInfo, ignoredTaints taintKeySet, daemonSets []*appsv1.DaemonSet, bestOption *expander.Option, @@ -695,8 +680,6 @@ type podsPredicatePassingCheckFunctions struct { getPodsNotPassingPredicates func(nodeGroupId string) (map[*apiv1.Pod]status.Reasons, error) } -// getPodsPredicatePassingCheckFunctions returns PodsPredicatePassingCheckFunctions -// NOCC:tosa/fn_length(设计如此) func getPodsPredicatePassingCheckFunctions( context *context.AutoscalingContext, unschedulablePods []*apiv1.Pod, @@ -771,7 +754,6 @@ func getPodsPredicatePassingCheckFunctions( } } -// getRemainingPods return remaining pods func getRemainingPods(schedulingErrors map[*apiv1.Pod]map[string]status.Reasons, skipped map[string]status.Reasons) []status.NoScaleUpInfo { remaining := []status.NoScaleUpInfo{} @@ -786,7 +768,6 @@ func getRemainingPods(schedulingErrors map[*apiv1.Pod]map[string]status.Reasons, return remaining } -// getPodsAwaitingEvaluation return pods awaiting evaluation func getPodsAwaitingEvaluation(allPods []*apiv1.Pod, unschedulable map[*apiv1.Pod]map[string]status.Reasons, bestOption []*apiv1.Pod) []*apiv1.Pod { awaitsEvaluation := make(map[*apiv1.Pod]bool, len(allPods)) @@ -806,7 +787,6 @@ func getPodsAwaitingEvaluation(allPods []*apiv1.Pod, unschedulable map[*apiv1.Po return result } -// filterNodeGroupsByPods return suitable nodegroups for pods func filterNodeGroupsByPods( groups []cloudprovider.NodeGroup, podsRequiredToFit []*apiv1.Pod, @@ -838,7 +818,6 @@ groupsloop: return result } -// executeScaleUp execute scale up action with option func executeScaleUp(context *context.AutoscalingContext, clusterStateRegistry *clusterstate.ClusterStateRegistry, info nodegroupset.ScaleUpInfo, gpuType string, now time.Time) errors.AutoscalerError { klog.V(0).Infof("Scale-up: setting group %s size to %d", info.Group.Id(), info.NewSize) @@ -862,7 +841,6 @@ func executeScaleUp(context *context.AutoscalingContext, clusterStateRegistry *c return nil } -// applyScaleUpResourcesLimits applys scale up resources limits on scale up option func applyScaleUpResourcesLimits( cp cloudprovider.CloudProvider, newNodes int, diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/utils.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/utils.go index 40765f8022..6c2b255418 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/utils.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/utils.go @@ -65,8 +65,6 @@ const ( unschedulablePodWithGpuTimeBuffer = 30 * time.Second // How long should Cluster Autoscaler wait for nodes to become ready after start. nodesNotReadyAfterStartTimeout = 10 * time.Minute - - valueTrue = "true" ) var ( @@ -280,9 +278,9 @@ func getNodeInfosForGroups(nodes []*apiv1.Node, nodeInfoCache map[string]*schedu // processNode returns information whether the nodeTemplate was generated and if there was an error. processNode := func(node *apiv1.Node) (bool, string, errors.AutoscalerError) { - nodeGroup, getErr := cloudProvider.NodeGroupForNode(node) - if getErr != nil { - return false, "", errors.ToAutoscalerError(errors.CloudProviderError, getErr) + nodeGroup, err := cloudProvider.NodeGroupForNode(node) + if err != nil { + return false, "", errors.ToAutoscalerError(errors.CloudProviderError, err) } if nodeGroup == nil || reflect.ValueOf(nodeGroup).IsNil() { return false, "", nil @@ -290,13 +288,13 @@ func getNodeInfosForGroups(nodes []*apiv1.Node, nodeInfoCache map[string]*schedu id := nodeGroup.Id() if _, found := result[id]; !found { // Build nodeInfo. - nodeInfo, buildErr := simulator.BuildNodeInfoForNode(node, podsForNodes) - if buildErr != nil { - return false, "", buildErr + nodeInfo, err := simulator.BuildNodeInfoForNode(node, podsForNodes) + if err != nil { + return false, "", err } - sanitizedNodeInfo, sanErr := sanitizeNodeInfo(nodeInfo, id, ignoredTaints) - if sanErr != nil { - return false, "", sanErr + sanitizedNodeInfo, err := sanitizeNodeInfo(nodeInfo, id, ignoredTaints) + if err != nil { + return false, "", err } result[id] = sanitizedNodeInfo return true, id, nil @@ -458,7 +456,6 @@ func getNodeInfoFromTemplate(nodeGroup cloudprovider.NodeGroup, daemonsets []*ap // filterOutNodesFromNotAutoscaledGroups return subset of input nodes for which cloud provider does not // return autoscaled node group. -// NOCC:tosa/fn_length(设计如此) func filterOutNodesFromNotAutoscaledGroups(nodes []*apiv1.Node, cloudProvider cloudprovider.CloudProvider) ( []*apiv1.Node, errors.AutoscalerError) { result := make([]*apiv1.Node, 0) @@ -678,7 +675,7 @@ func getNodeCoresAndMemory(node *apiv1.Node) (int64, int64) { if node.Labels[nodeInstanceTypeLabelKey] == nodeInstanceTypeEklet { return 0, 0 } - if node.Annotations[filterNodeResourceAnnoKey] == valueTrue { + if node.Annotations[filterNodeResourceAnnoKey] == "true" { return 0, 0 } cores := getNodeResource(node, apiv1.ResourceCPU) @@ -788,10 +785,10 @@ func checkResourceNotEnough(nodes map[string]*schedulernodeinfo.NodeInfo, if node.Labels["node.kubernetes.io/instance-type"] == "eklet" { continue } - if node.Annotations[filterNodeResourceAnnoKey] == valueTrue { + if node.Annotations[filterNodeResourceAnnoKey] == "true" { continue } - if node.Labels[nodeLabel.LabelNodeRoleMaster] == valueTrue { + if node.Labels[nodeLabel.LabelNodeRoleMaster] == "true" { continue } klog.V(6).Infof("resource: %+v", node.Status.Allocatable) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/webhook_utils.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/webhook_utils.go index 84efd77508..588c33fbe8 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/webhook_utils.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/webhook_utils.go @@ -64,7 +64,6 @@ func GenerateAutoscalerRequest(nodeGroups []cloudprovider.NodeGroup, return req, nil } -// generateNodeGroup generates the information of node groups func generateNodeGroup(nodeGroup cloudprovider.NodeGroup, upcomingNodes map[string]int, newPriorities priorities, nodeDeletionTracker *NodeDeletionTracker) (*NodeGroup, error) { @@ -139,7 +138,6 @@ func HandleResponse(review ClusterAutoscalerReview, nodes []*corev1.Node, return options, candidates, nil } -// handleScaleUpResponse abstracts options of scale up from response func handleScaleUpResponse(req *AutoscalerRequest, policies []*ScaleUpPolicy) (ScaleUpOptions, error) { options := make(ScaleUpOptions, 0) if len(policies) <= 0 { @@ -165,7 +163,6 @@ func handleScaleUpResponse(req *AutoscalerRequest, policies []*ScaleUpPolicy) (S return options, nil } -// handleScaleDownResponse abstracts candidates of scale down from response func handleScaleDownResponse(req *AutoscalerRequest, policies []*ScaleDownPolicy, nodes []*corev1.Node, nodeNameToNodeInfo map[string]*schedulernodeinfo.NodeInfo, sd *ScaleDown, scaleDownDelay time.Duration) (ScaleDownCandidates, error) { @@ -234,7 +231,6 @@ func handleScaleDownResponse(req *AutoscalerRequest, policies []*ScaleDownPolicy } -// intersect iintersect two sets func intersect(slice1, slice2 []string) []string { m := make(map[string]int) n := make([]string, 0) @@ -251,7 +247,6 @@ func intersect(slice1, slice2 []string) []string { return n } -// sortNodesWithCostAndUtilization sorts nodes woth cost and utilization func sortNodesWithCostAndUtilization(nodes []*corev1.Node, candidates []string, nodeNameToNodeInfo map[string]*schedulernodeinfo.NodeInfo, sd *ScaleDown) ([]string, error) { nodeToUtilInfo := make(map[string]simulator.UtilizationInfo) @@ -397,7 +392,6 @@ func ExecuteScaleDown(context *contextinternal.Context, sd *ScaleDown, } -// checkCandidates determinates whether the node is in candidates func checkCandidates(node *corev1.Node, candidates ScaleDownCandidates) (string, bool) { // get internal IP IP := getInternalIP(node) @@ -416,7 +410,6 @@ func checkCandidates(node *corev1.Node, candidates ScaleDownCandidates) (string, return IP, found } -// simpleGetPodsToMove returns the pods that need to evict when scaling down the node func simpleGetPodsToMove(nodeInfo *schedulernodeinfo.NodeInfo) []*corev1.Pod { pods := []*corev1.Pod{} for _, pod := range nodeInfo.Pods() { @@ -434,7 +427,6 @@ func simpleGetPodsToMove(nodeInfo *schedulernodeinfo.NodeInfo) []*corev1.Pod { return pods } -// getPriority returns the priority of node groups func getPriority(lister v1lister.ConfigMapNamespaceLister) (priorities, error) { cm, err := lister.Get(priority_util.PriorityConfigMapName) if err != nil && kube_errors.IsNotFound(err) { @@ -458,7 +450,6 @@ func getPriority(lister v1lister.ConfigMapNamespaceLister) (priorities, error) { return newPriorities, nil } -// parsePrioritiesYAMLString parse priority from yaml func parsePrioritiesYAMLString(prioritiesYAML string) (priorities, error) { if prioritiesYAML == "" { return nil, fmt.Errorf("priority configuration in %s configmap is empty; please provide valid configuration", @@ -480,7 +471,6 @@ func parsePrioritiesYAMLString(prioritiesYAML string) (priorities, error) { return newPriorities, nil } -// processMultiNodeGroupWithPriority process option of node group based on priority func processMultiNodeGroupWithPriority(req *AutoscalerRequest, policy *ScaleUpPolicy) (ScaleUpOptions, error) { policyNodeGroupIDs := strings.Split(policy.NodeGroupID, ",") nodeGroups := make([]*NodeGroup, 0) @@ -538,7 +528,6 @@ func processMultiNodeGroupWithPriority(req *AutoscalerRequest, policy *ScaleUpPo return options, nil } -// checkResourcesLimits checks the resources limitation of scale up option and scale down candidates func checkResourcesLimits( context *contextinternal.Context, nodes []*corev1.Node, @@ -566,7 +555,6 @@ func checkResourcesLimits( return nil } -// checkScaleUpResourcesLimits checks the resources limitation of scale up option func checkScaleUpResourcesLimits(options ScaleUpOptions, nodes []*corev1.Node, cp cloudprovider.CloudProvider, @@ -599,8 +587,6 @@ func checkScaleUpResourcesLimits(options ScaleUpOptions, return nil } -// calculateWebhookScaleUpCoresMemoryTotal return the total resources after scaling up -// NOCC:tosa/fn_length(设计如此) func calculateWebhookScaleUpCoresMemoryTotal(options ScaleUpOptions, nodes []*corev1.Node, cp cloudprovider.CloudProvider) (int64, int64, errors.AutoscalerError) { @@ -635,7 +621,6 @@ func calculateWebhookScaleUpCoresMemoryTotal(options ScaleUpOptions, return coresTotal, memoryTotal, nil } -// checkScaleDownResourcesLimits checks the resources limitation of scale down candidates func checkScaleDownResourcesLimits(candidates ScaleDownCandidates, nodes []*corev1.Node, cp cloudprovider.CloudProvider, resourceLimiter *cloudprovider.ResourceLimiter) errors.AutoscalerError { @@ -668,8 +653,6 @@ func checkScaleDownResourcesLimits(candidates ScaleDownCandidates, return nil } -// calculateWebhookScaleDownCoresMemoryTotal return the total resources after scaling down -// NOCC:tosa/fn_length(设计如此) func calculateWebhookScaleDownCoresMemoryTotal(candidates ScaleDownCandidates, nodes []*corev1.Node, cp cloudprovider.CloudProvider) (int64, int64, errors.AutoscalerError) { timestamp := time.Now() @@ -686,7 +669,6 @@ func calculateWebhookScaleDownCoresMemoryTotal(candidates ScaleDownCandidates, n return coresTotal, memoryTotal, nil } -// filteroutInitializingNodes filter out initializing nodes func filteroutInitializingNodes(nodes []*corev1.Node, ips []string, delayTime time.Duration) []string { res := make([]string, 0, len(nodes)) now := time.Now() @@ -707,7 +689,6 @@ func filteroutInitializingNodes(nodes []*corev1.Node, ips []string, delayTime ti return res } -// getInternalIP returns the internal IP of node func getInternalIP(node *corev1.Node) string { if len(node.Status.Addresses) == 0 { return "" @@ -722,7 +703,6 @@ func getInternalIP(node *corev1.Node) string { return IP } -// hasTaint return true when the node has specific taint func hasTaint(node *corev1.Node, taintKey string) bool { for _, taint := range node.Spec.Taints { if taint.Key == taintKey { diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/webhook_web.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/webhook_web.go index 150648e1bd..66946ba911 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/webhook_web.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/core/webhook_web.go @@ -50,7 +50,7 @@ type WebScaler struct { func NewWebScaler(kubeClient kubeclient.Interface, configNamespace, url, token string, maxBulkScaleUpCount int) Webhook { tr := &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: false}, + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } client := &http.Client{ Transport: tr, diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/estimator/resource_estimator.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/estimator/resource_estimator.go index b9fb5fce3c..4fa88140c1 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/estimator/resource_estimator.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/estimator/resource_estimator.go @@ -27,12 +27,8 @@ import ( schedulernodeinfo "k8s.io/kubernetes/pkg/scheduler/nodeinfo" ) -const ( - // filterNodeResourceAnnoKey filters nodes when calculating buffer and total resource - filterNodeResourceAnnoKey = "io.tencent.bcs.dev/filter-node-resource" - - valueTrue = "true" -) +// filterNodeResourceAnnoKey filters nodes when calculating buffer and total resource +const filterNodeResourceAnnoKey = "io.tencent.bcs.dev/filter-node-resource" // podInfo contains Pod and score that corresponds to how important it is to handle the pod first. type podInfo struct { @@ -150,10 +146,10 @@ func (estimator *ClusterResourceEstimator) estimateAccordingToLoad(nodeTemplate if node.Labels["node.kubernetes.io/instance-type"] == "eklet" { continue } - if node.Annotations[filterNodeResourceAnnoKey] == valueTrue { + if node.Annotations[filterNodeResourceAnnoKey] == "true" { continue } - if node.Labels["node-role.kubernetes.io/master"] == valueTrue { + if node.Labels["node-role.kubernetes.io/master"] == "true" { continue } allocatable := nodeInfo.AllocatableResource() diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/go.mod b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/go.mod index cedc7f859a..22386b165b 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/go.mod +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/go.mod @@ -61,7 +61,6 @@ require ( github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect github.com/cyphar/filepath-securejoin v0.2.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - // NOCC:horus-dependency-security(已replace) github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect github.com/docker/distribution v2.7.1+incompatible // indirect github.com/docker/docker v20.10.2+incompatible // indirect @@ -83,7 +82,6 @@ require ( github.com/godbus/dbus v4.1.0+incompatible // indirect github.com/godbus/dbus/v5 v5.0.4 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/cadvisor v0.34.0 // indirect @@ -136,7 +134,6 @@ require ( github.com/prometheus/procfs v0.8.0 // indirect github.com/quobyte/api v0.1.2 // indirect github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c // indirect - // NOCC:horus-dependency-security(已replace) github.com/satori/go.uuid v1.2.0 // indirect github.com/seccomp/libseccomp-golang v0.9.1 // indirect github.com/sirupsen/logrus v1.8.1 // indirect @@ -199,20 +196,16 @@ require ( ) replace ( - // NOCC:horus-dependency-security(已replace) - github.com/dgrijalva/jwt-go v3.2.0+incompatible => github.com/golang-jwt/jwt/v4 v4.1.0 github.com/google/cadvisor => github.com/google/cadvisor v0.39.2 github.com/google/uuid => github.com/google/uuid v1.1.1 github.com/prometheus/client_golang => github.com/prometheus/client_golang v0.9.2 - // NOCC:horus-dependency-security(已replace) - github.com/satori/go.uuid v1.2.0 => github.com/gofrs/uuid v4.4.0+incompatible google.golang.org/api => google.golang.org/api v0.14.0 google.golang.org/grpc => google.golang.org/grpc v1.26.0 k8s.io/api => k8s.io/api v0.16.15 k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.16.15 k8s.io/apimachinery => k8s.io/apimachinery v0.16.15 k8s.io/apiserver => k8s.io/apiserver v0.16.15 - k8s.io/autoscaler/cluster-autoscaler => github.com/OvertimeDog/cluster-autoscaler v0.0.0-20230605040125-4690d438c904 + k8s.io/autoscaler/cluster-autoscaler => github.com/OvertimeDog/cluster-autoscaler v0.0.0-20230314084328-8391c8e6a59f k8s.io/cli-runtime => k8s.io/cli-runtime v0.16.15 k8s.io/client-go => k8s.io/client-go v0.16.15 k8s.io/cloud-provider => k8s.io/cloud-provider v0.16.15 diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/main.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/main.go index c78f76f27d..3f0159c0ad 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/main.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.16/main.go @@ -80,35 +80,23 @@ func multiStringFlag(name string, usage string) *MultiStringFlag { } var ( - // clusterName Autoscaled cluster name, if available - clusterName = flag.String("cluster-name", "", "Autoscaled cluster name, if available") - // address The address to expose prometheus metrics - address = flag.String("address", ":8085", "The address to expose prometheus metrics.") - // kubernetes Kubernetes master location - kubernetes = flag.String("kubernetes", "", "Kubernetes master location. Leave blank for default") - // kubeConfigFile Path to kubeconfig file with authorization and master location information + clusterName = flag.String("cluster-name", "", "Autoscaled cluster name, if available") + address = flag.String("address", ":8085", "The address to expose prometheus metrics.") + kubernetes = flag.String("kubernetes", "", "Kubernetes master location. Leave blank for default") kubeConfigFile = flag.String("kubeconfig", "", "Path to kubeconfig file with authorization and master location information.") - // cloudConfig The path to the cloud provider configuration file cloudConfig = flag.String("cloud-config", "", "The path to the cloud provider configuration file. Empty string for no configuration file.") - // namespace Namespace in which cluster-autoscaler run - namespace = flag.String("namespace", "bcs-system", "Namespace in which cluster-autoscaler run.") - // scaleDownEnabled Should CA scale down the cluster - scaleDownEnabled = flag.Bool("scale-down-enabled", true, "Should CA scale down the cluster") - // scaleDownDelayAfterAdd How long after scale up that scale down evaluation resumes + namespace = flag.String("namespace", "bcs-system", "Namespace in which cluster-autoscaler run.") + scaleDownEnabled = flag.Bool("scale-down-enabled", true, "Should CA scale down the cluster") scaleDownDelayAfterAdd = flag.Duration("scale-down-delay-after-add", 20*time.Minute, "How long after scale up that scale down evaluation resumes") - // scaleDownDelayAfterDelete How long after node deletion that scale down evaluation resumes scaleDownDelayAfterDelete = flag.Duration("scale-down-delay-after-delete", 0, "How long after node deletion that scale down evaluation resumes, defaults to scanInterval") - // scaleDownDelayAfterFailure How long after scale down failure that scale down evaluation resumes scaleDownDelayAfterFailure = flag.Duration("scale-down-delay-after-failure", 3*time.Minute, "How long after scale down failure that scale down evaluation resumes") - // scaleDownUnneededTime How long a node should be unneeded before it is eligible for scale down scaleDownUnneededTime = flag.Duration("scale-down-unneeded-time", 10*time.Minute, "How long a node should be unneeded before it is eligible for scale down") - // scaleDownUnreadyTime How long an unready node should be unneeded before it is eligible for scale down scaleDownUnreadyTime = flag.Duration("scale-down-unready-time", 20*time.Minute, "How long an unready node should be unneeded before it is eligible for scale down") scaleDownUtilizationThreshold = flag.Float64("scale-down-utilization-threshold", 0.5, @@ -138,59 +126,43 @@ var ( nodeDeletionDelayTimeout = flag.Duration("node-deletion-delay-timeout", 2*time.Minute, "Maximum time CA waits for removing delay-deletion.cluster-autoscaler.kubernetes.io/ annotations"+ "before deleting the node.") - // scanInterval How often cluster is reevaluated for scale up or down scanInterval = flag.Duration("scan-interval", 10*time.Second, "How often cluster is reevaluated for scale up or down") - // maxNodesTotal Maximum number of nodes in all node groups maxNodesTotal = flag.Int("max-nodes-total", 0, "Maximum number of nodes in all node groups. Cluster autoscaler will not grow the cluster beyond this number.") - // coresTotal Minimum and maximum number of cores in cluster coresTotal = flag.String("cores-total", minMaxFlagString(0, config.DefaultMaxClusterCores), "Minimum and maximum number of cores in cluster, in the format :."+ "Cluster autoscaler will not scale the cluster beyond these numbers.") - // memoryTotal Minimum and maximum number of gigabytes of memory in cluster memoryTotal = flag.String("memory-total", minMaxFlagString(0, config.DefaultMaxClusterMemory), "Minimum and maximum number of gigabytes of memory in cluster, in the format :."+ "Cluster autoscaler will not scale the cluster beyond these numbers.") - // gpuTotal Minimum and maximum number of different GPUs in cluster gpuTotal = multiStringFlag("gpu-total", "Minimum and maximum number of different GPUs in cluster, in the format ::."+ "Cluster autoscaler will not scale the cluster beyond these numbers. Can be passed multiple times."+ "CURRENTLY THIS FLAG ONLY WORKS ON GKE.") - // cloudProviderFlag Cloud provider type cloudProviderFlag = flag.String("cloud-provider", cloudBuilder.DefaultCloudProvider, "Cloud provider type. Available values: ["+strings.Join(cloudBuilder.AvailableCloudProviders, ",")+"]") - // maxBulkSoftTaintCount Maximum number of nodes that can be tainted/untainted PreferNoSchedule at the same time maxBulkSoftTaintCount = flag.Int("max-bulk-soft-taint-count", 10, "Maximum number of nodes that can be tainted/untainted PreferNoSchedule at the same time."+ "Set to 0 to turn off such tainting.") maxBulkScaleUpCount = flag.Int("max-bulk-scale-up-count", 100, "Maximum number of nodes that can be scale up at the same time. Set to 0 to turn off such scaling up") - // maxBulkSoftTaintTime Maximum duration of tainting/untainting nodes as PreferNoSchedule at the same time maxBulkSoftTaintTime = flag.Duration("max-bulk-soft-taint-time", 3*time.Second, "Maximum duration of tainting/untainting nodes as PreferNoSchedule at the same time.") - // maxEmptyBulkDeleteFlag Maximum number of empty nodes that can be deleted at the same time maxEmptyBulkDeleteFlag = flag.Int("max-empty-bulk-delete", 10, "Maximum number of empty nodes that can be deleted at the same time.") - // maxGracefulTerminationFlag Maximum number of seconds CA waits for pod termination when trying to scale down a node maxGracefulTerminationFlag = flag.Int("max-graceful-termination-sec", 10*60, "Maximum number of seconds CA waits for pod termination when trying to scale down a node.") - // maxTotalUnreadyPercentage Maximum percentage of unready nodes in the cluster maxTotalUnreadyPercentage = flag.Float64("max-total-unready-percentage", 45, "Maximum percentage of unready nodes in the cluster. After this is exceeded, CA halts operations") - // okTotalUnreadyCount Number of allowed unready nodes okTotalUnreadyCount = flag.Int("ok-total-unready-count", 3, "Number of allowed unready nodes, irrespective of max-total-unready-percentage") - // scaleUpFromZero Should CA scale up when there 0 ready nodes scaleUpFromZero = flag.Bool("scale-up-from-zero", true, "Should CA scale up when there 0 ready nodes.") - // maxNodeProvisionTime Maximum time CA waits for node to be provisioned maxNodeProvisionTime = flag.Duration("max-node-provision-time", 15*time.Minute, "Maximum time CA waits for node to be provisioned") - // maxNodeStartupTime Maximum time CA waits for node to be ready maxNodeStartupTime = flag.Duration("max-node-startup-time", 15*time.Minute, "Maximum time CA waits for node to be ready") - // maxNodeStartScheduleTime Maximum time CA waits for node to be schedulable maxNodeStartScheduleTime = flag.Duration("max-node-start-schedule-time", 15*time.Minute, "Maximum time CA waits for node to be schedulable") nodeGroupsFlag = multiStringFlag("nodes", @@ -633,5 +605,3 @@ func parseSingleGpuLimit(limits string) (config.GpuLimits, error) { } return parsedGpuLimits, nil } - -// NOCC:tosa/comment_ratio diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/cache.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/cache.go index c5ab8aca8a..cc493b63ad 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/cache.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/cache.go @@ -18,7 +18,7 @@ import ( "sync" "time" - klog "k8s.io/klog/v2" + klog "k8s.io/klog/v2" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/cloudprovider/bcs/clustermanager" ) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/cloud_provider.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/cloud_provider.go index 427277d54a..202536beaf 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/cloud_provider.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/cloud_provider.go @@ -79,12 +79,12 @@ func BuildCloudProvider(opts scalingconfig.Options, do cloudprovider.NodeGroupDi } } - // err := client.SyncParams(opts) - // if err != nil { - // klog.Warningf("Failed to sync parameters: %v", err) - // } else { - // klog.Infof("Sync parameters successfully") - // } + err := client.SyncParams(opts) + if err != nil { + klog.Warningf("Failed to sync parameters: %v", err) + } else { + klog.Infof("Sync parameters successfully") + } metricsinternal.RegisterScaleTask() cloudProvider, err := BuildBcsCloudProvider(cache, client, do, rl) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/clustermanager/clustermanager.pb.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/clustermanager/clustermanager.pb.go index 1bf8907508..734415ec43 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/clustermanager/clustermanager.pb.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/clustermanager/clustermanager.pb.go @@ -1,16 +1,3 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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 clustermanager // NodeGroup 节点池定义 diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/clustermanager/common.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/clustermanager/common.go index 9d336a7088..2bc3868493 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/clustermanager/common.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/clustermanager/common.go @@ -23,7 +23,7 @@ import ( "net/url" "strings" - klog "k8s.io/klog/v2" + klog "k8s.io/klog/v2" ) // Client is common sdk client diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/clustermanager/nodepool.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/clustermanager/nodepool.go index e764ca1027..7b162606f6 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/clustermanager/nodepool.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/clustermanager/nodepool.go @@ -321,38 +321,33 @@ func (npc *NodePoolClient) SyncParams(opts scalingconfig.Options) error { ctx, cancelFunc := context.WithTimeout(context.Background(), httpTimeOut) defer cancelFunc() req := &SyncAutoScalingOptionRequest{ - IsScaleDownEnable: opts.AutoscalingOptions.ScaleDownEnabled, - Expander: opts.AutoscalingOptions.ExpanderName, - MaxEmptyBulkDelete: uint32(opts.AutoscalingOptions.MaxEmptyBulkDelete), - ScaleDownDelay: uint32(opts.AutoscalingOptions.NodeGroupDefaults.ScaleDownUnneededTime.Seconds()), - ScaleDownUnneededTime: uint32(opts.AutoscalingOptions.NodeGroupDefaults.ScaleDownUnneededTime.Seconds()), - // should be float, not uint32 - ScaleDownUtilizationThreahold: uint32(opts.AutoscalingOptions.NodeGroupDefaults.ScaleDownUtilizationThreshold), - SkipNodesWithLocalStorage: skipNodesWithLocalStorage, - SkipNodesWithSystemPods: skipNodesWithSystemPods, - IgnoreDaemonSetsUtilization: opts.AutoscalingOptions.IgnoreDaemonSetsUtilization, - OkTotalUnreadyCount: uint32(opts.AutoscalingOptions.OkTotalUnreadyCount), - // should be float, not uint32 + IsScaleDownEnable: opts.AutoscalingOptions.ScaleDownEnabled, + Expander: opts.AutoscalingOptions.ExpanderName, + MaxEmptyBulkDelete: uint32(opts.AutoscalingOptions.MaxEmptyBulkDelete), + ScaleDownDelay: uint32(opts.AutoscalingOptions.NodeGroupDefaults.ScaleDownUnneededTime.Seconds()), + ScaleDownUnneededTime: uint32(opts.AutoscalingOptions.NodeGroupDefaults.ScaleDownUnneededTime.Seconds()), + ScaleDownUtilizationThreahold: uint32(opts.AutoscalingOptions.NodeGroupDefaults.ScaleDownUtilizationThreshold), + SkipNodesWithLocalStorage: skipNodesWithLocalStorage, + SkipNodesWithSystemPods: skipNodesWithSystemPods, + IgnoreDaemonSetsUtilization: opts.AutoscalingOptions.IgnoreDaemonSetsUtilization, + OkTotalUnreadyCount: uint32(opts.AutoscalingOptions.OkTotalUnreadyCount), MaxTotalUnreadyPercentage: uint32(opts.AutoscalingOptions.MaxTotalUnreadyPercentage), ScaleDownUnreadyTime: uint32(opts.AutoscalingOptions.NodeGroupDefaults.ScaleDownUnreadyTime.Seconds()), ClusterID: clusterID, Updater: "bcs-ca", ScaleDownGpuUtilizationThreshold: uint32(opts.AutoscalingOptions.NodeGroupDefaults.ScaleDownGpuUtilizationThreshold), - // should be float, not uint32 - BufferResourceRatio: uint32(opts.BufferedResourceRatio), - MaxGracefulTerminationSec: uint32(opts.AutoscalingOptions.MaxGracefulTerminationSec), - ScanInterval: uint32(opts.ScanInterval.Seconds()), - MaxNodeProvisionTime: uint32(opts.AutoscalingOptions.MaxNodeProvisionTime.Seconds()), - MaxNodeStartupTime: uint32(opts.MaxNodeStartupTime.Seconds()), - MaxNodeStartScheduleTime: uint32(opts.MaxNodeStartScheduleTime.Seconds()), - ScaleUpFromZero: &opts.AutoscalingOptions.ScaleUpFromZero, - ScaleDownDelayAfterAdd: uint32(opts.AutoscalingOptions.ScaleDownDelayAfterAdd.Seconds()), - ScaleDownDelayAfterDelete: uint32(opts.AutoscalingOptions.ScaleDownDelayAfterDelete.Seconds()), - ScaleDownDelayAfterFailure: newUint32Ptr(uint32(opts.AutoscalingOptions.ScaleDownDelayAfterFailure.Seconds())), - // should be float, not uint32 - BufferResourceCpuRatio: uint32(opts.BufferedCPURatio), - // should be float, not uint32 - BufferResourceMemRatio: uint32(opts.BufferedMemRatio), + BufferResourceRatio: uint32(opts.BufferedResourceRatio), + MaxGracefulTerminationSec: uint32(opts.AutoscalingOptions.MaxGracefulTerminationSec), + ScanInterval: uint32(opts.ScanInterval.Seconds()), + MaxNodeProvisionTime: uint32(opts.AutoscalingOptions.MaxNodeProvisionTime.Seconds()), + MaxNodeStartupTime: uint32(opts.MaxNodeStartupTime.Seconds()), + MaxNodeStartScheduleTime: uint32(opts.MaxNodeStartScheduleTime.Seconds()), + ScaleUpFromZero: &opts.AutoscalingOptions.ScaleUpFromZero, + ScaleDownDelayAfterAdd: uint32(opts.AutoscalingOptions.ScaleDownDelayAfterAdd.Seconds()), + ScaleDownDelayAfterDelete: uint32(opts.AutoscalingOptions.ScaleDownDelayAfterDelete.Seconds()), + ScaleDownDelayAfterFailure: newUint32Ptr(uint32(opts.AutoscalingOptions.ScaleDownDelayAfterFailure.Seconds())), + BufferResourceCpuRatio: uint32(opts.BufferedCPURatio), + BufferResourceMemRatio: uint32(opts.BufferedMemRatio), Webhook: &WebhookMode{ Mode: opts.WebhookMode, Server: opts.WebhookModeConfig, @@ -384,12 +379,10 @@ func (npc *NodePoolClient) SyncParams(opts scalingconfig.Options) error { return nil } -// newUint32Ptr returns pointer of the uint32 variable func newUint32Ptr(val uint32) *uint32 { return &val } -// newInt32Ptr returns pointer of the int32 variable func newInt32Ptr(val int32) *int32 { return &val } diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/clustermanager/nodepool_test.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/clustermanager/nodepool_test.go index 5d84113ad1..51813bdd4e 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/clustermanager/nodepool_test.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/clustermanager/nodepool_test.go @@ -460,11 +460,11 @@ func TestNodePoolClient_GetNodes(t *testing.T) { res := ListNodesInGroupResponse{ Code: 0, Data: []*Node{ - { + &Node{ NodeID: "n1", NodeGroupID: "test1", }, - { + &Node{ NodeID: "n2", NodeGroupID: "test1", }, @@ -516,11 +516,11 @@ func TestNodePoolClient_GetNodes(t *testing.T) { np: "test1", }, want: []*Node{ - { + &Node{ NodeID: "n1", NodeGroupID: "test1", }, - { + &Node{ NodeID: "n2", NodeGroupID: "test1", }, @@ -601,15 +601,15 @@ func TestNodePoolClient_GetAutoScalingNodes(t *testing.T) { res := ListNodesInGroupResponse{ Code: 0, Data: []*Node{ - { + &Node{ NodeID: "n1", NodeGroupID: "test1", }, - { + &Node{ NodeID: "n2", NodeGroupID: "test1", }, - { + &Node{ NodeID: "n3", NodeGroupID: "", }, @@ -663,11 +663,11 @@ func TestNodePoolClient_GetAutoScalingNodes(t *testing.T) { np: "test1", }, want: []*Node{ - { + &Node{ NodeID: "n1", NodeGroupID: "test1", }, - { + &Node{ NodeID: "n2", NodeGroupID: "test1", }, @@ -722,7 +722,7 @@ func TestNodePoolClient_GetNode(t *testing.T) { res := GetNodeResponse{ Code: 0, Data: []*Node{ - { + &Node{ NodeID: "n1", NodeGroupID: "test1", }, diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/node_group.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/node_group.go index 5361acce16..790669d40e 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/node_group.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/node_group.go @@ -28,7 +28,7 @@ import ( "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" ca_config "k8s.io/autoscaler/cluster-autoscaler/config" "k8s.io/autoscaler/cluster-autoscaler/utils/gpu" - klog "k8s.io/klog/v2" + klog "k8s.io/klog/v2" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/cloudprovider/bcs/clustermanager" ) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/util.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/util.go index c2978b3bb7..447acce0a6 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/util.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/cloudprovider/bcs/util.go @@ -31,7 +31,7 @@ import ( "k8s.io/apimachinery/pkg/api/resource" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" "k8s.io/autoscaler/cluster-autoscaler/config/dynamic" - klog "k8s.io/klog/v2" + klog "k8s.io/klog/v2" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/cloudprovider/bcs/clustermanager" ) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/filter_out_schedulable.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/filter_out_schedulable.go index 872bd76340..8e82780623 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/filter_out_schedulable.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/filter_out_schedulable.go @@ -33,7 +33,6 @@ type filterOutSchedulablePodListProcessor struct { } // NewFilterOutSchedulablePodListProcessor creates a PodListProcessor filtering out schedulable pods -// NOCC:golint/ret(设计如此),tosa/fn_length(设计如此) func NewFilterOutSchedulablePodListProcessor() *filterOutSchedulablePodListProcessor { return &filterOutSchedulablePodListProcessor{ schedulablePodsNodeHints: make(map[types.UID]string), diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/filter_out_schedulable_test.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/filter_out_schedulable_test.go index 9225c8c82c..0a2806249b 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/filter_out_schedulable_test.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/filter_out_schedulable_test.go @@ -102,10 +102,9 @@ func TestFilterOutSchedulableByPacking(t *testing.T) { t.Run(tt.name, func(t *testing.T) { predicateChecker, err := simulator.NewTestPredicateChecker() clusterSnapshot := simulator.NewBasicClusterSnapshot() - assert.NoError(t, err) for _, node := range tt.nodes { - err = clusterSnapshot.AddNode(node) + err := clusterSnapshot.AddNode(node) assert.NoError(t, err) } diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/scale_down.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/scale_down.go index 4c5b121ee5..e3bf1d0f77 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/scale_down.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/scale_down.go @@ -312,7 +312,6 @@ func calculateScaleDownCoresMemoryTotal(nodes []*apiv1.Node, timestamp time.Time return coresTotal, memoryTotal } -// NOCC:tosa/fn_length(设计如此) func (sd *ScaleDown) calculateScaleDownCustomResourcesTotal(nodes []*apiv1.Node, cp cloudprovider.CloudProvider, timestamp time.Time) (map[string]int64, error) { result := make(map[string]int64) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/scale_test_common.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/scale_test_common.go index 6cb6f15b74..027d015d0b 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/scale_test_common.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/scale_test_common.go @@ -97,8 +97,7 @@ type scaleTestResults struct { scaleUpStatus scaleUpStatusInfo } -// scaleUpStatusInfo is a simplified form of a ScaleUpStatus, to avoid -// mocking actual NodeGroup and Pod objects in test config. +// scaleUpStatusInfo is a simplified form of a ScaleUpStatus, to avoid mocking actual NodeGroup and Pod objects in test config. type scaleUpStatusInfo struct { result status.ScaleUpResult podsTriggeredScaleUp []string @@ -194,21 +193,18 @@ type mockAutoprovisioningNodeGroupManager struct { extraGroups int } -func (p *mockAutoprovisioningNodeGroupManager) CreateNodeGroup(context *context.AutoscalingContext, - nodeGroup cloudprovider.NodeGroup) (nodegroups.CreateNodeGroupResult, errors.AutoscalerError) { +func (p *mockAutoprovisioningNodeGroupManager) CreateNodeGroup(context *context.AutoscalingContext, nodeGroup cloudprovider.NodeGroup) (nodegroups.CreateNodeGroupResult, errors.AutoscalerError) { newNodeGroup, err := nodeGroup.Create() assert.NoError(p.t, err) metrics.RegisterNodeGroupCreation() extraGroups := []cloudprovider.NodeGroup{} testGroup, ok := nodeGroup.(*testcloudprovider.TestNodeGroup) if !ok { - return nodegroups.CreateNodeGroupResult{}, errors.ToAutoscalerError(errors.InternalError, - fmt.Errorf("expected test node group, found %v", reflect.TypeOf(nodeGroup))) + return nodegroups.CreateNodeGroupResult{}, errors.ToAutoscalerError(errors.InternalError, fmt.Errorf("expected test node group, found %v", reflect.TypeOf(nodeGroup))) } testCloudProvider, ok := context.CloudProvider.(*testcloudprovider.TestCloudProvider) if !ok { - return nodegroups.CreateNodeGroupResult{}, errors.ToAutoscalerError(errors.InternalError, - fmt.Errorf("expected test CloudProvider, found %v", reflect.TypeOf(context.CloudProvider))) + return nodegroups.CreateNodeGroupResult{}, errors.ToAutoscalerError(errors.InternalError, fmt.Errorf("expected test CloudProvider, found %v", reflect.TypeOf(context.CloudProvider))) } for i := 0; i < p.extraGroups; i++ { extraNodeGroup, err := testCloudProvider.NewNodeGroupWithId( @@ -232,8 +228,7 @@ func (p *mockAutoprovisioningNodeGroupManager) CreateNodeGroup(context *context. return result, nil } -func (p *mockAutoprovisioningNodeGroupManager) RemoveUnneededNodeGroups(context *context.AutoscalingContext) ( - removedNodeGroups []cloudprovider.NodeGroup, err error) { +func (p *mockAutoprovisioningNodeGroupManager) RemoveUnneededNodeGroups(context *context.AutoscalingContext) (removedNodeGroups []cloudprovider.NodeGroup, err error) { if !context.AutoscalingOptions.NodeAutoprovisioningEnabled { return nil, nil } @@ -267,8 +262,7 @@ type mockAutoprovisioningNodeGroupListProcessor struct { t *testing.T } -func (p *mockAutoprovisioningNodeGroupListProcessor) Process(context *context.AutoscalingContext, - nodeGroups []cloudprovider.NodeGroup, nodeInfos map[string]*schedulerframework.NodeInfo, +func (p *mockAutoprovisioningNodeGroupListProcessor) Process(context *context.AutoscalingContext, nodeGroups []cloudprovider.NodeGroup, nodeInfos map[string]*schedulerframework.NodeInfo, unschedulablePods []*apiv1.Pod) ([]cloudprovider.NodeGroup, map[string]*schedulerframework.NodeInfo, error) { machines, err := context.CloudProvider.GetAvailableMachineTypes() @@ -276,8 +270,7 @@ func (p *mockAutoprovisioningNodeGroupListProcessor) Process(context *context.Au bestLabels := labels.BestLabelSet(unschedulablePods) for _, machineType := range machines { - nodeGroup, err := context.CloudProvider.NewNodeGroup(machineType, bestLabels, - map[string]string{}, []apiv1.Taint{}, map[string]resource.Quantity{}) + nodeGroup, err := context.CloudProvider.NewNodeGroup(machineType, bestLabels, map[string]string{}, []apiv1.Taint{}, map[string]resource.Quantity{}) assert.NoError(p.t, err) nodeInfo, err := nodeGroup.TemplateNodeInfo() assert.NoError(p.t, err) @@ -291,6 +284,5 @@ func (p *mockAutoprovisioningNodeGroupListProcessor) CleanUp() { } func newBackoff() backoff.Backoff { - return backoff.NewIdBasedExponentialBackoff(clusterstate.InitialNodeGroupBackoffDuration, - clusterstate.MaxNodeGroupBackoffDuration, clusterstate.NodeGroupBackoffResetTimeout) + return backoff.NewIdBasedExponentialBackoff(clusterstate.InitialNodeGroupBackoffDuration, clusterstate.MaxNodeGroupBackoffDuration, clusterstate.NodeGroupBackoffResetTimeout) } diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/scale_up.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/scale_up.go index e3e609c1b8..62d71de25b 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/scale_up.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/scale_up.go @@ -50,7 +50,6 @@ type scaleUpResourcesDelta map[string]int64 // due to errors talking to cloud provider const scaleUpLimitUnknown = math.MaxInt64 -// computeScaleUpResourcesLeftLimits computes the resource limits of scale up func computeScaleUpResourcesLeftLimits( context *context.AutoscalingContext, processors *ca_processors.AutoscalingProcessors, @@ -110,7 +109,6 @@ func computeScaleUpResourcesLeftLimits( return resultScaleUpLimits, nil } -// calculateScaleUpCoresMemoryTotal calculate the total cores and memory func calculateScaleUpCoresMemoryTotal( nodeGroups []cloudprovider.NodeGroup, nodeInfos map[string]*schedulerframework.NodeInfo, @@ -145,8 +143,6 @@ func calculateScaleUpCoresMemoryTotal( return coresTotal, memoryTotal, nil } -// calculateScaleUpGpusTotal calculate the total gpu -// NOCC:tosa/fn_length(设计如此) func calculateScaleUpCustomResourcesTotal( context *context.AutoscalingContext, processors *ca_processors.AutoscalingProcessors, @@ -207,7 +203,6 @@ func computeBelowMax(total int64, max int64) int64 { return 0 } -// computeScaleUpResourcesDelta compute scale up resources delta func computeScaleUpResourcesDelta(context *context.AutoscalingContext, processors *ca_processors.AutoscalingProcessors, nodeInfo *schedulerframework.NodeInfo, nodeGroup cloudprovider.NodeGroup, @@ -233,18 +228,15 @@ func computeScaleUpResourcesDelta(context *context.AutoscalingContext, return resultScaleUpDelta, nil } -// scaleUpLimitsCheckResult the check result of scale up limits type scaleUpLimitsCheckResult struct { exceeded bool exceededResources []string } -// scaleUpLimitsNotExceeded returns the result that limits not exceed func scaleUpLimitsNotExceeded() scaleUpLimitsCheckResult { return scaleUpLimitsCheckResult{false, []string{}} } -// checkScaleUpDeltaWithinLimits check whether the scale up delta is within limits func (limits *scaleUpResourcesLimits) checkScaleUpDeltaWithinLimits( delta scaleUpResourcesDelta) scaleUpLimitsCheckResult { exceededResources := sets.NewString() @@ -263,17 +255,15 @@ func (limits *scaleUpResourcesLimits) checkScaleUpDeltaWithinLimits( return scaleUpLimitsNotExceeded() } -// getNodeInfoCoresAndMemory returns the cores and memory of nodeInfo func getNodeInfoCoresAndMemory(nodeInfo *schedulerframework.NodeInfo) (int64, int64) { return getNodeCoresAndMemory(nodeInfo.Node()) } -// skippedReasons contains the skipped reason type skippedReasons struct { message []string } -// Reasons returns the specific reason +// Reasons xxx func (sr *skippedReasons) Reasons() []string { return sr.message } @@ -284,13 +274,11 @@ var ( notReadyReason = &skippedReasons{[]string{"not ready for scale-up"}} ) -// maxResourceLimitReached returns the reason of max resource limit reached func maxResourceLimitReached(resources []string) *skippedReasons { return &skippedReasons{[]string{fmt.Sprintf("max cluster %s limit reached", strings.Join(resources, ", "))}} } -// computeExpansionOption computes scale up options func computeExpansionOption(context *contextinternal.Context, podEquivalenceGroups []*podEquivalenceGroup, nodeGroup cloudprovider.NodeGroup, nodeInfo *schedulerframework.NodeInfo, upcomingNodes []*schedulerframework.NodeInfo, bufferNotEnough bool) (expander.Option, error) { @@ -456,7 +444,6 @@ func ScaleUp(context *contextinternal.Context, processors *ca_processors.Autosca ConsideredNodeGroups: nodeGroups}, nil } -// optimizeBestOption generates the best scale up options func optimizeBestOption(context *contextinternal.Context, processors *ca_processors.AutoscalingProcessors, clusterStateRegistry *clusterstate.ClusterStateRegistry, daemonSets []*appsv1.DaemonSet, nodes []*apiv1.Node, upcomingNodes []*schedulerframework.NodeInfo, @@ -575,7 +562,6 @@ func optimizeBestOption(context *contextinternal.Context, processors *ca_process }, nil } -// computeExpansionOptionForNodeGroups computes scale up option for each nodegroup func computeExpansionOptionForNodeGroups(context *contextinternal.Context, podEquivalenceGroups []*podEquivalenceGroup, nodeGroups []cloudprovider.NodeGroup, nodeInfos map[string]*schedulerframework.NodeInfo, clusterStateRegistry *clusterstate.ClusterStateRegistry, processors *ca_processors.AutoscalingProcessors, @@ -652,8 +638,6 @@ func computeExpansionOptionForNodeGroups(context *contextinternal.Context, podEq return expansionOptions, skippedNodeGroups, &status.ScaleUpStatus{Result: status.ScaleUpNotTried}, nil } -// computeExpansionOptionForCreatedNodeGroups computes expansion option for created nodegroups -// NOCC:tosa/fn_length(设计如此) func computeExpansionOptionForCreatedNodeGroups(context *contextinternal.Context, podEquivalenceGroups []*podEquivalenceGroup, nodeInfos map[string]*schedulerframework.NodeInfo, clusterStateRegistry *clusterstate.ClusterStateRegistry, processors *ca_processors.AutoscalingProcessors, @@ -721,7 +705,6 @@ func computeExpansionOptionForCreatedNodeGroups(context *contextinternal.Context return expansionOptions, createNodeGroupResults, &status.ScaleUpStatus{}, nil } -// getRemainingPods return remaining pods func getRemainingPods(egs []*podEquivalenceGroup, skipped map[string]status.Reasons) []status.NoScaleUpInfo { remaining := []status.NoScaleUpInfo{} @@ -741,7 +724,6 @@ func getRemainingPods(egs []*podEquivalenceGroup, return remaining } -// getPodsAwaitingEvaluation return pods awaiting evaluation func getPodsAwaitingEvaluation(egs []*podEquivalenceGroup, bestOption string) []*apiv1.Pod { awaitsEvaluation := []*apiv1.Pod{} for _, eg := range egs { @@ -755,7 +737,6 @@ func getPodsAwaitingEvaluation(egs []*podEquivalenceGroup, bestOption string) [] return awaitsEvaluation } -// filterNodeGroupsByPods return suitable nodegroups for pods func filterNodeGroupsByPods( groups []cloudprovider.NodeGroup, podsRequiredToFit []*apiv1.Pod, @@ -788,7 +769,6 @@ groupsloop: return result } -// executeScaleUp execute scale up action with option func executeScaleUp(context *context.AutoscalingContext, clusterStateRegistry *clusterstate.ClusterStateRegistry, info nodegroupset.ScaleUpInfo, gpuType string, now time.Time) errors.AutoscalerError { klog.V(0).Infof("Scale-up: setting group %s size to %d", info.Group.Id(), info.NewSize) @@ -815,7 +795,6 @@ func executeScaleUp(context *context.AutoscalingContext, clusterStateRegistry *c return nil } -// applyScaleUpResourcesLimits applys scale up resources limits on scale up option func applyScaleUpResourcesLimits( context *context.AutoscalingContext, processors *ca_processors.AutoscalingProcessors, diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/utils.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/utils.go index 81d7014da2..51784be323 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/utils.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/utils.go @@ -60,8 +60,6 @@ const ( // How long should Cluster Autoscaler wait for nodes to become ready after start. nodesNotReadyAfterStartTimeout = 10 * time.Minute - - valueTrue = "true" ) var ( @@ -187,9 +185,9 @@ func getNodeInfosForGroups(nodes []*apiv1.Node, nodeInfoCache map[string]*schedu // processNode returns information whether the nodeTemplate was generated and if there was an error. processNode := func(node *apiv1.Node) (bool, string, errors.AutoscalerError) { - nodeGroup, getErr := cloudProvider.NodeGroupForNode(node) - if getErr != nil { - return false, "", errors.ToAutoscalerError(errors.CloudProviderError, getErr) + nodeGroup, err := cloudProvider.NodeGroupForNode(node) + if err != nil { + return false, "", errors.ToAutoscalerError(errors.CloudProviderError, err) } if nodeGroup == nil || reflect.ValueOf(nodeGroup).IsNil() { return false, "", nil @@ -197,13 +195,13 @@ func getNodeInfosForGroups(nodes []*apiv1.Node, nodeInfoCache map[string]*schedu id := nodeGroup.Id() if _, found := result[id]; !found { // Build nodeInfo. - nodeInfo, buildErr := simulator.BuildNodeInfoForNode(node, podsForNodes) - if buildErr != nil { - return false, "", buildErr + nodeInfo, err := simulator.BuildNodeInfoForNode(node, podsForNodes) + if err != nil { + return false, "", err } - sanitizedNodeInfo, sanErr := sanitizeNodeInfo(nodeInfo, id, ignoredTaints) - if sanErr != nil { - return false, "", sanErr + sanitizedNodeInfo, err := sanitizeNodeInfo(nodeInfo, id, ignoredTaints) + if err != nil { + return false, "", err } result[id] = sanitizedNodeInfo return true, id, nil @@ -349,7 +347,6 @@ func getNodeInfoFromTemplate(nodeGroup cloudprovider.NodeGroup, daemonsets []*ap // filterOutNodesFromNotAutoscaledGroups return subset of input nodes for which cloud provider does not // return autoscaled node group. -// NOCC:tosa/fn_length(设计如此) func filterOutNodesFromNotAutoscaledGroups(nodes []*apiv1.Node, cloudProvider cloudprovider.CloudProvider) ( []*apiv1.Node, errors.AutoscalerError) { result := make([]*apiv1.Node, 0) @@ -526,7 +523,7 @@ func getNodeCoresAndMemory(node *apiv1.Node) (int64, int64) { if node.Labels[nodeInstanceTypeLabelKey] == nodeInstanceTypeEklet { return 0, 0 } - if node.Annotations[filterNodeResourceAnnoKey] == valueTrue { + if node.Annotations[filterNodeResourceAnnoKey] == "true" { return 0, 0 } cores := getNodeResource(node, apiv1.ResourceCPU) @@ -611,7 +608,7 @@ func getUpcomingNodeInfos(registry *clusterstate.ClusterStateRegistry, if nodeTemplate.Node().Annotations == nil { nodeTemplate.Node().Annotations = make(map[string]string) } - nodeTemplate.Node().Annotations[NodeUpcomingAnnotation] = valueTrue + nodeTemplate.Node().Annotations[NodeUpcomingAnnotation] = "true" for i := 0; i < numberOfNodes; i++ { // Ensure new nodes have different names because nodeName @@ -638,13 +635,13 @@ func checkResourceNotEnough(nodes map[string]*schedulerframework.NodeInfo, if node.Labels[apiv1.LabelInstanceTypeStable] == "eklet" { continue } - if node.Annotations[filterNodeResourceAnnoKey] == valueTrue { + if node.Annotations[filterNodeResourceAnnoKey] == "true" { continue } - if node.Labels[nodeLabel.LabelNodeRoleControlPlane] == valueTrue { + if node.Labels[nodeLabel.LabelNodeRoleControlPlane] == "true" { continue } - if node.Labels[nodeLabel.LabelNodeRoleOldControlPlane] == valueTrue { + if node.Labels[nodeLabel.LabelNodeRoleOldControlPlane] == "true" { continue } sumResources.Add(scheduler.ResourceToResourceList(nodeInfo.Allocatable)) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/webhook_utils.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/webhook_utils.go index a45e44b0c7..4eed80c205 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/webhook_utils.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/webhook_utils.go @@ -66,7 +66,6 @@ func GenerateAutoscalerRequest(nodeGroups []cloudprovider.NodeGroup, return req, nil } -// generateNodeGroup generates the information of node groups func generateNodeGroup(nodeGroup cloudprovider.NodeGroup, upcomingNodes map[string]int, newPriorities priorities, nodeDeletionTracker *NodeDeletionTracker) (*NodeGroup, error) { @@ -141,7 +140,6 @@ func HandleResponse(review ClusterAutoscalerReview, nodes []*corev1.Node, return options, candidates, nil } -// handleScaleUpResponse abstracts options of scale up from response func handleScaleUpResponse(req *AutoscalerRequest, policies []*ScaleUpPolicy) (ScaleUpOptions, error) { options := make(ScaleUpOptions, 0) if len(policies) <= 0 { @@ -167,7 +165,6 @@ func handleScaleUpResponse(req *AutoscalerRequest, policies []*ScaleUpPolicy) (S return options, nil } -// handleScaleDownResponse abstracts candidates of scale down from response func handleScaleDownResponse(req *AutoscalerRequest, policies []*ScaleDownPolicy, nodes []*corev1.Node, nodeNameToNodeInfo map[string]*schedulerframework.NodeInfo, sd *ScaleDown, scaleDownDelay time.Duration) (ScaleDownCandidates, error) { @@ -236,7 +233,6 @@ func handleScaleDownResponse(req *AutoscalerRequest, policies []*ScaleDownPolicy } -// intersect iintersect two sets func intersect(slice1, slice2 []string) []string { m := make(map[string]int) n := make([]string, 0) @@ -253,7 +249,6 @@ func intersect(slice1, slice2 []string) []string { return n } -// sortNodesWithCostAndUtilization sorts nodes woth cost and utilization func sortNodesWithCostAndUtilization(nodes []*corev1.Node, candidates []string, nodeNameToNodeInfo map[string]*schedulerframework.NodeInfo, sd *ScaleDown) ([]string, error) { nodeToUtilInfo := make(map[string]simulator.UtilizationInfo) @@ -398,7 +393,6 @@ func ExecuteScaleDown(context *contextinternal.Context, sd *ScaleDown, } -// checkCandidates determinates whether the node is in candidates func checkCandidates(node *corev1.Node, candidates ScaleDownCandidates) (string, bool) { // get internal IP IP := getInternalIP(node) @@ -417,7 +411,6 @@ func checkCandidates(node *corev1.Node, candidates ScaleDownCandidates) (string, return IP, found } -// simpleGetPodsToMove returns the pods that need to evict when scaling down the node func simpleGetPodsToMove(nodeInfo *schedulerframework.NodeInfo) ([]*corev1.Pod, []*corev1.Pod) { pods := make([]*corev1.Pod, 0) daemonsetPods := make([]*corev1.Pod, 0) @@ -438,7 +431,18 @@ func simpleGetPodsToMove(nodeInfo *schedulerframework.NodeInfo) ([]*corev1.Pod, return pods, daemonsetPods } -// getPriority returns the priority of node groups +// func hasToBeDeletedTaint(taints []corev1.Taint) bool { +// if len(taints) == 0 { +// return false +// } +// for _, taint := range taints { +// if taint.Key == deletetaint.ToBeDeletedTaint && taint.Effect == corev1.TaintEffectNoSchedule { +// return true +// } +// } +// return false +// } + func getPriority(lister v1lister.ConfigMapNamespaceLister) (priorities, error) { cm, err := lister.Get(priority_util.PriorityConfigMapName) if err != nil && kube_errors.IsNotFound(err) { @@ -462,7 +466,6 @@ func getPriority(lister v1lister.ConfigMapNamespaceLister) (priorities, error) { return newPriorities, nil } -// parsePrioritiesYAMLString parse priority from yaml func parsePrioritiesYAMLString(prioritiesYAML string) (priorities, error) { if prioritiesYAML == "" { return nil, fmt.Errorf("priority configuration in %s configmap is empty; please provide valid configuration", @@ -484,7 +487,6 @@ func parsePrioritiesYAMLString(prioritiesYAML string) (priorities, error) { return newPriorities, nil } -// processMultiNodeGroupWithPriority process option of node group based on priority func processMultiNodeGroupWithPriority(req *AutoscalerRequest, policy *ScaleUpPolicy) (ScaleUpOptions, error) { policyNodeGroupIDs := strings.Split(policy.NodeGroupID, ",") nodeGroups := make([]*NodeGroup, 0) @@ -542,7 +544,6 @@ func processMultiNodeGroupWithPriority(req *AutoscalerRequest, policy *ScaleUpPo return options, nil } -// checkResourcesLimits checks the resources limitation of scale up option and scale down candidates func checkResourcesLimits( context *contextinternal.Context, nodes []*corev1.Node, @@ -570,7 +571,6 @@ func checkResourcesLimits( return nil } -// checkScaleUpResourcesLimits checks the resources limitation of scale up option func checkScaleUpResourcesLimits(options ScaleUpOptions, nodes []*corev1.Node, cp cloudprovider.CloudProvider, @@ -603,8 +603,6 @@ func checkScaleUpResourcesLimits(options ScaleUpOptions, return nil } -// calculateWebhookScaleUpCoresMemoryTotal return the total resources after scaling up -// NOCC:tosa/fn_length(设计如此) func calculateWebhookScaleUpCoresMemoryTotal(options ScaleUpOptions, nodes []*corev1.Node, cp cloudprovider.CloudProvider) (int64, int64, errors.AutoscalerError) { @@ -639,7 +637,6 @@ func calculateWebhookScaleUpCoresMemoryTotal(options ScaleUpOptions, return coresTotal, memoryTotal, nil } -// checkScaleDownResourcesLimits checks the resources limitation of scale down candidates func checkScaleDownResourcesLimits(candidates ScaleDownCandidates, nodes []*corev1.Node, cp cloudprovider.CloudProvider, resourceLimiter *cloudprovider.ResourceLimiter) errors.AutoscalerError { @@ -672,8 +669,6 @@ func checkScaleDownResourcesLimits(candidates ScaleDownCandidates, return nil } -// calculateWebhookScaleDownCoresMemoryTotal return the total resources after scaling down -// NOCC:tosa/fn_length(设计如此) func calculateWebhookScaleDownCoresMemoryTotal(candidates ScaleDownCandidates, nodes []*corev1.Node, cp cloudprovider.CloudProvider) (int64, int64, errors.AutoscalerError) { timestamp := time.Now() @@ -690,7 +685,6 @@ func calculateWebhookScaleDownCoresMemoryTotal(candidates ScaleDownCandidates, n return coresTotal, memoryTotal, nil } -// filteroutInitializingNodes filter out initializing nodes func filteroutInitializingNodes(nodes []*corev1.Node, ips []string, delayTime time.Duration) []string { res := make([]string, 0) now := time.Now() @@ -711,7 +705,6 @@ func filteroutInitializingNodes(nodes []*corev1.Node, ips []string, delayTime ti return res } -// getInternalIP returns the internal IP of node func getInternalIP(node *corev1.Node) string { if len(node.Status.Addresses) == 0 { return "" @@ -726,7 +719,6 @@ func getInternalIP(node *corev1.Node) string { return IP } -// hasTaint return true when the node has specific taint func hasTaint(node *corev1.Node, taintKey string) bool { for _, taint := range node.Spec.Taints { if taint.Key == taintKey { diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/webhook_web.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/webhook_web.go index ad0f35ed48..bcb12e2f4c 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/webhook_web.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/core/webhook_web.go @@ -50,7 +50,7 @@ type WebScaler struct { func NewWebScaler(kubeClient kubeclient.Interface, configNamespace, url, token string, maxBulkScaleUpCount int) Webhook { tr := &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: false}, + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } client := &http.Client{ Transport: tr, diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/estimator/resource_estimator.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/estimator/resource_estimator.go index fe5816ce88..73dca811a0 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/estimator/resource_estimator.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/estimator/resource_estimator.go @@ -29,12 +29,8 @@ import ( schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" ) -const ( - // filterNodeResourceAnnoKey filters nodes when calculating buffer and total resource - filterNodeResourceAnnoKey = "io.tencent.bcs.dev/filter-node-resource" - - valueTrue = "true" -) +// filterNodeResourceAnnoKey filters nodes when calculating buffer and total resource +const filterNodeResourceAnnoKey = "io.tencent.bcs.dev/filter-node-resource" // podInfo contains Pod and score that corresponds to how important it is to handle the pod first. type podInfo struct { @@ -150,13 +146,13 @@ func (e *ClusterResourceEstimator) estimateAccordingToLoad(nodeTemplate *schedul if node.Labels[corev1.LabelInstanceTypeStable] == "eklet" { continue } - if node.Annotations[filterNodeResourceAnnoKey] == valueTrue { + if node.Annotations[filterNodeResourceAnnoKey] == "true" { continue } - if node.Annotations[filterNodeResourceAnnoKey] == valueTrue { + if node.Annotations[filterNodeResourceAnnoKey] == "true" { continue } - if node.Labels[nodeLabel.LabelNodeRoleControlPlane] == valueTrue { + if node.Labels[nodeLabel.LabelNodeRoleControlPlane] == "true" { continue } sumResourcesList.Add(scheduler.ResourceToResourceList(nodeInfo.Allocatable)) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/go.mod b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/go.mod index a77bc64c47..6644394b07 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/go.mod +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/go.mod @@ -203,15 +203,14 @@ replace ( github.com/google/cadvisor => github.com/google/cadvisor v0.39.2 github.com/google/uuid => github.com/google/uuid v1.1.1 github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.13.0 - // NOCC:horus-dependency-security(已replace) - github.com/satori/go.uuid v1.2.0 => github.com/gofrs/uuid v4.4.0+incompatible google.golang.org/api => google.golang.org/api v0.20.0 google.golang.org/grpc => google.golang.org/grpc v1.38.0 k8s.io/api => k8s.io/api v0.22.0 k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.22.0 k8s.io/apimachinery => k8s.io/apimachinery v0.22.0 k8s.io/apiserver => k8s.io/apiserver v0.22.0 - k8s.io/autoscaler/cluster-autoscaler => github.com/OvertimeDog/cluster-autoscaler v0.0.0-20230605062414-0c6b329e9ef7 + k8s.io/autoscaler/cluster-autoscaler => github.com/OvertimeDog/cluster-autoscaler v0.0.0-20230202081332-3b703816dceb + // k8s.io/autoscaler/cluster-autoscaler => k8s.io/autoscaler/cluster-autoscaler v0.0.0-20220613131812-a28edd0f3d24 k8s.io/cli-runtime => k8s.io/cli-runtime v0.22.0 k8s.io/client-go => k8s.io/client-go v0.22.0 k8s.io/cloud-provider => k8s.io/cloud-provider v0.22.0 diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/main.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/main.go index 88f492a423..462b7cb9e5 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/main.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/main.go @@ -82,35 +82,23 @@ func multiStringFlag(name string, usage string) *MultiStringFlag { } var ( - // clusterName Autoscaled cluster name, if available - clusterName = flag.String("cluster-name", "", "Autoscaled cluster name, if available") - // address The address to expose prometheus metrics - address = flag.String("address", ":8085", "The address to expose prometheus metrics.") - // kubernetes Kubernetes master location - kubernetes = flag.String("kubernetes", "", "Kubernetes master location. Leave blank for default") - // kubeConfigFile Path to kubeconfig file with authorization and master location information + clusterName = flag.String("cluster-name", "", "Autoscaled cluster name, if available") + address = flag.String("address", ":8085", "The address to expose prometheus metrics.") + kubernetes = flag.String("kubernetes", "", "Kubernetes master location. Leave blank for default") kubeConfigFile = flag.String("kubeconfig", "", "Path to kubeconfig file with authorization and master location information.") - // cloudConfig The path to the cloud provider configuration file cloudConfig = flag.String("cloud-config", "", "The path to the cloud provider configuration file. Empty string for no configuration file.") - // namespace Namespace in which cluster-autoscaler run - namespace = flag.String("namespace", "bcs-system", "Namespace in which cluster-autoscaler run.") - // scaleDownEnabled Should CA scale down the cluster - scaleDownEnabled = flag.Bool("scale-down-enabled", true, "Should CA scale down the cluster") - // scaleDownDelayAfterAdd How long after scale up that scale down evaluation resumes + namespace = flag.String("namespace", "bcs-system", "Namespace in which cluster-autoscaler run.") + scaleDownEnabled = flag.Bool("scale-down-enabled", true, "Should CA scale down the cluster") scaleDownDelayAfterAdd = flag.Duration("scale-down-delay-after-add", 20*time.Minute, "How long after scale up that scale down evaluation resumes") - // scaleDownDelayAfterDelete How long after node deletion that scale down evaluation resumes scaleDownDelayAfterDelete = flag.Duration("scale-down-delay-after-delete", 0, "How long after node deletion that scale down evaluation resumes, defaults to scanInterval") - // scaleDownDelayAfterFailure How long after scale down failure that scale down evaluation resumes scaleDownDelayAfterFailure = flag.Duration("scale-down-delay-after-failure", 3*time.Minute, "How long after scale down failure that scale down evaluation resumes") - // scaleDownUnneededTime How long a node should be unneeded before it is eligible for scale down scaleDownUnneededTime = flag.Duration("scale-down-unneeded-time", 10*time.Minute, "How long a node should be unneeded before it is eligible for scale down") - // scaleDownUnreadyTime How long an unready node should be unneeded before it is eligible for scale down scaleDownUnreadyTime = flag.Duration("scale-down-unready-time", 20*time.Minute, "How long an unready node should be unneeded before it is eligible for scale down") scaleDownUtilizationThreshold = flag.Float64("scale-down-utilization-threshold", 0.5, @@ -140,57 +128,41 @@ var ( nodeDeletionDelayTimeout = flag.Duration("node-deletion-delay-timeout", 2*time.Minute, "Maximum time CA waits for removing delay-deletion.cluster-autoscaler.kubernetes.io/ annotations"+ "before deleting the node.") - // scanInterval How often cluster is reevaluated for scale up or down scanInterval = flag.Duration("scan-interval", 10*time.Second, "How often cluster is reevaluated for scale up or down") - // maxNodesTotal Maximum number of nodes in all node groups maxNodesTotal = flag.Int("max-nodes-total", 0, "Maximum number of nodes in all node groups. Cluster autoscaler will not grow the cluster beyond this number.") - // coresTotal Minimum and maximum number of cores in cluster coresTotal = flag.String("cores-total", minMaxFlagString(0, config.DefaultMaxClusterCores), "Minimum and maximum number of cores in cluster, in the format :."+ "Cluster autoscaler will not scale the cluster beyond these numbers.") - // memoryTotal Minimum and maximum number of gigabytes of memory in cluster memoryTotal = flag.String("memory-total", minMaxFlagString(0, config.DefaultMaxClusterMemory), "Minimum and maximum number of gigabytes of memory in cluster, in the format :."+ "Cluster autoscaler will not scale the cluster beyond these numbers.") - // gpuTotal Minimum and maximum number of different GPUs in cluster gpuTotal = multiStringFlag("gpu-total", "Minimum and maximum number of different GPUs in cluster, in the format ::."+ "Cluster autoscaler will not scale the cluster beyond these numbers. Can be passed multiple times."+ "CURRENTLY THIS FLAG ONLY WORKS ON GKE.") - // cloudProviderFlag Cloud provider type cloudProviderFlag = flag.String("cloud-provider", cloudBuilder.DefaultCloudProvider, "Cloud provider type. Available values: ["+strings.Join(cloudBuilder.AvailableCloudProviders, ",")+"]") - // maxBulkSoftTaintCount Maximum number of nodes that can be tainted/untainted PreferNoSchedule at the same time maxBulkSoftTaintCount = flag.Int("max-bulk-soft-taint-count", 10, "Maximum number of nodes that can be tainted/untainted PreferNoSchedule at the same time."+ "Set to 0 to turn off such tainting.") - // maxBulkSoftTaintTime Maximum duration of tainting/untainting nodes as PreferNoSchedule at the same time maxBulkSoftTaintTime = flag.Duration("max-bulk-soft-taint-time", 3*time.Second, "Maximum duration of tainting/untainting nodes as PreferNoSchedule at the same time.") - // maxEmptyBulkDeleteFlag Maximum number of empty nodes that can be deleted at the same time maxEmptyBulkDeleteFlag = flag.Int("max-empty-bulk-delete", 10, "Maximum number of empty nodes that can be deleted at the same time.") - // maxGracefulTerminationFlag Maximum number of seconds CA waits for pod termination when trying to scale down a node maxGracefulTerminationFlag = flag.Int("max-graceful-termination-sec", 10*60, "Maximum number of seconds CA waits for pod termination when trying to scale down a node.") - // maxTotalUnreadyPercentage Maximum percentage of unready nodes in the cluster maxTotalUnreadyPercentage = flag.Float64("max-total-unready-percentage", 45, "Maximum percentage of unready nodes in the cluster. After this is exceeded, CA halts operations") - // okTotalUnreadyCount Number of allowed unready nodes okTotalUnreadyCount = flag.Int("ok-total-unready-count", 3, "Number of allowed unready nodes, irrespective of max-total-unready-percentage") - // scaleUpFromZero Should CA scale up when there 0 ready nodes scaleUpFromZero = flag.Bool("scale-up-from-zero", true, "Should CA scale up when there 0 ready nodes.") - // maxNodeProvisionTime Maximum time CA waits for node to be provisioned maxNodeProvisionTime = flag.Duration("max-node-provision-time", 15*time.Minute, "Maximum time CA waits for node to be provisioned") - // maxNodeStartupTime Maximum time CA waits for node to be ready maxNodeStartupTime = flag.Duration("max-node-startup-time", 15*time.Minute, "Maximum time CA waits for node to be ready") - // maxNodeStartScheduleTime Maximum time CA waits for node to be schedulable maxNodeStartScheduleTime = flag.Duration("max-node-start-schedule-time", 15*time.Minute, "Maximum time CA waits for node to be schedulable") nodeGroupsFlag = multiStringFlag("nodes", @@ -266,13 +238,11 @@ var ( maxBulkScaleUpCount = flag.Int("max-bulk-scale-up-count", 100, "Maximum number of nodes that can be scale up at the same time. Set to 0 to turn off such scaling up") - // buffer ratio configuration bufferedCPURatio = flag.Float64("buffer-cpu-ratio", 0, "ratio of buffered cpu") bufferedMemRatio = flag.Float64("buffer-mem-ratio", 0, "ratio of buffered memory") bufferedResourceRatio = flag.Float64("buffer-resource-ratio", 0, "ratio of buffered resources") - // webhook configuration - webhookMode = flag.String("webhook-mode", "", "Webhook Mode. Available values: [ Web, ConfigMap ]") - webhookModeConfig = flag.String("webhook-mode-config", "", "Configuration of webhook mode."+ + webhookMode = flag.String("webhook-mode", "", "Webhook Mode. Available values: [ Web, ConfigMap ]") + webhookModeConfig = flag.String("webhook-mode-config", "", "Configuration of webhook mode."+ " It is a url for web, or namespace/name for configmap") webhookModeToken = flag.String("webhook-mode-token", "", "Token for webhook mode") ) @@ -367,7 +337,6 @@ func createAutoscalingOptions() scalingconfig.Options { } } -// getKubeConfig get config of kube func getKubeConfig() *rest.Config { if *kubeConfigFile != "" { klog.V(1).Infof("Using kubeconfig file: %s", *kubeConfigFile) @@ -391,14 +360,12 @@ func getKubeConfig() *rest.Config { return kubeConfig } -// createKubeClient create kube client func createKubeClient(kubeConfig *rest.Config) kube_client.Interface { kubeConfig.QPS = 100 kubeConfig.Burst = 200 return kube_client.NewForConfigOrDie(kubeConfig) } -// registerSignalHandlers register handler for grace termination func registerSignalHandlers(autoscaler core.Autoscaler) { sigs := make(chan os.Signal, 1) signal.Notify(sigs, os.Interrupt, os.Kill, syscall.SIGTERM, syscall.SIGQUIT) @@ -505,7 +472,6 @@ func main() { klog.V(1).Infof("Cluster Autoscaler %s", version.ClusterAutoscalerVersion) - // start web server for prometheus and health check go func() { pathRecorderMux := mux.NewPathRecorderMux("cluster-autoscaler") defaultMetricsHandler := legacyregistry.Handler().ServeHTTP @@ -570,7 +536,6 @@ func main() { } } -// defaultLeaderElectionConfiguration construct default configuration of leader election func defaultLeaderElectionConfiguration() componentbaseconfig.LeaderElectionConfiguration { return componentbaseconfig.LeaderElectionConfiguration{ LeaderElect: false, @@ -582,14 +547,12 @@ func defaultLeaderElectionConfiguration() componentbaseconfig.LeaderElectionConf } } -// leader election config const ( defaultLeaseDuration = 15 * time.Second defaultRenewDeadline = 10 * time.Second defaultRetryPeriod = 2 * time.Second ) -// parseMinMaxFlag parse MinMax flag func parseMinMaxFlag(flag string) (int64, int64, error) { tokens := strings.SplitN(flag, ":", 2) if len(tokens) != 2 { @@ -614,7 +577,6 @@ func parseMinMaxFlag(flag string) (int64, int64, error) { return min, max, nil } -// validateMinMaxFlag validates flag of MinMax func validateMinMaxFlag(min, max int64) error { if min < 0 { return fmt.Errorf("min size must be greater or equal to 0") @@ -629,7 +591,6 @@ func minMaxFlagString(min, max int64) string { return fmt.Sprintf("%v:%v", min, max) } -// parseMultipleGpuLimits parse multiple gpu limits func parseMultipleGpuLimits(flags MultiStringFlag) ([]config.GpuLimits, error) { parsedFlags := make([]config.GpuLimits, 0, len(flags)) for _, flag := range flags { @@ -642,7 +603,6 @@ func parseMultipleGpuLimits(flags MultiStringFlag) ([]config.GpuLimits, error) { return parsedFlags, nil } -// parseSingleGpuLimit parse single gpu limits func parseSingleGpuLimit(limits string) (config.GpuLimits, error) { parts := strings.Split(limits, ":") if len(parts) != 3 { @@ -673,5 +633,3 @@ func parseSingleGpuLimit(limits string) (config.GpuLimits, error) { } return parsedGpuLimits, nil } - -// NOCC:tosa/comment_ratio diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/test/e2e.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/test/e2e.go index 0c86005fe2..0f04bce768 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/test/e2e.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler-1.22/test/e2e.go @@ -18,11 +18,10 @@ import ( "context" "flag" "fmt" + "k8s.io/apimachinery/pkg/types" "net/http" "time" - "k8s.io/apimachinery/pkg/types" - "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/spf13/pflag" appsv1 "k8s.io/api/apps/v1" @@ -39,7 +38,7 @@ import ( v12 "k8s.io/client-go/listers/core/v1" restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/cache" - klog "k8s.io/klog/v2" + klog "k8s.io/klog/v2" ) var ( @@ -54,7 +53,6 @@ var ( name = flag.String("name", "", "name of this pod") ) -// testConfig config of test type testConfig struct { desiredReplicas int32 client kubernetes.Interface @@ -63,7 +61,6 @@ type testConfig struct { podTemplateSpec v1.PodTemplateSpec } -// newConfig news testConfig func newConfig() *testConfig { kubeConfig, err := restclient.InClusterConfig() if err != nil { @@ -102,7 +99,6 @@ func newConfig() *testConfig { } } -// produceName produce name func (tc *testConfig) produceName() { name := fmt.Sprintf("ca-%v", string(uuid.NewUUID())) tc.name = name @@ -183,7 +179,6 @@ func (tc *testConfig) ScaleDownWorkLoad(deploy *appsv1.Deployment, lister v12.No return nil } -// changeScale change scale func (tc *testConfig) changeScale(deploy *appsv1.Deployment, desired int32) error { return wait.PollImmediate(1*time.Second, 5*time.Second, func() (done bool, err error) { scale, err := tc.client.AppsV1().Deployments(deploy.Namespace).GetScale(context.TODO(), deploy.Name, metav1.GetOptions{}) @@ -275,7 +270,6 @@ func (tc *testConfig) ReconcileScaleDown(lister v12.NodeLister, desired int) boo return len(nodes) <= desired } -// getNodeCount return count of nodes func (tc *testConfig) getNodeCount(lister v12.NodeLister) int { nodes, err := lister.List(labels.Everything()) if err != nil { diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/app/app.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/app/app.go index 02efd4ace9..462e2c403f 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/app/app.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/app/app.go @@ -22,7 +22,7 @@ import ( "github.com/Tencent/bk-bcs/bcs-common/common/static" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/app/options" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/config" - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpusetdevice" + "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpuset-device" ) // Run run the server @@ -30,7 +30,7 @@ func Run(op *options.Option) error { conf := config.NewConfig() setConfig(conf, op) - controller := cpusetdevice.NewCpusetDevicePlugin(conf) + controller := cpuset_device.NewCpusetDevicePlugin(conf) err := controller.Start() if err != nil { blog.Errorf("CpusetDevicePlugin Start failed: %s", err.Error()) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpusetdevice/container.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpuset-device/container.go similarity index 99% rename from bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpusetdevice/container.go rename to bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpuset-device/container.go index 87c1e1c631..75bbe76a03 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpusetdevice/container.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpuset-device/container.go @@ -11,7 +11,7 @@ * */ -package cpusetdevice +package cpuset_device import ( "fmt" diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpusetdevice/manager.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpuset-device/manager.go similarity index 99% rename from bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpusetdevice/manager.go rename to bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpuset-device/manager.go index f88d10a004..6c44b286f7 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpusetdevice/manager.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpuset-device/manager.go @@ -11,7 +11,7 @@ * */ -package cpusetdevice +package cpuset_device import ( "fmt" diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpusetdevice/numa.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpuset-device/numa.go similarity index 99% rename from bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpusetdevice/numa.go rename to bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpuset-device/numa.go index a29205276e..ac24a81c01 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpusetdevice/numa.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/cpuset-device/numa.go @@ -11,7 +11,7 @@ * */ -package cpusetdevice +package cpuset_device // #cgo LDFLAGS: -lnuma // #include diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/go.mod b/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/go.mod index 490cecb46c..3e718ce1b7 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/go.mod +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/go.mod @@ -17,57 +17,3 @@ require ( k8s.io/klog v1.0.0 sigs.k8s.io/controller-runtime v0.5.7 ) - -require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.1 // indirect - github.com/coreos/prometheus-operator v0.38.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/evanphx/json-patch v4.5.0+incompatible // indirect - github.com/fsnotify/fsnotify v1.4.7 // indirect - github.com/go-logr/logr v0.1.0 // indirect - github.com/gogo/protobuf v1.3.1 // indirect - github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 // indirect - github.com/golang/protobuf v1.4.2 // indirect - github.com/google/go-cmp v0.4.0 // indirect - github.com/google/gofuzz v1.0.0 // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/googleapis/gnostic v0.3.1 // indirect - github.com/hashicorp/golang-lru v0.5.4 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect - github.com/imdario/mergo v0.3.9 // indirect - github.com/json-iterator/go v1.1.10 // indirect - github.com/magiconair/properties v1.8.1 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect - github.com/mitchellh/mapstructure v1.1.2 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect - github.com/pelletier/go-toml v1.2.0 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.5.1 // indirect - github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.9.1 // indirect - github.com/prometheus/procfs v0.0.11 // indirect - github.com/spf13/afero v1.2.2 // indirect - github.com/spf13/cast v1.3.0 // indirect - github.com/spf13/jwalterweatherman v1.0.0 // indirect - github.com/subosito/gotenv v1.2.0 // indirect - golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975 // indirect - golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 // indirect - golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect - golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd // indirect - golang.org/x/text v0.3.3 // indirect - golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect - gomodules.xyz/jsonpatch/v2 v2.0.1 // indirect - google.golang.org/appengine v1.6.5 // indirect - google.golang.org/protobuf v1.23.0 // indirect - gopkg.in/fsnotify.v1 v1.4.7 // indirect - gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/ini.v1 v1.51.0 // indirect - gopkg.in/yaml.v2 v2.3.0 // indirect - k8s.io/klog/v2 v2.0.0 // indirect - k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29 // indirect - k8s.io/kube-state-metrics v1.7.2 // indirect - k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 // indirect - sigs.k8s.io/yaml v1.1.0 // indirect -) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/pkg/apis/bkbcs/v1alpha1/bcsegress_types.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/pkg/apis/bkbcs/v1alpha1/bcsegress_types.go index 11344b23a2..099cb61192 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/pkg/apis/bkbcs/v1alpha1/bcsegress_types.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/pkg/apis/bkbcs/v1alpha1/bcsegress_types.go @@ -20,7 +20,7 @@ import ( // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. -// ControllerRef reference for egress controller +// ControllerRef refference for egress controller type ControllerRef struct { // +kubebuilder:default=bcs-system Namespace string `json:"namespace"` @@ -82,7 +82,7 @@ const ( // BCSEgressStatus defines the observed state of BCSEgress type BCSEgressStatus struct { - // State reference EgressState above + // State refference EgressState above // +kubebuilder:default=Pending State string `json:"state"` HTTPActives uint `json:"httpActives"` diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/pkg/controller/bcsegress/bcsegress_controller.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/pkg/controller/bcsegress/bcsegress_controller.go index 06cfe9472a..a9cc26f710 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/pkg/controller/bcsegress/bcsegress_controller.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/pkg/controller/bcsegress/bcsegress_controller.go @@ -82,7 +82,7 @@ type ReconcileBCSEgress struct { option *EgressOption // identity comes from namespace/name in ENV identity string - // proxy is interface for network flow control + // proxy is interface for network flow controll proxy Proxy // LastError for BCSEgress error recording // * key is reconcile.Request.String() @@ -129,7 +129,7 @@ func (r *ReconcileBCSEgress) Reconcile(request reconcile.Request) (reconcile.Res klog.Errorf("reading BCSEgress %s failed, requeue...", request.String()) return reconcile.Result{}, err } - // port conflict verification and filter, if port conflicts, + // port conflict verification and filter, if port conflics, // do nothing until client fix them all. tcps, https, err := r.fromBCSEgressToList(instance) if err != nil { @@ -215,7 +215,7 @@ func (r *ReconcileBCSEgress) Reconcile(request reconcile.Request) (reconcile.Res return reconcile.Result{}, nil } -// Init all BCSEgressController instance running requirement +// Init all BCSEgressController instance running requirment func (r *ReconcileBCSEgress) Init(mgr manager.Manager) error { // Create a new controller c, err := controller.New("bcsegress-controller", mgr, controller.Options{Reconciler: r}) @@ -317,7 +317,7 @@ func (r *ReconcileBCSEgress) cleanRulesByLabel(cleanLabel map[string]string) err } // fromBCSEgressToList convert egress proxy rule to local cache -// in conversion, we have to verify: +// in convertion, we have to verify: // * first, find all conflict ports within this egress // * second, find all port conflicted with other egresses(already exist ones) // all return Configs are verified diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/pkg/controller/bcsegress/egress.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/pkg/controller/bcsegress/egress.go index 97256496e6..0998aeac81 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/pkg/controller/bcsegress/egress.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/pkg/controller/bcsegress/egress.go @@ -35,7 +35,7 @@ type HTTPConfig struct { indexer string Name string Domain string - // backend ip list, reserved for extension + // backend ip list, reserved for extention IPs []string DestinationPort uint // Label use for custom information storage diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/pkg/controller/bcsegress/proxy.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/pkg/controller/bcsegress/proxy.go index 30c2934d86..d10ce6bbf5 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/pkg/controller/bcsegress/proxy.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-egress/pkg/controller/bcsegress/proxy.go @@ -14,7 +14,7 @@ package bcsegress import ( - "crypto/md5" // NOCC:gas/crypto(设计如此) + "crypto/md5" "fmt" "io" "os" @@ -53,7 +53,7 @@ type Proxy interface { DeleteTCPRule(key string) error UpdateTCPRule(cfg *TCPConfig) error - // Reload proxy for new configuration. egress is the rule reference why proxy + // Reload proxy for new configuration. egress is the rule referrence why proxy // need to reload, proxy stores error information relative to this egress rule // it's convenience for user to check egress last error for decision of reloading again Reload(egress string) error @@ -285,7 +285,7 @@ func (ngx *Nginx) Reload(egress string) error { return err } // configuration validation - if err = ngx.configValidation(output); err != nil { + if err := ngx.configValidation(output); err != nil { klog.Errorf("proxy nginx check egress %s new configuration %s failed, %s", egress, output, err.Error()) ngx.lastError[egress] = err return err @@ -348,7 +348,6 @@ func (ngx *Nginx) dataGeneration() *generator { func (ngx *Nginx) configValidation(filename string) error { command := fmt.Sprintf("%s -t -c %s", ngx.option.ProxyExecutable, filename) - // NOCC:gas/subprocess(设计如此) cmd := exec.Command("/bin/sh", "-c", command) output, err := cmd.CombinedOutput() if err != nil { @@ -382,7 +381,6 @@ func md5sum(filename string) (string, error) { return "", fmt.Errorf("Open file %s failed: %s", filename, err.Error()) } defer config.Close() - // NOCC:gas/crypto(设计如此) md5Block := md5.New() _, err = io.Copy(md5Block, config) if err != nil { @@ -416,7 +414,6 @@ func (ngx *Nginx) reloadNginx(config string) error { klog.V(3).Infof("Replace config file %s success", config) // ready to reload command := fmt.Sprintf("%s -s reload", ngx.option.ProxyExecutable) - // NOCC:gas/subprocess(设计如此) cmd := exec.Command("/bin/sh", "-c", command) output, err := cmd.CombinedOutput() if err != nil { diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-general-pod-autoscaler/cmd/gpa/app/options.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-general-pod-autoscaler/cmd/gpa/app/options.go index 8693e31c5e..0b52fec900 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-general-pod-autoscaler/cmd/gpa/app/options.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-general-pod-autoscaler/cmd/gpa/app/options.go @@ -91,9 +91,7 @@ func (o *RunOptions) addGPAFlags() { pflag.BoolVar(&o.GeneralPodAutoscalerUseRESTClients, "general-pod-autoscaler-use-rest-clients", o.GeneralPodAutoscalerUseRESTClients, - "If set to true, causes the general pod autoscaler controller to use REST clients through the kube-aggregator,"+ - " instead of using the legacy metrics client through the API server proxy."+ - " This is required for custom metrics support in the general pod autoscaler.") + "If set to true, causes the general pod autoscaler controller to use REST clients through the kube-aggregator, instead of using the legacy metrics client through the API server proxy. This is required for custom metrics support in the general pod autoscaler.") pflag.DurationVar(&o.GeneralPodAutoscalerCPUInitializationPeriod.Duration, "general-pod-autoscaler-cpu-initialization-period", o.GeneralPodAutoscalerCPUInitializationPeriod.Duration, diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-general-pod-autoscaler/pkg/scaler/general.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-general-pod-autoscaler/pkg/scaler/general.go index 44727f1583..db0c1774cf 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-general-pod-autoscaler/pkg/scaler/general.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-general-pod-autoscaler/pkg/scaler/general.go @@ -293,6 +293,7 @@ func getMetricName(metricSpec autoscaling.MetricSpec) string { default: return "" } + return "" } // computeReplicasForMetrics computes the desired number of replicas for the metric specifications listed in the GPA, @@ -1283,11 +1284,11 @@ type NormalizationArg struct { // normalizeDesiredReplicasWithB 原方法名 normalizeDesiredReplicasWithBehaviors // // normalizeDesiredReplicasWithB takes the metrics desired replicas value and normalizes it: -// 1. Apply the basic conditions (i.e. < maxReplicas, > minReplicas, etc...) -// 2. Apply the scale up/down limits from the gpaSpec.Behaviors (i.e. add no more than 4 pods) -// 3. Apply the constraints period (i.e. add no more than 4 pods per minute) -// 4. Apply the stabilization (i.e. add no more than 4 pods per minute, and pick the smallest -// recommendation during last 5 minutes) +// 1. Apply the basic conditions (i.e. < maxReplicas, > minReplicas, etc...) +// 2. Apply the scale up/down limits from the gpaSpec.Behaviors (i.e. add no more than 4 pods) +// 3. Apply the constraints period (i.e. add no more than 4 pods per minute) +// 4. Apply the stabilization (i.e. add no more than 4 pods per minute, and pick the smallest +// recommendation during last 5 minutes) func (a *GeneralController) normalizeDesiredReplicasWithB(gpa *autoscaling.GeneralPodAutoscaler, key string, currentReplicas, prenormalizedDesiredReplicas, minReplicas int32) int32 { a.maybeInitScaleDownSW(gpa) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-general-pod-autoscaler/pkg/validation/validation.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-general-pod-autoscaler/pkg/validation/validation.go index 5f4830f76c..d003af348d 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-general-pod-autoscaler/pkg/validation/validation.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-general-pod-autoscaler/pkg/validation/validation.go @@ -38,8 +38,6 @@ const ( // Prefix indicates this name will be used as part of generation, in which case trailing dashes are allowed. var ValidateHorizontalPodAutoscalerName = apimachineryvalidation.NameIsDNSSubdomain -// validateHorizontalPodAutoscalerSpec validates the spec of pod autoscaler and returns an -// ErrorList with any errors. func validateHorizontalPodAutoscalerSpec(autoscaler autoscaling.GeneralPodAutoscalerSpec, fldPath *field.Path, minReplicasLowerBound int32) field.ErrorList { allErrs := field.ErrorList{} @@ -160,7 +158,6 @@ func ValidateHorizontalPodASU(newAutoscaler, oldAutoscaler *autoscaling.GeneralP return allErrs } -// validateMetrics validates metrics and returns an ErrorList with any errors. func validateMetrics(metrics []autoscaling.MetricSpec, fldPath *field.Path, minReplicas *int32) field.ErrorList { allErrs := field.ErrorList{} hasObjectMetrics := false @@ -189,7 +186,6 @@ func validateMetrics(metrics []autoscaling.MetricSpec, fldPath *field.Path, minR return allErrs } -// validateWebhook validates webhook configuration and returns an ErrorList with any errors. func validateWebhook(wc *v1beta1.WebhookClientConfig, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} if wc == nil { @@ -213,7 +209,6 @@ func validateWebhook(wc *v1beta1.WebhookClientConfig, fldPath *field.Path) field return allErrs } -// validateTime validates time configuration and returns an ErrorList with any errors. func validateTime(timeRanges []autoscaling.TimeRange, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} if len(timeRanges) == 0 { @@ -235,7 +230,6 @@ func validateTime(timeRanges []autoscaling.TimeRange, fldPath *field.Path) field return allErrs } -// validateEvent validates event configuration and returns an ErrorList with any errors. func validateEvent(triggers []autoscaling.ScaleTriggers, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} if len(triggers) == 0 { @@ -253,7 +247,6 @@ func validateEvent(triggers []autoscaling.ScaleTriggers, fldPath *field.Path) fi return allErrs } -// validateBehavior validates behavior configuration and returns an ErrorList with any errors. func validateBehavior(behavior *autoscaling.GeneralPodAutoscalerBehavior, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} if behavior != nil { @@ -271,7 +264,6 @@ var validSelectPolicyTypes = sets.NewString(string(autoscaling.MaxPolicySelect), string(autoscaling.DisabledPolicySelect)) var validSelectPolicyTypesList = validSelectPolicyTypes.List() -// validateScalingRules validates scaling rules and returns an ErrorList with any errors. func validateScalingRules(rules *autoscaling.GPAScalingRules, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} if rules != nil { @@ -305,7 +297,6 @@ func validateScalingRules(rules *autoscaling.GPAScalingRules, fldPath *field.Pat var validPolicyTypes = sets.NewString(string(autoscaling.PodsScalingPolicy), string(autoscaling.PercentScalingPolicy)) var validPolicyTypesList = validPolicyTypes.List() -// validateScalingPolicy validates scaling policy and returns an ErrorList with any errors. func validateScalingPolicy(policy autoscaling.GPAScalingPolicy, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} if policy.Type != autoscaling.PodsScalingPolicy && policy.Type != autoscaling.PercentScalingPolicy { @@ -333,7 +324,6 @@ var validMetricSourceTypes = sets.NewString( string(autoscaling.ExternalMetricSourceType)) var validMetricSourceTypesList = validMetricSourceTypes.List() -// validateMetricSpec validates spec of metric and returns an ErrorList with any errors. func validateMetricSpec(spec autoscaling.MetricSpec, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} @@ -421,7 +411,6 @@ func validateMetricSpec(spec autoscaling.MetricSpec, fldPath *field.Path) field. return allErrs } -// validateObjectSource validates object resource and returns an ErrorList with any errors. func validateObjectSource(src *autoscaling.ObjectMetricSource, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} @@ -438,7 +427,6 @@ func validateObjectSource(src *autoscaling.ObjectMetricSource, fldPath *field.Pa return allErrs } -// validateExternalSource validates external source and returns an ErrorList with any errors. func validateExternalSource(src *autoscaling.ExternalMetricSource, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} @@ -458,7 +446,6 @@ func validateExternalSource(src *autoscaling.ExternalMetricSource, fldPath *fiel return allErrs } -// validatePodsSource validates pods source and returns an ErrorList with any errors. func validatePodsSource(src *autoscaling.PodsMetricSource, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} @@ -473,7 +460,6 @@ func validatePodsSource(src *autoscaling.PodsMetricSource, fldPath *field.Path) return allErrs } -// validateResourceSource validates resource source and returns an ErrorList with any errors. func validateResourceSource(src *autoscaling.ResourceMetricSource, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} @@ -496,7 +482,6 @@ func validateResourceSource(src *autoscaling.ResourceMetricSource, fldPath *fiel return allErrs } -// validateMetricTarget validates metric target and returns an ErrorList with any errors. func validateMetricTarget(mt autoscaling.MetricTarget, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} @@ -532,7 +517,6 @@ func validateMetricTarget(mt autoscaling.MetricTarget, fldPath *field.Path) fiel return allErrs } -// validateMetricIdentifier validates metric identifier and returns an ErrorList with any errors. func validateMetricIdentifier(id autoscaling.MetricIdentifier, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/app/api-init.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/app/api-init.go index 0b0e271d97..f2007e630a 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/app/api-init.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/app/api-init.go @@ -16,6 +16,6 @@ package app import ( // import predicate actions _ "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/actions/bind" - _ "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/actions/predicate" - _ "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/metrics" + _ "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/actions/predicate" // predicate TODO + _ "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/metrics" // metrics TODO ) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/app/app.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/app/app.go index 501cd6fdee..2aa4f651cc 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/app/app.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/app/app.go @@ -21,7 +21,7 @@ import ( "strings" "github.com/Tencent/bk-bcs/bcs-common/common/blog" - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/app/customscheduler" + "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/app/custom-scheduler" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/config" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/options" @@ -30,7 +30,7 @@ import ( // Run the customScheduler func Run(conf *config.CustomSchedulerConfig) { - customSched := customscheduler.NewCustomScheduler(conf) + customSched := custom_scheduler.NewCustomScheduler(conf) // start customSched, and http service err := customSched.Start() if err != nil { diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/app/customscheduler/customscheduler.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/app/custom-scheduler/custom-scheduler.go similarity index 98% rename from bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/app/customscheduler/customscheduler.go rename to bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/app/custom-scheduler/custom-scheduler.go index f5217b6b72..61079d8c60 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/app/customscheduler/customscheduler.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/app/custom-scheduler/custom-scheduler.go @@ -11,7 +11,7 @@ * */ -package customscheduler +package custom_scheduler import ( "fmt" diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/actions/common.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/actions/common.go index 8dff9025a2..7f98b4b7b7 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/actions/common.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/actions/common.go @@ -14,17 +14,17 @@ package actions const ( - // BcsCustomSchedulerPrefix prefix of custom scheduler + // BcsCustomSchedulerPrefix TODO BcsCustomSchedulerPrefix = "/bcs/custom/scheduler/k8s/" - // IpSchedulerV1 scheduler v1 + // IpSchedulerV1 TODO IpSchedulerV1 = "v1" - // IpSchedulerV2 scheduler v2 + // IpSchedulerV2 TODO IpSchedulerV2 = "v2" - // TotalNodeNumKey total node + // TotalNodeNumKey TODO TotalNodeNumKey = "totalNode" - // CanSchedulerNodeNumKey can be scheduled + // CanSchedulerNodeNumKey TODO CanSchedulerNodeNumKey = "canScheduler" - // CanNotSchedulerNodeNumKey can not be scheduled + // CanNotSchedulerNodeNumKey TODO CanNotSchedulerNodeNumKey = "canNotScheduler" ) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/ipscheduler/v1/ipscheduler.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/ipscheduler/v1/ipscheduler.go index efe5dfc718..7d4ae0ab52 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/ipscheduler/v1/ipscheduler.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/ipscheduler/v1/ipscheduler.go @@ -27,7 +27,7 @@ import ( "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/actions" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/metrics" - v1 "k8s.io/api/core/v1" + "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" @@ -243,6 +243,7 @@ func (i *IpScheduler) checkSchedulable(node v1.Node) error { if len(matchedNetPool.Available) == 0 { return fmt.Errorf("no available ip address anymore") + } else { + return nil } - return nil } diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/ipscheduler/v2/ipscheduler_test.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/ipscheduler/v2/ipscheduler_test.go index 21a89acee6..94f5790335 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/ipscheduler/v2/ipscheduler_test.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/pkg/ipscheduler/v2/ipscheduler_test.go @@ -18,16 +18,15 @@ import ( "strings" "testing" + cloudv1 "github.com/Tencent/bk-bcs/bcs-k8s/kubernetes/apis/cloud/v1" + "github.com/Tencent/bk-bcs/bcs-k8s/kubernetes/generated/clientset/versioned/fake" + informers "github.com/Tencent/bk-bcs/bcs-k8s/kubernetes/generated/informers/externalversions" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/uuid" core "k8s.io/client-go/testing" schedulerapi "k8s.io/kubernetes/pkg/scheduler/api" - - cloudv1 "github.com/Tencent/bk-bcs/bcs-k8s/kubernetes/apis/cloud/v1" - "github.com/Tencent/bk-bcs/bcs-k8s/kubernetes/generated/clientset/versioned/fake" - informers "github.com/Tencent/bk-bcs/bcs-k8s/kubernetes/generated/informers/externalversions" ) var ( diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/client/client.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/client/client.go index 25b07796c1..5ab454e540 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/client/client.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/client/client.go @@ -15,35 +15,37 @@ package client import ( - urllib "net/url" - glog "github.com/Tencent/bk-bcs/bcs-common/common/blog" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/options" + urllib "net/url" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" ) // NewClientSet create k8s clientset -func NewClientSet(k8sMasterUrl string, tlsCfg options.TLSConfig) *kubernetes.Clientset { +func NewClientSet(KubeMasterURL string, TLSConfig options.TLSConfig) *kubernetes.Clientset { - glog.V(3).Infof("k8sConfig.Master is set: %s", k8sMasterUrl) + glog.V(3).Infof("k8sConfig.Master is set: %s", KubeMasterURL) + // TODO: modify here, need to use master url and cert file to make clientset config := &rest.Config{ - Host: k8sMasterUrl, + Host: KubeMasterURL, QPS: 1e6, Burst: 1e6, } - kubeURL, _ := urllib.Parse(k8sMasterUrl) + kubeURL, _ := urllib.Parse(KubeMasterURL) if kubeURL.Scheme == options.HTTPS { - if tlsCfg.CAFile == "" || tlsCfg.CertFile == "" || tlsCfg.KeyFile == "" { + if TLSConfig.CAFile == "" || TLSConfig.CertFile == "" || TLSConfig.KeyFile == "" { return nil } - config.TLSClientConfig = rest.TLSClientConfig{ - CAFile: tlsCfg.CAFile, - CertFile: tlsCfg.CertFile, - KeyFile: tlsCfg.KeyFile, + tlsConfig := rest.TLSClientConfig{ + CAFile: TLSConfig.CAFile, + CertFile: TLSConfig.CertFile, + KeyFile: TLSConfig.KeyFile, } + + config.TLSClientConfig = tlsConfig } // 2.2 creates the clientSet diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/go.mod b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/go.mod index 77fba9fc90..2ed3e0813d 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/go.mod +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/go.mod @@ -22,52 +22,53 @@ replace ( ) require ( - github.com/Tencent/bk-bcs/bcs-common v0.0.0-20220901090711-36bfa115011f + github.com/Tencent/bk-bcs/bcs-common v0.0.0-00010101000000-000000000000 github.com/Tencent/bk-bcs/bcs-services/bcs-k8s-watch v0.0.0-00010101000000-000000000000 github.com/emicklei/go-restful v2.15.0+incompatible - github.com/gofrs/uuid v3.2.0+incompatible - github.com/json-iterator/go v1.1.12 + github.com/json-iterator/go v1.1.10 github.com/parnurzeal/gorequest v0.2.16 + github.com/satori/go.uuid v1.2.0 github.com/spf13/pflag v1.0.5 - k8s.io/api v0.24.2 - k8s.io/apimachinery v0.24.2 - k8s.io/client-go v0.24.2 + k8s.io/api v0.18.6 + k8s.io/apimachinery v0.18.6 + k8s.io/client-go v0.18.6 ) require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bitly/go-simplejson v0.5.0 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/protobuf v1.4.3 // indirect github.com/google/btree v1.0.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/googleapis/gnostic v0.5.3 // indirect github.com/gorilla/websocket v1.4.2 // indirect github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect - github.com/kr/pretty v0.2.1 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.12.1 // indirect + github.com/prometheus/client_golang v1.9.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.32.1 // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/common v0.15.0 // indirect + github.com/prometheus/procfs v0.2.0 // indirect github.com/samuel/go-zookeeper v0.0.0-20201211165307-7117e9ea2414 // indirect github.com/ugorji/go/codec v1.2.3 // indirect golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect - golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect - golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect - golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect - golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect - golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.27.1 // indirect + golang.org/x/net v0.0.0-20201224014010-6772e930b67b // indirect + golang.org/x/oauth2 v0.0.0-20210113205817-d3ed898aa8a3 // indirect + golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 // indirect + golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect + golang.org/x/text v0.3.5 // indirect + golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 // indirect + google.golang.org/appengine v1.6.6 // indirect + google.golang.org/protobuf v1.25.0 // indirect + gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect k8s.io/klog v1.0.0 // indirect moul.io/http2curl v1.0.0 // indirect sigs.k8s.io/yaml v1.2.0 // indirect diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/client.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/client.go index 7d6aa319dc..d00316e007 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/client.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/client.go @@ -16,15 +16,14 @@ package custom import ( "bytes" "fmt" + "github.com/Tencent/bk-bcs/bcs-common/common/blog" + "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/options" "io/ioutil" "net/http" urllib "net/url" "strings" - "github.com/Tencent/bk-bcs/bcs-common/common/blog" - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/options" - - "github.com/emicklei/go-restful" + restful "github.com/emicklei/go-restful" ) // BcsClientAPIHandler xxx @@ -94,9 +93,9 @@ func (h *BcsClientAPIHandler) Handler(request *restful.Request, response *restfu } // Config xxx -func (h *BcsClientAPIHandler) Config(k8sMasterUrl string, tlsCfg options.TLSConfig) error { - h.KubeMasterUrl = k8sMasterUrl - h.TLSConfig = tlsCfg +func (h *BcsClientAPIHandler) Config(KubeMasterURL string, TLSConfig options.TLSConfig) error { + h.KubeMasterUrl = KubeMasterURL + h.TLSConfig = TLSConfig return nil } diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/clusterresource.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/clusterresource.go index 1a0e5eb642..b13e9e4b0b 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/clusterresource.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/clusterresource.go @@ -20,7 +20,7 @@ import ( "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/client" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/options" - "github.com/emicklei/go-restful" + restful "github.com/emicklei/go-restful" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -99,8 +99,8 @@ OutLoop: } // Config config kube clientset -func (cph *ClusterResourceAPIHandler) Config(k8sMasterUrl string, tlsCfg options.TLSConfig) error { - cph.clientSet = client.NewClientSet(k8sMasterUrl, tlsCfg) +func (cph *ClusterResourceAPIHandler) Config(KubeMasterURL string, TLSConfig options.TLSConfig) error { + cph.clientSet = client.NewClientSet(KubeMasterURL, TLSConfig) if cph.clientSet == nil { return fmt.Errorf("failed to get k8s clientSet") } diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/clusterstatus.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/clusterstatus.go index d6d815aee3..7fcf4224af 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/clusterstatus.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/clusterstatus.go @@ -19,7 +19,7 @@ import ( "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/client" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/options" - "github.com/emicklei/go-restful" + restful "github.com/emicklei/go-restful" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" ) @@ -48,8 +48,8 @@ OutLoop: } // Config config kube clientset -func (csh *ClusterStatusAPIHandler) Config(k8sMasterUrl string, tlsCfg options.TLSConfig) error { - csh.clientSet = client.NewClientSet(k8sMasterUrl, tlsCfg) +func (csh *ClusterStatusAPIHandler) Config(KubeMasterURL string, TLSConfig options.TLSConfig) error { + csh.clientSet = client.NewClientSet(KubeMasterURL, TLSConfig) if csh.clientSet == nil { return fmt.Errorf("failed to get k8s clientSet") } diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/handler.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/handler.go index 7002fdc292..96c82f533d 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/handler.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/handler.go @@ -16,11 +16,11 @@ package custom import ( "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/options" - "github.com/emicklei/go-restful" + restful "github.com/emicklei/go-restful" ) // APIHandler http API interface for info request type APIHandler interface { Handler(request *restful.Request, response *restful.Response) - Config(k8sMasterUrl string, tlsCfg options.TLSConfig) error + Config(KubeMasterURL string, TLSConfig options.TLSConfig) error } diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/node.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/node.go index 0c12c445c1..c90b4a6d33 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/node.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom/node.go @@ -16,9 +16,9 @@ package custom import ( "fmt" - "github.com/gofrs/uuid" - "github.com/Tencent/bk-bcs/bcs-common/common/types" + + uuid "github.com/satori/go.uuid" ) // ServiceNode is node info for bcs services. @@ -42,8 +42,7 @@ func NewServiceNode(info types.ServerInfo) ServiceNode { // PrimaryKey key for indexer func (n *ServiceNode) PrimaryKey() string { - u, _ := uuid.NewV4() - return fmt.Sprintf("%s", u.String()) + return fmt.Sprintf("%s", uuid.NewV4()) } // Payload content length diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/options/options.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/options/options.go index 0d9bcd1997..c10f341864 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/options/options.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/options/options.go @@ -18,18 +18,17 @@ import ( "crypto/tls" "errors" "fmt" - "net" - "net/url" - "strconv" - "time" - regd "github.com/Tencent/bk-bcs/bcs-common/common/RegisterDiscover" "github.com/Tencent/bk-bcs/bcs-common/common/blog" bcsssl "github.com/Tencent/bk-bcs/bcs-common/common/ssl" "github.com/Tencent/bk-bcs/bcs-common/common/static" "github.com/Tencent/bk-bcs/bcs-common/common/types" + "net" + "net/url" + "strconv" + "time" - "github.com/emicklei/go-restful" + restful "github.com/emicklei/go-restful" jsoniter "github.com/json-iterator/go" "github.com/spf13/pflag" ) @@ -256,7 +255,7 @@ func (o *KubeDriverServerOptions) GetClusterKeeperAddr() error { return fmt.Errorf("get cluster keeper api failed. reason: %s", data.Err.Error()) } if len(data.Server) == 0 { - return errors.New("get 0 cluster keeper api address") + return errors.New("get 0 cluster keeper api address.") } info := types.ServerInfo{} if err := json.Unmarshal([]byte(data.Server[0]), &info); nil != err { diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/proxier.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/proxier.go index 7fa2e9fc34..0b64e36d6b 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/proxier.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/proxier.go @@ -17,17 +17,16 @@ import ( "bytes" "errors" "fmt" - "io/ioutil" - "net/http" - urllib "net/url" - "strings" - "github.com/Tencent/bk-bcs/bcs-common/common/blog" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/options" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions" + "io/ioutil" + "net/http" + urllib "net/url" + "strings" - "github.com/emicklei/go-restful" + restful "github.com/emicklei/go-restful" "github.com/parnurzeal/gorequest" ) @@ -48,10 +47,10 @@ type KubeSmartProxier struct { } // NewKubeSmartProxier xxx -func NewKubeSmartProxier(kubeMasterURL string, tlsCfg options.TLSConfig) KubeSmartProxier { +func NewKubeSmartProxier(kubeMasterURL string, TLSConfig options.TLSConfig) KubeSmartProxier { return KubeSmartProxier{ KubeMasterURL: kubeMasterURL, - TLSConfig: tlsCfg, + TLSConfig: TLSConfig, KubeURLPrefix: DefaultKubeURLPrefix, } } diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/server.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/server.go index e833eb0002..d4231d9b8e 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/server.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/server.go @@ -16,9 +16,6 @@ package kubedriver import ( "crypto/tls" "fmt" - "net" - "net/http" - "github.com/Tencent/bk-bcs/bcs-common/common" "github.com/Tencent/bk-bcs/bcs-common/common/blog" "github.com/Tencent/bk-bcs/bcs-common/common/conf" @@ -27,8 +24,10 @@ import ( "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/custom" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/options" disreg "github.com/Tencent/bk-bcs/bcs-services/bcs-k8s-watch/pkg/discovery/register" + "net" + "net/http" - "github.com/emicklei/go-restful" + restful "github.com/emicklei/go-restful" ) const ( @@ -76,8 +75,10 @@ func StartServer(o *options.KubeDriverServerOptions) error { } if o.Environment == "prod" || o.Environment == "stag" { + if o.RegisterWithWebsocket { - if err = buildWebsocketToApi(o); err != nil { + err := buildWebsocketToApi(o) + if err != nil { blog.Fatalf("err when register with websocket: %s", err.Error()) return err } diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls.go index 139289535f..74c29ad7c1 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls.go @@ -33,3 +33,1670 @@ var apiVersionMap = map[string][]string{ "1.19": apiSetV112, "1.20": apiSetV112, } + +var apiSetV15 = []string{ + "/api/v1/componentstatuses", + "/api/v1/componentstatuses/{name}", + "/api/v1/configmaps", + "/api/v1/endpoints", + "/api/v1/events", + "/api/v1/limitranges", + "/api/v1/namespaces", + "/api/v1/namespaces/{namespace}/bindings", + "/api/v1/namespaces/{namespace}/configmaps", + "/api/v1/namespaces/{namespace}/configmaps/{name}", + "/api/v1/namespaces/{namespace}/endpoints", + "/api/v1/namespaces/{namespace}/endpoints/{name}", + "/api/v1/namespaces/{namespace}/events", + "/api/v1/namespaces/{namespace}/events/{name}", + "/api/v1/namespaces/{namespace}/limitranges", + "/api/v1/namespaces/{namespace}/limitranges/{name}", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status", + "/api/v1/namespaces/{namespace}/pods", + "/api/v1/namespaces/{namespace}/pods/{name}", + "/api/v1/namespaces/{namespace}/pods/{name}/attach", + "/api/v1/namespaces/{namespace}/pods/{name}/binding", + "/api/v1/namespaces/{namespace}/pods/{name}/eviction", + "/api/v1/namespaces/{namespace}/pods/{name}/exec", + "/api/v1/namespaces/{namespace}/pods/{name}/log", + "/api/v1/namespaces/{namespace}/pods/{name}/portforward", + "/api/v1/namespaces/{namespace}/pods/{name}/proxy", + "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}", + "/api/v1/namespaces/{namespace}/pods/{name}/status", + "/api/v1/namespaces/{namespace}/podtemplates", + "/api/v1/namespaces/{namespace}/podtemplates/{name}", + "/api/v1/namespaces/{namespace}/replicationcontrollers", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status", + "/api/v1/namespaces/{namespace}/resourcequotas", + "/api/v1/namespaces/{namespace}/resourcequotas/{name}", + "/api/v1/namespaces/{namespace}/resourcequotas/{name}/status", + "/api/v1/namespaces/{namespace}/secrets", + "/api/v1/namespaces/{namespace}/secrets/{name}", + "/api/v1/namespaces/{namespace}/serviceaccounts", + "/api/v1/namespaces/{namespace}/serviceaccounts/{name}", + "/api/v1/namespaces/{namespace}/services", + "/api/v1/namespaces/{namespace}/services/{name}", + "/api/v1/namespaces/{namespace}/services/{name}/proxy", + "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}", + "/api/v1/namespaces/{namespace}/services/{name}/status", + "/api/v1/namespaces/{namespace}", + "/api/v1/namespaces/{namespace}/finalize", + "/api/v1/namespaces/{namespace}/status", + "/api/v1/nodes", + "/api/v1/nodes/{name}", + "/api/v1/nodes/{name}/proxy", + "/api/v1/nodes/{name}/proxy/{path}", + "/api/v1/nodes/{name}/status", + "/api/v1/persistentvolumeclaims", + "/api/v1/persistentvolumes", + "/api/v1/persistentvolumes/{name}", + "/api/v1/persistentvolumes/{name}/status", + "/api/v1/pods", + "/api/v1/podtemplates", + "/api/v1/proxy/namespaces/{namespace}/pods/{name}", + "/api/v1/proxy/namespaces/{namespace}/pods/{name}/{path}", + "/api/v1/proxy/namespaces/{namespace}/services/{name}", + "/api/v1/proxy/namespaces/{namespace}/services/{name}/{path}", + "/api/v1/proxy/nodes/{name}", + "/api/v1/proxy/nodes/{name}/{path}", + "/api/v1/replicationcontrollers", + "/api/v1/resourcequotas", + "/api/v1/secrets", + "/api/v1/serviceaccounts", + "/api/v1/services", + "/api/v1/watch/configmaps", + "/api/v1/watch/endpoints", + "/api/v1/watch/events", + "/api/v1/watch/limitranges", + "/api/v1/watch/namespaces", + "/api/v1/watch/namespaces/{namespace}/configmaps", + "/api/v1/watch/namespaces/{namespace}/configmaps/{name}", + "/api/v1/watch/namespaces/{namespace}/endpoints", + "/api/v1/watch/namespaces/{namespace}/endpoints/{name}", + "/api/v1/watch/namespaces/{namespace}/events", + "/api/v1/watch/namespaces/{namespace}/events/{name}", + "/api/v1/watch/namespaces/{namespace}/limitranges", + "/api/v1/watch/namespaces/{namespace}/limitranges/{name}", + "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims", + "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}", + "/api/v1/watch/namespaces/{namespace}/pods", + "/api/v1/watch/namespaces/{namespace}/pods/{name}", + "/api/v1/watch/namespaces/{namespace}/podtemplates", + "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}", + "/api/v1/watch/namespaces/{namespace}/replicationcontrollers", + "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}", + "/api/v1/watch/namespaces/{namespace}/resourcequotas", + "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}", + "/api/v1/watch/namespaces/{namespace}/secrets", + "/api/v1/watch/namespaces/{namespace}/secrets/{name}", + "/api/v1/watch/namespaces/{namespace}/serviceaccounts", + "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}", + "/api/v1/watch/namespaces/{namespace}/services", + "/api/v1/watch/namespaces/{namespace}/services/{name}", + "/api/v1/watch/namespaces/{namespace}", + "/api/v1/watch/nodes", + "/api/v1/watch/nodes/{name}", + "/api/v1/watch/persistentvolumeclaims", + "/api/v1/watch/persistentvolumes", + "/api/v1/watch/persistentvolumes/{name}", + "/api/v1/watch/pods", + "/api/v1/watch/podtemplates", + "/api/v1/watch/replicationcontrollers", + "/api/v1/watch/resourcequotas", + "/api/v1/watch/secrets", + "/api/v1/watch/serviceaccounts", + "/api/v1/watch/services", + "/apis/", + "/apis/apps/", + "/apis/apps/v1beta1/", + "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets", + "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}", + "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status", + "/apis/apps/v1beta1/statefulsets", + "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets", + "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}", + "/apis/apps/v1beta1/watch/statefulsets", + "/apis/authentication.k8s.io/", + "/apis/authentication.k8s.io/v1beta1/", + "/apis/authentication.k8s.io/v1beta1/tokenreviews", + "/apis/authorization.k8s.io/", + "/apis/authorization.k8s.io/v1beta1/", + "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews", + "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews", + "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews", + "/apis/autoscaling/", + "/apis/autoscaling/v1/", + "/apis/autoscaling/v1/horizontalpodautoscalers", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", + "/apis/autoscaling/v1/watch/horizontalpodautoscalers", + "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/batch/", + "/apis/batch/v1/", + "/apis/batch/v1/jobs", + "/apis/batch/v1/namespaces/{namespace}/jobs", + "/apis/batch/v1/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status", + "/apis/batch/v1/watch/jobs", + "/apis/batch/v1/watch/namespaces/{namespace}/jobs", + "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v2alpha1/", + "/apis/batch/v2alpha1/cronjobs", + "/apis/batch/v2alpha1/jobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}", + "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status", + "/apis/batch/v2alpha1/namespaces/{namespace}/jobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}/status", + "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}", + "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}/status", + "/apis/batch/v2alpha1/scheduledjobs", + "/apis/batch/v2alpha1/watch/cronjobs", + "/apis/batch/v2alpha1/watch/jobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs/{name}", + "/apis/batch/v2alpha1/watch/scheduledjobs", + "/apis/certificates.k8s.io/", + "/apis/certificates.k8s.io/v1alpha1/", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/approval", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/status", + "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests", + "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests/{name}", + "/apis/extensions/", + "/apis/extensions/v1beta1/", + "/apis/extensions/v1beta1/daemonsets", + "/apis/extensions/v1beta1/deployments", + "/apis/extensions/v1beta1/horizontalpodautoscalers", + "/apis/extensions/v1beta1/ingresses", + "/apis/extensions/v1beta1/jobs", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies", + "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale", + "/apis/extensions/v1beta1/networkpolicies", + "/apis/extensions/v1beta1/replicasets", + "/apis/extensions/v1beta1/thirdpartyresources", + "/apis/extensions/v1beta1/thirdpartyresources/{name}", + "/apis/extensions/v1beta1/watch/daemonsets", + "/apis/extensions/v1beta1/watch/deployments", + "/apis/extensions/v1beta1/watch/horizontalpodautoscalers", + "/apis/extensions/v1beta1/watch/ingresses", + "/apis/extensions/v1beta1/watch/jobs", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}", + "/apis/extensions/v1beta1/watch/networkpolicies", + "/apis/extensions/v1beta1/watch/replicasets", + "/apis/extensions/v1beta1/watch/thirdpartyresources", + "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}", + "/apis/policy/", + "/apis/policy/v1beta1/", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status", + "/apis/policy/v1beta1/poddisruptionbudgets", + "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets", + "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}", + "/apis/policy/v1beta1/watch/poddisruptionbudgets", + "/apis/rbac.authorization.k8s.io/", + "/apis/rbac.authorization.k8s.io/v1alpha1/", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/roles", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles", + "/apis/storage.k8s.io/", + "/apis/storage.k8s.io/v1beta1/", + "/apis/storage.k8s.io/v1beta1/storageclasses", + "/apis/storage.k8s.io/v1beta1/storageclasses/{name}", + "/apis/storage.k8s.io/v1beta1/watch/storageclasses", + "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}", + "/logs/", + "/logs/{logpath}", + "/version/", + "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/{name}", + "/apis/metrics.k8s.io/v1beta1/pods", + "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/", + "/apis/metrics.k8s.io/v1beta1/nodes", + "/apis/metrics.k8s.io/v1beta1/nodes/{name}", +} +var apiSetV16 = []string{ + "/api/v1/componentstatuses", + "/api/v1/componentstatuses/{name}", + "/api/v1/configmaps", + "/api/v1/endpoints", + "/api/v1/events", + "/api/v1/limitranges", + "/api/v1/namespaces", + "/api/v1/namespaces/{namespace}/bindings", + "/api/v1/namespaces/{namespace}/configmaps", + "/api/v1/namespaces/{namespace}/configmaps/{name}", + "/api/v1/namespaces/{namespace}/endpoints", + "/api/v1/namespaces/{namespace}/endpoints/{name}", + "/api/v1/namespaces/{namespace}/events", + "/api/v1/namespaces/{namespace}/events/{name}", + "/api/v1/namespaces/{namespace}/limitranges", + "/api/v1/namespaces/{namespace}/limitranges/{name}", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status", + "/api/v1/namespaces/{namespace}/pods", + "/api/v1/namespaces/{namespace}/pods/{name}", + "/api/v1/namespaces/{namespace}/pods/{name}/attach", + "/api/v1/namespaces/{namespace}/pods/{name}/binding", + "/api/v1/namespaces/{namespace}/pods/{name}/eviction", + "/api/v1/namespaces/{namespace}/pods/{name}/exec", + "/api/v1/namespaces/{namespace}/pods/{name}/log", + "/api/v1/namespaces/{namespace}/pods/{name}/portforward", + "/api/v1/namespaces/{namespace}/pods/{name}/proxy", + "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}", + "/api/v1/namespaces/{namespace}/pods/{name}/status", + "/api/v1/namespaces/{namespace}/podtemplates", + "/api/v1/namespaces/{namespace}/podtemplates/{name}", + "/api/v1/namespaces/{namespace}/replicationcontrollers", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status", + "/api/v1/namespaces/{namespace}/resourcequotas", + "/api/v1/namespaces/{namespace}/resourcequotas/{name}", + "/api/v1/namespaces/{namespace}/resourcequotas/{name}/status", + "/api/v1/namespaces/{namespace}/secrets", + "/api/v1/namespaces/{namespace}/secrets/{name}", + "/api/v1/namespaces/{namespace}/serviceaccounts", + "/api/v1/namespaces/{namespace}/serviceaccounts/{name}", + "/api/v1/namespaces/{namespace}/services", + "/api/v1/namespaces/{namespace}/services/{name}", + "/api/v1/namespaces/{namespace}/services/{name}/proxy", + "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}", + "/api/v1/namespaces/{namespace}/services/{name}/status", + "/api/v1/namespaces/{namespace}", + "/api/v1/namespaces/{namespace}/finalize", + "/api/v1/namespaces/{namespace}/status", + "/api/v1/nodes", + "/api/v1/nodes/{name}", + "/api/v1/nodes/{name}/proxy", + "/api/v1/nodes/{name}/proxy/{path}", + "/api/v1/nodes/{name}/status", + "/api/v1/persistentvolumeclaims", + "/api/v1/persistentvolumes", + "/api/v1/persistentvolumes/{name}", + "/api/v1/persistentvolumes/{name}/status", + "/api/v1/pods", + "/api/v1/podtemplates", + "/api/v1/proxy/namespaces/{namespace}/pods/{name}", + "/api/v1/proxy/namespaces/{namespace}/pods/{name}/{path}", + "/api/v1/proxy/namespaces/{namespace}/services/{name}", + "/api/v1/proxy/namespaces/{namespace}/services/{name}/{path}", + "/api/v1/proxy/nodes/{name}", + "/api/v1/proxy/nodes/{name}/{path}", + "/api/v1/replicationcontrollers", + "/api/v1/resourcequotas", + "/api/v1/secrets", + "/api/v1/serviceaccounts", + "/api/v1/services", + "/api/v1/watch/configmaps", + "/api/v1/watch/endpoints", + "/api/v1/watch/events", + "/api/v1/watch/limitranges", + "/api/v1/watch/namespaces", + "/api/v1/watch/namespaces/{namespace}/configmaps", + "/api/v1/watch/namespaces/{namespace}/configmaps/{name}", + "/api/v1/watch/namespaces/{namespace}/endpoints", + "/api/v1/watch/namespaces/{namespace}/endpoints/{name}", + "/api/v1/watch/namespaces/{namespace}/events", + "/api/v1/watch/namespaces/{namespace}/events/{name}", + "/api/v1/watch/namespaces/{namespace}/limitranges", + "/api/v1/watch/namespaces/{namespace}/limitranges/{name}", + "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims", + "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}", + "/api/v1/watch/namespaces/{namespace}/pods", + "/api/v1/watch/namespaces/{namespace}/pods/{name}", + "/api/v1/watch/namespaces/{namespace}/podtemplates", + "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}", + "/api/v1/watch/namespaces/{namespace}/replicationcontrollers", + "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}", + "/api/v1/watch/namespaces/{namespace}/resourcequotas", + "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}", + "/api/v1/watch/namespaces/{namespace}/secrets", + "/api/v1/watch/namespaces/{namespace}/secrets/{name}", + "/api/v1/watch/namespaces/{namespace}/serviceaccounts", + "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}", + "/api/v1/watch/namespaces/{namespace}/services", + "/api/v1/watch/namespaces/{namespace}/services/{name}", + "/api/v1/watch/namespaces/{namespace}", + "/api/v1/watch/nodes", + "/api/v1/watch/nodes/{name}", + "/api/v1/watch/persistentvolumeclaims", + "/api/v1/watch/persistentvolumes", + "/api/v1/watch/persistentvolumes/{name}", + "/api/v1/watch/pods", + "/api/v1/watch/podtemplates", + "/api/v1/watch/replicationcontrollers", + "/api/v1/watch/resourcequotas", + "/api/v1/watch/secrets", + "/api/v1/watch/serviceaccounts", + "/api/v1/watch/services", + "/apis/apps/v1beta1/", + "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets", + "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}", + "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status", + "/apis/apps/v1beta1/statefulsets", + "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets", + "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}", + "/apis/apps/v1beta1/watch/statefulsets", + "/apis/authentication.k8s.io/v1beta1/", + "/apis/authentication.k8s.io/v1beta1/tokenreviews", + "/apis/authorization.k8s.io/v1beta1/", + "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews", + "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews", + "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews", + "/apis/autoscaling/v1/", + "/apis/autoscaling/v1/horizontalpodautoscalers", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", + "/apis/autoscaling/v1/watch/horizontalpodautoscalers", + "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/batch/v1/", + "/apis/batch/v1/jobs", + "/apis/batch/v1/namespaces/{namespace}/jobs", + "/apis/batch/v1/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status", + "/apis/batch/v1/watch/jobs", + "/apis/batch/v1/watch/namespaces/{namespace}/jobs", + "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v2alpha1/", + "/apis/batch/v2alpha1/cronjobs", + "/apis/batch/v2alpha1/jobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}", + "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status", + "/apis/batch/v2alpha1/namespaces/{namespace}/jobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}/status", + "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}", + "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}/status", + "/apis/batch/v2alpha1/scheduledjobs", + "/apis/batch/v2alpha1/watch/cronjobs", + "/apis/batch/v2alpha1/watch/jobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs/{name}", + "/apis/batch/v2alpha1/watch/scheduledjobs", + "/apis/certificates.k8s.io/v1alpha1/", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/approval", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/status", + "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests", + "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests/{name}", + "/apis/extensions/v1beta1/", + "/apis/extensions/v1beta1/daemonsets", + "/apis/extensions/v1beta1/deployments", + "/apis/extensions/v1beta1/horizontalpodautoscalers", + "/apis/extensions/v1beta1/ingresses", + "/apis/extensions/v1beta1/jobs", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies", + "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale", + "/apis/extensions/v1beta1/networkpolicies", + "/apis/extensions/v1beta1/replicasets", + "/apis/extensions/v1beta1/thirdpartyresources", + "/apis/extensions/v1beta1/thirdpartyresources/{name}", + "/apis/extensions/v1beta1/watch/daemonsets", + "/apis/extensions/v1beta1/watch/deployments", + "/apis/extensions/v1beta1/watch/horizontalpodautoscalers", + "/apis/extensions/v1beta1/watch/ingresses", + "/apis/extensions/v1beta1/watch/jobs", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}", + "/apis/extensions/v1beta1/watch/networkpolicies", + "/apis/extensions/v1beta1/watch/replicasets", + "/apis/extensions/v1beta1/watch/thirdpartyresources", + "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}", + "/apis/policy/v1beta1/", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status", + "/apis/policy/v1beta1/poddisruptionbudgets", + "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets", + "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}", + "/apis/policy/v1beta1/watch/poddisruptionbudgets", + "/apis/rbac.authorization.k8s.io/v1alpha1/", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/roles", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles", + "/apis/storage.k8s.io/v1beta1/", + "/apis/storage.k8s.io/v1beta1/storageclasses", + "/apis/storage.k8s.io/v1beta1/storageclasses/{name}", + "/apis/storage.k8s.io/v1beta1/watch/storageclasses", + "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}", + "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/{name}", + "/apis/metrics.k8s.io/v1beta1/pods", + "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/", + "/apis/metrics.k8s.io/v1beta1/nodes", + "/apis/metrics.k8s.io/v1beta1/nodes/{name}", +} +var apiSetV17 = []string{ + "/api/v1/", + "/api/v1/componentstatuses", + "/api/v1/componentstatuses/{name}", + "/api/v1/configmaps", + "/api/v1/endpoints", + "/api/v1/events", + "/api/v1/limitranges", + "/api/v1/namespaces", + "/api/v1/namespaces/{namespace}/bindings", + "/api/v1/namespaces/{namespace}/configmaps", + "/api/v1/namespaces/{namespace}/configmaps/{name}", + "/api/v1/namespaces/{namespace}/endpoints", + "/api/v1/namespaces/{namespace}/endpoints/{name}", + "/api/v1/namespaces/{namespace}/events", + "/api/v1/namespaces/{namespace}/events/{name}", + "/api/v1/namespaces/{namespace}/limitranges", + "/api/v1/namespaces/{namespace}/limitranges/{name}", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status", + "/api/v1/namespaces/{namespace}/pods", + "/api/v1/namespaces/{namespace}/pods/{name}", + "/api/v1/namespaces/{namespace}/pods/{name}/attach", + "/api/v1/namespaces/{namespace}/pods/{name}/binding", + "/api/v1/namespaces/{namespace}/pods/{name}/eviction", + "/api/v1/namespaces/{namespace}/pods/{name}/exec", + "/api/v1/namespaces/{namespace}/pods/{name}/log", + "/api/v1/namespaces/{namespace}/pods/{name}/portforward", + "/api/v1/namespaces/{namespace}/pods/{name}/proxy", + "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}", + "/api/v1/namespaces/{namespace}/pods/{name}/status", + "/api/v1/namespaces/{namespace}/podtemplates", + "/api/v1/namespaces/{namespace}/podtemplates/{name}", + "/api/v1/namespaces/{namespace}/replicationcontrollers", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status", + "/api/v1/namespaces/{namespace}/resourcequotas", + "/api/v1/namespaces/{namespace}/resourcequotas/{name}", + "/api/v1/namespaces/{namespace}/resourcequotas/{name}/status", + "/api/v1/namespaces/{namespace}/secrets", + "/api/v1/namespaces/{namespace}/secrets/{name}", + "/api/v1/namespaces/{namespace}/serviceaccounts", + "/api/v1/namespaces/{namespace}/serviceaccounts/{name}", + "/api/v1/namespaces/{namespace}/services", + "/api/v1/namespaces/{namespace}/services/{name}", + "/api/v1/namespaces/{namespace}/services/{name}/proxy", + "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}", + "/api/v1/namespaces/{namespace}/services/{name}/status", + "/api/v1/namespaces/{namespace}", + "/api/v1/namespaces/{namespace}/finalize", + "/api/v1/namespaces/{namespace}/status", + "/api/v1/nodes", + "/api/v1/nodes/{name}", + "/api/v1/nodes/{name}/proxy", + "/api/v1/nodes/{name}/proxy/{path}", + "/api/v1/nodes/{name}/status", + "/api/v1/persistentvolumeclaims", + "/api/v1/persistentvolumes", + "/api/v1/persistentvolumes/{name}", + "/api/v1/persistentvolumes/{name}/status", + "/api/v1/pods", + "/api/v1/podtemplates", + "/api/v1/proxy/namespaces/{namespace}/pods/{name}", + "/api/v1/proxy/namespaces/{namespace}/pods/{name}/{path}", + "/api/v1/proxy/namespaces/{namespace}/services/{name}", + "/api/v1/proxy/namespaces/{namespace}/services/{name}/{path}", + "/api/v1/proxy/nodes/{name}", + "/api/v1/proxy/nodes/{name}/{path}", + "/api/v1/replicationcontrollers", + "/api/v1/resourcequotas", + "/api/v1/secrets", + "/api/v1/serviceaccounts", + "/api/v1/services", + "/api/v1/watch/configmaps", + "/api/v1/watch/endpoints", + "/api/v1/watch/events", + "/api/v1/watch/limitranges", + "/api/v1/watch/namespaces", + "/api/v1/watch/namespaces/{namespace}/configmaps", + "/api/v1/watch/namespaces/{namespace}/configmaps/{name}", + "/api/v1/watch/namespaces/{namespace}/endpoints", + "/api/v1/watch/namespaces/{namespace}/endpoints/{name}", + "/api/v1/watch/namespaces/{namespace}/events", + "/api/v1/watch/namespaces/{namespace}/events/{name}", + "/api/v1/watch/namespaces/{namespace}/limitranges", + "/api/v1/watch/namespaces/{namespace}/limitranges/{name}", + "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims", + "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}", + "/api/v1/watch/namespaces/{namespace}/pods", + "/api/v1/watch/namespaces/{namespace}/pods/{name}", + "/api/v1/watch/namespaces/{namespace}/podtemplates", + "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}", + "/api/v1/watch/namespaces/{namespace}/replicationcontrollers", + "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}", + "/api/v1/watch/namespaces/{namespace}/resourcequotas", + "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}", + "/api/v1/watch/namespaces/{namespace}/secrets", + "/api/v1/watch/namespaces/{namespace}/secrets/{name}", + "/api/v1/watch/namespaces/{namespace}/serviceaccounts", + "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}", + "/api/v1/watch/namespaces/{namespace}/services", + "/api/v1/watch/namespaces/{namespace}/services/{name}", + "/api/v1/watch/namespaces/{namespace}", + "/api/v1/watch/nodes", + "/api/v1/watch/nodes/{name}", + "/api/v1/watch/persistentvolumeclaims", + "/api/v1/watch/persistentvolumes", + "/api/v1/watch/persistentvolumes/{name}", + "/api/v1/watch/pods", + "/api/v1/watch/podtemplates", + "/api/v1/watch/replicationcontrollers", + "/api/v1/watch/resourcequotas", + "/api/v1/watch/secrets", + "/api/v1/watch/serviceaccounts", + "/api/v1/watch/services", + "/apis/", + "/apis/apps/", + "/apis/apps/v1beta1/", + "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets", + "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}", + "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status", + "/apis/apps/v1beta1/statefulsets", + "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets", + "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}", + "/apis/apps/v1beta1/watch/statefulsets", + "/apis/authentication.k8s.io/", + "/apis/authentication.k8s.io/v1beta1/", + "/apis/authentication.k8s.io/v1beta1/tokenreviews", + "/apis/authorization.k8s.io/", + "/apis/authorization.k8s.io/v1beta1/", + "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews", + "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews", + "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews", + "/apis/autoscaling/", + "/apis/autoscaling/v1/", + "/apis/autoscaling/v1/horizontalpodautoscalers", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", + "/apis/autoscaling/v1/watch/horizontalpodautoscalers", + "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/batch/", + "/apis/batch/v1/", + "/apis/batch/v1/jobs", + "/apis/batch/v1/namespaces/{namespace}/jobs", + "/apis/batch/v1/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status", + "/apis/batch/v1/watch/jobs", + "/apis/batch/v1/watch/namespaces/{namespace}/jobs", + "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v2alpha1/", + "/apis/batch/v2alpha1/cronjobs", + "/apis/batch/v2alpha1/jobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}", + "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status", + "/apis/batch/v2alpha1/namespaces/{namespace}/jobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}/status", + "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}", + "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}/status", + "/apis/batch/v2alpha1/scheduledjobs", + "/apis/batch/v2alpha1/watch/cronjobs", + "/apis/batch/v2alpha1/watch/jobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs/{name}", + "/apis/batch/v2alpha1/watch/scheduledjobs", + "/apis/certificates.k8s.io/", + "/apis/certificates.k8s.io/v1alpha1/", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/approval", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/status", + "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests", + "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests/{name}", + "/apis/extensions/", + "/apis/extensions/v1beta1/", + "/apis/extensions/v1beta1/daemonsets", + "/apis/extensions/v1beta1/deployments", + "/apis/extensions/v1beta1/horizontalpodautoscalers", + "/apis/extensions/v1beta1/ingresses", + "/apis/extensions/v1beta1/jobs", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies", + "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale", + "/apis/extensions/v1beta1/networkpolicies", + "/apis/extensions/v1beta1/replicasets", + "/apis/extensions/v1beta1/thirdpartyresources", + "/apis/extensions/v1beta1/thirdpartyresources/{name}", + "/apis/extensions/v1beta1/watch/daemonsets", + "/apis/extensions/v1beta1/watch/deployments", + "/apis/extensions/v1beta1/watch/horizontalpodautoscalers", + "/apis/extensions/v1beta1/watch/ingresses", + "/apis/extensions/v1beta1/watch/jobs", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}", + "/apis/extensions/v1beta1/watch/networkpolicies", + "/apis/extensions/v1beta1/watch/replicasets", + "/apis/extensions/v1beta1/watch/thirdpartyresources", + "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}", + "/apis/policy/", + "/apis/policy/v1beta1/", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status", + "/apis/policy/v1beta1/poddisruptionbudgets", + "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets", + "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}", + "/apis/policy/v1beta1/watch/poddisruptionbudgets", + "/apis/rbac.authorization.k8s.io/", + "/apis/rbac.authorization.k8s.io/v1alpha1/", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/roles", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles", + "/apis/storage.k8s.io/", + "/apis/storage.k8s.io/v1beta1/", + "/apis/storage.k8s.io/v1beta1/storageclasses", + "/apis/storage.k8s.io/v1beta1/storageclasses/{name}", + "/apis/storage.k8s.io/v1beta1/watch/storageclasses", + "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}", + "/logs/", + "/logs/{logpath}", + "/version/", + "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/{name}", + "/apis/metrics.k8s.io/v1beta1/pods", + "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/", + "/apis/metrics.k8s.io/v1beta1/nodes", + "/apis/metrics.k8s.io/v1beta1/nodes/{name}", +} +var apiSetV18 = []string{ + "/api/v1/", + "/api/v1/componentstatuses", + "/api/v1/componentstatuses/{name}", + "/api/v1/configmaps", + "/api/v1/endpoints", + "/api/v1/events", + "/api/v1/limitranges", + "/api/v1/namespaces", + "/api/v1/namespaces/{namespace}/bindings", + "/api/v1/namespaces/{namespace}/configmaps", + "/api/v1/namespaces/{namespace}/configmaps/{name}", + "/api/v1/namespaces/{namespace}/endpoints", + "/api/v1/namespaces/{namespace}/endpoints/{name}", + "/api/v1/namespaces/{namespace}/events", + "/api/v1/namespaces/{namespace}/events/{name}", + "/api/v1/namespaces/{namespace}/limitranges", + "/api/v1/namespaces/{namespace}/limitranges/{name}", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status", + "/api/v1/namespaces/{namespace}/pods", + "/api/v1/namespaces/{namespace}/pods/{name}", + "/api/v1/namespaces/{namespace}/pods/{name}/attach", + "/api/v1/namespaces/{namespace}/pods/{name}/binding", + "/api/v1/namespaces/{namespace}/pods/{name}/eviction", + "/api/v1/namespaces/{namespace}/pods/{name}/exec", + "/api/v1/namespaces/{namespace}/pods/{name}/log", + "/api/v1/namespaces/{namespace}/pods/{name}/portforward", + "/api/v1/namespaces/{namespace}/pods/{name}/proxy", + "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}", + "/api/v1/namespaces/{namespace}/pods/{name}/status", + "/api/v1/namespaces/{namespace}/podtemplates", + "/api/v1/namespaces/{namespace}/podtemplates/{name}", + "/api/v1/namespaces/{namespace}/replicationcontrollers", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status", + "/api/v1/namespaces/{namespace}/resourcequotas", + "/api/v1/namespaces/{namespace}/resourcequotas/{name}", + "/api/v1/namespaces/{namespace}/resourcequotas/{name}/status", + "/api/v1/namespaces/{namespace}/secrets", + "/api/v1/namespaces/{namespace}/secrets/{name}", + "/api/v1/namespaces/{namespace}/serviceaccounts", + "/api/v1/namespaces/{namespace}/serviceaccounts/{name}", + "/api/v1/namespaces/{namespace}/services", + "/api/v1/namespaces/{namespace}/services/{name}", + "/api/v1/namespaces/{namespace}/services/{name}/proxy", + "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}", + "/api/v1/namespaces/{namespace}/services/{name}/status", + "/api/v1/namespaces/{namespace}", + "/api/v1/namespaces/{namespace}/finalize", + "/api/v1/namespaces/{namespace}/status", + "/api/v1/nodes", + "/api/v1/nodes/{name}", + "/api/v1/nodes/{name}/proxy", + "/api/v1/nodes/{name}/proxy/{path}", + "/api/v1/nodes/{name}/status", + "/api/v1/persistentvolumeclaims", + "/api/v1/persistentvolumes", + "/api/v1/persistentvolumes/{name}", + "/api/v1/persistentvolumes/{name}/status", + "/api/v1/pods", + "/api/v1/podtemplates", + "/api/v1/proxy/namespaces/{namespace}/pods/{name}", + "/api/v1/proxy/namespaces/{namespace}/pods/{name}/{path}", + "/api/v1/proxy/namespaces/{namespace}/services/{name}", + "/api/v1/proxy/namespaces/{namespace}/services/{name}/{path}", + "/api/v1/proxy/nodes/{name}", + "/api/v1/proxy/nodes/{name}/{path}", + "/api/v1/replicationcontrollers", + "/api/v1/resourcequotas", + "/api/v1/secrets", + "/api/v1/serviceaccounts", + "/api/v1/services", + "/api/v1/watch/configmaps", + "/api/v1/watch/endpoints", + "/api/v1/watch/events", + "/api/v1/watch/limitranges", + "/api/v1/watch/namespaces", + "/api/v1/watch/namespaces/{namespace}/configmaps", + "/api/v1/watch/namespaces/{namespace}/configmaps/{name}", + "/api/v1/watch/namespaces/{namespace}/endpoints", + "/api/v1/watch/namespaces/{namespace}/endpoints/{name}", + "/api/v1/watch/namespaces/{namespace}/events", + "/api/v1/watch/namespaces/{namespace}/events/{name}", + "/api/v1/watch/namespaces/{namespace}/limitranges", + "/api/v1/watch/namespaces/{namespace}/limitranges/{name}", + "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims", + "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}", + "/api/v1/watch/namespaces/{namespace}/pods", + "/api/v1/watch/namespaces/{namespace}/pods/{name}", + "/api/v1/watch/namespaces/{namespace}/podtemplates", + "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}", + "/api/v1/watch/namespaces/{namespace}/replicationcontrollers", + "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}", + "/api/v1/watch/namespaces/{namespace}/resourcequotas", + "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}", + "/api/v1/watch/namespaces/{namespace}/secrets", + "/api/v1/watch/namespaces/{namespace}/secrets/{name}", + "/api/v1/watch/namespaces/{namespace}/serviceaccounts", + "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}", + "/api/v1/watch/namespaces/{namespace}/services", + "/api/v1/watch/namespaces/{namespace}/services/{name}", + "/api/v1/watch/namespaces/{namespace}", + "/api/v1/watch/nodes", + "/api/v1/watch/nodes/{name}", + "/api/v1/watch/persistentvolumeclaims", + "/api/v1/watch/persistentvolumes", + "/api/v1/watch/persistentvolumes/{name}", + "/api/v1/watch/pods", + "/api/v1/watch/podtemplates", + "/api/v1/watch/replicationcontrollers", + "/api/v1/watch/resourcequotas", + "/api/v1/watch/secrets", + "/api/v1/watch/serviceaccounts", + "/api/v1/watch/services", + "/apis/apps/v1beta1/", + "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets", + "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}", + "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status", + "/apis/apps/v1beta1/statefulsets", + "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets", + "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}", + "/apis/apps/v1beta1/watch/statefulsets", + "/apis/authentication.k8s.io/v1beta1/", + "/apis/authentication.k8s.io/v1beta1/tokenreviews", + "/apis/authorization.k8s.io/v1beta1/", + "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews", + "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews", + "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews", + "/apis/autoscaling/v1/", + "/apis/autoscaling/v1/horizontalpodautoscalers", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", + "/apis/autoscaling/v1/watch/horizontalpodautoscalers", + "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/batch/v1/", + "/apis/batch/v1/jobs", + "/apis/batch/v1/namespaces/{namespace}/jobs", + "/apis/batch/v1/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status", + "/apis/batch/v1/watch/jobs", + "/apis/batch/v1/watch/namespaces/{namespace}/jobs", + "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v2alpha1/", + "/apis/batch/v2alpha1/cronjobs", + "/apis/batch/v2alpha1/jobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}", + "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status", + "/apis/batch/v2alpha1/namespaces/{namespace}/jobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}/status", + "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}", + "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}/status", + "/apis/batch/v2alpha1/scheduledjobs", + "/apis/batch/v2alpha1/watch/cronjobs", + "/apis/batch/v2alpha1/watch/jobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs/{name}", + "/apis/batch/v2alpha1/watch/scheduledjobs", + "/apis/certificates.k8s.io/v1alpha1/", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/approval", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/status", + "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests", + "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests/{name}", + "/apis/extensions/v1beta1/", + "/apis/extensions/v1beta1/daemonsets", + "/apis/extensions/v1beta1/deployments", + "/apis/extensions/v1beta1/horizontalpodautoscalers", + "/apis/extensions/v1beta1/ingresses", + "/apis/extensions/v1beta1/jobs", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies", + "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale", + "/apis/extensions/v1beta1/networkpolicies", + "/apis/extensions/v1beta1/replicasets", + "/apis/extensions/v1beta1/thirdpartyresources", + "/apis/extensions/v1beta1/thirdpartyresources/{name}", + "/apis/extensions/v1beta1/watch/daemonsets", + "/apis/extensions/v1beta1/watch/deployments", + "/apis/extensions/v1beta1/watch/horizontalpodautoscalers", + "/apis/extensions/v1beta1/watch/ingresses", + "/apis/extensions/v1beta1/watch/jobs", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}", + "/apis/extensions/v1beta1/watch/networkpolicies", + "/apis/extensions/v1beta1/watch/replicasets", + "/apis/extensions/v1beta1/watch/thirdpartyresources", + "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}", + "/apis/policy/v1beta1/", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status", + "/apis/policy/v1beta1/poddisruptionbudgets", + "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets", + "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}", + "/apis/policy/v1beta1/watch/poddisruptionbudgets", + "/apis/rbac.authorization.k8s.io/v1alpha1/", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/roles", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles", + "/apis/storage.k8s.io/v1beta1/", + "/apis/storage.k8s.io/v1beta1/storageclasses", + "/apis/storage.k8s.io/v1beta1/storageclasses/{name}", + "/apis/storage.k8s.io/v1beta1/watch/storageclasses", + "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}", + "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/{name}", + "/apis/metrics.k8s.io/v1beta1/pods", + "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/", + "/apis/metrics.k8s.io/v1beta1/nodes", + "/apis/metrics.k8s.io/v1beta1/nodes/{name}", +} + +var apiSetV111 = []string{ + "/api/v1/", + "/api/v1/componentstatuses", + "/api/v1/componentstatuses/{name}", + "/api/v1/configmaps", + "/api/v1/endpoints", + "/api/v1/events", + "/api/v1/limitranges", + "/api/v1/namespaces", + "/api/v1/namespaces/{namespace}/bindings", + "/api/v1/namespaces/{namespace}/configmaps", + "/api/v1/namespaces/{namespace}/configmaps/{name}", + "/api/v1/namespaces/{namespace}/endpoints", + "/api/v1/namespaces/{namespace}/endpoints/{name}", + "/api/v1/namespaces/{namespace}/events", + "/api/v1/namespaces/{namespace}/events/{name}", + "/api/v1/namespaces/{namespace}/limitranges", + "/api/v1/namespaces/{namespace}/limitranges/{name}", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status", + "/api/v1/namespaces/{namespace}/pods", + "/api/v1/namespaces/{namespace}/pods/{name}", + "/api/v1/namespaces/{namespace}/pods/{name}/attach", + "/api/v1/namespaces/{namespace}/pods/{name}/binding", + "/api/v1/namespaces/{namespace}/pods/{name}/eviction", + "/api/v1/namespaces/{namespace}/pods/{name}/exec", + "/api/v1/namespaces/{namespace}/pods/{name}/log", + "/api/v1/namespaces/{namespace}/pods/{name}/portforward", + "/api/v1/namespaces/{namespace}/pods/{name}/proxy", + "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}", + "/api/v1/namespaces/{namespace}/pods/{name}/status", + "/api/v1/namespaces/{namespace}/podtemplates", + "/api/v1/namespaces/{namespace}/podtemplates/{name}", + "/api/v1/namespaces/{namespace}/replicationcontrollers", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status", + "/api/v1/namespaces/{namespace}/resourcequotas", + "/api/v1/namespaces/{namespace}/resourcequotas/{name}", + "/api/v1/namespaces/{namespace}/resourcequotas/{name}/status", + "/api/v1/namespaces/{namespace}/secrets", + "/api/v1/namespaces/{namespace}/secrets/{name}", + "/api/v1/namespaces/{namespace}/serviceaccounts", + "/api/v1/namespaces/{namespace}/serviceaccounts/{name}", + "/api/v1/namespaces/{namespace}/services", + "/api/v1/namespaces/{namespace}/services/{name}", + "/api/v1/namespaces/{namespace}/services/{name}/proxy", + "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}", + "/api/v1/namespaces/{namespace}/services/{name}/status", + "/api/v1/namespaces/{namespace}", + "/api/v1/namespaces/{namespace}/finalize", + "/api/v1/namespaces/{namespace}/status", + "/api/v1/nodes", + "/api/v1/nodes/{name}", + "/api/v1/nodes/{name}/proxy", + "/api/v1/nodes/{name}/proxy/{path}", + "/api/v1/nodes/{name}/status", + "/api/v1/persistentvolumeclaims", + "/api/v1/persistentvolumes", + "/api/v1/persistentvolumes/{name}", + "/api/v1/persistentvolumes/{name}/status", + "/api/v1/pods", + "/api/v1/podtemplates", + "/api/v1/proxy/namespaces/{namespace}/pods/{name}", + "/api/v1/proxy/namespaces/{namespace}/pods/{name}/{path}", + "/api/v1/proxy/namespaces/{namespace}/services/{name}", + "/api/v1/proxy/namespaces/{namespace}/services/{name}/{path}", + "/api/v1/proxy/nodes/{name}", + "/api/v1/proxy/nodes/{name}/{path}", + "/api/v1/replicationcontrollers", + "/api/v1/resourcequotas", + "/api/v1/secrets", + "/api/v1/serviceaccounts", + "/api/v1/services", + "/api/v1/watch/configmaps", + "/api/v1/watch/endpoints", + "/api/v1/watch/events", + "/api/v1/watch/limitranges", + "/api/v1/watch/namespaces", + "/api/v1/watch/namespaces/{namespace}/configmaps", + "/api/v1/watch/namespaces/{namespace}/configmaps/{name}", + "/api/v1/watch/namespaces/{namespace}/endpoints", + "/api/v1/watch/namespaces/{namespace}/endpoints/{name}", + "/api/v1/watch/namespaces/{namespace}/events", + "/api/v1/watch/namespaces/{namespace}/events/{name}", + "/api/v1/watch/namespaces/{namespace}/limitranges", + "/api/v1/watch/namespaces/{namespace}/limitranges/{name}", + "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims", + "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}", + "/api/v1/watch/namespaces/{namespace}/pods", + "/api/v1/watch/namespaces/{namespace}/pods/{name}", + "/api/v1/watch/namespaces/{namespace}/podtemplates", + "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}", + "/api/v1/watch/namespaces/{namespace}/replicationcontrollers", + "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}", + "/api/v1/watch/namespaces/{namespace}/resourcequotas", + "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}", + "/api/v1/watch/namespaces/{namespace}/secrets", + "/api/v1/watch/namespaces/{namespace}/secrets/{name}", + "/api/v1/watch/namespaces/{namespace}/serviceaccounts", + "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}", + "/api/v1/watch/namespaces/{namespace}/services", + "/api/v1/watch/namespaces/{namespace}/services/{name}", + "/api/v1/watch/namespaces/{namespace}", + "/api/v1/watch/nodes", + "/api/v1/watch/nodes/{name}", + "/api/v1/watch/persistentvolumeclaims", + "/api/v1/watch/persistentvolumes", + "/api/v1/watch/persistentvolumes/{name}", + "/api/v1/watch/pods", + "/api/v1/watch/podtemplates", + "/api/v1/watch/replicationcontrollers", + "/api/v1/watch/resourcequotas", + "/api/v1/watch/secrets", + "/api/v1/watch/serviceaccounts", + "/api/v1/watch/services", + "/apis/apps/v1beta1/", + "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets", + "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}", + "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status", + "/apis/apps/v1beta1/statefulsets", + "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets", + "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}", + "/apis/apps/v1beta1/watch/statefulsets", + "/apis/authentication.k8s.io/v1beta1/", + "/apis/authentication.k8s.io/v1beta1/tokenreviews", + "/apis/authorization.k8s.io/v1beta1/", + "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews", + "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews", + "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews", + "/apis/autoscaling/v1/", + "/apis/autoscaling/v1/horizontalpodautoscalers", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", + "/apis/autoscaling/v1/watch/horizontalpodautoscalers", + "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/batch/v1/", + "/apis/batch/v1/jobs", + "/apis/batch/v1/namespaces/{namespace}/jobs", + "/apis/batch/v1/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status", + "/apis/batch/v1/watch/jobs", + "/apis/batch/v1/watch/namespaces/{namespace}/jobs", + "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v2alpha1/", + "/apis/batch/v2alpha1/cronjobs", + "/apis/batch/v2alpha1/jobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}", + "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status", + "/apis/batch/v2alpha1/namespaces/{namespace}/jobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}/status", + "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs", + "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}", + "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}/status", + "/apis/batch/v2alpha1/scheduledjobs", + "/apis/batch/v2alpha1/watch/cronjobs", + "/apis/batch/v2alpha1/watch/jobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs", + "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs/{name}", + "/apis/batch/v2alpha1/watch/scheduledjobs", + "/apis/certificates.k8s.io/v1alpha1/", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/approval", + "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/status", + "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests", + "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests/{name}", + "/apis/extensions/v1beta1/", + "/apis/extensions/v1beta1/daemonsets", + "/apis/extensions/v1beta1/deployments", + "/apis/extensions/v1beta1/horizontalpodautoscalers", + "/apis/extensions/v1beta1/ingresses", + "/apis/extensions/v1beta1/jobs", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies", + "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale", + "/apis/extensions/v1beta1/networkpolicies", + "/apis/extensions/v1beta1/replicasets", + "/apis/extensions/v1beta1/thirdpartyresources", + "/apis/extensions/v1beta1/thirdpartyresources/{name}", + "/apis/extensions/v1beta1/watch/daemonsets", + "/apis/extensions/v1beta1/watch/deployments", + "/apis/extensions/v1beta1/watch/horizontalpodautoscalers", + "/apis/extensions/v1beta1/watch/ingresses", + "/apis/extensions/v1beta1/watch/jobs", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}", + "/apis/extensions/v1beta1/watch/networkpolicies", + "/apis/extensions/v1beta1/watch/replicasets", + "/apis/extensions/v1beta1/watch/thirdpartyresources", + "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}", + "/apis/policy/v1beta1/", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status", + "/apis/policy/v1beta1/poddisruptionbudgets", + "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets", + "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}", + "/apis/policy/v1beta1/watch/poddisruptionbudgets", + "/apis/rbac.authorization.k8s.io/v1alpha1/", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles", + "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles", + "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/roles", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings", + "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles", + "/apis/storage.k8s.io/v1beta1/", + "/apis/storage.k8s.io/v1beta1/storageclasses", + "/apis/storage.k8s.io/v1beta1/storageclasses/{name}", + "/apis/storage.k8s.io/v1beta1/watch/storageclasses", + "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}", + "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/{name}", + "/apis/metrics.k8s.io/v1beta1/pods", + "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/", + "/apis/metrics.k8s.io/v1beta1/nodes", + "/apis/metrics.k8s.io/v1beta1/nodes/{name}", +} + +var apiSetV112 = []string{ + "/api/v1/", + "/api/v1/componentstatuses", + "/api/v1/componentstatuses/{name}", + "/api/v1/configmaps", + "/api/v1/endpoints", + "/api/v1/events", + "/api/v1/limitranges", + "/api/v1/namespaces", + "/api/v1/namespaces/{namespace}/bindings", + "/api/v1/namespaces/{namespace}/configmaps", + "/api/v1/namespaces/{namespace}/configmaps/{name}", + "/api/v1/namespaces/{namespace}/endpoints", + "/api/v1/namespaces/{namespace}/endpoints/{name}", + "/api/v1/namespaces/{namespace}/events", + "/api/v1/namespaces/{namespace}/events/{name}", + "/api/v1/namespaces/{namespace}/limitranges", + "/api/v1/namespaces/{namespace}/limitranges/{name}", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}", + "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status", + "/api/v1/namespaces/{namespace}/pods", + "/api/v1/namespaces/{namespace}/pods/{name}", + "/api/v1/namespaces/{namespace}/pods/{name}/attach", + "/api/v1/namespaces/{namespace}/pods/{name}/binding", + "/api/v1/namespaces/{namespace}/pods/{name}/eviction", + "/api/v1/namespaces/{namespace}/pods/{name}/exec", + "/api/v1/namespaces/{namespace}/pods/{name}/log", + "/api/v1/namespaces/{namespace}/pods/{name}/portforward", + "/api/v1/namespaces/{namespace}/pods/{name}/proxy", + "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}", + "/api/v1/namespaces/{namespace}/pods/{name}/status", + "/api/v1/namespaces/{namespace}/podtemplates", + "/api/v1/namespaces/{namespace}/podtemplates/{name}", + "/api/v1/namespaces/{namespace}/replicationcontrollers", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale", + "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status", + "/api/v1/namespaces/{namespace}/resourcequotas", + "/api/v1/namespaces/{namespace}/resourcequotas/{name}", + "/api/v1/namespaces/{namespace}/resourcequotas/{name}/status", + "/api/v1/namespaces/{namespace}/secrets", + "/api/v1/namespaces/{namespace}/secrets/{name}", + "/api/v1/namespaces/{namespace}/serviceaccounts", + "/api/v1/namespaces/{namespace}/serviceaccounts/{name}", + "/api/v1/namespaces/{namespace}/services", + "/api/v1/namespaces/{namespace}/services/{name}", + "/api/v1/namespaces/{namespace}/services/{name}/proxy", + "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}", + "/api/v1/namespaces/{namespace}/services/{name}/status", + "/api/v1/namespaces/{namespace}", + "/api/v1/namespaces/{namespace}/finalize", + "/api/v1/namespaces/{namespace}/status", + "/api/v1/nodes", + "/api/v1/nodes/{name}", + "/api/v1/nodes/{name}/proxy", + "/api/v1/nodes/{name}/proxy/{path}", + "/api/v1/nodes/{name}/status", + "/api/v1/persistentvolumeclaims", + "/api/v1/persistentvolumes", + "/api/v1/persistentvolumes/{name}", + "/api/v1/persistentvolumes/{name}/status", + "/api/v1/pods", + "/api/v1/podtemplates", + "/api/v1/proxy/namespaces/{namespace}/pods/{name}", + "/api/v1/proxy/namespaces/{namespace}/pods/{name}/{path}", + "/api/v1/proxy/namespaces/{namespace}/services/{name}", + "/api/v1/proxy/namespaces/{namespace}/services/{name}/{path}", + "/api/v1/proxy/nodes/{name}", + "/api/v1/proxy/nodes/{name}/{path}", + "/api/v1/replicationcontrollers", + "/api/v1/resourcequotas", + "/api/v1/secrets", + "/api/v1/serviceaccounts", + "/api/v1/services", + "/api/v1/watch/configmaps", + "/api/v1/watch/endpoints", + "/api/v1/watch/events", + "/api/v1/watch/limitranges", + "/api/v1/watch/namespaces", + "/api/v1/watch/namespaces/{namespace}/configmaps", + "/api/v1/watch/namespaces/{namespace}/configmaps/{name}", + "/api/v1/watch/namespaces/{namespace}/endpoints", + "/api/v1/watch/namespaces/{namespace}/endpoints/{name}", + "/api/v1/watch/namespaces/{namespace}/events", + "/api/v1/watch/namespaces/{namespace}/events/{name}", + "/api/v1/watch/namespaces/{namespace}/limitranges", + "/api/v1/watch/namespaces/{namespace}/limitranges/{name}", + "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims", + "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}", + "/api/v1/watch/namespaces/{namespace}/pods", + "/api/v1/watch/namespaces/{namespace}/pods/{name}", + "/api/v1/watch/namespaces/{namespace}/podtemplates", + "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}", + "/api/v1/watch/namespaces/{namespace}/replicationcontrollers", + "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}", + "/api/v1/watch/namespaces/{namespace}/resourcequotas", + "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}", + "/api/v1/watch/namespaces/{namespace}/secrets", + "/api/v1/watch/namespaces/{namespace}/secrets/{name}", + "/api/v1/watch/namespaces/{namespace}/serviceaccounts", + "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}", + "/api/v1/watch/namespaces/{namespace}/services", + "/api/v1/watch/namespaces/{namespace}/services/{name}", + "/api/v1/watch/namespaces/{namespace}", + "/api/v1/watch/nodes", + "/api/v1/watch/nodes/{name}", + "/api/v1/watch/persistentvolumeclaims", + "/api/v1/watch/persistentvolumes", + "/api/v1/watch/persistentvolumes/{name}", + "/api/v1/watch/pods", + "/api/v1/watch/podtemplates", + "/api/v1/watch/replicationcontrollers", + "/api/v1/watch/resourcequotas", + "/api/v1/watch/secrets", + "/api/v1/watch/serviceaccounts", + "/api/v1/watch/services", + "/apis/apps/v1/", + "/apis/apps/v1/namespaces/{namespace}/statefulsets", + "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}", + "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status", + "/apis/apps/v1/statefulsets", + "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets", + "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets/{name}", + "/apis/apps/v1/watch/statefulsets", + "/apis/authentication.k8s.io/v1/", + "/apis/authentication.k8s.io/v1/tokenreviews", + "/apis/authorization.k8s.io/v1/", + "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews", + "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews", + "/apis/authorization.k8s.io/v1/subjectaccessreviews", + "/apis/autoscaling/v1/", + "/apis/autoscaling/v1/horizontalpodautoscalers", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", + "/apis/autoscaling/v1/watch/horizontalpodautoscalers", + "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/batch/v1/", + "/apis/batch/v1/jobs", + "/apis/batch/v1/namespaces/{namespace}/jobs", + "/apis/batch/v1/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status", + "/apis/batch/v1/watch/jobs", + "/apis/batch/v1/watch/namespaces/{namespace}/jobs", + "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v1/", + "/apis/batch/v1/cronjobs", + "/apis/batch/v1/jobs", + "/apis/batch/v1/namespaces/{namespace}/cronjobs", + "/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}", + "/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status", + "/apis/batch/v1/namespaces/{namespace}/jobs", + "/apis/batch/v1/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status", + "/apis/batch/v1/namespaces/{namespace}/scheduledjobs", + "/apis/batch/v1/namespaces/{namespace}/scheduledjobs/{name}", + "/apis/batch/v1/namespaces/{namespace}/scheduledjobs/{name}/status", + "/apis/batch/v1/scheduledjobs", + "/apis/batch/v1/watch/cronjobs", + "/apis/batch/v1/watch/jobs", + "/apis/batch/v1/watch/namespaces/{namespace}/cronjobs", + "/apis/batch/v1/watch/namespaces/{namespace}/cronjobs/{name}", + "/apis/batch/v1/watch/namespaces/{namespace}/jobs", + "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/batch/v1/watch/namespaces/{namespace}/scheduledjobs", + "/apis/batch/v1/watch/namespaces/{namespace}/scheduledjobs/{name}", + "/apis/batch/v1/watch/scheduledjobs", + "/apis/certificates.k8s.io/v1beta1/", + "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests", + "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}", + "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/approval", + "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status", + "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests", + "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}", + "/apis/extensions/v1beta1/", + "/apis/extensions/v1beta1/daemonsets", + "/apis/extensions/v1beta1/deployments", + "/apis/extensions/v1beta1/horizontalpodautoscalers", + "/apis/extensions/v1beta1/ingresses", + "/apis/extensions/v1beta1/jobs", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale", + "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies", + "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status", + "/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale", + "/apis/extensions/v1beta1/networkpolicies", + "/apis/extensions/v1beta1/replicasets", + "/apis/extensions/v1beta1/thirdpartyresources", + "/apis/extensions/v1beta1/thirdpartyresources/{name}", + "/apis/extensions/v1beta1/watch/daemonsets", + "/apis/extensions/v1beta1/watch/deployments", + "/apis/extensions/v1beta1/watch/horizontalpodautoscalers", + "/apis/extensions/v1beta1/watch/ingresses", + "/apis/extensions/v1beta1/watch/jobs", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets", + "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}", + "/apis/extensions/v1beta1/watch/networkpolicies", + "/apis/extensions/v1beta1/watch/replicasets", + "/apis/extensions/v1beta1/watch/thirdpartyresources", + "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}", + "/apis/policy/v1beta1/", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}", + "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status", + "/apis/policy/v1beta1/poddisruptionbudgets", + "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets", + "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}", + "/apis/policy/v1beta1/watch/poddisruptionbudgets", + "/apis/rbac.authorization.k8s.io/v1/", + "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings", + "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1/clusterroles", + "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}", + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings", + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles", + "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}", + "/apis/rbac.authorization.k8s.io/v1/rolebindings", + "/apis/rbac.authorization.k8s.io/v1/roles", + "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings", + "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles", + "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles/{name}", + "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings", + "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings/{name}", + "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles", + "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles/{name}", + "/apis/rbac.authorization.k8s.io/v1/watch/rolebindings", + "/apis/rbac.authorization.k8s.io/v1/watch/roles", + "/apis/storage.k8s.io/v1/", + "/apis/storage.k8s.io/v1/storageclasses", + "/apis/storage.k8s.io/v1/storageclasses/{name}", + "/apis/storage.k8s.io/v1/watch/storageclasses", + "/apis/storage.k8s.io/v1/watch/storageclasses/{name}", + "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/{name}", + "/apis/metrics.k8s.io/v1beta1/pods", + "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/", + "/apis/metrics.k8s.io/v1beta1/nodes", + "/apis/metrics.k8s.io/v1beta1/nodes/{name}", +} diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v111.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v111.go deleted file mode 100644 index 300f905f81..0000000000 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v111.go +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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 versions - -// apiSetV111 defines the api urls of kubernetes v1.11 version. We define these urls -// to check url specifications and create the client for kubernetes. All urls of kubernetes -// are defined, users don't need to care about the details. -// These urls contain the following resources: -// - componentstatuses -// - configmaps -// - endpoints -// - secrets -// - services -// - events -// - limitranges -// - namespaces -// - bindings -// - pv/pvcs -// - pods -// - replicationcontrollers -// - and so on. -// The k8s driver will return the urls under control to handle request. These apis map all the -// original apis and are used to verify the user's api request. It is adapted to different -// versions of k8s, and users do not need to pay attention to details. -// And bcs-k8s-driver is deprecated. We add this comment because the code scanning tool checks out -// that the comment rate should not be lower than 10%. That's why we added some comments to avoid this error. -// But because this component has been deprecated, the addition here does not make much sense. -// If the user sees it, it can be ignored -var apiSetV111 = []string{ - "/api/v1/", - "/api/v1/componentstatuses", - "/api/v1/componentstatuses/{name}", - "/api/v1/configmaps", - "/api/v1/endpoints", - "/api/v1/events", - "/api/v1/limitranges", - "/api/v1/namespaces", - "/api/v1/namespaces/{namespace}/bindings", - "/api/v1/namespaces/{namespace}/configmaps", - "/api/v1/namespaces/{namespace}/configmaps/{name}", - "/api/v1/namespaces/{namespace}/endpoints", - "/api/v1/namespaces/{namespace}/endpoints/{name}", - "/api/v1/namespaces/{namespace}/events", - "/api/v1/namespaces/{namespace}/events/{name}", - "/api/v1/namespaces/{namespace}/limitranges", - "/api/v1/namespaces/{namespace}/limitranges/{name}", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status", - "/api/v1/namespaces/{namespace}/pods", - "/api/v1/namespaces/{namespace}/pods/{name}", - "/api/v1/namespaces/{namespace}/pods/{name}/attach", - "/api/v1/namespaces/{namespace}/pods/{name}/binding", - "/api/v1/namespaces/{namespace}/pods/{name}/eviction", - "/api/v1/namespaces/{namespace}/pods/{name}/exec", - "/api/v1/namespaces/{namespace}/pods/{name}/log", - "/api/v1/namespaces/{namespace}/pods/{name}/portforward", - "/api/v1/namespaces/{namespace}/pods/{name}/proxy", - "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}", - "/api/v1/namespaces/{namespace}/pods/{name}/status", - "/api/v1/namespaces/{namespace}/podtemplates", - "/api/v1/namespaces/{namespace}/podtemplates/{name}", - "/api/v1/namespaces/{namespace}/replicationcontrollers", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status", - "/api/v1/namespaces/{namespace}/resourcequotas", - "/api/v1/namespaces/{namespace}/resourcequotas/{name}", - "/api/v1/namespaces/{namespace}/resourcequotas/{name}/status", - "/api/v1/namespaces/{namespace}/secrets", - "/api/v1/namespaces/{namespace}/secrets/{name}", - "/api/v1/namespaces/{namespace}/serviceaccounts", - "/api/v1/namespaces/{namespace}/serviceaccounts/{name}", - "/api/v1/namespaces/{namespace}/services", - "/api/v1/namespaces/{namespace}/services/{name}", - "/api/v1/namespaces/{namespace}/services/{name}/proxy", - "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}", - "/api/v1/namespaces/{namespace}/services/{name}/status", - "/api/v1/namespaces/{namespace}", - "/api/v1/namespaces/{namespace}/finalize", - "/api/v1/namespaces/{namespace}/status", - "/api/v1/nodes", - "/api/v1/nodes/{name}", - "/api/v1/nodes/{name}/proxy", - "/api/v1/nodes/{name}/proxy/{path}", - "/api/v1/nodes/{name}/status", - "/api/v1/persistentvolumeclaims", - "/api/v1/persistentvolumes", - "/api/v1/persistentvolumes/{name}", - "/api/v1/persistentvolumes/{name}/status", - "/api/v1/pods", - "/api/v1/podtemplates", - "/api/v1/proxy/namespaces/{namespace}/pods/{name}", - "/api/v1/proxy/namespaces/{namespace}/pods/{name}/{path}", - "/api/v1/proxy/namespaces/{namespace}/services/{name}", - "/api/v1/proxy/namespaces/{namespace}/services/{name}/{path}", - "/api/v1/proxy/nodes/{name}", - "/api/v1/proxy/nodes/{name}/{path}", - "/api/v1/replicationcontrollers", - "/api/v1/resourcequotas", - "/api/v1/secrets", - "/api/v1/serviceaccounts", - "/api/v1/services", - "/api/v1/watch/configmaps", - "/api/v1/watch/endpoints", - "/api/v1/watch/events", - "/api/v1/watch/limitranges", - "/api/v1/watch/namespaces", - "/api/v1/watch/namespaces/{namespace}/configmaps", - "/api/v1/watch/namespaces/{namespace}/configmaps/{name}", - "/api/v1/watch/namespaces/{namespace}/endpoints", - "/api/v1/watch/namespaces/{namespace}/endpoints/{name}", - "/api/v1/watch/namespaces/{namespace}/events", - "/api/v1/watch/namespaces/{namespace}/events/{name}", - "/api/v1/watch/namespaces/{namespace}/limitranges", - "/api/v1/watch/namespaces/{namespace}/limitranges/{name}", - "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims", - "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}", - "/api/v1/watch/namespaces/{namespace}/pods", - "/api/v1/watch/namespaces/{namespace}/pods/{name}", - "/api/v1/watch/namespaces/{namespace}/podtemplates", - "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}", - "/api/v1/watch/namespaces/{namespace}/replicationcontrollers", - "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}", - "/api/v1/watch/namespaces/{namespace}/resourcequotas", - "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}", - "/api/v1/watch/namespaces/{namespace}/secrets", - "/api/v1/watch/namespaces/{namespace}/secrets/{name}", - "/api/v1/watch/namespaces/{namespace}/serviceaccounts", - "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}", - "/api/v1/watch/namespaces/{namespace}/services", - "/api/v1/watch/namespaces/{namespace}/services/{name}", - "/api/v1/watch/namespaces/{namespace}", - "/api/v1/watch/nodes", - "/api/v1/watch/nodes/{name}", - "/api/v1/watch/persistentvolumeclaims", - "/api/v1/watch/persistentvolumes", - "/api/v1/watch/persistentvolumes/{name}", - "/api/v1/watch/pods", - "/api/v1/watch/podtemplates", - "/api/v1/watch/replicationcontrollers", - "/api/v1/watch/resourcequotas", - "/api/v1/watch/secrets", - "/api/v1/watch/serviceaccounts", - "/api/v1/watch/services", - "/apis/apps/v1beta1/", - "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets", - "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}", - "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status", - "/apis/apps/v1beta1/statefulsets", - "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets", - "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}", - "/apis/apps/v1beta1/watch/statefulsets", - "/apis/authentication.k8s.io/v1beta1/", - "/apis/authentication.k8s.io/v1beta1/tokenreviews", - "/apis/authorization.k8s.io/v1beta1/", - "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews", - "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews", - "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews", - "/apis/autoscaling/v1/", - "/apis/autoscaling/v1/horizontalpodautoscalers", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", - "/apis/autoscaling/v1/watch/horizontalpodautoscalers", - "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/batch/v1/", - "/apis/batch/v1/jobs", - "/apis/batch/v1/namespaces/{namespace}/jobs", - "/apis/batch/v1/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status", - "/apis/batch/v1/watch/jobs", - "/apis/batch/v1/watch/namespaces/{namespace}/jobs", - "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v2alpha1/", - "/apis/batch/v2alpha1/cronjobs", - "/apis/batch/v2alpha1/jobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}", - "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status", - "/apis/batch/v2alpha1/namespaces/{namespace}/jobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}/status", - "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}", - "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}/status", - "/apis/batch/v2alpha1/scheduledjobs", - "/apis/batch/v2alpha1/watch/cronjobs", - "/apis/batch/v2alpha1/watch/jobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs/{name}", - "/apis/batch/v2alpha1/watch/scheduledjobs", - "/apis/certificates.k8s.io/v1alpha1/", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/approval", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/status", - "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests", - "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests/{name}", - "/apis/extensions/v1beta1/", - "/apis/extensions/v1beta1/daemonsets", - "/apis/extensions/v1beta1/deployments", - "/apis/extensions/v1beta1/horizontalpodautoscalers", - "/apis/extensions/v1beta1/ingresses", - "/apis/extensions/v1beta1/jobs", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies", - "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale", - "/apis/extensions/v1beta1/networkpolicies", - "/apis/extensions/v1beta1/replicasets", - "/apis/extensions/v1beta1/thirdpartyresources", - "/apis/extensions/v1beta1/thirdpartyresources/{name}", - "/apis/extensions/v1beta1/watch/daemonsets", - "/apis/extensions/v1beta1/watch/deployments", - "/apis/extensions/v1beta1/watch/horizontalpodautoscalers", - "/apis/extensions/v1beta1/watch/ingresses", - "/apis/extensions/v1beta1/watch/jobs", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}", - "/apis/extensions/v1beta1/watch/networkpolicies", - "/apis/extensions/v1beta1/watch/replicasets", - "/apis/extensions/v1beta1/watch/thirdpartyresources", - "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}", - "/apis/policy/v1beta1/", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status", - "/apis/policy/v1beta1/poddisruptionbudgets", - "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets", - "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}", - "/apis/policy/v1beta1/watch/poddisruptionbudgets", - "/apis/rbac.authorization.k8s.io/v1alpha1/", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/roles", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles", - "/apis/storage.k8s.io/v1beta1/", - "/apis/storage.k8s.io/v1beta1/storageclasses", - "/apis/storage.k8s.io/v1beta1/storageclasses/{name}", - "/apis/storage.k8s.io/v1beta1/watch/storageclasses", - "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}", - "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/{name}", - "/apis/metrics.k8s.io/v1beta1/pods", - "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/", - "/apis/metrics.k8s.io/v1beta1/nodes", - "/apis/metrics.k8s.io/v1beta1/nodes/{name}", -} diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v112.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v112.go deleted file mode 100644 index 271b9296b5..0000000000 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v112.go +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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 versions - -// apiSetV112 defines the api urls of kubernetes v1.12 version. We define these urls -// to check url specifications and create the client for kubernetes. All urls of kubernetes -// are defined, users don't need to care about the details. -// These urls contain the following resources: -// - componentstatuses -// - configmaps -// - endpoints -// - secrets -// - services -// - events -// - limitranges -// - namespaces -// - bindings -// - pv/pvcs -// - pods -// - replicationcontrollers -// - and so on. -// The k8s driver will return the urls under control to handle request. These apis map all the -// original apis and are used to verify the user's api request. It is adapted to different -// versions of k8s, and users do not need to pay attention to details. -// And bcs-k8s-driver is deprecated. We add this comment because the code scanning tool checks out -// that the comment rate should not be lower than 10%. That's why we added some comments to avoid this error. -// But because this component has been deprecated, the addition here does not make much sense. -// If the user sees it, it can be ignored -var apiSetV112 = []string{ - "/api/v1/", - "/api/v1/componentstatuses", - "/api/v1/componentstatuses/{name}", - "/api/v1/configmaps", - "/api/v1/endpoints", - "/api/v1/events", - "/api/v1/limitranges", - "/api/v1/namespaces", - "/api/v1/namespaces/{namespace}/bindings", - "/api/v1/namespaces/{namespace}/configmaps", - "/api/v1/namespaces/{namespace}/configmaps/{name}", - "/api/v1/namespaces/{namespace}/endpoints", - "/api/v1/namespaces/{namespace}/endpoints/{name}", - "/api/v1/namespaces/{namespace}/events", - "/api/v1/namespaces/{namespace}/events/{name}", - "/api/v1/namespaces/{namespace}/limitranges", - "/api/v1/namespaces/{namespace}/limitranges/{name}", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status", - "/api/v1/namespaces/{namespace}/pods", - "/api/v1/namespaces/{namespace}/pods/{name}", - "/api/v1/namespaces/{namespace}/pods/{name}/attach", - "/api/v1/namespaces/{namespace}/pods/{name}/binding", - "/api/v1/namespaces/{namespace}/pods/{name}/eviction", - "/api/v1/namespaces/{namespace}/pods/{name}/exec", - "/api/v1/namespaces/{namespace}/pods/{name}/log", - "/api/v1/namespaces/{namespace}/pods/{name}/portforward", - "/api/v1/namespaces/{namespace}/pods/{name}/proxy", - "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}", - "/api/v1/namespaces/{namespace}/pods/{name}/status", - "/api/v1/namespaces/{namespace}/podtemplates", - "/api/v1/namespaces/{namespace}/podtemplates/{name}", - "/api/v1/namespaces/{namespace}/replicationcontrollers", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status", - "/api/v1/namespaces/{namespace}/resourcequotas", - "/api/v1/namespaces/{namespace}/resourcequotas/{name}", - "/api/v1/namespaces/{namespace}/resourcequotas/{name}/status", - "/api/v1/namespaces/{namespace}/secrets", - "/api/v1/namespaces/{namespace}/secrets/{name}", - "/api/v1/namespaces/{namespace}/serviceaccounts", - "/api/v1/namespaces/{namespace}/serviceaccounts/{name}", - "/api/v1/namespaces/{namespace}/services", - "/api/v1/namespaces/{namespace}/services/{name}", - "/api/v1/namespaces/{namespace}/services/{name}/proxy", - "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}", - "/api/v1/namespaces/{namespace}/services/{name}/status", - "/api/v1/namespaces/{namespace}", - "/api/v1/namespaces/{namespace}/finalize", - "/api/v1/namespaces/{namespace}/status", - "/api/v1/nodes", - "/api/v1/nodes/{name}", - "/api/v1/nodes/{name}/proxy", - "/api/v1/nodes/{name}/proxy/{path}", - "/api/v1/nodes/{name}/status", - "/api/v1/persistentvolumeclaims", - "/api/v1/persistentvolumes", - "/api/v1/persistentvolumes/{name}", - "/api/v1/persistentvolumes/{name}/status", - "/api/v1/pods", - "/api/v1/podtemplates", - "/api/v1/proxy/namespaces/{namespace}/pods/{name}", - "/api/v1/proxy/namespaces/{namespace}/pods/{name}/{path}", - "/api/v1/proxy/namespaces/{namespace}/services/{name}", - "/api/v1/proxy/namespaces/{namespace}/services/{name}/{path}", - "/api/v1/proxy/nodes/{name}", - "/api/v1/proxy/nodes/{name}/{path}", - "/api/v1/replicationcontrollers", - "/api/v1/resourcequotas", - "/api/v1/secrets", - "/api/v1/serviceaccounts", - "/api/v1/services", - "/api/v1/watch/configmaps", - "/api/v1/watch/endpoints", - "/api/v1/watch/events", - "/api/v1/watch/limitranges", - "/api/v1/watch/namespaces", - "/api/v1/watch/namespaces/{namespace}/configmaps", - "/api/v1/watch/namespaces/{namespace}/configmaps/{name}", - "/api/v1/watch/namespaces/{namespace}/endpoints", - "/api/v1/watch/namespaces/{namespace}/endpoints/{name}", - "/api/v1/watch/namespaces/{namespace}/events", - "/api/v1/watch/namespaces/{namespace}/events/{name}", - "/api/v1/watch/namespaces/{namespace}/limitranges", - "/api/v1/watch/namespaces/{namespace}/limitranges/{name}", - "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims", - "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}", - "/api/v1/watch/namespaces/{namespace}/pods", - "/api/v1/watch/namespaces/{namespace}/pods/{name}", - "/api/v1/watch/namespaces/{namespace}/podtemplates", - "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}", - "/api/v1/watch/namespaces/{namespace}/replicationcontrollers", - "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}", - "/api/v1/watch/namespaces/{namespace}/resourcequotas", - "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}", - "/api/v1/watch/namespaces/{namespace}/secrets", - "/api/v1/watch/namespaces/{namespace}/secrets/{name}", - "/api/v1/watch/namespaces/{namespace}/serviceaccounts", - "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}", - "/api/v1/watch/namespaces/{namespace}/services", - "/api/v1/watch/namespaces/{namespace}/services/{name}", - "/api/v1/watch/namespaces/{namespace}", - "/api/v1/watch/nodes", - "/api/v1/watch/nodes/{name}", - "/api/v1/watch/persistentvolumeclaims", - "/api/v1/watch/persistentvolumes", - "/api/v1/watch/persistentvolumes/{name}", - "/api/v1/watch/pods", - "/api/v1/watch/podtemplates", - "/api/v1/watch/replicationcontrollers", - "/api/v1/watch/resourcequotas", - "/api/v1/watch/secrets", - "/api/v1/watch/serviceaccounts", - "/api/v1/watch/services", - "/apis/apps/v1/", - "/apis/apps/v1/namespaces/{namespace}/statefulsets", - "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}", - "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status", - "/apis/apps/v1/statefulsets", - "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets", - "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets/{name}", - "/apis/apps/v1/watch/statefulsets", - "/apis/authentication.k8s.io/v1/", - "/apis/authentication.k8s.io/v1/tokenreviews", - "/apis/authorization.k8s.io/v1/", - "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews", - "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews", - "/apis/authorization.k8s.io/v1/subjectaccessreviews", - "/apis/autoscaling/v1/", - "/apis/autoscaling/v1/horizontalpodautoscalers", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", - "/apis/autoscaling/v1/watch/horizontalpodautoscalers", - "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/batch/v1/", - "/apis/batch/v1/jobs", - "/apis/batch/v1/namespaces/{namespace}/jobs", - "/apis/batch/v1/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status", - "/apis/batch/v1/watch/jobs", - "/apis/batch/v1/watch/namespaces/{namespace}/jobs", - "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v1/", - "/apis/batch/v1/cronjobs", - "/apis/batch/v1/jobs", - "/apis/batch/v1/namespaces/{namespace}/cronjobs", - "/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}", - "/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status", - "/apis/batch/v1/namespaces/{namespace}/jobs", - "/apis/batch/v1/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status", - "/apis/batch/v1/namespaces/{namespace}/scheduledjobs", - "/apis/batch/v1/namespaces/{namespace}/scheduledjobs/{name}", - "/apis/batch/v1/namespaces/{namespace}/scheduledjobs/{name}/status", - "/apis/batch/v1/scheduledjobs", - "/apis/batch/v1/watch/cronjobs", - "/apis/batch/v1/watch/jobs", - "/apis/batch/v1/watch/namespaces/{namespace}/cronjobs", - "/apis/batch/v1/watch/namespaces/{namespace}/cronjobs/{name}", - "/apis/batch/v1/watch/namespaces/{namespace}/jobs", - "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v1/watch/namespaces/{namespace}/scheduledjobs", - "/apis/batch/v1/watch/namespaces/{namespace}/scheduledjobs/{name}", - "/apis/batch/v1/watch/scheduledjobs", - "/apis/certificates.k8s.io/v1beta1/", - "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests", - "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}", - "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/approval", - "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status", - "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests", - "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}", - "/apis/extensions/v1beta1/", - "/apis/extensions/v1beta1/daemonsets", - "/apis/extensions/v1beta1/deployments", - "/apis/extensions/v1beta1/horizontalpodautoscalers", - "/apis/extensions/v1beta1/ingresses", - "/apis/extensions/v1beta1/jobs", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies", - "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale", - "/apis/extensions/v1beta1/networkpolicies", - "/apis/extensions/v1beta1/replicasets", - "/apis/extensions/v1beta1/thirdpartyresources", - "/apis/extensions/v1beta1/thirdpartyresources/{name}", - "/apis/extensions/v1beta1/watch/daemonsets", - "/apis/extensions/v1beta1/watch/deployments", - "/apis/extensions/v1beta1/watch/horizontalpodautoscalers", - "/apis/extensions/v1beta1/watch/ingresses", - "/apis/extensions/v1beta1/watch/jobs", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}", - "/apis/extensions/v1beta1/watch/networkpolicies", - "/apis/extensions/v1beta1/watch/replicasets", - "/apis/extensions/v1beta1/watch/thirdpartyresources", - "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}", - "/apis/policy/v1beta1/", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status", - "/apis/policy/v1beta1/poddisruptionbudgets", - "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets", - "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}", - "/apis/policy/v1beta1/watch/poddisruptionbudgets", - "/apis/rbac.authorization.k8s.io/v1/", - "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings", - "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1/clusterroles", - "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}", - "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings", - "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles", - "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}", - "/apis/rbac.authorization.k8s.io/v1/rolebindings", - "/apis/rbac.authorization.k8s.io/v1/roles", - "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings", - "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles", - "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles/{name}", - "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings", - "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles", - "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles/{name}", - "/apis/rbac.authorization.k8s.io/v1/watch/rolebindings", - "/apis/rbac.authorization.k8s.io/v1/watch/roles", - "/apis/storage.k8s.io/v1/", - "/apis/storage.k8s.io/v1/storageclasses", - "/apis/storage.k8s.io/v1/storageclasses/{name}", - "/apis/storage.k8s.io/v1/watch/storageclasses", - "/apis/storage.k8s.io/v1/watch/storageclasses/{name}", - "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/{name}", - "/apis/metrics.k8s.io/v1beta1/pods", - "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/", - "/apis/metrics.k8s.io/v1beta1/nodes", - "/apis/metrics.k8s.io/v1beta1/nodes/{name}", -} diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v15.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v15.go deleted file mode 100644 index cf5c59ecb4..0000000000 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v15.go +++ /dev/null @@ -1,325 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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 versions - -// apiSetV15 defines the api urls of kubernetes v1.15 version. We define these urls -// to check url specifications and create the client for kubernetes. All urls of kubernetes -// are defined, users don't need to care about the details. -// These urls contain the following resources: -// - componentstatuses -// - configmaps -// - endpoints -// - secrets -// - services -// - events -// - limitranges -// - namespaces -// - bindings -// - pv/pvcs -// - pods -// - replicationcontrollers -// - and so on. -// The k8s driver will return the urls under control to handle request. These apis map all the -// original apis and are used to verify the user's api request. It is adapted to different -// versions of k8s, and users do not need to pay attention to details. -// And bcs-k8s-driver is deprecated. We add this comment because the code scanning tool checks out -// that the comment rate should not be lower than 10%. That's why we added some comments to avoid this error. -// But because this component has been deprecated, the addition here does not make much sense. -// If the user sees it, it can be ignored -var apiSetV15 = []string{ - "/api/v1/componentstatuses", - "/api/v1/componentstatuses/{name}", - "/api/v1/configmaps", - "/api/v1/endpoints", - "/api/v1/events", - "/api/v1/limitranges", - "/api/v1/namespaces", - "/api/v1/namespaces/{namespace}/bindings", - "/api/v1/namespaces/{namespace}/configmaps", - "/api/v1/namespaces/{namespace}/configmaps/{name}", - "/api/v1/namespaces/{namespace}/endpoints", - "/api/v1/namespaces/{namespace}/endpoints/{name}", - "/api/v1/namespaces/{namespace}/events", - "/api/v1/namespaces/{namespace}/events/{name}", - "/api/v1/namespaces/{namespace}/limitranges", - "/api/v1/namespaces/{namespace}/limitranges/{name}", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status", - "/api/v1/namespaces/{namespace}/pods", - "/api/v1/namespaces/{namespace}/pods/{name}", - "/api/v1/namespaces/{namespace}/pods/{name}/attach", - "/api/v1/namespaces/{namespace}/pods/{name}/binding", - "/api/v1/namespaces/{namespace}/pods/{name}/eviction", - "/api/v1/namespaces/{namespace}/pods/{name}/exec", - "/api/v1/namespaces/{namespace}/pods/{name}/log", - "/api/v1/namespaces/{namespace}/pods/{name}/portforward", - "/api/v1/namespaces/{namespace}/pods/{name}/proxy", - "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}", - "/api/v1/namespaces/{namespace}/pods/{name}/status", - "/api/v1/namespaces/{namespace}/podtemplates", - "/api/v1/namespaces/{namespace}/podtemplates/{name}", - "/api/v1/namespaces/{namespace}/replicationcontrollers", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status", - "/api/v1/namespaces/{namespace}/resourcequotas", - "/api/v1/namespaces/{namespace}/resourcequotas/{name}", - "/api/v1/namespaces/{namespace}/resourcequotas/{name}/status", - "/api/v1/namespaces/{namespace}/secrets", - "/api/v1/namespaces/{namespace}/secrets/{name}", - "/api/v1/namespaces/{namespace}/serviceaccounts", - "/api/v1/namespaces/{namespace}/serviceaccounts/{name}", - "/api/v1/namespaces/{namespace}/services", - "/api/v1/namespaces/{namespace}/services/{name}", - "/api/v1/namespaces/{namespace}/services/{name}/proxy", - "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}", - "/api/v1/namespaces/{namespace}/services/{name}/status", - "/api/v1/namespaces/{namespace}", - "/api/v1/namespaces/{namespace}/finalize", - "/api/v1/namespaces/{namespace}/status", - "/api/v1/nodes", - "/api/v1/nodes/{name}", - "/api/v1/nodes/{name}/proxy", - "/api/v1/nodes/{name}/proxy/{path}", - "/api/v1/nodes/{name}/status", - "/api/v1/persistentvolumeclaims", - "/api/v1/persistentvolumes", - "/api/v1/persistentvolumes/{name}", - "/api/v1/persistentvolumes/{name}/status", - "/api/v1/pods", - "/api/v1/podtemplates", - "/api/v1/proxy/namespaces/{namespace}/pods/{name}", - "/api/v1/proxy/namespaces/{namespace}/pods/{name}/{path}", - "/api/v1/proxy/namespaces/{namespace}/services/{name}", - "/api/v1/proxy/namespaces/{namespace}/services/{name}/{path}", - "/api/v1/proxy/nodes/{name}", - "/api/v1/proxy/nodes/{name}/{path}", - "/api/v1/replicationcontrollers", - "/api/v1/resourcequotas", - "/api/v1/secrets", - "/api/v1/serviceaccounts", - "/api/v1/services", - "/api/v1/watch/configmaps", - "/api/v1/watch/endpoints", - "/api/v1/watch/events", - "/api/v1/watch/limitranges", - "/api/v1/watch/namespaces", - "/api/v1/watch/namespaces/{namespace}/configmaps", - "/api/v1/watch/namespaces/{namespace}/configmaps/{name}", - "/api/v1/watch/namespaces/{namespace}/endpoints", - "/api/v1/watch/namespaces/{namespace}/endpoints/{name}", - "/api/v1/watch/namespaces/{namespace}/events", - "/api/v1/watch/namespaces/{namespace}/events/{name}", - "/api/v1/watch/namespaces/{namespace}/limitranges", - "/api/v1/watch/namespaces/{namespace}/limitranges/{name}", - "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims", - "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}", - "/api/v1/watch/namespaces/{namespace}/pods", - "/api/v1/watch/namespaces/{namespace}/pods/{name}", - "/api/v1/watch/namespaces/{namespace}/podtemplates", - "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}", - "/api/v1/watch/namespaces/{namespace}/replicationcontrollers", - "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}", - "/api/v1/watch/namespaces/{namespace}/resourcequotas", - "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}", - "/api/v1/watch/namespaces/{namespace}/secrets", - "/api/v1/watch/namespaces/{namespace}/secrets/{name}", - "/api/v1/watch/namespaces/{namespace}/serviceaccounts", - "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}", - "/api/v1/watch/namespaces/{namespace}/services", - "/api/v1/watch/namespaces/{namespace}/services/{name}", - "/api/v1/watch/namespaces/{namespace}", - "/api/v1/watch/nodes", - "/api/v1/watch/nodes/{name}", - "/api/v1/watch/persistentvolumeclaims", - "/api/v1/watch/persistentvolumes", - "/api/v1/watch/persistentvolumes/{name}", - "/api/v1/watch/pods", - "/api/v1/watch/podtemplates", - "/api/v1/watch/replicationcontrollers", - "/api/v1/watch/resourcequotas", - "/api/v1/watch/secrets", - "/api/v1/watch/serviceaccounts", - "/api/v1/watch/services", - "/apis/", - "/apis/apps/", - "/apis/apps/v1beta1/", - "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets", - "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}", - "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status", - "/apis/apps/v1beta1/statefulsets", - "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets", - "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}", - "/apis/apps/v1beta1/watch/statefulsets", - "/apis/authentication.k8s.io/", - "/apis/authentication.k8s.io/v1beta1/", - "/apis/authentication.k8s.io/v1beta1/tokenreviews", - "/apis/authorization.k8s.io/", - "/apis/authorization.k8s.io/v1beta1/", - "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews", - "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews", - "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews", - "/apis/autoscaling/", - "/apis/autoscaling/v1/", - "/apis/autoscaling/v1/horizontalpodautoscalers", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", - "/apis/autoscaling/v1/watch/horizontalpodautoscalers", - "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/batch/", - "/apis/batch/v1/", - "/apis/batch/v1/jobs", - "/apis/batch/v1/namespaces/{namespace}/jobs", - "/apis/batch/v1/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status", - "/apis/batch/v1/watch/jobs", - "/apis/batch/v1/watch/namespaces/{namespace}/jobs", - "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v2alpha1/", - "/apis/batch/v2alpha1/cronjobs", - "/apis/batch/v2alpha1/jobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}", - "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status", - "/apis/batch/v2alpha1/namespaces/{namespace}/jobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}/status", - "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}", - "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}/status", - "/apis/batch/v2alpha1/scheduledjobs", - "/apis/batch/v2alpha1/watch/cronjobs", - "/apis/batch/v2alpha1/watch/jobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs/{name}", - "/apis/batch/v2alpha1/watch/scheduledjobs", - "/apis/certificates.k8s.io/", - "/apis/certificates.k8s.io/v1alpha1/", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/approval", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/status", - "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests", - "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests/{name}", - "/apis/extensions/", - "/apis/extensions/v1beta1/", - "/apis/extensions/v1beta1/daemonsets", - "/apis/extensions/v1beta1/deployments", - "/apis/extensions/v1beta1/horizontalpodautoscalers", - "/apis/extensions/v1beta1/ingresses", - "/apis/extensions/v1beta1/jobs", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies", - "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale", - "/apis/extensions/v1beta1/networkpolicies", - "/apis/extensions/v1beta1/replicasets", - "/apis/extensions/v1beta1/thirdpartyresources", - "/apis/extensions/v1beta1/thirdpartyresources/{name}", - "/apis/extensions/v1beta1/watch/daemonsets", - "/apis/extensions/v1beta1/watch/deployments", - "/apis/extensions/v1beta1/watch/horizontalpodautoscalers", - "/apis/extensions/v1beta1/watch/ingresses", - "/apis/extensions/v1beta1/watch/jobs", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}", - "/apis/extensions/v1beta1/watch/networkpolicies", - "/apis/extensions/v1beta1/watch/replicasets", - "/apis/extensions/v1beta1/watch/thirdpartyresources", - "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}", - "/apis/policy/", - "/apis/policy/v1beta1/", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status", - "/apis/policy/v1beta1/poddisruptionbudgets", - "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets", - "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}", - "/apis/policy/v1beta1/watch/poddisruptionbudgets", - "/apis/rbac.authorization.k8s.io/", - "/apis/rbac.authorization.k8s.io/v1alpha1/", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/roles", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles", - "/apis/storage.k8s.io/", - "/apis/storage.k8s.io/v1beta1/", - "/apis/storage.k8s.io/v1beta1/storageclasses", - "/apis/storage.k8s.io/v1beta1/storageclasses/{name}", - "/apis/storage.k8s.io/v1beta1/watch/storageclasses", - "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}", - "/logs/", - "/logs/{logpath}", - "/version/", - "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/{name}", - "/apis/metrics.k8s.io/v1beta1/pods", - "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/", - "/apis/metrics.k8s.io/v1beta1/nodes", - "/apis/metrics.k8s.io/v1beta1/nodes/{name}", -} diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v16.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v16.go deleted file mode 100644 index 47514e3080..0000000000 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v16.go +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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 versions - -// apiSetV16 defines the api urls of kubernetes v1.16 version. We define these urls -// to check url specifications and create the client for kubernetes. All urls of kubernetes -// are defined, users don't need to care about the details. -// These urls contain the following resources: -// - componentstatuses -// - configmaps -// - endpoints -// - secrets -// - services -// - events -// - limitranges -// - namespaces -// - bindings -// - pv/pvcs -// - pods -// - replicationcontrollers -// - and so on. -// The k8s driver will return the urls under control to handle request. These apis map all the -// original apis and are used to verify the user's api request. It is adapted to different -// versions of k8s, and users do not need to pay attention to details. -// And bcs-k8s-driver is deprecated. We add this comment because the code scanning tool checks out -// that the comment rate should not be lower than 10%. That's why we added some comments to avoid this error. -// But because this component has been deprecated, the addition here does not make much sense. -// If the user sees it, it can be ignored -var apiSetV16 = []string{ - "/api/v1/componentstatuses", - "/api/v1/componentstatuses/{name}", - "/api/v1/configmaps", - "/api/v1/endpoints", - "/api/v1/events", - "/api/v1/limitranges", - "/api/v1/namespaces", - "/api/v1/namespaces/{namespace}/bindings", - "/api/v1/namespaces/{namespace}/configmaps", - "/api/v1/namespaces/{namespace}/configmaps/{name}", - "/api/v1/namespaces/{namespace}/endpoints", - "/api/v1/namespaces/{namespace}/endpoints/{name}", - "/api/v1/namespaces/{namespace}/events", - "/api/v1/namespaces/{namespace}/events/{name}", - "/api/v1/namespaces/{namespace}/limitranges", - "/api/v1/namespaces/{namespace}/limitranges/{name}", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status", - "/api/v1/namespaces/{namespace}/pods", - "/api/v1/namespaces/{namespace}/pods/{name}", - "/api/v1/namespaces/{namespace}/pods/{name}/attach", - "/api/v1/namespaces/{namespace}/pods/{name}/binding", - "/api/v1/namespaces/{namespace}/pods/{name}/eviction", - "/api/v1/namespaces/{namespace}/pods/{name}/exec", - "/api/v1/namespaces/{namespace}/pods/{name}/log", - "/api/v1/namespaces/{namespace}/pods/{name}/portforward", - "/api/v1/namespaces/{namespace}/pods/{name}/proxy", - "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}", - "/api/v1/namespaces/{namespace}/pods/{name}/status", - "/api/v1/namespaces/{namespace}/podtemplates", - "/api/v1/namespaces/{namespace}/podtemplates/{name}", - "/api/v1/namespaces/{namespace}/replicationcontrollers", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status", - "/api/v1/namespaces/{namespace}/resourcequotas", - "/api/v1/namespaces/{namespace}/resourcequotas/{name}", - "/api/v1/namespaces/{namespace}/resourcequotas/{name}/status", - "/api/v1/namespaces/{namespace}/secrets", - "/api/v1/namespaces/{namespace}/secrets/{name}", - "/api/v1/namespaces/{namespace}/serviceaccounts", - "/api/v1/namespaces/{namespace}/serviceaccounts/{name}", - "/api/v1/namespaces/{namespace}/services", - "/api/v1/namespaces/{namespace}/services/{name}", - "/api/v1/namespaces/{namespace}/services/{name}/proxy", - "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}", - "/api/v1/namespaces/{namespace}/services/{name}/status", - "/api/v1/namespaces/{namespace}", - "/api/v1/namespaces/{namespace}/finalize", - "/api/v1/namespaces/{namespace}/status", - "/api/v1/nodes", - "/api/v1/nodes/{name}", - "/api/v1/nodes/{name}/proxy", - "/api/v1/nodes/{name}/proxy/{path}", - "/api/v1/nodes/{name}/status", - "/api/v1/persistentvolumeclaims", - "/api/v1/persistentvolumes", - "/api/v1/persistentvolumes/{name}", - "/api/v1/persistentvolumes/{name}/status", - "/api/v1/pods", - "/api/v1/podtemplates", - "/api/v1/proxy/namespaces/{namespace}/pods/{name}", - "/api/v1/proxy/namespaces/{namespace}/pods/{name}/{path}", - "/api/v1/proxy/namespaces/{namespace}/services/{name}", - "/api/v1/proxy/namespaces/{namespace}/services/{name}/{path}", - "/api/v1/proxy/nodes/{name}", - "/api/v1/proxy/nodes/{name}/{path}", - "/api/v1/replicationcontrollers", - "/api/v1/resourcequotas", - "/api/v1/secrets", - "/api/v1/serviceaccounts", - "/api/v1/services", - "/api/v1/watch/configmaps", - "/api/v1/watch/endpoints", - "/api/v1/watch/events", - "/api/v1/watch/limitranges", - "/api/v1/watch/namespaces", - "/api/v1/watch/namespaces/{namespace}/configmaps", - "/api/v1/watch/namespaces/{namespace}/configmaps/{name}", - "/api/v1/watch/namespaces/{namespace}/endpoints", - "/api/v1/watch/namespaces/{namespace}/endpoints/{name}", - "/api/v1/watch/namespaces/{namespace}/events", - "/api/v1/watch/namespaces/{namespace}/events/{name}", - "/api/v1/watch/namespaces/{namespace}/limitranges", - "/api/v1/watch/namespaces/{namespace}/limitranges/{name}", - "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims", - "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}", - "/api/v1/watch/namespaces/{namespace}/pods", - "/api/v1/watch/namespaces/{namespace}/pods/{name}", - "/api/v1/watch/namespaces/{namespace}/podtemplates", - "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}", - "/api/v1/watch/namespaces/{namespace}/replicationcontrollers", - "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}", - "/api/v1/watch/namespaces/{namespace}/resourcequotas", - "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}", - "/api/v1/watch/namespaces/{namespace}/secrets", - "/api/v1/watch/namespaces/{namespace}/secrets/{name}", - "/api/v1/watch/namespaces/{namespace}/serviceaccounts", - "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}", - "/api/v1/watch/namespaces/{namespace}/services", - "/api/v1/watch/namespaces/{namespace}/services/{name}", - "/api/v1/watch/namespaces/{namespace}", - "/api/v1/watch/nodes", - "/api/v1/watch/nodes/{name}", - "/api/v1/watch/persistentvolumeclaims", - "/api/v1/watch/persistentvolumes", - "/api/v1/watch/persistentvolumes/{name}", - "/api/v1/watch/pods", - "/api/v1/watch/podtemplates", - "/api/v1/watch/replicationcontrollers", - "/api/v1/watch/resourcequotas", - "/api/v1/watch/secrets", - "/api/v1/watch/serviceaccounts", - "/api/v1/watch/services", - "/apis/apps/v1beta1/", - "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets", - "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}", - "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status", - "/apis/apps/v1beta1/statefulsets", - "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets", - "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}", - "/apis/apps/v1beta1/watch/statefulsets", - "/apis/authentication.k8s.io/v1beta1/", - "/apis/authentication.k8s.io/v1beta1/tokenreviews", - "/apis/authorization.k8s.io/v1beta1/", - "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews", - "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews", - "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews", - "/apis/autoscaling/v1/", - "/apis/autoscaling/v1/horizontalpodautoscalers", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", - "/apis/autoscaling/v1/watch/horizontalpodautoscalers", - "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/batch/v1/", - "/apis/batch/v1/jobs", - "/apis/batch/v1/namespaces/{namespace}/jobs", - "/apis/batch/v1/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status", - "/apis/batch/v1/watch/jobs", - "/apis/batch/v1/watch/namespaces/{namespace}/jobs", - "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v2alpha1/", - "/apis/batch/v2alpha1/cronjobs", - "/apis/batch/v2alpha1/jobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}", - "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status", - "/apis/batch/v2alpha1/namespaces/{namespace}/jobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}/status", - "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}", - "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}/status", - "/apis/batch/v2alpha1/scheduledjobs", - "/apis/batch/v2alpha1/watch/cronjobs", - "/apis/batch/v2alpha1/watch/jobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs/{name}", - "/apis/batch/v2alpha1/watch/scheduledjobs", - "/apis/certificates.k8s.io/v1alpha1/", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/approval", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/status", - "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests", - "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests/{name}", - "/apis/extensions/v1beta1/", - "/apis/extensions/v1beta1/daemonsets", - "/apis/extensions/v1beta1/deployments", - "/apis/extensions/v1beta1/horizontalpodautoscalers", - "/apis/extensions/v1beta1/ingresses", - "/apis/extensions/v1beta1/jobs", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies", - "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale", - "/apis/extensions/v1beta1/networkpolicies", - "/apis/extensions/v1beta1/replicasets", - "/apis/extensions/v1beta1/thirdpartyresources", - "/apis/extensions/v1beta1/thirdpartyresources/{name}", - "/apis/extensions/v1beta1/watch/daemonsets", - "/apis/extensions/v1beta1/watch/deployments", - "/apis/extensions/v1beta1/watch/horizontalpodautoscalers", - "/apis/extensions/v1beta1/watch/ingresses", - "/apis/extensions/v1beta1/watch/jobs", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}", - "/apis/extensions/v1beta1/watch/networkpolicies", - "/apis/extensions/v1beta1/watch/replicasets", - "/apis/extensions/v1beta1/watch/thirdpartyresources", - "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}", - "/apis/policy/v1beta1/", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status", - "/apis/policy/v1beta1/poddisruptionbudgets", - "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets", - "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}", - "/apis/policy/v1beta1/watch/poddisruptionbudgets", - "/apis/rbac.authorization.k8s.io/v1alpha1/", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/roles", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles", - "/apis/storage.k8s.io/v1beta1/", - "/apis/storage.k8s.io/v1beta1/storageclasses", - "/apis/storage.k8s.io/v1beta1/storageclasses/{name}", - "/apis/storage.k8s.io/v1beta1/watch/storageclasses", - "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}", - "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/{name}", - "/apis/metrics.k8s.io/v1beta1/pods", - "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/", - "/apis/metrics.k8s.io/v1beta1/nodes", - "/apis/metrics.k8s.io/v1beta1/nodes/{name}", -} diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v17.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v17.go deleted file mode 100644 index bae68c48b7..0000000000 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v17.go +++ /dev/null @@ -1,326 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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 versions - -// apiSetV17 defines the api urls of kubernetes v1.17 version. We define these urls -// to check url specifications and create the client for kubernetes. All urls of kubernetes -// are defined, users don't need to care about the details. -// These urls contain the following resources: -// - componentstatuses -// - configmaps -// - endpoints -// - secrets -// - services -// - events -// - limitranges -// - namespaces -// - bindings -// - pv/pvcs -// - pods -// - replicationcontrollers -// - and so on. -// The k8s driver will return the urls under control to handle request. These apis map all the -// original apis and are used to verify the user's api request. It is adapted to different -// versions of k8s, and users do not need to pay attention to details. -// And bcs-k8s-driver is deprecated. We add this comment because the code scanning tool checks out -// that the comment rate should not be lower than 10%. That's why we added some comments to avoid this error. -// But because this component has been deprecated, the addition here does not make much sense. -// If the user sees it, it can be ignored -var apiSetV17 = []string{ - "/api/v1/", - "/api/v1/componentstatuses", - "/api/v1/componentstatuses/{name}", - "/api/v1/configmaps", - "/api/v1/endpoints", - "/api/v1/events", - "/api/v1/limitranges", - "/api/v1/namespaces", - "/api/v1/namespaces/{namespace}/bindings", - "/api/v1/namespaces/{namespace}/configmaps", - "/api/v1/namespaces/{namespace}/configmaps/{name}", - "/api/v1/namespaces/{namespace}/endpoints", - "/api/v1/namespaces/{namespace}/endpoints/{name}", - "/api/v1/namespaces/{namespace}/events", - "/api/v1/namespaces/{namespace}/events/{name}", - "/api/v1/namespaces/{namespace}/limitranges", - "/api/v1/namespaces/{namespace}/limitranges/{name}", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status", - "/api/v1/namespaces/{namespace}/pods", - "/api/v1/namespaces/{namespace}/pods/{name}", - "/api/v1/namespaces/{namespace}/pods/{name}/attach", - "/api/v1/namespaces/{namespace}/pods/{name}/binding", - "/api/v1/namespaces/{namespace}/pods/{name}/eviction", - "/api/v1/namespaces/{namespace}/pods/{name}/exec", - "/api/v1/namespaces/{namespace}/pods/{name}/log", - "/api/v1/namespaces/{namespace}/pods/{name}/portforward", - "/api/v1/namespaces/{namespace}/pods/{name}/proxy", - "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}", - "/api/v1/namespaces/{namespace}/pods/{name}/status", - "/api/v1/namespaces/{namespace}/podtemplates", - "/api/v1/namespaces/{namespace}/podtemplates/{name}", - "/api/v1/namespaces/{namespace}/replicationcontrollers", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status", - "/api/v1/namespaces/{namespace}/resourcequotas", - "/api/v1/namespaces/{namespace}/resourcequotas/{name}", - "/api/v1/namespaces/{namespace}/resourcequotas/{name}/status", - "/api/v1/namespaces/{namespace}/secrets", - "/api/v1/namespaces/{namespace}/secrets/{name}", - "/api/v1/namespaces/{namespace}/serviceaccounts", - "/api/v1/namespaces/{namespace}/serviceaccounts/{name}", - "/api/v1/namespaces/{namespace}/services", - "/api/v1/namespaces/{namespace}/services/{name}", - "/api/v1/namespaces/{namespace}/services/{name}/proxy", - "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}", - "/api/v1/namespaces/{namespace}/services/{name}/status", - "/api/v1/namespaces/{namespace}", - "/api/v1/namespaces/{namespace}/finalize", - "/api/v1/namespaces/{namespace}/status", - "/api/v1/nodes", - "/api/v1/nodes/{name}", - "/api/v1/nodes/{name}/proxy", - "/api/v1/nodes/{name}/proxy/{path}", - "/api/v1/nodes/{name}/status", - "/api/v1/persistentvolumeclaims", - "/api/v1/persistentvolumes", - "/api/v1/persistentvolumes/{name}", - "/api/v1/persistentvolumes/{name}/status", - "/api/v1/pods", - "/api/v1/podtemplates", - "/api/v1/proxy/namespaces/{namespace}/pods/{name}", - "/api/v1/proxy/namespaces/{namespace}/pods/{name}/{path}", - "/api/v1/proxy/namespaces/{namespace}/services/{name}", - "/api/v1/proxy/namespaces/{namespace}/services/{name}/{path}", - "/api/v1/proxy/nodes/{name}", - "/api/v1/proxy/nodes/{name}/{path}", - "/api/v1/replicationcontrollers", - "/api/v1/resourcequotas", - "/api/v1/secrets", - "/api/v1/serviceaccounts", - "/api/v1/services", - "/api/v1/watch/configmaps", - "/api/v1/watch/endpoints", - "/api/v1/watch/events", - "/api/v1/watch/limitranges", - "/api/v1/watch/namespaces", - "/api/v1/watch/namespaces/{namespace}/configmaps", - "/api/v1/watch/namespaces/{namespace}/configmaps/{name}", - "/api/v1/watch/namespaces/{namespace}/endpoints", - "/api/v1/watch/namespaces/{namespace}/endpoints/{name}", - "/api/v1/watch/namespaces/{namespace}/events", - "/api/v1/watch/namespaces/{namespace}/events/{name}", - "/api/v1/watch/namespaces/{namespace}/limitranges", - "/api/v1/watch/namespaces/{namespace}/limitranges/{name}", - "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims", - "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}", - "/api/v1/watch/namespaces/{namespace}/pods", - "/api/v1/watch/namespaces/{namespace}/pods/{name}", - "/api/v1/watch/namespaces/{namespace}/podtemplates", - "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}", - "/api/v1/watch/namespaces/{namespace}/replicationcontrollers", - "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}", - "/api/v1/watch/namespaces/{namespace}/resourcequotas", - "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}", - "/api/v1/watch/namespaces/{namespace}/secrets", - "/api/v1/watch/namespaces/{namespace}/secrets/{name}", - "/api/v1/watch/namespaces/{namespace}/serviceaccounts", - "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}", - "/api/v1/watch/namespaces/{namespace}/services", - "/api/v1/watch/namespaces/{namespace}/services/{name}", - "/api/v1/watch/namespaces/{namespace}", - "/api/v1/watch/nodes", - "/api/v1/watch/nodes/{name}", - "/api/v1/watch/persistentvolumeclaims", - "/api/v1/watch/persistentvolumes", - "/api/v1/watch/persistentvolumes/{name}", - "/api/v1/watch/pods", - "/api/v1/watch/podtemplates", - "/api/v1/watch/replicationcontrollers", - "/api/v1/watch/resourcequotas", - "/api/v1/watch/secrets", - "/api/v1/watch/serviceaccounts", - "/api/v1/watch/services", - "/apis/", - "/apis/apps/", - "/apis/apps/v1beta1/", - "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets", - "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}", - "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status", - "/apis/apps/v1beta1/statefulsets", - "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets", - "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}", - "/apis/apps/v1beta1/watch/statefulsets", - "/apis/authentication.k8s.io/", - "/apis/authentication.k8s.io/v1beta1/", - "/apis/authentication.k8s.io/v1beta1/tokenreviews", - "/apis/authorization.k8s.io/", - "/apis/authorization.k8s.io/v1beta1/", - "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews", - "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews", - "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews", - "/apis/autoscaling/", - "/apis/autoscaling/v1/", - "/apis/autoscaling/v1/horizontalpodautoscalers", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", - "/apis/autoscaling/v1/watch/horizontalpodautoscalers", - "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/batch/", - "/apis/batch/v1/", - "/apis/batch/v1/jobs", - "/apis/batch/v1/namespaces/{namespace}/jobs", - "/apis/batch/v1/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status", - "/apis/batch/v1/watch/jobs", - "/apis/batch/v1/watch/namespaces/{namespace}/jobs", - "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v2alpha1/", - "/apis/batch/v2alpha1/cronjobs", - "/apis/batch/v2alpha1/jobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}", - "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status", - "/apis/batch/v2alpha1/namespaces/{namespace}/jobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}/status", - "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}", - "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}/status", - "/apis/batch/v2alpha1/scheduledjobs", - "/apis/batch/v2alpha1/watch/cronjobs", - "/apis/batch/v2alpha1/watch/jobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs/{name}", - "/apis/batch/v2alpha1/watch/scheduledjobs", - "/apis/certificates.k8s.io/", - "/apis/certificates.k8s.io/v1alpha1/", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/approval", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/status", - "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests", - "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests/{name}", - "/apis/extensions/", - "/apis/extensions/v1beta1/", - "/apis/extensions/v1beta1/daemonsets", - "/apis/extensions/v1beta1/deployments", - "/apis/extensions/v1beta1/horizontalpodautoscalers", - "/apis/extensions/v1beta1/ingresses", - "/apis/extensions/v1beta1/jobs", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies", - "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale", - "/apis/extensions/v1beta1/networkpolicies", - "/apis/extensions/v1beta1/replicasets", - "/apis/extensions/v1beta1/thirdpartyresources", - "/apis/extensions/v1beta1/thirdpartyresources/{name}", - "/apis/extensions/v1beta1/watch/daemonsets", - "/apis/extensions/v1beta1/watch/deployments", - "/apis/extensions/v1beta1/watch/horizontalpodautoscalers", - "/apis/extensions/v1beta1/watch/ingresses", - "/apis/extensions/v1beta1/watch/jobs", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}", - "/apis/extensions/v1beta1/watch/networkpolicies", - "/apis/extensions/v1beta1/watch/replicasets", - "/apis/extensions/v1beta1/watch/thirdpartyresources", - "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}", - "/apis/policy/", - "/apis/policy/v1beta1/", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status", - "/apis/policy/v1beta1/poddisruptionbudgets", - "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets", - "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}", - "/apis/policy/v1beta1/watch/poddisruptionbudgets", - "/apis/rbac.authorization.k8s.io/", - "/apis/rbac.authorization.k8s.io/v1alpha1/", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/roles", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles", - "/apis/storage.k8s.io/", - "/apis/storage.k8s.io/v1beta1/", - "/apis/storage.k8s.io/v1beta1/storageclasses", - "/apis/storage.k8s.io/v1beta1/storageclasses/{name}", - "/apis/storage.k8s.io/v1beta1/watch/storageclasses", - "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}", - "/logs/", - "/logs/{logpath}", - "/version/", - "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/{name}", - "/apis/metrics.k8s.io/v1beta1/pods", - "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/", - "/apis/metrics.k8s.io/v1beta1/nodes", - "/apis/metrics.k8s.io/v1beta1/nodes/{name}", -} diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v18.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v18.go deleted file mode 100644 index ac4cc4d370..0000000000 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/versions/metaurls_v18.go +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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 versions - -// apiSetV18 defines the api urls of kubernetes v1.18 version. We define these urls -// to check url specifications and create the client for kubernetes. All urls of kubernetes -// are defined, users don't need to care about the details. -// These urls contain the following resources: -// - componentstatuses -// - configmaps -// - endpoints -// - secrets -// - services -// - events -// - limitranges -// - namespaces -// - bindings -// - pv/pvcs -// - pods -// - replicationcontrollers -// - and so on. -// The k8s driver will return the urls under control to handle request. These apis map all the -// original apis and are used to verify the user's api request. It is adapted to different -// versions of k8s, and users do not need to pay attention to details. -// And bcs-k8s-driver is deprecated. We add this comment because the code scanning tool checks out -// that the comment rate should not be lower than 10%. That's why we added some comments to avoid this error. -// But because this component has been deprecated, the addition here does not make much sense. -// If the user sees it, it can be ignored -var apiSetV18 = []string{ - "/api/v1/", - "/api/v1/componentstatuses", - "/api/v1/componentstatuses/{name}", - "/api/v1/configmaps", - "/api/v1/endpoints", - "/api/v1/events", - "/api/v1/limitranges", - "/api/v1/namespaces", - "/api/v1/namespaces/{namespace}/bindings", - "/api/v1/namespaces/{namespace}/configmaps", - "/api/v1/namespaces/{namespace}/configmaps/{name}", - "/api/v1/namespaces/{namespace}/endpoints", - "/api/v1/namespaces/{namespace}/endpoints/{name}", - "/api/v1/namespaces/{namespace}/events", - "/api/v1/namespaces/{namespace}/events/{name}", - "/api/v1/namespaces/{namespace}/limitranges", - "/api/v1/namespaces/{namespace}/limitranges/{name}", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}", - "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status", - "/api/v1/namespaces/{namespace}/pods", - "/api/v1/namespaces/{namespace}/pods/{name}", - "/api/v1/namespaces/{namespace}/pods/{name}/attach", - "/api/v1/namespaces/{namespace}/pods/{name}/binding", - "/api/v1/namespaces/{namespace}/pods/{name}/eviction", - "/api/v1/namespaces/{namespace}/pods/{name}/exec", - "/api/v1/namespaces/{namespace}/pods/{name}/log", - "/api/v1/namespaces/{namespace}/pods/{name}/portforward", - "/api/v1/namespaces/{namespace}/pods/{name}/proxy", - "/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}", - "/api/v1/namespaces/{namespace}/pods/{name}/status", - "/api/v1/namespaces/{namespace}/podtemplates", - "/api/v1/namespaces/{namespace}/podtemplates/{name}", - "/api/v1/namespaces/{namespace}/replicationcontrollers", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale", - "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status", - "/api/v1/namespaces/{namespace}/resourcequotas", - "/api/v1/namespaces/{namespace}/resourcequotas/{name}", - "/api/v1/namespaces/{namespace}/resourcequotas/{name}/status", - "/api/v1/namespaces/{namespace}/secrets", - "/api/v1/namespaces/{namespace}/secrets/{name}", - "/api/v1/namespaces/{namespace}/serviceaccounts", - "/api/v1/namespaces/{namespace}/serviceaccounts/{name}", - "/api/v1/namespaces/{namespace}/services", - "/api/v1/namespaces/{namespace}/services/{name}", - "/api/v1/namespaces/{namespace}/services/{name}/proxy", - "/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}", - "/api/v1/namespaces/{namespace}/services/{name}/status", - "/api/v1/namespaces/{namespace}", - "/api/v1/namespaces/{namespace}/finalize", - "/api/v1/namespaces/{namespace}/status", - "/api/v1/nodes", - "/api/v1/nodes/{name}", - "/api/v1/nodes/{name}/proxy", - "/api/v1/nodes/{name}/proxy/{path}", - "/api/v1/nodes/{name}/status", - "/api/v1/persistentvolumeclaims", - "/api/v1/persistentvolumes", - "/api/v1/persistentvolumes/{name}", - "/api/v1/persistentvolumes/{name}/status", - "/api/v1/pods", - "/api/v1/podtemplates", - "/api/v1/proxy/namespaces/{namespace}/pods/{name}", - "/api/v1/proxy/namespaces/{namespace}/pods/{name}/{path}", - "/api/v1/proxy/namespaces/{namespace}/services/{name}", - "/api/v1/proxy/namespaces/{namespace}/services/{name}/{path}", - "/api/v1/proxy/nodes/{name}", - "/api/v1/proxy/nodes/{name}/{path}", - "/api/v1/replicationcontrollers", - "/api/v1/resourcequotas", - "/api/v1/secrets", - "/api/v1/serviceaccounts", - "/api/v1/services", - "/api/v1/watch/configmaps", - "/api/v1/watch/endpoints", - "/api/v1/watch/events", - "/api/v1/watch/limitranges", - "/api/v1/watch/namespaces", - "/api/v1/watch/namespaces/{namespace}/configmaps", - "/api/v1/watch/namespaces/{namespace}/configmaps/{name}", - "/api/v1/watch/namespaces/{namespace}/endpoints", - "/api/v1/watch/namespaces/{namespace}/endpoints/{name}", - "/api/v1/watch/namespaces/{namespace}/events", - "/api/v1/watch/namespaces/{namespace}/events/{name}", - "/api/v1/watch/namespaces/{namespace}/limitranges", - "/api/v1/watch/namespaces/{namespace}/limitranges/{name}", - "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims", - "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}", - "/api/v1/watch/namespaces/{namespace}/pods", - "/api/v1/watch/namespaces/{namespace}/pods/{name}", - "/api/v1/watch/namespaces/{namespace}/podtemplates", - "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}", - "/api/v1/watch/namespaces/{namespace}/replicationcontrollers", - "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}", - "/api/v1/watch/namespaces/{namespace}/resourcequotas", - "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}", - "/api/v1/watch/namespaces/{namespace}/secrets", - "/api/v1/watch/namespaces/{namespace}/secrets/{name}", - "/api/v1/watch/namespaces/{namespace}/serviceaccounts", - "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}", - "/api/v1/watch/namespaces/{namespace}/services", - "/api/v1/watch/namespaces/{namespace}/services/{name}", - "/api/v1/watch/namespaces/{namespace}", - "/api/v1/watch/nodes", - "/api/v1/watch/nodes/{name}", - "/api/v1/watch/persistentvolumeclaims", - "/api/v1/watch/persistentvolumes", - "/api/v1/watch/persistentvolumes/{name}", - "/api/v1/watch/pods", - "/api/v1/watch/podtemplates", - "/api/v1/watch/replicationcontrollers", - "/api/v1/watch/resourcequotas", - "/api/v1/watch/secrets", - "/api/v1/watch/serviceaccounts", - "/api/v1/watch/services", - "/apis/apps/v1beta1/", - "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets", - "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}", - "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status", - "/apis/apps/v1beta1/statefulsets", - "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets", - "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}", - "/apis/apps/v1beta1/watch/statefulsets", - "/apis/authentication.k8s.io/v1beta1/", - "/apis/authentication.k8s.io/v1beta1/tokenreviews", - "/apis/authorization.k8s.io/v1beta1/", - "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews", - "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews", - "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews", - "/apis/autoscaling/v1/", - "/apis/autoscaling/v1/horizontalpodautoscalers", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", - "/apis/autoscaling/v1/watch/horizontalpodautoscalers", - "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/batch/v1/", - "/apis/batch/v1/jobs", - "/apis/batch/v1/namespaces/{namespace}/jobs", - "/apis/batch/v1/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status", - "/apis/batch/v1/watch/jobs", - "/apis/batch/v1/watch/namespaces/{namespace}/jobs", - "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v2alpha1/", - "/apis/batch/v2alpha1/cronjobs", - "/apis/batch/v2alpha1/jobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}", - "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status", - "/apis/batch/v2alpha1/namespaces/{namespace}/jobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v2alpha1/namespaces/{namespace}/jobs/{name}/status", - "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs", - "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}", - "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}/status", - "/apis/batch/v2alpha1/scheduledjobs", - "/apis/batch/v2alpha1/watch/cronjobs", - "/apis/batch/v2alpha1/watch/jobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs", - "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs/{name}", - "/apis/batch/v2alpha1/watch/scheduledjobs", - "/apis/certificates.k8s.io/v1alpha1/", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/approval", - "/apis/certificates.k8s.io/v1alpha1/certificatesigningrequests/{name}/status", - "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests", - "/apis/certificates.k8s.io/v1alpha1/watch/certificatesigningrequests/{name}", - "/apis/extensions/v1beta1/", - "/apis/extensions/v1beta1/daemonsets", - "/apis/extensions/v1beta1/deployments", - "/apis/extensions/v1beta1/horizontalpodautoscalers", - "/apis/extensions/v1beta1/ingresses", - "/apis/extensions/v1beta1/jobs", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale", - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/jobs/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies", - "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status", - "/apis/extensions/v1beta1/namespaces/{namespace}/replicationcontrollers/{name}/scale", - "/apis/extensions/v1beta1/networkpolicies", - "/apis/extensions/v1beta1/replicasets", - "/apis/extensions/v1beta1/thirdpartyresources", - "/apis/extensions/v1beta1/thirdpartyresources/{name}", - "/apis/extensions/v1beta1/watch/daemonsets", - "/apis/extensions/v1beta1/watch/deployments", - "/apis/extensions/v1beta1/watch/horizontalpodautoscalers", - "/apis/extensions/v1beta1/watch/ingresses", - "/apis/extensions/v1beta1/watch/jobs", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/jobs/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets", - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}", - "/apis/extensions/v1beta1/watch/networkpolicies", - "/apis/extensions/v1beta1/watch/replicasets", - "/apis/extensions/v1beta1/watch/thirdpartyresources", - "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}", - "/apis/policy/v1beta1/", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}", - "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status", - "/apis/policy/v1beta1/poddisruptionbudgets", - "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets", - "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}", - "/apis/policy/v1beta1/watch/poddisruptionbudgets", - "/apis/rbac.authorization.k8s.io/v1alpha1/", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles", - "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles", - "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/roles", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings", - "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles", - "/apis/storage.k8s.io/v1beta1/", - "/apis/storage.k8s.io/v1beta1/storageclasses", - "/apis/storage.k8s.io/v1beta1/storageclasses/{name}", - "/apis/storage.k8s.io/v1beta1/watch/storageclasses", - "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}", - "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/{name}", - "/apis/metrics.k8s.io/v1beta1/pods", - "/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods/", - "/apis/metrics.k8s.io/v1beta1/nodes", - "/apis/metrics.k8s.io/v1beta1/nodes/{name}", -} diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/websocket.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/websocket.go index 6298cc17fa..1b243ab892 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/websocket.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-driver/kubedriver/websocket.go @@ -30,13 +30,13 @@ import ( ) const ( - // Module model name + // Module TODO Module = "BCS-API-Tunnel-Module" - // RegisterToken token header - RegisterToken = "BCS-API-Tunnel-Token" // nolint - // Params tunnel params + // RegisterToken TODO + RegisterToken = "BCS-API-Tunnel-Token" + // Params TODO Params = "BCS-API-Tunnel-Params" - // Cluster cluster params + // Cluster TODO Cluster = "BCS-API-Tunnel-ClusterId" ) @@ -79,7 +79,7 @@ func buildWebsocketToApi(o *options.KubeDriverServerOptions) error { var tlsConfig *tls.Config if o.InsecureSkipVerify { - tlsConfig = &tls.Config{InsecureSkipVerify: true} // nolint + tlsConfig = &tls.Config{InsecureSkipVerify: true} } else { // use bcs cacert pool := x509.NewCertPool() diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-logbeat-sidecar/sidecar/cache.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-logbeat-sidecar/sidecar/cache.go index 01185b7034..0cd15b0350 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-logbeat-sidecar/sidecar/cache.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-logbeat-sidecar/sidecar/cache.go @@ -62,7 +62,6 @@ func (s *SidecarController) syncContainerCacheOnce() { func (s *SidecarController) inspectContainer(ID string) *dockertypes.ContainerJSON { inspectChan := make(chan interface{}, 1) timer := time.NewTimer(3 * time.Second) - // NOCC:vet/vet(工具误报:函数末尾有用到cancelFunc) ctx, cancelFunc := context.WithCancel(context.Background()) go func() { defer close(inspectChan) @@ -81,7 +80,6 @@ func (s *SidecarController) inspectContainer(ID string) *dockertypes.ContainerJS } err, ok := obj.(error) if ok { - // NOCC:vet/vet(设计如此:不需要使用cancelFunc) blog.Errorf("docker InspectContainer %s failed: %s", ID, err.Error()) return nil } diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-logbeat-sidecar/sidecar/controller.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-logbeat-sidecar/sidecar/controller.go index 10e012db52..40d15afd2f 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-logbeat-sidecar/sidecar/controller.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-logbeat-sidecar/sidecar/controller.go @@ -297,7 +297,6 @@ func (s *SidecarController) syncLogConfs() { } podName := c.Config.Labels[ContainerLabelK8sPodName] podNameSpace := c.Config.Labels[ContainerLabelK8sPodNameSpace] - // NOCC:vetshadow/shadow(设计如此:可以覆盖err) pod, err := s.podLister.Pods(podNameSpace).Get(podName) if err != nil { blog.Errorf("list pod(%s/%s) failed: %s", podNameSpace, podName, err.Error()) @@ -588,8 +587,7 @@ func (s *SidecarController) produceLogConfParameterV2(container *dockertypes.Con BCSLogConfigKey: s.getBCSLogConfigKey(logConf), } var ( - stdoutDataid = "" - // NOCC:ineffassign/assign(设计如此:仅初始化赋值为空字符串) + stdoutDataid = "" referenceKind = "" referenceName = "" ) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-logbeat-sidecar/sidecar/logconfop_linux.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-logbeat-sidecar/sidecar/logconfop_linux.go index aed8684159..506e83cd33 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-logbeat-sidecar/sidecar/logconfop_linux.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-logbeat-sidecar/sidecar/logconfop_linux.go @@ -1,7 +1,6 @@ //go:build linux // +build linux -// NOCC:tosa/license(设计如此:需要先包含编译头,已包含Tencent license头) /* * Tencent is pleased to support the open source community by making Blueking Container Service available. * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-mcs/go.mod b/bcs-runtime/bcs-k8s/bcs-component/bcs-mcs/go.mod index 1bd3ca1c53..5a81eb388e 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-mcs/go.mod +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-mcs/go.mod @@ -14,7 +14,6 @@ require ( k8s.io/component-base v0.20.2 k8s.io/klog/v2 v2.4.0 sigs.k8s.io/controller-runtime v0.8.3 - sigs.k8s.io/controller-tools v0.3.0 sigs.k8s.io/mcs-api v0.1.0 ) @@ -31,14 +30,12 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful v2.15.0+incompatible // indirect github.com/evanphx/json-patch v4.9.0+incompatible // indirect - github.com/fatih/color v1.13.0 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/go-logr/logr v0.3.0 // indirect github.com/go-openapi/jsonpointer v0.19.3 // indirect github.com/go-openapi/jsonreference v0.19.3 // indirect github.com/go-openapi/spec v0.19.3 // indirect github.com/go-openapi/swag v0.19.5 // indirect - github.com/gobuffalo/flect v0.2.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect @@ -52,8 +49,6 @@ require ( github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/mailru/easyjson v0.7.0 // indirect - github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect @@ -85,7 +80,6 @@ require ( google.golang.org/protobuf v1.27.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect k8s.io/apiextensions-apiserver v0.20.1 // indirect k8s.io/gengo v0.0.0-20201113003025-83324d819ded // indirect k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd // indirect diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-unified-apiserver/go.mod b/bcs-runtime/bcs-k8s/bcs-component/bcs-unified-apiserver/go.mod index e5a76c6ab1..228b04bac1 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-unified-apiserver/go.mod +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-unified-apiserver/go.mod @@ -5,9 +5,8 @@ go 1.17 require ( github.com/Tencent/bk-bcs/bcs-common v0.0.0-20220123082150-ac3c90791ab4 github.com/clusternet/clusternet v0.9.1 - //NOCC:horus-dependency-security(工具误报:未使用github.com/dgrijalva/jwt-go) + github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/go-resty/resty/v2 v2.7.0 - github.com/golang-jwt/jwt/v4 v4.5.0 github.com/gorilla/mux v1.8.0 github.com/mitchellh/go-homedir v1.1.0 github.com/pkg/errors v0.9.1 @@ -23,32 +22,54 @@ require ( ) require ( + github.com/beorn7/perks v1.0.1 // indirect github.com/bitly/go-simplejson v0.5.0 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/coreos/etcd v3.3.18+incompatible // indirect + github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f // indirect + github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/envoyproxy/protoc-gen-validate v0.6.2 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/go-logr/logr v1.2.1 // indirect + github.com/go-stack/stack v1.8.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/glog v1.0.0 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-cmp v0.5.7 // indirect github.com/google/gofuzz v1.1.0 // indirect + github.com/google/uuid v1.2.0 // indirect github.com/googleapis/gnostic v0.5.5 // indirect + github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/juju/ratelimit v1.0.1 // indirect github.com/magiconair/properties v1.8.6 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/micro/go-micro/v2 v2.9.1 // indirect + github.com/miekg/dns v1.1.41 // indirect + github.com/mitchellh/hashstructure v1.0.0 // indirect github.com/mitchellh/mapstructure v1.4.3 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect + github.com/parnurzeal/gorequest v0.2.16 // indirect github.com/pelletier/go-toml v1.9.4 // indirect github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.11.0 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.28.0 // indirect + github.com/prometheus/procfs v0.6.0 // indirect + github.com/samuel/go-zookeeper v0.0.0-20201211165307-7117e9ea2414 // indirect github.com/spf13/afero v1.8.2 // indirect github.com/spf13/cast v1.4.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/ugorji/go/codec v1.2.3 // indirect + go.mongodb.org/mongo-driver v1.5.3 // indirect go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect @@ -58,6 +79,8 @@ require ( golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac // indirect + google.golang.org/grpc v1.45.0 // indirect google.golang.org/protobuf v1.28.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.66.4 // indirect @@ -65,6 +88,7 @@ require ( k8s.io/klog/v2 v2.30.0 // indirect k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect + moul.io/http2curl v1.0.0 // indirect sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect sigs.k8s.io/yaml v1.3.0 // indirect diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-unified-apiserver/go.sum b/bcs-runtime/bcs-k8s/bcs-component/bcs-unified-apiserver/go.sum index b6d71bda12..80b7e308af 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-unified-apiserver/go.sum +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-unified-apiserver/go.sum @@ -189,6 +189,7 @@ github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZx github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y= @@ -218,8 +219,10 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= @@ -341,20 +344,24 @@ github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkE github.com/coreos/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.18+incompatible h1:Zz1aXgDrFFi1nadh58tA9ktt06cmPTwNNP3dXwIq1lE= github.com/coreos/etcd v3.3.18+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20161114122254-48702e0da86b/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpu/goacmedns v0.0.1/go.mod h1:sesf/pNnCYwUevQEQfEwY0Y3DydlQWSGZbaMElOWxok= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -377,6 +384,7 @@ github.com/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1 github.com/denisenkom/go-mssqldb v0.9.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= @@ -414,6 +422,7 @@ github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFP github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/ef-ds/deque v1.0.4-0.20190904040645-54cb57c252a1/go.mod h1:HvODWzv6Y6kBf3Ah2WzN1bHjDUezGLaAhwuWVwfpEJs= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20210110162100-a92cc753f88e h1:/cwV7t2xezilMljIftb7WlFtzGANRCnoOhPjtl2ifcs= github.com/elazarl/goproxy v0.0.0-20210110162100-a92cc753f88e/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= @@ -423,6 +432,7 @@ github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3 github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.6.2 h1:JiO+kJTpmYGjEodY7O1Zk8oZcNz1+f30UtwtXoFUPzE= github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -510,6 +520,7 @@ github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSM github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM= @@ -566,17 +577,17 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -614,6 +625,7 @@ github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA// github.com/gomodule/redigo v1.8.2/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/cel-go v0.9.0/go.mod h1:U7ayypeSkw23szu4GaQTPJGx66c20mx8JklMSxrmI1w= github.com/google/cel-spec v0.6.0/go.mod h1:Nwjgxy5CbjlPrtCWjeDjUyKMl8w41YBYGjsyDdqk0xA= @@ -661,6 +673,7 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.4/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= @@ -674,6 +687,7 @@ github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9 github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gophercloud/gophercloud v0.3.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= @@ -690,17 +704,21 @@ github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= @@ -791,6 +809,7 @@ github.com/jmoiron/sqlx v1.3.4/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXL github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= @@ -805,7 +824,9 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/juju/ratelimit v1.0.1 h1:+7AIFJVQ0EQgq/K9+0Krm7m530Du7tIz0METWzN0RgY= github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= @@ -900,9 +921,11 @@ github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lL github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= github.com/micro/cli/v2 v2.1.2/go.mod h1:EguNh6DAoWKm9nmk+k/Rg0H3lQnDxqzu5x5srOtGtYg= +github.com/micro/go-micro/v2 v2.9.1 h1:+S9koIrNWARjpP6k2TZ7kt0uC9zUJtNXzIdZTZRms7Q= github.com/micro/go-micro/v2 v2.9.1/go.mod h1:x55ZM3Puy0FyvvkR3e0ha0xsE9DFwfPSUMWAIbFY0SY= github.com/micro/go-plugins/broker/rabbitmq/v2 v2.9.1/go.mod h1:HVSLIB7iIe7mw/yvzg65F+2qV57mkcMpWeTo0jdtZFA= github.com/micro/go-plugins/broker/stan/v2 v2.9.1/go.mod h1:iICNUhRSrwM0+E984DywhyfOqITjqNHv/xewnXE5g28= @@ -910,6 +933,7 @@ github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3N github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.27/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= +github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= @@ -925,6 +949,7 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed/go.mod h1:3rdaFaCv4AyBgu5ALFM0+tSuHrBh6v692nyQe3ikrq0= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -1065,6 +1090,7 @@ github.com/oracle/oci-go-sdk v7.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukw github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014/go.mod h1:joRatxRJaZBsY3JAOEMcoOp05CnZzsx4scTxi95DHyQ= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/parnurzeal/gorequest v0.2.16 h1:T/5x+/4BT+nj+3eSknXmCTnEVGSzFzPGdpqmUVVZXHQ= github.com/parnurzeal/gorequest v0.2.16/go.mod h1:3Kh2QUMJoqw3icWAecsyzkpY7UzRfDhbRdTjtNwNiUE= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -1108,6 +1134,7 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= +github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -1115,6 +1142,7 @@ github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1: github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= @@ -1128,6 +1156,7 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.28.0 h1:vGVfV9KrDTvWt5boZO0I19g2E3CsWfpPPKZM9dt3mEw= github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1141,6 +1170,7 @@ github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDa github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rabbitmq/amqp091-go v1.1.0/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM= @@ -1165,6 +1195,7 @@ github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiB github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= github.com/sagikazarmark/crypt v0.5.0/go.mod h1:l+nzl7KWh51rpzp2h7t4MZWyiEWdhNpOAnclKvg+mdA= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/samuel/go-zookeeper v0.0.0-20201211165307-7117e9ea2414 h1:AJNDS0kP60X8wwWFvbLPwDuojxubj9pbfK7pjHw0vKg= github.com/samuel/go-zookeeper v0.0.0-20201211165307-7117e9ea2414/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= @@ -1181,12 +1212,16 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -1250,11 +1285,13 @@ github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog= +github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7/go.mod h1:imsgLplxEC/etjIhdr3dNzV3JeT27LbVu5pYWm0JCBY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/transip/gotransip v0.0.0-20190812104329-6d8d9179b66f/go.mod h1:i0f4R4o2HM0m3DZYQWsj6/MEowD57VzoH0v3d7igeFY= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= @@ -1289,6 +1326,7 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1: github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= @@ -1305,6 +1343,7 @@ github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= @@ -1323,6 +1362,7 @@ go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lL go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= +go.mongodb.org/mongo-driver v1.5.3 h1:wWbFB6zaGHpzguF3f7tW94sVE8sFl3lHx8OZx/4OuFI= go.mongodb.org/mongo-driver v1.5.3/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw= go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1415,6 +1455,7 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210920023735-84f357641f63/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1563,6 +1604,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180622082034-63fc586f45fe/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1941,7 +1983,9 @@ google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2 google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac h1:qSNTkEN+L2mvWcLgJOR+8bdHX9rN/IdU3A1Ghpfb1Rg= google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -2089,6 +2133,7 @@ k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20211116205334-6203023598ed h1:ck1fRPWPJWsMd8ZRFsWc6mh/zHp5fZ/shhbrgPUxDAE= k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +moul.io/http2curl v1.0.0 h1:6XwpyZOYsgZJrU8exnG87ncVkU1FVCcTRpwzOkTDUi8= moul.io/http2curl v1.0.0/go.mod h1:f6cULg+e4Md/oW1cYmwW4IWQOVl2lGbmCNGOHvzX2kE= oras.land/oras-go v1.1.0/go.mod h1:1A7vR/0KknT2UkJVWh+xMi95I/AhK8ZrxrnUSmXN0bQ= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-unified-apiserver/pkg/config/bcs.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-unified-apiserver/pkg/config/bcs.go index 24808bf78b..48148238e3 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-unified-apiserver/pkg/config/bcs.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-unified-apiserver/pkg/config/bcs.go @@ -16,7 +16,7 @@ package config import ( "crypto/rsa" - "github.com/golang-jwt/jwt/v4" + "github.com/dgrijalva/jwt-go" ) // BCSClusterEnv xxx diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-unified-apiserver/pkg/rest/apis/pod.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-unified-apiserver/pkg/rest/apis/pod.go index 77c1ebf6da..5cc3977f9d 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-unified-apiserver/pkg/rest/apis/pod.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-unified-apiserver/pkg/rest/apis/pod.go @@ -75,7 +75,6 @@ func (h *PodHandler) Serve(c *rest.RequestContext) error { case rest.DeleteVerb: obj, err = h.handler.Delete(ctx, c.Namespace, c.Name, *c.Options.DeleteOptions) case rest.GetLogsVerb: // 处理 Pod 日志流 - // NOCC:vetshadow/shadow(设计如此:需要初始化restReq并且err可以被覆盖) restReq, err := h.handler.GetLogs(ctx, c.Namespace, c.Name, c.Options.PodLogOptions) if err != nil { return err @@ -90,7 +89,6 @@ func (h *PodHandler) Serve(c *rest.RequestContext) error { return nil case rest.WatchVerb: // watch 需要特殊处理 chunk - // NOCC:vetshadow/shadow(设计如此:需要初始化watch并且err可以被覆盖) watch, err := h.handler.Watch(ctx, c.Namespace, *c.Options.ListOptions) if err != nil { return err @@ -107,7 +105,6 @@ func (h *PodHandler) Serve(c *rest.RequestContext) error { return nil case rest.ExecVerb: // remotecommand 直接使用透明代理 - // NOCC:vetshadow/shadow(设计如此:需要初始化proxy并且err可以被覆盖) proxy, err := h.handler.Exec(ctx, c.Namespace, c.Name, *c.Options.GetOptions) if err != nil { return err diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/cmd/server.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/cmd/server.go index 7caac17d85..88db536779 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/cmd/server.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/cmd/server.go @@ -15,10 +15,8 @@ package main import ( "fmt" - "math/rand" "os" "runtime" - "time" "github.com/Tencent/bk-bcs/bcs-common/common/blog" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/server" @@ -27,7 +25,6 @@ import ( func main() { runtime.GOMAXPROCS(runtime.NumCPU()) - rand.Seed(time.Now().UnixNano()) // create option object op := options.NewServerOption() diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/metrics/mtrics.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/metrics/mtrics.go index 2c776b2763..6b01cab495 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/metrics/mtrics.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/metrics/mtrics.go @@ -67,7 +67,6 @@ func ReportBcsWebhookServerAPIMetrics(handler, method, status string, started ti requestLatencyAPI.WithLabelValues(handler, method, status).Observe(time.Since(started).Seconds()) } -// NOCC:tosa/fn_length(设计如此) // ReportBcsWebhookServerPluginLantency report call plugin lantency func ReportBcsWebhookServerPluginLantency(pluginName, status string, started time.Time) { pluginLatency.WithLabelValues(pluginName, status).Observe(time.Since(started).Seconds()) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/bscp/bscp.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/bscp/bscp.go index c15a3e0b3c..fdcb12c061 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/bscp/bscp.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/bscp/bscp.go @@ -182,8 +182,7 @@ func (h *Hooker) retrieveEnvFromPod(pod *corev1.Pod) (map[string]string, []types if len(cfgPath) == 0 { return nil, nil, fmt.Errorf("bscp SideCar environment BSCP_BCSSIDECAR_APPCFG_PATH is empty") } - modValue, ok := envMap[SideCarMod] - if !ok { + if modValue, ok := envMap[SideCarMod]; !ok { // for single app if !ValidateEnvs(envMap) { return nil, nil, fmt.Errorf("bscp sidecar envs are invalid") @@ -191,11 +190,11 @@ func (h *Hooker) retrieveEnvFromPod(pod *corev1.Pod) (map[string]string, []types } else { // for multiple app // if BSCP_BCSSIDECAR_APPINFO_MOD's value is invlaid, cannot do inject - newModValue, err := AddPathIntoAppInfoMode(modValue, cfgPath) + modValue, err := AddPathIntoAppInfoMode(modValue, cfgPath) if err != nil { - return nil, nil, fmt.Errorf("env %s:%s is invalid", SideCarMod, newModValue) + return nil, nil, fmt.Errorf("env %s:%s is invalid", SideCarMod, modValue) } - envMap[SideCarMod] = newModValue + envMap[SideCarMod] = modValue } return envMap, patches, nil diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/bscp/bscpmesos.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/bscp/bscpmesos.go index 20783e7769..e10957f147 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/bscp/bscpmesos.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/bscp/bscpmesos.go @@ -170,8 +170,7 @@ func (bi *MesosInject) retrieveEnvFromContainer(containers []commtypes.Container if len(cfgPath) == 0 { return nil, nil, fmt.Errorf("bscp SideCar environment BSCP_BCSSIDECAR_APPCFG_PATH is empty") } - modValue, ok := envMap[SideCarMod] - if !ok { + if modValue, ok := envMap[SideCarMod]; !ok { // for single app if !ValidateEnvs(envMap) { return nil, nil, fmt.Errorf("bscp SideCar envs are invalid") @@ -179,11 +178,11 @@ func (bi *MesosInject) retrieveEnvFromContainer(containers []commtypes.Container } else { // for multiple app, inject BSCP_BCSSIDECAR_APPCFG_PATH into every app path // if BSCP_BCSSideCar_APPINFO_MOD's value is invlaid, cannot do inject; - newModValue, err := AddPathIntoAppInfoMode(modValue, cfgPath) + modValue, err := AddPathIntoAppInfoMode(modValue, cfgPath) if err != nil { - return nil, nil, fmt.Errorf("env %s:%s is invalid", SideCarMod, newModValue) + return nil, nil, fmt.Errorf("env %s:%s is invalid", SideCarMod, modValue) } - envMap[SideCarMod] = newModValue + envMap[SideCarMod] = modValue } return retContainers, envMap, nil } diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/dbprivilege/types.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/dbprivilege/types.go index fccc3eb062..af2f4d91b0 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/dbprivilege/types.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/dbprivilege/types.go @@ -20,5 +20,5 @@ const ( // NetworkTypeUnderlay underlay network NetworkTypeUnderlay = "underlay" // DbPrivilegeSecretName the name of secret to store db privilege info - DbPrivilegeSecretName = "bcs-db-privilege" // NOCC:gas/crypto(存量代码) + DbPrivilegeSecretName = "bcs-db-privilege" ) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/filterclb/filterclb.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/filterclb/filterclb.go index 6cea7a0fe9..644e4178f2 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/filterclb/filterclb.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/filterclb/filterclb.go @@ -53,8 +53,6 @@ const ( ingressClassQcloud = "qcloud" l7LbControllerName = "l7-lb-controller" - - constStringTrue = "true" ) var ( @@ -168,7 +166,7 @@ func (h *Handler) Handle(review v1beta1.AdmissionReview) *v1beta1.AdmissionRespo if h.DenyIngress(ingress) { blog.Infof("filterclb: %s %s/%s deny ingress", req.Operation, req.Namespace, req.Name) metrics.ReportBcsWebhookServerPluginLantency(pluginName, metrics.StatusFailure, started) - return pluginutil.ToAdmissionResponse(fmt.Errorf("ingress %s/%s is not allowed to create, It is forbidden to directly create external network clb", req.Namespace, req.Name)) + return pluginutil.ToAdmissionResponse(fmt.Errorf("service %s/%s is not allowed to create, It is forbidden to directly create external network clb", req.Namespace, req.Name)) } // pass @@ -182,7 +180,8 @@ func (h *Handler) Handle(review v1beta1.AdmissionReview) *v1beta1.AdmissionRespo // DenyService deny the service func (h *Handler) DenyService(svc *corev1.Service) bool { - if svc.Annotations[annotationSkipDenyFilterCLB] == constStringTrue { + fmt.Println(svc.Annotations) + if svc.Annotations[annotationSkipDenyFilterCLB] == "true" { return false } if svc.Spec.Type != corev1.ServiceTypeLoadBalancer { @@ -199,7 +198,7 @@ func (h *Handler) DenyService(svc *corev1.Service) bool { // DenyIngress deny the ingress func (h *Handler) DenyIngress(ingress *v1.Ingress) bool { - if ingress.Annotations[annotationSkipDenyFilterCLB] == constStringTrue { + if ingress.Annotations[annotationSkipDenyFilterCLB] == "true" { return false } if ingress.Annotations[annotationIngressSubnetID] != "" { @@ -228,7 +227,7 @@ func (h *Handler) DenyIngress(ingress *v1.Ingress) bool { //默认的是非qcloud,不需要拦截 for _, ingressClass := range ingressClassList.Items { // 也许可能存在多个默认,但是就必须指定ingressClassName了(k8s设定) - if ingressClass.Annotations[annotationIngressClassDefaultKey] == constStringTrue && ingressClass.Name != ingressClassQcloud { + if ingressClass.Annotations[annotationIngressClassDefaultKey] == "true" && ingressClass.Name != ingressClassQcloud { return false } } diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/imageacceleration/types.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/imageacceleration/types.go index dbfa5ff8f9..dbc343950b 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/imageacceleration/types.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/imageacceleration/types.go @@ -23,7 +23,7 @@ const ( // configMapName defines the name of configmap that can enable image acceleration configMapName = "bcs-image-acceleration" // secretImagePullItem defines the image pull data of secret - secretImagePullItem = ".dockerconfigjson" // // NOCC:gas/crypto(设计如此) + secretImagePullItem = ".dockerconfigjson" // configMapKeyEnabled key of configmap, namespace will enable image acceleration if value is "true" configMapKeyEnabled = "enabled" diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/randhostport/cache_test.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/randhostport/cache_test.go index ca87667899..6729b39ad3 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/randhostport/cache_test.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/randhostport/cache_test.go @@ -60,32 +60,32 @@ func TestPortHeap(t *testing.T) { func TestPortCache(t *testing.T) { pc := NewPortCache() portEntryList := []*PortEntry{ - { + &PortEntry{ Port: 10000, Quantity: 100, }, - { + &PortEntry{ Port: 10001, Quantity: 99, }, - { + &PortEntry{ Port: 10002, Quantity: 120, }, } orderedList := []*PortEntry{ - { + &PortEntry{ Port: 10001, Quantity: 99, Index: 0, }, - { + &PortEntry{ Port: 10000, Quantity: 100, Index: 1, }, - { + &PortEntry{ Port: 10002, Quantity: 120, Index: 2, diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/randhostport/randhostport.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/randhostport/randhostport.go index 20e3974d37..260d8607eb 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/randhostport/randhostport.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/randhostport/randhostport.go @@ -17,7 +17,6 @@ import ( "encoding/json" "fmt" "io/ioutil" - "math/rand" "strconv" "time" @@ -46,10 +45,9 @@ func init() { // HostPortInjectorConfig config of host port injector type HostPortInjectorConfig struct { - StartPort uint64 `json:"startPort"` - EndPort uint64 `json:"endPort"` - EnableOrderAssign bool `json:"enableOrderAssign"` - Kubeconfig string `json:"kubeconfig"` + StartPort uint64 `json:"startPort"` + EndPort uint64 `json:"endPort"` + Kubeconfig string `json:"kubeconfig"` } // HostPortInjector host port injector @@ -61,8 +59,6 @@ type HostPortInjector struct { podLister corev1lister.PodLister portCache *PortCache - - nextAssignPort uint64 } // AnnotationKey returns key of the randhostport plugin for hook server to identify @@ -102,35 +98,27 @@ func (hpi *HostPortInjector) Init(configFilePath string) error { } } - if !hpi.conf.EnableOrderAssign { - if err = hpi.initCache(); err != nil { - return fmt.Errorf("init cache failed, err %s", err.Error()) - } - } else { - portPeriod := hpi.conf.EndPort - hpi.conf.StartPort - hpi.nextAssignPort = uint64(rand.Int63n(int64(portPeriod)) + int64(hpi.conf.StartPort)) + if err := hpi.initCache(); err != nil { + return fmt.Errorf("init cache failed, err %s", err.Error()) } - blog.Infof("randhostport plugin init cache successfully") - if !hpi.conf.EnableOrderAssign { - k8sClient, err = kubernetes.NewForConfig(restConfig) - if err != nil { - return fmt.Errorf("build kubeClient failed, err %s", err.Error()) - } - hpi.k8sClient = k8sClient - corev1InformerFactory := kubeinformers.NewSharedInformerFactory(hpi.k8sClient, 0) - podInformer := corev1InformerFactory.Core().V1().Pods().Informer() - podLister := corev1InformerFactory.Core().V1().Pods().Lister() - podInformer.AddEventHandler(hpi) - hpi.podLister = podLister - hpi.stopCh = make(chan struct{}) - corev1InformerFactory.Start(hpi.stopCh) - if !cache.WaitForCacheSync(hpi.stopCh, podInformer.HasSynced) { - return fmt.Errorf("pod cache synced failed") - } - } - blog.Infof("randhostport plugin wait k8s informer cache synced successfully") + k8sClient, err = kubernetes.NewForConfig(restConfig) + if err != nil { + return fmt.Errorf("build kubeClient failed, err %s", err.Error()) + } + hpi.k8sClient = k8sClient + corev1InformerFactory := kubeinformers.NewSharedInformerFactory(hpi.k8sClient, 0) + podInformer := corev1InformerFactory.Core().V1().Pods().Informer() + podLister := corev1InformerFactory.Core().V1().Pods().Lister() + podInformer.AddEventHandler(hpi) + hpi.podLister = podLister + hpi.stopCh = make(chan struct{}) + corev1InformerFactory.Start(hpi.stopCh) + if !cache.WaitForCacheSync(hpi.stopCh, podInformer.HasSynced) { + return fmt.Errorf("pod cache synced failed") + } + blog.Infof("randhostport plugin wait k8s informer cache synced successfullly") return nil } @@ -251,27 +239,19 @@ func (hpi *HostPortInjector) injectToPod(pod *corev1.Pod) ([]types.PatchOperatio return nil, fmt.Errorf("not all ports %v in annotation match ports in container", portStrs) } + // get rand host port var hostPorts []*PortEntry - if !hpi.conf.EnableOrderAssign { - // get rand host port - hpi.portCache.Lock() - for i := 0; i < needInjectCount; i++ { - portEntry := hpi.portCache.PopPortEntry() - hostPorts = append(hostPorts, portEntry) - } - for _, hostPort := range hostPorts { - hostPort.Quantity = hostPort.Quantity + 1 - hpi.portCache.PushPortEntry(hostPort) - } - hpi.portCache.Unlock() - } else { - // get order host port - for i := 0; i < needInjectCount; i++ { - portEntry := hpi.getOrderPortEntry() - blog.Infof("get order portentry %d for pod %s/%s", portEntry.Port, pod.GetName(), pod.GetNamespace()) - hostPorts = append(hostPorts, portEntry) - } + hpi.portCache.Lock() + for i := 0; i < needInjectCount; i++ { + portEntry := hpi.portCache.PopPortEntry() + hostPorts = append(hostPorts, portEntry) + } + for _, hostPort := range hostPorts { + hostPort.Quantity = hostPort.Quantity + 1 + hpi.portCache.PushPortEntry(hostPort) } + hpi.portCache.Unlock() + var retPatches []types.PatchOperation // patch affinity retPatches = append(retPatches, hpi.generateAffinityPath(pod, hostPorts)) @@ -279,12 +259,8 @@ func (hpi *HostPortInjector) injectToPod(pod *corev1.Pod) ([]types.PatchOperatio retPatches = append(retPatches, hpi.generateLabelPatch(pod, hostPorts)) // patch container port hostPortCount := 0 - - // containerPort=>hostPort - hostPortMapping := make(map[uint64]uint64, len(containerPortsIndexList)) for containerIndex, portIndexList := range containerPortsIndexList { for _, portIndex := range portIndexList { - containerPort := pod.Spec.Containers[containerIndex].Ports[portIndex].ContainerPort // inject hostport into container port retPatches = append(retPatches, types.PatchOperation{ Path: fmt.Sprintf(PatchPathContainerHostPort, containerIndex, portIndex), @@ -297,9 +273,6 @@ func (hpi *HostPortInjector) injectToPod(pod *corev1.Pod) ([]types.PatchOperatio Op: PatchOperationAdd, Value: hostPorts[hostPortCount].Port, }) - hostPortMapping[hostPorts[hostPortCount].Port] = uint64(hostPorts[hostPortCount].Port) - } else { - hostPortMapping[uint64(containerPort)] = uint64(hostPorts[hostPortCount].Port) } hostPortCount++ } @@ -315,31 +288,9 @@ func (hpi *HostPortInjector) injectToPod(pod *corev1.Pod) ([]types.PatchOperatio retPatches = append(retPatches, envPatch) } - // inject hostport into pod annotations - retPatches = append(retPatches, hpi.generateAnnotationsPatch(pod, hostPortMapping)) - fmt.Println(retPatches) - return retPatches, nil } -// generateAnnotationsPatch generate patch for pod annotations -func (hpi *HostPortInjector) generateAnnotationsPatch(pod *corev1.Pod, hostPortMapping map[uint64]uint64) types.PatchOperation { - annotations := pod.Annotations - op := PatchOperationReplace - if len(annotations) == 0 { - op = PatchOperationAdd - annotations = make(map[string]string) - } - for containerPort, hostPort := range hostPortMapping { - annotations[fmt.Sprintf(annotationsRandHostportPrefix+"%d", containerPort)] = strconv.FormatUint(hostPort, 10) - } - return types.PatchOperation{ - Path: PatchPathPodAnnotations, - Op: op, - Value: annotations, - } -} - func (hpi *HostPortInjector) generateEnvPatch( patchPath string, index int, envs []corev1.EnvVar, containerPortList []int32, hostPorts []*PortEntry) types.PatchOperation { @@ -497,14 +448,3 @@ func (hpi *HostPortInjector) OnDelete(obj interface{}) { blog.V(5).Infof("descrease portentry %d quantity successfully", portNumber) } } - -func (hpi *HostPortInjector) getOrderPortEntry() *PortEntry { - portEntry := &PortEntry{ - Port: hpi.nextAssignPort, - } - hpi.nextAssignPort++ - if hpi.nextAssignPort > hpi.conf.EndPort { - hpi.nextAssignPort = hpi.conf.StartPort - } - return portEntry -} diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/randhostport/randhostport_test.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/randhostport/randhostport_test.go index eb5a163745..3d9270d727 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/randhostport/randhostport_test.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/randhostport/randhostport_test.go @@ -48,9 +48,9 @@ func TestInjectPod(t *testing.T) { }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ - { + corev1.Container{ Ports: []corev1.ContainerPort{ - { + corev1.ContainerPort{ ContainerPort: 8080, }, }, @@ -59,7 +59,7 @@ func TestInjectPod(t *testing.T) { }, }, PortsList: []*PortEntry{ - { + &PortEntry{ Port: 31000, Quantity: 0, }, @@ -74,26 +74,25 @@ func TestInjectPod(t *testing.T) { "31000" + podHostportLabelSuffix: "31000", }, Annotations: map[string]string{ - pluginAnnotationKey: pluginAnnotationValue, - pluginPortsAnnotationKey: "8080", - annotationsRandHostportPrefix + "8080": "31000", + pluginAnnotationKey: pluginAnnotationValue, + pluginPortsAnnotationKey: "8080", }, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ - { + corev1.Container{ Ports: []corev1.ContainerPort{ - { + corev1.ContainerPort{ ContainerPort: 8080, HostPort: 31000, }, }, Env: []corev1.EnvVar{ - { + corev1.EnvVar{ Name: envRandHostportPrefix + "8080", Value: "31000", }, - { + corev1.EnvVar{ Name: envRandHostportHostIP, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -101,7 +100,7 @@ func TestInjectPod(t *testing.T) { }, }, }, - { + corev1.EnvVar{ Name: envRandHostportPodName, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -109,7 +108,7 @@ func TestInjectPod(t *testing.T) { }, }, }, - { + corev1.EnvVar{ Name: envRandHostportPodNamespace, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -123,7 +122,7 @@ func TestInjectPod(t *testing.T) { Affinity: &corev1.Affinity{ PodAntiAffinity: &corev1.PodAntiAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{ - { + corev1.PodAffinityTerm{ LabelSelector: k8smetav1.SetAsLabelSelector(labels.Set(map[string]string{ "31000" + podHostportLabelSuffix: "31000", })), @@ -153,9 +152,9 @@ func TestInjectPod(t *testing.T) { }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ - { + corev1.Container{ Ports: []corev1.ContainerPort{ - { + corev1.ContainerPort{ ContainerPort: 8080, }, }, @@ -164,7 +163,7 @@ func TestInjectPod(t *testing.T) { }, }, PortsList: []*PortEntry{ - { + &PortEntry{ Port: 31000, Quantity: 0, }, @@ -179,27 +178,26 @@ func TestInjectPod(t *testing.T) { "31000" + podHostportLabelSuffix: "31000", }, Annotations: map[string]string{ - pluginAnnotationKey: pluginAnnotationValue, - pluginPortsAnnotationKey: "8080", - pluginContainerPortsAnnotationKey: pluginAnnotationValue, - annotationsRandHostportPrefix + "31000": "31000", + pluginAnnotationKey: pluginAnnotationValue, + pluginPortsAnnotationKey: "8080", + pluginContainerPortsAnnotationKey: pluginAnnotationValue, }, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ - { + corev1.Container{ Ports: []corev1.ContainerPort{ - { + corev1.ContainerPort{ ContainerPort: 31000, HostPort: 31000, }, }, Env: []corev1.EnvVar{ - { + corev1.EnvVar{ Name: envRandHostportPrefix + "8080", Value: "31000", }, - { + corev1.EnvVar{ Name: envRandHostportHostIP, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -207,7 +205,7 @@ func TestInjectPod(t *testing.T) { }, }, }, - { + corev1.EnvVar{ Name: envRandHostportPodName, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -215,7 +213,7 @@ func TestInjectPod(t *testing.T) { }, }, }, - { + corev1.EnvVar{ Name: envRandHostportPodNamespace, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -229,7 +227,7 @@ func TestInjectPod(t *testing.T) { Affinity: &corev1.Affinity{ PodAntiAffinity: &corev1.PodAntiAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{ - { + corev1.PodAffinityTerm{ LabelSelector: k8smetav1.SetAsLabelSelector(labels.Set(map[string]string{ "31000" + podHostportLabelSuffix: "31000", })), @@ -258,16 +256,16 @@ func TestInjectPod(t *testing.T) { }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ - { + corev1.Container{ Ports: []corev1.ContainerPort{ - { + corev1.ContainerPort{ ContainerPort: 8080, }, }, }, - { + corev1.Container{ Ports: []corev1.ContainerPort{ - { + corev1.ContainerPort{ Name: "http", ContainerPort: 8081, }, @@ -277,15 +275,15 @@ func TestInjectPod(t *testing.T) { }, }, PortsList: []*PortEntry{ - { + &PortEntry{ Port: 31000, Quantity: 0, }, - { + &PortEntry{ Port: 31001, Quantity: 3, }, - { + &PortEntry{ Port: 31002, Quantity: 4, }, @@ -301,31 +299,29 @@ func TestInjectPod(t *testing.T) { "31001" + podHostportLabelSuffix: "31001", }, Annotations: map[string]string{ - pluginAnnotationKey: pluginAnnotationValue, - pluginPortsAnnotationKey: "8080,http", - annotationsRandHostportPrefix + "8080": "31000", - annotationsRandHostportPrefix + "8081": "31001", + pluginAnnotationKey: pluginAnnotationValue, + pluginPortsAnnotationKey: "8080,http", }, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ - { + corev1.Container{ Ports: []corev1.ContainerPort{ - { + corev1.ContainerPort{ ContainerPort: 8080, HostPort: 31000, }, }, Env: []corev1.EnvVar{ - { + corev1.EnvVar{ Name: envRandHostportPrefix + "8080", Value: "31000", }, - { + corev1.EnvVar{ Name: envRandHostportPrefix + "8081", Value: "31001", }, - { + corev1.EnvVar{ Name: envRandHostportHostIP, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -333,7 +329,7 @@ func TestInjectPod(t *testing.T) { }, }, }, - { + corev1.EnvVar{ Name: envRandHostportPodName, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -341,7 +337,7 @@ func TestInjectPod(t *testing.T) { }, }, }, - { + corev1.EnvVar{ Name: envRandHostportPodNamespace, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -351,24 +347,24 @@ func TestInjectPod(t *testing.T) { }, }, }, - { + corev1.Container{ Ports: []corev1.ContainerPort{ - { + corev1.ContainerPort{ Name: "http", ContainerPort: 8081, HostPort: 31001, }, }, Env: []corev1.EnvVar{ - { + corev1.EnvVar{ Name: envRandHostportPrefix + "8080", Value: "31000", }, - { + corev1.EnvVar{ Name: envRandHostportPrefix + "8081", Value: "31001", }, - { + corev1.EnvVar{ Name: envRandHostportHostIP, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -376,7 +372,7 @@ func TestInjectPod(t *testing.T) { }, }, }, - { + corev1.EnvVar{ Name: envRandHostportPodName, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -384,7 +380,7 @@ func TestInjectPod(t *testing.T) { }, }, }, - { + corev1.EnvVar{ Name: envRandHostportPodNamespace, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -398,13 +394,13 @@ func TestInjectPod(t *testing.T) { Affinity: &corev1.Affinity{ PodAntiAffinity: &corev1.PodAntiAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{ - { + corev1.PodAffinityTerm{ LabelSelector: k8smetav1.SetAsLabelSelector(labels.Set(map[string]string{ "31000" + podHostportLabelSuffix: "31000", })), TopologyKey: "kubernetes.io/hostname", }, - { + corev1.PodAffinityTerm{ LabelSelector: k8smetav1.SetAsLabelSelector(labels.Set(map[string]string{ "31001" + podHostportLabelSuffix: "31001", })), @@ -433,21 +429,21 @@ func TestInjectPod(t *testing.T) { }, Spec: corev1.PodSpec{ InitContainers: []corev1.Container{ - { + corev1.Container{ Image: "test-image", }, }, Containers: []corev1.Container{ - { + corev1.Container{ Ports: []corev1.ContainerPort{ - { + corev1.ContainerPort{ ContainerPort: 8080, }, }, }, - { + corev1.Container{ Ports: []corev1.ContainerPort{ - { + corev1.ContainerPort{ Name: "http", ContainerPort: 8081, }, @@ -457,15 +453,15 @@ func TestInjectPod(t *testing.T) { }, }, PortsList: []*PortEntry{ - { + &PortEntry{ Port: 31000, Quantity: 0, }, - { + &PortEntry{ Port: 31001, Quantity: 3, }, - { + &PortEntry{ Port: 31002, Quantity: 4, }, @@ -481,26 +477,24 @@ func TestInjectPod(t *testing.T) { "31001" + podHostportLabelSuffix: "31001", }, Annotations: map[string]string{ - pluginAnnotationKey: pluginAnnotationValue, - pluginPortsAnnotationKey: "8080,http", - annotationsRandHostportPrefix + "8080": "31000", - annotationsRandHostportPrefix + "8081": "31001", + pluginAnnotationKey: pluginAnnotationValue, + pluginPortsAnnotationKey: "8080,http", }, }, Spec: corev1.PodSpec{ InitContainers: []corev1.Container{ - { + corev1.Container{ Image: "test-image", Env: []corev1.EnvVar{ - { + corev1.EnvVar{ Name: envRandHostportPrefix + "8080", Value: "31000", }, - { + corev1.EnvVar{ Name: envRandHostportPrefix + "8081", Value: "31001", }, - { + corev1.EnvVar{ Name: envRandHostportHostIP, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -508,7 +502,7 @@ func TestInjectPod(t *testing.T) { }, }, }, - { + corev1.EnvVar{ Name: envRandHostportPodName, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -516,7 +510,7 @@ func TestInjectPod(t *testing.T) { }, }, }, - { + corev1.EnvVar{ Name: envRandHostportPodNamespace, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -528,23 +522,23 @@ func TestInjectPod(t *testing.T) { }, }, Containers: []corev1.Container{ - { + corev1.Container{ Ports: []corev1.ContainerPort{ - { + corev1.ContainerPort{ ContainerPort: 8080, HostPort: 31000, }, }, Env: []corev1.EnvVar{ - { + corev1.EnvVar{ Name: envRandHostportPrefix + "8080", Value: "31000", }, - { + corev1.EnvVar{ Name: envRandHostportPrefix + "8081", Value: "31001", }, - { + corev1.EnvVar{ Name: envRandHostportHostIP, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -552,7 +546,7 @@ func TestInjectPod(t *testing.T) { }, }, }, - { + corev1.EnvVar{ Name: envRandHostportPodName, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -560,7 +554,7 @@ func TestInjectPod(t *testing.T) { }, }, }, - { + corev1.EnvVar{ Name: envRandHostportPodNamespace, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -570,24 +564,24 @@ func TestInjectPod(t *testing.T) { }, }, }, - { + corev1.Container{ Ports: []corev1.ContainerPort{ - { + corev1.ContainerPort{ Name: "http", ContainerPort: 8081, HostPort: 31001, }, }, Env: []corev1.EnvVar{ - { + corev1.EnvVar{ Name: envRandHostportPrefix + "8080", Value: "31000", }, - { + corev1.EnvVar{ Name: envRandHostportPrefix + "8081", Value: "31001", }, - { + corev1.EnvVar{ Name: envRandHostportHostIP, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -595,7 +589,7 @@ func TestInjectPod(t *testing.T) { }, }, }, - { + corev1.EnvVar{ Name: envRandHostportPodName, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -603,7 +597,7 @@ func TestInjectPod(t *testing.T) { }, }, }, - { + corev1.EnvVar{ Name: envRandHostportPodNamespace, ValueFrom: &corev1.EnvVarSource{ FieldRef: &corev1.ObjectFieldSelector{ @@ -617,13 +611,13 @@ func TestInjectPod(t *testing.T) { Affinity: &corev1.Affinity{ PodAntiAffinity: &corev1.PodAntiAffinity{ RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{ - { + corev1.PodAffinityTerm{ LabelSelector: k8smetav1.SetAsLabelSelector(labels.Set(map[string]string{ "31000" + podHostportLabelSuffix: "31000", })), TopologyKey: "kubernetes.io/hostname", }, - { + corev1.PodAffinityTerm{ LabelSelector: k8smetav1.SetAsLabelSelector(labels.Set(map[string]string{ "31001" + podHostportLabelSuffix: "31001", })), @@ -648,9 +642,9 @@ func TestInjectPod(t *testing.T) { }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ - { + corev1.Container{ Ports: []corev1.ContainerPort{ - { + corev1.ContainerPort{ ContainerPort: 8080, }, }, @@ -670,7 +664,6 @@ func TestInjectPod(t *testing.T) { } hpi := &HostPortInjector{ portCache: portCache, - conf: &HostPortInjectorConfig{}, } patches, err := hpi.injectToPod(test.Pod) if err == nil { diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/randhostport/types.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/randhostport/types.go index 002359009a..97f6bcc6cb 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/randhostport/types.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/plugin/randhostport/types.go @@ -29,8 +29,6 @@ const ( envRandHostportPodName = "BCS_RANDHOSTPORT_POD_NAME" envRandHostportPodNamespace = "BCS_RANDHOSTPORT_POD_NAMESPACE" - annotationsRandHostportPrefix = pluginAnnotationKey + "." - // PatchOperationAdd patch add operation PatchOperationAdd = "add" // PatchOperationReplace patch replace operation @@ -50,6 +48,4 @@ const ( PatchPathPodLabel = "/metadata/labels" // PatchPathAffinity path for patching pod affinity PatchPathAffinity = "/spec/affinity" - // PatchPathPodAnnotations path for patching pod annotations - PatchPathPodAnnotations = "/metadata/annotations" ) diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/server/k8s.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/server/k8s.go index c4aefb8342..14bf89493e 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/server/k8s.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/server/k8s.go @@ -206,7 +206,6 @@ func (ws *WebhookServer) doK8sHook(ar v1beta1.AdmissionReview) *v1beta1.Admissio switch value { default: return &v1beta1.AdmissionResponse{Allowed: true} - // NOCC:goconst/string(设计如此) case "y", "yes", "true", "on": // do nothing, let it go } diff --git a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/server/mesos.go b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/server/mesos.go index 986d7be4f8..8212b36bf9 100644 --- a/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/server/mesos.go +++ b/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/internal/server/mesos.go @@ -168,7 +168,6 @@ func (ws *WebhookServer) doAppHook(application *commtypes.ReplicaController) (*c switch value { default: return patchedApplication, nil - // NOCC:goconst/string(设计如此) case "y", "yes", "true", "on": // do nothing, let it go } @@ -202,7 +201,6 @@ func (ws *WebhookServer) doDepHook(deployment *commtypes.BcsDeployment) (*commty switch value { default: return patchedDeployment, nil - // NOCC:goconst/string(设计如此) case "y", "yes", "true", "on": // do nothing, let it go } diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/check/ingresschecker.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/check/ingresschecker.go index e0caa59ed8..e2350a6dd4 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/check/ingresschecker.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/check/ingresschecker.go @@ -28,8 +28,7 @@ import ( networkextensionv1 "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/apis/networkextension/v1" ) -// IngressChecker do ingress related check -type IngressChecker struct { +type ingressChecker struct { cli client.Client lbClient cloud.LoadBalance @@ -43,8 +42,8 @@ type IngressChecker struct { // NewIngressChecker return new ingress checker func NewIngressChecker(cli client.Client, lbClient cloud.LoadBalance, lbIDCache, lbNameCache *gocache.Cache, - lbCacheExpiration int) *IngressChecker { - return &IngressChecker{ + lbCacheExpiration int) *ingressChecker { + return &ingressChecker{ cli: cli, lbClient: lbClient, lbIDCache: lbIDCache, @@ -54,12 +53,12 @@ func NewIngressChecker(cli client.Client, lbClient cloud.LoadBalance, lbIDCache, } // Run start check -func (ic *IngressChecker) Run() { +func (ic *ingressChecker) Run() { blog.Infof("ingress checker begin") ingressList := &networkextensionv1.IngressList{} if err := ic.cli.List(context.TODO(), ingressList); err != nil { - blog.Errorf("list ingress failed, err: %s", err.Error()) + blog.Errorf("list ingress failed, err: %s") return } @@ -105,7 +104,7 @@ func (ic *IngressChecker) Run() { blog.Infof("ingress checker done") } -func (ic *IngressChecker) renewCache(info lbInfo) { +func (ic *ingressChecker) renewCache(info lbInfo) { var lbObj *cloud.LoadBalanceObject var err error diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/check/listenerchecker.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/check/listenerchecker.go index 8de566f74f..25e9f36f62 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/check/listenerchecker.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/check/listenerchecker.go @@ -33,22 +33,19 @@ import ( networkextensionv1 "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/apis/networkextension/v1" ) -// ListenerChecker do listener related check -type ListenerChecker struct { +type listenerChecker struct { cli client.Client listenerHelper *listenercontroller.ListenerHelper } -// NewListenerChecker return listener checker -func NewListenerChecker(cli client.Client, listenerHelp *listenercontroller.ListenerHelper) *ListenerChecker { - return &ListenerChecker{ +func NewListenerChecker(cli client.Client, listenerHelp *listenercontroller.ListenerHelper) *listenerChecker { + return &listenerChecker{ cli: cli, listenerHelper: listenerHelp, } } -// Run start -func (l *ListenerChecker) Run() { +func (l *listenerChecker) Run() { listenerList := &networkextensionv1.ListenerList{} if err := l.cli.List(context.TODO(), listenerList); err != nil { blog.Errorf("list listener failed, err: %s", err.Error()) @@ -59,7 +56,7 @@ func (l *ListenerChecker) Run() { go l.deletePortPoolUnusedListener(listenerList) } -func (l *ListenerChecker) setMetric(listenerList *networkextensionv1.ListenerList) { +func (l *listenerChecker) setMetric(listenerList *networkextensionv1.ListenerList) { cntMap := make(map[string]int) for _, listener := range listenerList.Items { status := listener.Status.Status @@ -108,7 +105,7 @@ func (l *ListenerChecker) setMetric(listenerList *networkextensionv1.ListenerLis } // deleteUnusedListener 端口池中修改item-lbID后,需要回收不需要的监听器 -func (l *ListenerChecker) deletePortPoolUnusedListener(listenerList *networkextensionv1.ListenerList) { +func (l *listenerChecker) deletePortPoolUnusedListener(listenerList *networkextensionv1.ListenerList) { portPoolList := &networkextensionv1.PortPoolList{} if err := l.cli.List(context.TODO(), portPoolList); err != nil { blog.Errorf("list portpool failed, err: %s", err.Error()) diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/elb.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/elb.go index ff4a4e5451..2c4601cee9 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/elb.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/elb.go @@ -152,7 +152,7 @@ func (e *Elb) DeleteListener(region string, listener *networkextensionv1.Listene } // 1. get listener id input := &elbv2.DescribeListenersInput{LoadBalancerArn: &listener.Spec.LoadbalancerID} - listeners, err := e.sdkWrapper.DescribeListeners(region, input, 3) + listeners, err := e.sdkWrapper.DescribeListeners(region, input) if err != nil { return fmt.Errorf("DescribeListeners failed, err %s", err.Error()) } @@ -163,7 +163,7 @@ func (e *Elb) DeleteListener(region string, listener *networkextensionv1.Listene } // 2. get listener's rules and all target groups - rules, tgs, err := e.getAllListenerRulesAndTargetGroups(region, *found.ListenerArn, 3) + rules, tgs, err := e.getAllListenerRulesAndTargetGroups(region, *found.ListenerArn) if err != nil { return err } @@ -177,18 +177,18 @@ func (e *Elb) DeleteListener(region string, listener *networkextensionv1.Listene // 4. delete all listeners' rules for _, rule := range rules { - out, inErr := e.sdkWrapper.DescribeRules(region, &elbv2.DescribeRulesInput{RuleArns: []string{rule}}, 3) - if inErr != nil { - blog.Warnf("DescribeRules failed, err %s", inErr.Error()) + out, err := e.sdkWrapper.DescribeRules(region, &elbv2.DescribeRulesInput{RuleArns: []string{rule}}) + if err != nil { + blog.Warnf("DescribeRules failed, err %s", err.Error()) continue } // default rule cannot be deleted if out.Rules != nil && out.Rules[0].IsDefault { continue } - _, inErr = e.sdkWrapper.DeleteRule(region, &elbv2.DeleteRuleInput{RuleArn: &rule}) - if inErr != nil { - return fmt.Errorf("DeleteRule failed, err %s", inErr.Error()) + _, err = e.sdkWrapper.DeleteRule(region, &elbv2.DeleteRuleInput{RuleArn: &rule}) + if err != nil { + return fmt.Errorf("DeleteRule failed, err %s", err.Error()) } } @@ -316,13 +316,13 @@ func (e *Elb) DescribeBackendStatus(region, ns string, lbIDs []string) (map[stri for _, lbID := range lbIDs { listeners, err := e.sdkWrapper.DescribeListeners(region, &elbv2.DescribeListenersInput{ LoadBalancerArn: &lbID, - }, 4) + }) if err != nil { return nil, fmt.Errorf("DescribeListeners failed, err %s", err.Error()) } // 2. get all listener's target groups for _, listener := range listeners.Listeners { - _, targetGroups, err := e.getAllListenerRulesAndTargetGroups(region, *listener.ListenerArn, 4) + _, targetGroups, err := e.getAllListenerRulesAndTargetGroups(region, *listener.ListenerArn) if err != nil { return nil, err } diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/helper.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/helper.go index ca3f72e379..9c56d3bab8 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/helper.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/helper.go @@ -13,18 +13,16 @@ package aws import ( - // NOCC:gas/crypto(误报 未使用于密钥) "crypto/md5" "fmt" "reflect" "strconv" + "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud" + networkextensionv1 "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/apis/networkextension/v1" "github.com/aws/aws-sdk-go-v2/aws" elbv2 "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types" - - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud" - networkextensionv1 "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/apis/networkextension/v1" ) // do ensure network lb listener, only support one target group @@ -141,7 +139,7 @@ func (e *Elb) ensureListenerSelf(region string, listener *networkextensionv1.Lis defaultTargetGroup string) (string, error) { // get cloud listener input := &elbv2.DescribeListenersInput{LoadBalancerArn: &listener.Spec.LoadbalancerID} - listeners, err := e.sdkWrapper.DescribeListeners(region, input, 3) + listeners, err := e.sdkWrapper.DescribeListeners(region, input) if err != nil { return "", fmt.Errorf("DescribeListeners failed, err %s", err.Error()) } @@ -152,9 +150,9 @@ func (e *Elb) ensureListenerSelf(region string, listener *networkextensionv1.Lis // if not found, create listener if found == nil { - output, inErr := e.sdkWrapper.CreateListener(region, listenerInput) - if inErr != nil { - return "", fmt.Errorf("CreateListener failed, err %s", inErr.Error()) + output, err := e.sdkWrapper.CreateListener(region, listenerInput) + if err != nil { + return "", fmt.Errorf("CreateListener failed, err %s", err.Error()) } if len(output.Listeners) == 0 { return "", fmt.Errorf("CreateLIstener failed, response listeners is nil") @@ -186,51 +184,22 @@ func (e *Elb) ensureRule(region string, listener *networkextensionv1.Listener, l return err } exceptRules := e.generateExceptRules(listener.Spec.Rules, ruleTargetGroup) - rules, err := e.sdkWrapper.DescribeRules(region, &elbv2.DescribeRulesInput{ListenerArn: &listenerArn}, 3) + rules, err := e.sdkWrapper.DescribeRules(region, &elbv2.DescribeRulesInput{ListenerArn: &listenerArn}) if err != nil { return fmt.Errorf("DescribeRules failed, err %s", err.Error()) } - add, modify, del := e.compareRule(rules, exceptRules, listenerArn) - for _, v := range add { - if _, err := e.sdkWrapper.CreateRule(region, &v); err != nil { - return fmt.Errorf("CreateRule failed, err %s", err.Error()) - } - } - for _, v := range modify { - if _, err := e.sdkWrapper.ModifyRule(region, &v); err != nil { - return fmt.Errorf("ModifyRule failed, err %s", err.Error()) - } - } - for _, v := range del { - if _, err := e.sdkWrapper.DeleteRule(region, &elbv2.DeleteRuleInput{RuleArn: v.RuleArn}); err != nil { - return fmt.Errorf("DeleteRule failed, err %s", err.Error()) - } - for _, tg := range v.Actions { - if _, err := e.sdkWrapper.DeleteTargetGroup(region, &elbv2.DeleteTargetGroupInput{ - TargetGroupArn: tg.TargetGroupArn, - }); err != nil { - return fmt.Errorf("DeleteTargetGroup failed, err %s", err.Error()) - } - } - } - return nil -} - -func (e *Elb) compareRule(cloudRule *elbv2.DescribeRulesOutput, localRule []types.Rule, - listenerArn string) ([]elbv2.CreateRuleInput, []elbv2.ModifyRuleInput, []types.Rule) { var add []elbv2.CreateRuleInput var modify []elbv2.ModifyRuleInput var del []types.Rule - - for _, r := range cloudRule.Rules { + for _, r := range rules.Rules { if r.IsDefault { continue } var found *types.Rule - for idx, v := range localRule { + for _, v := range exceptRules { if isSameRuleCondition(r.Conditions, v.Conditions) { - found = &localRule[idx] + found = &v } } if found == nil { @@ -248,9 +217,9 @@ func (e *Elb) compareRule(cloudRule *elbv2.DescribeRulesOutput, localRule []type } } - for _, r := range localRule { + for _, r := range exceptRules { found := false - for _, v := range cloudRule.Rules { + for _, v := range rules.Rules { if v.IsDefault { continue } @@ -262,13 +231,35 @@ func (e *Elb) compareRule(cloudRule *elbv2.DescribeRulesOutput, localRule []type add = append(add, elbv2.CreateRuleInput{ Conditions: r.Conditions, Actions: r.Actions, - Priority: e.nextPriority(cloudRule.Rules, add), + Priority: e.nextPriority(rules.Rules, add), ListenerArn: &listenerArn, }) } } - return add, modify, del + for _, v := range add { + if _, err := e.sdkWrapper.CreateRule(region, &v); err != nil { + return fmt.Errorf("CreateRule failed, err %s", err.Error()) + } + } + for _, v := range modify { + if _, err := e.sdkWrapper.ModifyRule(region, &v); err != nil { + return fmt.Errorf("ModifyRule failed, err %s", err.Error()) + } + } + for _, v := range del { + if _, err := e.sdkWrapper.DeleteRule(region, &elbv2.DeleteRuleInput{RuleArn: v.RuleArn}); err != nil { + return fmt.Errorf("DeleteRule failed, err %s", err.Error()) + } + for _, tg := range v.Actions { + if _, err := e.sdkWrapper.DeleteTargetGroup(region, &elbv2.DeleteTargetGroupInput{ + TargetGroupArn: tg.TargetGroupArn, + }); err != nil { + return fmt.Errorf("DeleteTargetGroup failed, err %s", err.Error()) + } + } + } + return nil } // ensure all rules's backend are created, every backend is created by one target group @@ -406,9 +397,8 @@ func setModifyHealthCheck(input *elbv2.ModifyTargetGroupInput, rule *networkexte } } -// md5(domain+path) md5避免命名出现特殊字符 +// md5(domain+path) func getRuleTargetGroupName(domain, path string) string { - // NOCC:gas/crypto(误报 未使用于密钥) return fmt.Sprintf("%x", (md5.Sum([]byte(domain + path)))) } @@ -628,10 +618,48 @@ func (e *Elb) ensureTargetGroupHealthCheck(region string, listener *networkexten input.HealthCheckPort = aws.String(strconv.Itoa(listener.Spec.TargetGroup.Backends[0].Port)) } if listener.Spec.Protocol == ElbProtocolHTTP || listener.Spec.Protocol == ElbProtocolHTTPS { - e.genLayer7HealthCheck(input, listener) - } else if listener.Spec.Protocol == ElbProtocolTCP || listener.Spec.Protocol == ElbProtocolUDP { + if listener.Spec.ListenerAttribute != nil && + listener.Spec.ListenerAttribute.HealthCheck != nil { + hc := listener.Spec.ListenerAttribute.HealthCheck + if hc.HealthNum != 0 { + input.HealthyThresholdCount = aws.Int32(int32(hc.HealthNum)) + } + if hc.HTTPCheckPath != "" { + input.HealthCheckPath = aws.String(hc.HTTPCheckPath) + } + if hc.UnHealthNum != 0 { + input.UnhealthyThresholdCount = aws.Int32(int32(hc.UnHealthNum)) + } + if hc.Timeout != 0 { + input.HealthCheckTimeoutSeconds = aws.Int32(int32(hc.Timeout)) + } + if hc.IntervalTime != 0 { + input.HealthCheckIntervalSeconds = aws.Int32(int32(hc.IntervalTime)) + } + if len(hc.HTTPCodeValues) != 0 { + input.Matcher = &types.Matcher{HttpCode: aws.String(hc.HTTPCodeValues)} + } + if len(hc.HealthCheckProtocol) != 0 { + input.HealthCheckProtocol = types.ProtocolEnum(hc.HealthCheckProtocol) + } + if hc.HealthCheckPort != 0 { + input.HealthCheckPort = aws.String(strconv.Itoa(hc.HealthCheckPort)) + } + } + } + if listener.Spec.Protocol == ElbProtocolTCP || listener.Spec.Protocol == ElbProtocolUDP { input.HealthCheckProtocol = types.ProtocolEnumTcp - e.genLayer4HealthCheck(input, listener) + if listener.Spec.ListenerAttribute != nil && + listener.Spec.ListenerAttribute.HealthCheck != nil { + hc := listener.Spec.ListenerAttribute.HealthCheck + if hc.HealthNum != 0 { + input.HealthyThresholdCount = aws.Int32(int32(hc.HealthNum)) + input.UnhealthyThresholdCount = aws.Int32(int32(hc.HealthNum)) + } + if hc.HealthCheckPort != 0 { + input.HealthCheckPort = aws.String(strconv.Itoa(hc.HealthCheckPort)) + } + } } _, err := e.sdkWrapper.ModifyTargetGroup(region, input) @@ -641,51 +669,6 @@ func (e *Elb) ensureTargetGroupHealthCheck(region string, listener *networkexten return nil } -func (e *Elb) genLayer7HealthCheck(input *elbv2.ModifyTargetGroupInput, listener *networkextensionv1.Listener) { - if listener.Spec.ListenerAttribute != nil && - listener.Spec.ListenerAttribute.HealthCheck != nil { - hc := listener.Spec.ListenerAttribute.HealthCheck - if hc.HealthNum != 0 { - input.HealthyThresholdCount = aws.Int32(int32(hc.HealthNum)) - } - if hc.HTTPCheckPath != "" { - input.HealthCheckPath = aws.String(hc.HTTPCheckPath) - } - if hc.UnHealthNum != 0 { - input.UnhealthyThresholdCount = aws.Int32(int32(hc.UnHealthNum)) - } - if hc.Timeout != 0 { - input.HealthCheckTimeoutSeconds = aws.Int32(int32(hc.Timeout)) - } - if hc.IntervalTime != 0 { - input.HealthCheckIntervalSeconds = aws.Int32(int32(hc.IntervalTime)) - } - if len(hc.HTTPCodeValues) != 0 { - input.Matcher = &types.Matcher{HttpCode: aws.String(hc.HTTPCodeValues)} - } - if len(hc.HealthCheckProtocol) != 0 { - input.HealthCheckProtocol = types.ProtocolEnum(hc.HealthCheckProtocol) - } - if hc.HealthCheckPort != 0 { - input.HealthCheckPort = aws.String(strconv.Itoa(hc.HealthCheckPort)) - } - } -} - -func (e *Elb) genLayer4HealthCheck(input *elbv2.ModifyTargetGroupInput, listener *networkextensionv1.Listener) { - if listener.Spec.ListenerAttribute != nil && - listener.Spec.ListenerAttribute.HealthCheck != nil { - hc := listener.Spec.ListenerAttribute.HealthCheck - if hc.HealthNum != 0 { - input.HealthyThresholdCount = aws.Int32(int32(hc.HealthNum)) - input.UnhealthyThresholdCount = aws.Int32(int32(hc.HealthNum)) - } - if hc.HealthCheckPort != 0 { - input.HealthCheckPort = aws.String(strconv.Itoa(hc.HealthCheckPort)) - } - } -} - func (e *Elb) ensureTargetGroupAttributes(region string, listener *networkextensionv1.Listener, targetGroupArn *string) error { attrs := make([]types.TargetGroupAttribute, 0) @@ -728,10 +711,9 @@ func (e *Elb) ensureRuleTargetGroupAttributes(region string, rule networkextensi return err } -func (e *Elb) getAllListenerRulesAndTargetGroups(region, listenerArn string, logV int32) ([]string, map[string]bool, - error) { +func (e *Elb) getAllListenerRulesAndTargetGroups(region, listenerArn string) ([]string, map[string]bool, error) { ruleInput := &elbv2.DescribeRulesInput{ListenerArn: &listenerArn} - rules, err := e.sdkWrapper.DescribeRules(region, ruleInput, logV) + rules, err := e.sdkWrapper.DescribeRules(region, ruleInput) if err != nil { return nil, nil, fmt.Errorf("DescribeRules failed, err %s", err.Error()) } @@ -770,23 +752,19 @@ func isSameRuleCondition(a, b []types.RuleCondition) bool { if len(a) != len(b) { return false } - sameHost := false - samePath := false for _, v := range a { + same := false for _, v1 := range b { - if *v.Field == "host-header" && *v1.Field == "host-header" { - if reflect.DeepEqual(v.HostHeaderConfig, v1.HostHeaderConfig) { - sameHost = true - } - break - } - if *v.Field == "path-pattern" && *v1.Field == "path-pattern" { - if reflect.DeepEqual(v.PathPatternConfig, v1.PathPatternConfig) { - samePath = true + if *v.Field == *v1.Field { + if reflect.DeepEqual(v.HostHeaderConfig, v1.HostHeaderConfig) || + reflect.DeepEqual(v.PathPatternConfig, v1.PathPatternConfig) { + same = true } - break } } + if !same { + return false + } } - return sameHost && samePath + return true } diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/helper_test.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/helper_test.go deleted file mode 100644 index f28182bb71..0000000000 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/helper_test.go +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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 aws - -import ( - "testing" - - "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types" -) - -func TestIsSameRuleCondition(t *testing.T) { - conditionA := []types.RuleCondition{ - { - Field: toStrPtr("host-header"), - HostHeaderConfig: &types.HostHeaderConditionConfig{Values: []string{"www.qq.com"}}, - }, - { - Field: toStrPtr("path-pattern"), - PathPatternConfig: &types.PathPatternConditionConfig{Values: []string{"/"}}, - }, - } - - conditionB := []types.RuleCondition{ - { - Field: toStrPtr("host-header"), - HostHeaderConfig: &types.HostHeaderConditionConfig{Values: []string{"www.qq.com"}}, - }, - { - Field: toStrPtr("path-pattern"), - PathPatternConfig: &types.PathPatternConditionConfig{Values: []string{"/grafana/pracing"}}, - }, - } - - conditionC := []types.RuleCondition{ - { - Field: toStrPtr("path-pattern"), - PathPatternConfig: &types.PathPatternConditionConfig{Values: []string{"/"}}, - }, - { - Field: toStrPtr("host-header"), - HostHeaderConfig: &types.HostHeaderConditionConfig{Values: []string{"www.qq.com"}}, - }, - } - - if isSameRuleCondition(conditionA, conditionB) { - t.Error("different condition") - } - if !isSameRuleCondition(conditionA, conditionC) { - t.Error("same condition") - } -} - -func toStrPtr(str string) *string { - return &str -} diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/sdk.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/sdk.go index fc92833cf4..286b15a620 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/sdk.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/sdk.go @@ -15,18 +15,20 @@ package aws import ( "context" "fmt" + "os" + "runtime" + "strconv" "strings" "time" - "github.com/aws/aws-sdk-go-v2/aws/ratelimit" - "github.com/aws/aws-sdk-go-v2/aws/retry" - elbv2 "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" - "github.com/Tencent/bk-bcs/bcs-common/common/blog" - "github.com/Tencent/bk-bcs/bcs-common/common/blog/glog" "github.com/Tencent/bk-bcs/bcs-common/pkg/throttle" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/metrics" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-network/pkg/common" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/ratelimit" + "github.com/aws/aws-sdk-go-v2/aws/retry" + elbv2 "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" ) // SdkWrapper wrapper for aws sdk @@ -102,13 +104,80 @@ func NewSdkWrapperWithSecretIDKey(secretID, secretKey string) (*SdkWrapper, erro return NewSdkWrapper() } +// getRegionClient create region client +func (sw *SdkWrapper) getRegionClient(region string) *elbv2.Client { + cli, ok := sw.elbClientMap[region] + if !ok { + credentials := aws.CredentialsProviderFunc(func(ctx context.Context) (aws.Credentials, error) { + return aws.Credentials{ + AccessKeyID: sw.secretID, + SecretAccessKey: sw.secretKey, + }, nil + }) + options := elbv2.Options{Region: region, Credentials: credentials} + options.Retryer = retry.NewStandard(RetryerWithDefaultOptions) + newCli := elbv2.New(options) + sw.elbClientMap[region] = newCli + return newCli + } + return cli +} + +func (sw *SdkWrapper) loadEnv() error { + if len(sw.secretID) == 0 { + sw.secretID = os.Getenv(EnvNameAWSAccessKeyID) + } + if len(sw.secretKey) == 0 { + sw.secretKey = os.Getenv(EnvNameAWSAccessKey) + } + + qpsStr := os.Getenv(EnvNameAWSRateLimitQPS) + if len(qpsStr) != 0 { + qps, err := strconv.ParseInt(qpsStr, 10, 64) + if err != nil { + blog.Warnf("parse rate limit qps %s failed, err %s, use default %d", + qpsStr, err.Error(), defaultThrottleQPS) + sw.ratelimitqps = int64(defaultThrottleQPS) + } else { + sw.ratelimitqps = qps + } + } else { + sw.ratelimitqps = int64(defaultThrottleQPS) + } + + bucketSizeStr := os.Getenv(EnvNameAWSRateLimitBucketSize) + if len(bucketSizeStr) != 0 { + bucketSize, err := strconv.ParseInt(bucketSizeStr, 10, 64) + if err != nil { + blog.Warnf("parse rate limit bucket size %s failed, err %s, use default %d", + bucketSizeStr, err.Error(), defaultBucketSize) + sw.ratelimitbucketSize = int64(defaultBucketSize) + } else { + sw.ratelimitbucketSize = bucketSize + } + } else { + sw.ratelimitbucketSize = int64(defaultBucketSize) + } + return nil +} + +// call tryThrottle before each api call +func (sw *SdkWrapper) tryThrottle() { + now := time.Now() + sw.throttler.Accept() + if latency := time.Since(now); latency > maxLatency { + pc, _, _, _ := runtime.Caller(2) + callerName := runtime.FuncForPC(pc).Name() + blog.Infof("Throttling request took %d ms, function: %s", latency, callerName) + } +} + // DescribeLoadBalancers describe load balancers func (sw *SdkWrapper) DescribeLoadBalancers(region string, input *elbv2.DescribeLoadBalancersInput) ( *elbv2.DescribeLoadBalancersOutput, error) { blog.V(3).Infof("DescribeLoadBalancers input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -121,19 +190,16 @@ func (sw *SdkWrapper) DescribeLoadBalancers(region string, input *elbv2.Describe rerr := ResolveError(err) if rerr.IsExceededAttemptError() { mf(metrics.LibCallStatusTimeout) - errMsg := fmt.Sprintf("DescribeLoadBalancers req[%s] out of maxRetry %d", common.ToJsonString(input), - maxRetry) + errMsg := fmt.Sprintf("DescribeLoadBalancers out of maxRetry %d", maxRetry) blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } if rerr.IsOperationError() { mf(metrics.LibCallStatusErr) - errMsg := fmt.Sprintf("DescribeLoadBalancers req[%s] failed, err %s", common.ToJsonString(input), - err.Error()) + errMsg := fmt.Sprintf("DescribeLoadBalancers failed, err %s", err.Error()) blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("DescribeLoadBalancers req[%s] failed, err: %s", common.ToJsonString(input), err.Error()) return nil, rerr.Unwrap() } blog.V(3).Infof("DescribeLoadBalancers response: %s", common.ToJsonString(out)) @@ -147,7 +213,6 @@ func (sw *SdkWrapper) CreateListener(region string, input *elbv2.CreateListenerI blog.V(3).Infof("CreateListener input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -171,7 +236,6 @@ func (sw *SdkWrapper) CreateListener(region string, input *elbv2.CreateListenerI blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("CreateListener failed, err: %s", err.Error()) return nil, rerr.Unwrap() } blog.V(3).Infof("CreateListener response: %s", common.ToJsonString(out)) @@ -180,12 +244,11 @@ func (sw *SdkWrapper) CreateListener(region string, input *elbv2.CreateListenerI } // DescribeListeners describe listeners -func (sw *SdkWrapper) DescribeListeners(region string, input *elbv2.DescribeListenersInput, logV int32) ( +func (sw *SdkWrapper) DescribeListeners(region string, input *elbv2.DescribeListenersInput) ( *elbv2.DescribeListenersOutput, error) { - blog.V(glog.Level(logV)).Infof("DescribeListeners input: %s", common.ToJsonString(input)) + blog.V(3).Infof("DescribeListeners input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -209,10 +272,9 @@ func (sw *SdkWrapper) DescribeListeners(region string, input *elbv2.DescribeList blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("DescribeListeners failed, err: %s", err.Error()) return nil, rerr.Unwrap() } - blog.V(glog.Level(logV)).Infof("DescribeListeners response: %s", common.ToJsonString(out)) + blog.V(3).Infof("DescribeListeners response: %s", common.ToJsonString(out)) mf(metrics.LibCallStatusOK) return out, nil } @@ -223,7 +285,6 @@ func (sw *SdkWrapper) DeleteListener(region string, input *elbv2.DeleteListenerI blog.V(3).Infof("DeleteListener input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -247,7 +308,6 @@ func (sw *SdkWrapper) DeleteListener(region string, input *elbv2.DeleteListenerI blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("DeleteListener failed, err: %s", err.Error()) return nil, rerr.Unwrap() } blog.V(3).Infof("DeleteListener response: %s", common.ToJsonString(out)) @@ -261,7 +321,6 @@ func (sw *SdkWrapper) ModifyListener(region string, input *elbv2.ModifyListenerI blog.V(3).Infof("ModifyListener input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -285,7 +344,6 @@ func (sw *SdkWrapper) ModifyListener(region string, input *elbv2.ModifyListenerI blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("ModifyListener failed, err: %s", err.Error()) return nil, rerr.Unwrap() } blog.V(3).Infof("ModifyListener response: %s", common.ToJsonString(out)) @@ -299,7 +357,6 @@ func (sw *SdkWrapper) CreateRule(region string, input *elbv2.CreateRuleInput) ( blog.V(3).Infof("CreateRule input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -313,17 +370,16 @@ func (sw *SdkWrapper) CreateRule(region string, input *elbv2.CreateRuleInput) ( rerr := ResolveError(err) if rerr.IsExceededAttemptError() { mf(metrics.LibCallStatusTimeout) - errMsg := fmt.Sprintf("CreateRule req[%s] out of maxRetry %d", common.ToJsonString(input), maxRetry) + errMsg := fmt.Sprintf("CreateRule out of maxRetry %d", maxRetry) blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } if rerr.IsOperationError() { mf(metrics.LibCallStatusErr) - errMsg := fmt.Sprintf("CreateRule req[%s] failed, err %s", common.ToJsonString(input), err.Error()) + errMsg := fmt.Sprintf("CreateRule failed, err %s", err.Error()) blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("CreateRule req[%s] failed, err: %s", common.ToJsonString(input), err.Error()) return nil, rerr.Unwrap() } blog.V(3).Infof("CreateRule response: %s", common.ToJsonString(out)) @@ -332,12 +388,11 @@ func (sw *SdkWrapper) CreateRule(region string, input *elbv2.CreateRuleInput) ( } // DescribeRules describe rules -func (sw *SdkWrapper) DescribeRules(region string, input *elbv2.DescribeRulesInput, logV int32) ( +func (sw *SdkWrapper) DescribeRules(region string, input *elbv2.DescribeRulesInput) ( *elbv2.DescribeRulesOutput, error) { - blog.V(glog.Level(logV)).Infof("DescribeRules input: %s", common.ToJsonString(input)) + blog.V(3).Infof("DescribeRules input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -351,20 +406,19 @@ func (sw *SdkWrapper) DescribeRules(region string, input *elbv2.DescribeRulesInp rerr := ResolveError(err) if rerr.IsExceededAttemptError() { mf(metrics.LibCallStatusTimeout) - errMsg := fmt.Sprintf("DescribeRules req[%s] out of maxRetry %d", common.ToJsonString(input), maxRetry) + errMsg := fmt.Sprintf("DescribeRules out of maxRetry %d", maxRetry) blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } if rerr.IsOperationError() { mf(metrics.LibCallStatusErr) - errMsg := fmt.Sprintf("DescribeRules req[%s] failed, err %s", common.ToJsonString(input), err.Error()) + errMsg := fmt.Sprintf("DescribeRules failed, err %s", err.Error()) blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("DescribeRules req[%s] failed, err: %s", common.ToJsonString(input), err.Error()) return nil, rerr.Unwrap() } - blog.V(glog.Level(logV)).Infof("DescribeRules response: %s", common.ToJsonString(out)) + blog.V(3).Infof("DescribeRules response: %s", common.ToJsonString(out)) mf(metrics.LibCallStatusOK) return out, nil } @@ -375,7 +429,6 @@ func (sw *SdkWrapper) DeleteRule(region string, input *elbv2.DeleteRuleInput) ( blog.V(3).Infof("DeleteRule input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -399,7 +452,6 @@ func (sw *SdkWrapper) DeleteRule(region string, input *elbv2.DeleteRuleInput) ( blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("DeleteRule failed, err: %s", err.Error()) return nil, rerr.Unwrap() } blog.V(3).Infof("DeleteRule response: %s", common.ToJsonString(out)) @@ -413,7 +465,6 @@ func (sw *SdkWrapper) ModifyRule(region string, input *elbv2.ModifyRuleInput) ( blog.V(3).Infof("ModifyRule input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -440,7 +491,6 @@ func (sw *SdkWrapper) ModifyRule(region string, input *elbv2.ModifyRuleInput) ( blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("ModifyRule failed, err: %s", err.Error()) return nil, rerr.Unwrap() } blog.V(3).Infof("ModifyRule response: %s", common.ToJsonString(out)) @@ -454,7 +504,6 @@ func (sw *SdkWrapper) CreateTargetGroup(region string, input *elbv2.CreateTarget blog.V(3).Infof("CreateTargetGroup input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -478,7 +527,6 @@ func (sw *SdkWrapper) CreateTargetGroup(region string, input *elbv2.CreateTarget blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("CreateTargetGroup failed, err: %s", err.Error()) return nil, rerr.Unwrap() } blog.V(3).Infof("CreateTargetGroup response: %s", common.ToJsonString(out)) @@ -492,7 +540,6 @@ func (sw *SdkWrapper) RegisterTargets(region string, input *elbv2.RegisterTarget blog.V(3).Infof("RegisterTargets input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -516,7 +563,6 @@ func (sw *SdkWrapper) RegisterTargets(region string, input *elbv2.RegisterTarget blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("RegisterTargets failed, err: %s", err.Error()) return nil, rerr.Unwrap() } blog.V(3).Infof("RegisterTargets response: %s", common.ToJsonString(out)) @@ -530,7 +576,6 @@ func (sw *SdkWrapper) DeregisterTargets(region string, input *elbv2.DeregisterTa blog.V(3).Infof("DeregisterTargets input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -554,7 +599,6 @@ func (sw *SdkWrapper) DeregisterTargets(region string, input *elbv2.DeregisterTa blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("DeregisterTargets failed, err: %s", err.Error()) return nil, rerr.Unwrap() } blog.V(3).Infof("DeregisterTargets response: %s", common.ToJsonString(out)) @@ -568,7 +612,6 @@ func (sw *SdkWrapper) DescribeTargetGroups(region string, input *elbv2.DescribeT blog.V(3).Infof("DescribeTargetGroups input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -587,7 +630,7 @@ func (sw *SdkWrapper) DescribeTargetGroups(region string, input *elbv2.DescribeT return nil, fmt.Errorf(errMsg) } if strings.Contains(err.Error(), "response error StatusCode: 400") { - blog.Warnf("DescribeTargetGroups not found: %v, raw error: %s", input.Names, err.Error()) + blog.Warnf("DescribeTargetGroups not found: %v", input.Names) return &elbv2.DescribeTargetGroupsOutput{}, nil } if rerr.IsOperationError() { @@ -596,7 +639,6 @@ func (sw *SdkWrapper) DescribeTargetGroups(region string, input *elbv2.DescribeT blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("DescribeTargetGroups failed, err: %s", err.Error()) return nil, rerr.Unwrap() } blog.V(3).Infof("DescribeTargetGroups response: %s", common.ToJsonString(out)) @@ -610,7 +652,6 @@ func (sw *SdkWrapper) DeleteTargetGroup(region string, input *elbv2.DeleteTarget blog.V(3).Infof("DeleteTargetGroup input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -634,7 +675,6 @@ func (sw *SdkWrapper) DeleteTargetGroup(region string, input *elbv2.DeleteTarget blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("DeleteTargetGroup failed, err: %s", err.Error()) return nil, rerr.Unwrap() } blog.V(3).Infof("DeleteTargetGroup response: %s", common.ToJsonString(out)) @@ -648,7 +688,6 @@ func (sw *SdkWrapper) DescribeTargetGroupAttributes(region string, input *elbv2. blog.V(3).Infof("DescribeTargetGroupAttributes input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -672,7 +711,6 @@ func (sw *SdkWrapper) DescribeTargetGroupAttributes(region string, input *elbv2. blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("DescribeTargetGroupAttributes failed, err: %s", err.Error()) return nil, rerr.Unwrap() } blog.V(3).Infof("DescribeTargetGroupAttributes response: %s", common.ToJsonString(out)) @@ -686,7 +724,6 @@ func (sw *SdkWrapper) ModifyTargetGroup(region string, input *elbv2.ModifyTarget blog.V(3).Infof("ModifyTargetGroup input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -710,7 +747,6 @@ func (sw *SdkWrapper) ModifyTargetGroup(region string, input *elbv2.ModifyTarget blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("ModifyTargetGroup failed, err: %s", err.Error()) return nil, rerr.Unwrap() } blog.V(3).Infof("ModifyTargetGroup response: %s", common.ToJsonString(out)) @@ -724,7 +760,6 @@ func (sw *SdkWrapper) ModifyTargetGroupAttributes(region string, input *elbv2.Mo blog.V(3).Infof("ModifyTargetGroupAttributes input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -748,7 +783,6 @@ func (sw *SdkWrapper) ModifyTargetGroupAttributes(region string, input *elbv2.Mo blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("ModifyTargetGroupAttributes failed, err: %s", err.Error()) return nil, rerr.Unwrap() } blog.V(3).Infof("ModifyTargetGroupAttributes response: %s", common.ToJsonString(out)) @@ -759,11 +793,9 @@ func (sw *SdkWrapper) ModifyTargetGroupAttributes(region string, input *elbv2.Mo // DescribeTargetHealth describe target health func (sw *SdkWrapper) DescribeTargetHealth(region string, input *elbv2.DescribeTargetHealthInput) ( *elbv2.DescribeTargetHealthOutput, error) { - // 定时调用,log v4避免日志量过大 - blog.V(4).Infof("DescribeTargetHealth input: %s", common.ToJsonString(input)) + blog.V(3).Infof("DescribeTargetHealth input: %s", common.ToJsonString(input)) startTime := time.Now() - // 统计API调用延时/状态 mf := func(ret string) { defer metrics.ReportLibRequestMetric( SystemNameInMetricAWS, @@ -787,10 +819,9 @@ func (sw *SdkWrapper) DescribeTargetHealth(region string, input *elbv2.DescribeT blog.Errorf(errMsg) return nil, fmt.Errorf(errMsg) } - blog.Errorf("DescribeTargetHealth failed, err: %s", err.Error()) return nil, rerr.Unwrap() } - blog.V(4).Infof("DescribeTargetHealth response: %s", common.ToJsonString(out)) + blog.V(3).Infof("DescribeTargetHealth response: %s", common.ToJsonString(out)) mf(metrics.LibCallStatusOK) return out, nil } diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/sdkhelper.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/sdkhelper.go deleted file mode 100644 index 278337e9e1..0000000000 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/sdkhelper.go +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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 aws - -import ( - "context" - "os" - "runtime" - "strconv" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/retry" - elbv2 "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" - - "github.com/Tencent/bk-bcs/bcs-common/common/blog" -) - -// getRegionClient create region client -func (sw *SdkWrapper) getRegionClient(region string) *elbv2.Client { - cli, ok := sw.elbClientMap[region] - if !ok { - credentials := aws.CredentialsProviderFunc(func(ctx context.Context) (aws.Credentials, error) { - return aws.Credentials{ - AccessKeyID: sw.secretID, - SecretAccessKey: sw.secretKey, - }, nil - }) - options := elbv2.Options{Region: region, Credentials: credentials} - options.Retryer = retry.NewStandard(RetryerWithDefaultOptions) - newCli := elbv2.New(options) - sw.elbClientMap[region] = newCli - return newCli - } - return cli -} - -// loadEnv load config from environment -func (sw *SdkWrapper) loadEnv() error { - if len(sw.secretID) == 0 { - sw.secretID = os.Getenv(EnvNameAWSAccessKeyID) - } - if len(sw.secretKey) == 0 { - sw.secretKey = os.Getenv(EnvNameAWSAccessKey) - } - - qpsStr := os.Getenv(EnvNameAWSRateLimitQPS) - if len(qpsStr) != 0 { - qps, err := strconv.ParseInt(qpsStr, 10, 64) - if err != nil { - blog.Warnf("parse rate limit qps %s failed, err %s, use default %d", - qpsStr, err.Error(), defaultThrottleQPS) - sw.ratelimitqps = int64(defaultThrottleQPS) - } else { - sw.ratelimitqps = qps - } - } else { - sw.ratelimitqps = int64(defaultThrottleQPS) - } - - bucketSizeStr := os.Getenv(EnvNameAWSRateLimitBucketSize) - if len(bucketSizeStr) != 0 { - bucketSize, err := strconv.ParseInt(bucketSizeStr, 10, 64) - if err != nil { - blog.Warnf("parse rate limit bucket size %s failed, err %s, use default %d", - bucketSizeStr, err.Error(), defaultBucketSize) - sw.ratelimitbucketSize = int64(defaultBucketSize) - } else { - sw.ratelimitbucketSize = bucketSize - } - } else { - sw.ratelimitbucketSize = int64(defaultBucketSize) - } - return nil -} - -// call tryThrottle before each api call -func (sw *SdkWrapper) tryThrottle() { - now := time.Now() - sw.throttler.Accept() - if latency := time.Since(now); latency > maxLatency { - pc, _, _, _ := runtime.Caller(2) - callerName := runtime.FuncForPC(pc).Name() - blog.Infof("Throttling request took %d ms, function: %s", latency, callerName) - } -} diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/validate.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/validate.go index 81ce1bf43a..fffa79ed70 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/validate.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/aws/validate.go @@ -101,7 +101,7 @@ func (e *ElbValidater) validateIngressRule(rule *networkextensionv1.IngressRule) switch rule.Protocol { case ElbProtocolHTTP, ElbProtocolHTTPS: if rule.ListenerAttribute != nil { - if ok, msg := e.validateApplicationListenerAttr(rule.ListenerAttribute); !ok { + if ok, msg := e.validateApplicationListenerAttribute(rule.ListenerAttribute); !ok { return ok, msg } } @@ -127,7 +127,7 @@ func (e *ElbValidater) validateIngressRule(rule *networkextensionv1.IngressRule) // validateAppListenerAttribute check aws application lb listener attribute // aws validater only check the HealthCheck and AWSAttribute -func (e *ElbValidater) validateApplicationListenerAttr(attr *networkextensionv1.IngressListenerAttribute) (bool, string) { +func (e *ElbValidater) validateApplicationListenerAttribute(attr *networkextensionv1.IngressListenerAttribute) (bool, string) { // check HealthCheck if attr.HealthCheck != nil { if attr.HealthCheck.HealthNum != 0 && (attr.HealthCheck.HealthNum < 2 || attr.HealthCheck.HealthNum > 10) { @@ -147,9 +147,8 @@ func (e *ElbValidater) validateApplicationListenerAttr(attr *networkextensionv1. } // check code if len(attr.HealthCheck.HTTPCodeValues) != 0 && !checkHTTPCodeValues(attr.HealthCheck.HTTPCodeValues) { - return false, fmt.Sprintf(`invalid http code values %s, you can specify values between 200 and 499, -and the default value is 200. You can specify multiple values (for example,"200, -202") or a range of values (for example, "200-299")`, attr.HealthCheck.HTTPCodeValues) + return false, fmt.Sprintf(`invalid http code values %s, you can specify values between 200 and 499, and the default value is 200. You can specify multiple values (for example,"200,202") or a range of values (for example, "200-299")`, + attr.HealthCheck.HTTPCodeValues) } } @@ -263,7 +262,7 @@ func (e *ElbValidater) validateListenerRoute(r *networkextensionv1.Layer7Route) return false, "domain cannot be empty for 7 layer listener" } if r.ListenerAttribute != nil { - if ok, msg := e.validateApplicationListenerAttr(r.ListenerAttribute); !ok { + if ok, msg := e.validateApplicationListenerAttribute(r.ListenerAttribute); !ok { return ok, msg } } @@ -280,7 +279,7 @@ func (e *ElbValidater) validatePortMappingRoute(r *networkextensionv1.IngressPor return false, "domain cannot be empty for 7 layer listener" } if r.ListenerAttribute != nil { - if ok, msg := e.validateApplicationListenerAttr(r.ListenerAttribute); !ok { + if ok, msg := e.validateApplicationListenerAttribute(r.ListenerAttribute); !ok { return ok, msg } } diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/azure.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/azure.go index cbc9b56613..3ee805b922 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/azure.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/azure.go @@ -173,10 +173,10 @@ func (a *Alb) EnsureMultiListeners(region, lbID string, listeners []*networkexte var err error switch group[0].Spec.Protocol { case AzureProtocolTCP, AzureProtocolUDP: - l4RetMap, inErr := a.ensureLoadBalancerListener(region, group) - if inErr != nil { + l4RetMap, err := a.ensureLoadBalancerListener(region, group) + if err != nil { for _, li := range group { - retMap[li.GetName()] = cloud.Result{IsError: true, Err: inErr} + retMap[li.GetName()] = cloud.Result{IsError: true, Err: err} } continue } diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/constant.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/constant.go index fc5bd95216..74fc666b41 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/constant.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/constant.go @@ -27,8 +27,6 @@ const ( AzureProtocolTCP = "TCP" // AzureProtocolUDP elb udp protocol AzureProtocolUDP = "UDP" - // AzureProtocolTLS elb tls protocol - AzureProtocolTLS = "TLS" // DefaultRequestTimeout seconds that application wait for backend's response DefaultRequestTimeout = 20 diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/helper.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/helper.go index 92d468127d..8a65762a57 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/helper.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/helper.go @@ -14,7 +14,6 @@ package azure import ( - // NOCC:gas/crypto(误报 未用于创建密钥) "crypto/md5" "fmt" "strings" @@ -32,15 +31,6 @@ import ( networkextensionv1 "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/apis/networkextension/v1" ) -// ensureLoadBalancerListener ensure load balancer listener, azure load balancer can only support layer4 listener -// LoadBalancerListener contains: -// - backendAddressPool -// - probe -// - loadBalancingRules (can be seen as listener) -// (LoadBalancer listener) --> LoadBalancingRule --> backendAddressPool --> backend1 -// |--> backend2 -// |--> ... -// |--> ... func (a *Alb) ensureLoadBalancerListener(region string, listeners []*networkextensionv1.Listener) (map[string]cloud. Result, error) { if len(listeners) == 0 { @@ -48,7 +38,6 @@ func (a *Alb) ensureLoadBalancerListener(region string, listeners []*networkexte } blog.V(4).Infof("ensure load balancer listener[%d]", len(listeners)) for _, listener := range listeners { - // listener下的targetGroup中,所有backend必须有相同的port if !isRuleSamePort(listener) { return nil, errors.Wrapf(multiplePortInOneTargetGroupError, "listener '%s/%s' check failed", listener.GetNamespace(), listener.GetName()) @@ -74,7 +63,6 @@ func (a *Alb) ensureLoadBalancerListener(region string, listeners []*networkexte } } - // ensure失败的监听器,需要将原因返回上层 retMap := make(map[string]cloud.Result) for _, li := range successListenerList { if errI, ok := failedListenerMap.Load(li.GetName()); ok { @@ -93,16 +81,13 @@ func (a *Alb) ensureLoadBalancerListener(region string, listeners []*networkexte return retMap, nil } -// ensureAddrPoolForLB ensure addr pool for load balancer func (a *Alb) ensureAddrPoolForLB(listeners []*networkextensionv1.Listener) *sync.Map { failedListenerMap := &sync.Map{} - // 通过channel限制同时启动的goroutine数量 ch := make(chan struct{}, CreateGoroutineLimit) wg := sync.WaitGroup{} wg.Add(len(listeners)) for _, listener := range listeners { ch <- struct{}{} - // 不同AddrPool之间互不影响,goroutine创建加快效率 go func(listener *networkextensionv1.Listener) { defer func() { wg.Done() @@ -113,11 +98,9 @@ func (a *Alb) ensureAddrPoolForLB(listeners []*networkextensionv1.Listener) *syn poolName := getLBRuleTgName(listener.Name, listener.Spec.Port) addrList := make([]*armnetwork.LoadBalancerBackendAddress, 0) - // 根据listener.spec.targetGroup构建AddressPool if listener.Spec.TargetGroup != nil && len(listener.Spec.TargetGroup.Backends) != 0 { for _, backend := range listener.Spec.TargetGroup.Backends { addrList = append(addrList, &armnetwork.LoadBalancerBackendAddress{ - // NOCC:gas/crypto(误报 未用于创建密钥) Name: to.StringPtr(fmt.Sprintf("%x", md5.Sum([]byte(backend.IP)))), Properties: &armnetwork.LoadBalancerBackendAddressPropertiesFormat{ IPAddress: to.StringPtr(backend.IP), @@ -127,7 +110,7 @@ func (a *Alb) ensureAddrPoolForLB(listeners []*networkextensionv1.Listener) *syn } } - _, err := a.sdkWrapper.CreateOrUpdateBackendAddressPool(lbName, poolName, armnetwork.BackendAddressPool{ + _, err := a.sdkWrapper.CreateOrUpdateLoadBalanceBackendAddressPool(lbName, poolName, armnetwork.BackendAddressPool{ Name: to.StringPtr(poolName), Properties: &armnetwork.BackendAddressPoolPropertiesFormat{ LoadBalancerBackendAddresses: addrList, @@ -161,7 +144,6 @@ func (a *Alb) ensureLoadBalancer(region string, listeners []*networkextensionv1. return err } - // 3. ensure loadBalancer _, err = a.sdkWrapper.CreateOrUpdateLoadBalancer(listeners[0].Spec.LoadbalancerID, *lb) if err != nil { return err @@ -188,7 +170,6 @@ func (a *Alb) ensureProbesForLB(loadBalancer *armnetwork.LoadBalancer, }, } - // translate cr listenerAttribute to cloud request field if listener.Spec.ListenerAttribute != nil && listener.Spec.ListenerAttribute.HealthCheck != nil && listener. Spec.ListenerAttribute.HealthCheck.Enabled == true { healthCheck := listener.Spec.ListenerAttribute.HealthCheck @@ -207,7 +188,6 @@ func (a *Alb) ensureProbesForLB(loadBalancer *armnetwork.LoadBalancer, probeNameSet.Add(probeName) } - // 避免遗漏用户手动创建的probe for _, probe := range loadBalancer.Properties.Probes { if probe.Name != nil && probeNameSet.Contains(*probe.Name) { continue @@ -235,7 +215,6 @@ func (a *Alb) ensureLoadBalancingRule(loadBalancer *armnetwork.LoadBalancer, ruleName := getLBRuleTgName(listener.Name, listener.Spec.Port) port := getBackendPort(listener.Spec.TargetGroup) - // translate cr field to cloud request field newRule := &armnetwork.LoadBalancingRule{ Name: to.StringPtr(ruleName), Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ @@ -243,9 +222,14 @@ func (a *Alb) ensureLoadBalancingRule(loadBalancer *armnetwork.LoadBalancer, Protocol: transTransportProtocolPtr(listener.Spec.Protocol), BackendAddressPool: a.resourceHelper.genSubResource(ResourceProviderLoadBalancer, listener.Spec.LoadbalancerID, ResourceTypeBackendAddressPools, ruleName), + BackendAddressPools: nil, BackendPort: to.Int32Ptr(port), + DisableOutboundSnat: nil, EnableFloatingIP: to.BoolPtr(false), + EnableTCPReset: nil, FrontendIPConfiguration: a.resourceHelper.getSubResourceByID(*frontendIPConfigurationID), + IdleTimeoutInMinutes: nil, + LoadDistribution: nil, Probe: a.resourceHelper.genSubResource(ResourceProviderLoadBalancer, listener.Spec.LoadbalancerID, ResourceTypeProbes, ruleName), }, @@ -261,7 +245,6 @@ func (a *Alb) ensureLoadBalancingRule(loadBalancer *armnetwork.LoadBalancer, ruleNameSet.Add(ruleName) } - // 避免遗漏用户手动创建的规则 for _, rule := range loadBalancer.Properties.LoadBalancingRules { if rule.Name != nil && ruleNameSet.Contains(*rule.Name) { continue @@ -337,17 +320,6 @@ func (a *Alb) deleteLoadBalancerListener(region string, listeners []*networkexte return nil } - -// ensureApplicationGatewayListener ensure listeners of ApplicationGateway. -// ApplicationGateway is layer7 load balancer in azure -// contains: -// - frontendPort -// - AddressPool -// - Probes -// - BackendSettings -// - HttpListener -// - URLPathMap -// - RequestRoutingRule func (a *Alb) ensureApplicationGatewayListener(region string, listeners []*networkextensionv1.Listener) error { if len(listeners) == 0 { return nil @@ -426,7 +398,6 @@ func (a *Alb) ensureFrontendPortForAg(appGateway *armnetwork.ApplicationGateway, return appGateway } -// azure中,addressPool只包含IP。 监听器具体的后端转发端口/协议由backendSetting指定 func (a *Alb) ensureAddrPoolForAg(appGateway *armnetwork.ApplicationGateway, listeners []*networkextensionv1.Listener) *armnetwork.ApplicationGateway { newPools := make([]*armnetwork.ApplicationGatewayBackendAddressPool, 0) @@ -475,7 +446,6 @@ func (a *Alb) ensureAddrPoolForAg(appGateway *armnetwork.ApplicationGateway, return appGateway } -// backendSetting 用于确认后端对应的端口和协议 func (a *Alb) ensureBackendSettings(appGateway *armnetwork.ApplicationGateway, listeners []*networkextensionv1.Listener) *armnetwork.ApplicationGateway { newSettings := make([]*armnetwork.ApplicationGatewayBackendHTTPSettings, 0) @@ -485,7 +455,7 @@ func (a *Alb) ensureBackendSettings(appGateway *armnetwork.ApplicationGateway, settingName := getRuleTgName(listener.Name, rule.Domain, rule.Path, listener.Spec.Port) needProbe := false - var probeResource *armnetwork.SubResource + var probeResource *armnetwork.SubResource = nil if rule.ListenerAttribute != nil && rule.ListenerAttribute.HealthCheck != nil && rule.ListenerAttribute. HealthCheck.Enabled { needProbe = true @@ -503,12 +473,20 @@ func (a *Alb) ensureBackendSettings(appGateway *armnetwork.ApplicationGateway, newSetting := &armnetwork.ApplicationGatewayBackendHTTPSettings{ Name: to.StringPtr(settingName), Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ + AffinityCookieName: nil, + AuthenticationCertificates: nil, + ConnectionDraining: nil, + CookieBasedAffinity: nil, + HostName: nil, + Path: nil, PickHostNameFromBackendAddress: to.BoolPtr(false), Port: to.Int32Ptr(int32(port)), Probe: probeResource, ProbeEnabled: &needProbe, Protocol: transAgProtocolPtr(protocol), RequestTimeout: to.Int32Ptr(DefaultRequestTimeout), + TrustedRootCertificates: nil, + ProvisioningState: nil, }, } newSettings = append(newSettings, newSetting) @@ -519,9 +497,18 @@ func (a *Alb) ensureBackendSettings(appGateway *armnetwork.ApplicationGateway, newSettings = append(newSettings, &armnetwork.ApplicationGatewayBackendHTTPSettings{ Name: to.StringPtr(DefaultBackendSettingName), Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ - Port: to.Int32Ptr(80), - Protocol: transAgProtocolPtr(string(armnetwork.ApplicationGatewayProtocolHTTP)), - RequestTimeout: to.Int32Ptr(DefaultRequestTimeout), + AffinityCookieName: nil, + AuthenticationCertificates: nil, + ConnectionDraining: nil, + CookieBasedAffinity: nil, + HostName: nil, + Path: nil, + PickHostNameFromBackendAddress: nil, + Port: to.Int32Ptr(80), + Protocol: transAgProtocolPtr(string(armnetwork.ApplicationGatewayProtocolHTTP)), + RequestTimeout: to.Int32Ptr(DefaultRequestTimeout), + TrustedRootCertificates: nil, + ProvisioningState: nil, }, }) @@ -563,7 +550,6 @@ func (a *Alb) ensureProbeForAg(appGateway *armnetwork.ApplicationGateway, probeHost = "127.0.0.1" } - // translate cr field to cloud request field newProbe := &armnetwork.ApplicationGatewayProbe{ Name: to.StringPtr(probeName), Properties: &armnetwork.ApplicationGatewayProbePropertiesFormat{ @@ -579,14 +565,11 @@ func (a *Alb) ensureProbeForAg(appGateway *armnetwork.ApplicationGateway, UnhealthyThreshold: to.Int32Ptr(int32(healthCheck.UnHealthNum)), }, } - // 用户未配置健康检查端口时,使用后端服务的端口 if healthCheck.HealthCheckPort == 0 { newProbe.Properties.Port = to.Int32Ptr(getBackendPort(rule.TargetGroup)) } - // 用户未配置健康检查协议时,使用后端服务的协议 if healthCheck.HealthCheckProtocol == "" { if rule.TargetGroup == nil || len(rule.TargetGroup.Backends) == 0 { - // 空监听器使用HTTP作为默认(用于没有rs,实际不会被用到) newProbe.Properties.Protocol = transAgProtocolPtr(AzureProtocolHTTP) } else { newProbe.Properties.Protocol = transAgProtocolPtr(rule.TargetGroup.TargetGroupProtocol) @@ -641,23 +624,25 @@ func (a *Alb) ensureHttpListenerForAg(appGateway *armnetwork.ApplicationGateway, httpListenerName := getHttpListenerName(listener.Spec.Port, rule.Domain) listenPort := listener.Spec.Port - var hostNamePtr *string + var hostNamePtr *string = nil if rule.Domain != "" { hostNamePtr = to.StringPtr(rule.Domain) } - // translate cr field to cloud request field newHttpListener := &armnetwork.ApplicationGatewayHTTPListener{ Name: to.StringPtr(httpListenerName), Properties: &armnetwork.ApplicationGatewayHTTPListenerPropertiesFormat{ FrontendIPConfiguration: a.resourceHelper.getSubResourceByID(*frontIPConfigurationID), FrontendPort: a.resourceHelper.genSubResource(ResourceProviderApplicationGateway, listener.Spec.LoadbalancerID, ResourceTypeFrontendPorts, fmt.Sprintf("port_%d", listenPort)), - HostName: hostNamePtr, - Protocol: transAgProtocolPtr(listener.Spec.Protocol), + HostName: hostNamePtr, + Protocol: transAgProtocolPtr(listener.Spec.Protocol), + RequireServerNameIndication: nil, + SSLCertificate: nil, + SSLProfile: nil, }, } - if strings.ToUpper(listener.Spec.Protocol) == AzureProtocolHTTPS && listener.Spec.Certificate != nil { + if strings.ToLower(listener.Spec.Protocol) == "https" && listener.Spec.Certificate != nil { newHttpListener.Properties.SSLCertificate = a.resourceHelper.genSubResource( ResourceProviderApplicationGateway, listener.Spec.LoadbalancerID, ResourceTypeSSLCertificate, listener.Spec.Certificate.CertID) @@ -668,7 +653,6 @@ func (a *Alb) ensureHttpListenerForAg(appGateway *armnetwork.ApplicationGateway, } } - // 避免遗漏用户手动创建的监听器 for _, httpListener := range appGateway.Properties.HTTPListeners { if httpListener.Name != nil && listenerNameSet.Contains(*httpListener.Name) { continue @@ -712,9 +696,8 @@ func (a *Alb) ensureRequestRoutingRule(appGateway *armnetwork.ApplicationGateway } } - // Azure 规定一个ruleTg中的所有backend都必须是相同的port + // Azure request all backends have same port ruleTgName := getRuleTgName(listener.Name, rule.Domain, rule.Path, listener.Spec.Port) - // 每条rule需要有唯一的优先级,这里会选择1~20000中没被使用过的最小优先级 priority := generatePriority(appGateway) newRoutingRule := &armnetwork.ApplicationGatewayRequestRoutingRule{ @@ -748,7 +731,6 @@ func (a *Alb) ensureRequestRoutingRule(appGateway *armnetwork.ApplicationGateway return appGateway, nil } -// URLPath 指定了http监听器中具体路径和addressPool/backendSetting的对应关系 func (a *Alb) ensureUrlPathMap(appGateway *armnetwork.ApplicationGateway, listeners []*networkextensionv1.Listener) *armnetwork.ApplicationGateway { urlPathMapMap := make(map[string]*armnetwork.ApplicationGatewayURLPathMap) @@ -781,7 +763,6 @@ func (a *Alb) ensureUrlPathMap(appGateway *armnetwork.ApplicationGateway, } } - // NOCC:gas/crypto(误报 未用于创建密钥) pathRuleName := fmt.Sprintf("%x", md5.Sum([]byte(rule.Path))) redundant := false for _, pathRule := range urlPathMap.Properties.PathRules { @@ -957,7 +938,6 @@ func (a *Alb) deleteURLPathMapForAg(appGateway *armnetwork.ApplicationGateway, if rule.Path == "" { continue } - // NOCC:gas/crypto(误报 未用于创建密钥) pathName := fmt.Sprintf("%x", md5.Sum([]byte(rule.Path))) urlPathMapName := getHttpListenerName(listener.Spec.Port, rule.Domain) diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/helper_test.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/helper_test.go index 641e09da60..5ad424b7db 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/helper_test.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/helper_test.go @@ -23,7 +23,6 @@ import ( ) // TestEnsureApplicationGatewayListener test ensure azure application gateway listener -// NOCC:tosa/fn_length(测试函数) func TestEnsureApplicationGatewayListener(t *testing.T) { listener := &networkextensionv1.Listener{ TypeMeta: metav1.TypeMeta{}, diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/resourcehelper.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/resourcehelper.go index d0b98c7417..9818ea2998 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/resourcehelper.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/resourcehelper.go @@ -69,7 +69,6 @@ const ( ResourceTypeSSLProfile resourceType = "sslProfile" ) -// NewResourceHelper return resource helper func NewResourceHelper(subscriptionsID string, resourceGroupName string) *ResourceHelper { return &ResourceHelper{ subscriptionsID: subscriptionsID, diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/sdk.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/sdk.go index cd4515362d..a531171521 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/sdk.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/sdk.go @@ -35,8 +35,7 @@ import ( ) const ( - envNameAzureClientID = "AZURE_CLIENT_ID" - // NOCC:gas/crypto(环境名误报) + envNameAzureClientID = "AZURE_CLIENT_ID" envNameAzureClientSecret = "AZURE_CLIENT_SECRET" envNameAzureTenantID = "AZURE_TENANT_ID" envNameAzureSubscriptionID = "AZURE_SUBSCRIPTION_ID" @@ -149,7 +148,7 @@ func NewSdkWrapperWithSecretIDKey(secretID, secretKey string) (*SdkWrapper, erro return sw, nil } -// loadEnv load env parameters +// loadEnv load env parameters todo func (sw *SdkWrapper) loadEnv() { sw.clientID = os.Getenv(envNameAzureClientID) sw.clientSecret = os.Getenv(envNameAzureClientSecret) @@ -376,8 +375,8 @@ func (sw *SdkWrapper) CreateOrUpdateLoadBalancer(loadBalancerName string, return &lb, nil } -// CreateOrUpdateBackendAddressPool create or update azure backend address pool -func (sw *SdkWrapper) CreateOrUpdateBackendAddressPool(loadBalancerName string, +// CreateOrUpdateLoadBalanceBackendAddressPool create or update azure backend address pool +func (sw *SdkWrapper) CreateOrUpdateLoadBalanceBackendAddressPool(loadBalancerName string, backendAddressPoolName string, parameters armnetwork.BackendAddressPool) (*armnetwork. LoadBalancerBackendAddressPoolsClientCreateOrUpdateResponse, error) { blog.V(3).Infof("createOrUpdateBackendAddressPool[%s] request: %s", loadBalancerName, diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/uitl.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/uitl.go index 5dfa36f8f7..4b6f193a76 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/uitl.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/azure/uitl.go @@ -14,7 +14,6 @@ package azure import ( - // NOCC:gas/crypto(未用于生成密钥) "crypto/md5" "fmt" "strings" @@ -27,10 +26,10 @@ import ( func transTransportProtocolPtr(str string) *armnetwork.TransportProtocol { var protocol armnetwork.TransportProtocol - switch strings.ToUpper(str) { - case AzureProtocolTCP: + switch strings.ToLower(str) { + case "tcp": protocol = armnetwork.TransportProtocolTCP - case AzureProtocolUDP: + case "udp": protocol = armnetwork.TransportProtocolUDP } @@ -39,14 +38,14 @@ func transTransportProtocolPtr(str string) *armnetwork.TransportProtocol { func transAgProtocolPtr(str string) *armnetwork.ApplicationGatewayProtocol { var protocol armnetwork.ApplicationGatewayProtocol - switch strings.ToUpper(str) { - case AzureProtocolHTTP: + switch strings.ToLower(str) { + case "http": protocol = armnetwork.ApplicationGatewayProtocolHTTP - case AzureProtocolHTTPS: + case "https": protocol = armnetwork.ApplicationGatewayProtocolHTTPS - case AzureProtocolTCP: + case "tcp": protocol = armnetwork.ApplicationGatewayProtocolTCP - case AzureProtocolTLS: + case "tls": protocol = armnetwork.ApplicationGatewayProtocolTLS } @@ -55,12 +54,12 @@ func transAgProtocolPtr(str string) *armnetwork.ApplicationGatewayProtocol { func transProbeProtocolPtr(str string) *armnetwork.ProbeProtocol { var protocol armnetwork.ProbeProtocol - switch strings.ToUpper(str) { - case AzureProtocolHTTP: + switch strings.ToLower(str) { + case "http": protocol = armnetwork.ProbeProtocolHTTP - case AzureProtocolHTTPS: + case "https": protocol = armnetwork.ProbeProtocolHTTPS - case AzureProtocolTCP: + case "tcp": protocol = armnetwork.ProbeProtocolTCP } return &protocol @@ -68,7 +67,7 @@ func transProbeProtocolPtr(str string) *armnetwork.ProbeProtocol { // transAgProbeMatch translate healthCheck to azure entity func transAgProbeMatch(healthCheck *networkextensionv1.ListenerHealthCheck) *armnetwork. - ApplicationGatewayProbeHealthResponseMatch { +ApplicationGatewayProbeHealthResponseMatch { if healthCheck == nil || healthCheck.HTTPCode < 1 || healthCheck.HTTPCode > 31 { return nil } @@ -88,13 +87,11 @@ func transAgProbeMatch(healthCheck *networkextensionv1.ListenerHealthCheck) *arm // listenerName.md5(listenerName+domain+path) func getRuleTgName(listenerName, domain, path string, listenPort int) string { - // NOCC:gas/crypto(未用于生成密钥) return fmt.Sprintf("%s.%x.%d", listenerName, md5.Sum([]byte(listenerName+domain+path)), listenPort) } // listenPort.md5(domain) func getHttpListenerName(listenPort int, domain string) string { - // NOCC:gas/crypto(未用于生成密钥) return fmt.Sprintf("%d.%x", listenPort, md5.Sum([]byte(domain))) } @@ -167,7 +164,7 @@ func splitListenersToDiffProtocol(listeners []*networkextensionv1.Listener) [][] if li.Spec.EndPort != 0 { listenerList = append(listenerList, splitSegListener([]*networkextensionv1. - Listener{li})...) + Listener{li})...) } else { listenerList = append(listenerList, li) } diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/gcp/helper.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/gcp/helper.go index e0ee99cfe0..9d02c286bb 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/gcp/helper.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/gcp/helper.go @@ -14,7 +14,6 @@ package gcp import ( "context" - // NOCC:gas/crypto(未使用于密钥) "crypto/md5" "errors" "fmt" @@ -135,16 +134,16 @@ func (e *GCLB) ensureListenerService(region string, listener *networkextensionv1 // ensure service without selector service := &k8scorev1.Service{} objectKey := types.NamespacedName{Namespace: listener.Namespace, Name: listener.Name} - if inErr := e.client.Get(context.TODO(), objectKey, service); inErr != nil { - if k8serrors.IsNotFound(inErr) { + if err := e.client.Get(context.TODO(), objectKey, service); err != nil { + if k8serrors.IsNotFound(err) { // create service - svc := e.generateListenerService(listener, address.Address) - if inErr = e.client.Create(context.TODO(), svc); inErr != nil { - return "", false, inErr + service := e.generateListenerService(listener, address.Address) + if err := e.client.Create(context.TODO(), service); err != nil { + return "", false, err } - return svc.Name, true, nil + return service.Name, true, nil } - return "", false, inErr + return "", false, err } if service.DeletionTimestamp != nil { @@ -213,12 +212,12 @@ func (e *GCLB) ensureListenerEndpoints(listener *networkextensionv1.Listener) (b if err := e.client.Get(context.TODO(), objectKey, ep); err != nil { if k8serrors.IsNotFound(err) { // create endpoints - inEp := e.generateListenerEndpoints(listener) - if inEp == nil { + ep := e.generateListenerEndpoints(listener) + if ep == nil { blog.Warnf("endpoints %s is empty", objectKey.String()) return false, nil } - return true, e.client.Create(context.TODO(), inEp) + return true, e.client.Create(context.TODO(), ep) } return false, err } @@ -318,11 +317,11 @@ func (e *GCLB) ensureURLMap(listener *networkextensionv1.Listener) (string, erro // ensure url map _, err = e.sdkWrapper.GetURLMaps(e.project, listener.Name) if err != nil { - if isNotFound(err) { - inErr := e.sdkWrapper.CreateURLMap(e.project, &compute.UrlMap{Name: listener.Name, DefaultService: "global/backendServices/" + bsName}) - if inErr != nil { - blog.Errorf("CreateURLMap %s failed, %s", listener.Name, inErr.Error()) - return "", inErr + if IsNotFound(err) { + err := e.sdkWrapper.CreateURLMap(e.project, &compute.UrlMap{Name: listener.Name, DefaultService: "global/backendServices/" + bsName}) + if err != nil { + blog.Errorf("CreateURLMap %s failed, %s", listener.Name, err.Error()) + return "", err } return listener.Name, nil } @@ -339,14 +338,14 @@ func (e *GCLB) ensureTargetProxy(listener *networkextensionv1.Listener) (string, } // get target proxy - if listener.Spec.Protocol == ProtocolHTTP { + if listener.Spec.Protocol == "HTTP" { _, err = e.sdkWrapper.GetTargetHTTPProxies(e.project, listener.Name) if err != nil { - if isNotFound(err) { - inErr := e.sdkWrapper.CreateTargetHTTPProxy(e.project, &compute.TargetHttpProxy{Name: listener.Name, UrlMap: "global/urlMaps/" + urlMapName}) - if inErr != nil { - blog.Errorf("CreateTargetHTTPProxy %s failed, %s", listener.Name, inErr.Error()) - return "", inErr + if IsNotFound(err) { + err := e.sdkWrapper.CreateTargetHTTPProxy(e.project, &compute.TargetHttpProxy{Name: listener.Name, UrlMap: "global/urlMaps/" + urlMapName}) + if err != nil { + blog.Errorf("CreateTargetHTTPProxy %s failed, %s", listener.Name, err.Error()) + return "", err } return listener.Name, nil } @@ -362,13 +361,13 @@ func (e *GCLB) ensureTargetProxy(listener *networkextensionv1.Listener) (string, } _, err = e.sdkWrapper.GetTargetHTTPSProxies(e.project, listener.Name) if err != nil { - if isNotFound(err) { - inErr := e.sdkWrapper.CreateTargetHTTPSProxy(e.project, &compute.TargetHttpsProxy{Name: listener.Name, + if IsNotFound(err) { + err := e.sdkWrapper.CreateTargetHTTPSProxy(e.project, &compute.TargetHttpsProxy{Name: listener.Name, UrlMap: "global/urlMaps/" + urlMapName, SslCertificates: []string{"global/sslCertificates/" + listener.Spec.Certificate.CertID}}) - if inErr != nil { - blog.Errorf("CreateTargetHTTPSProxy %s failed, %s", listener.Name, inErr.Error()) - return "", inErr + if err != nil { + blog.Errorf("CreateTargetHTTPSProxy %s failed, %s", listener.Name, err.Error()) + return "", err } return listener.Name, nil } @@ -389,12 +388,12 @@ func (e *GCLB) ensureForwardingRules(listener *networkextensionv1.Listener) (str // get forwarding rules fr, err := e.sdkWrapper.GetForwardingRules(e.project, listener.Name) if err != nil { - if isNotFound(err) { + if IsNotFound(err) { // create forwarding rules - inErr := e.sdkWrapper.CreateForwardingRules(e.project, listener.Name, targetProxyName, + err := e.sdkWrapper.CreateForwardingRules(e.project, listener.Name, targetProxyName, listener.Spec.LoadbalancerID, listener.Spec.Port) - if inErr != nil { - return "", inErr + if err != nil { + return "", err } return listener.Name, nil } @@ -447,7 +446,6 @@ func (e *GCLB) ensureL7Rules(rules []networkextensionv1.ListenerRule, protocol, // md5(domain+path) func getRuleName(domain, path string, port int) string { - // NOCC:gas/crypto(未使用于密钥) return fmt.Sprintf("a%x", md5.Sum([]byte(fmt.Sprintf("%s:%d%s", domain, port, path)))) } @@ -460,10 +458,10 @@ func getNEGName(backendServiceName, zone string) string { func (e *GCLB) ensureL7HealthCheck(rule networkextensionv1.ListenerRule, port int) error { _, err := e.sdkWrapper.GetHealthChecks(e.project, getRuleName(rule.Domain, rule.Path, port)) if err != nil { - if isNotFound(err) { - if inErr := e.sdkWrapper.CreateHealthChecks(e.project, e.generateHealthCheck(rule, port)); inErr != nil { - blog.Errorf("CreateHealthChecks failed, err: %s", inErr.Error()) - return inErr + if IsNotFound(err) { + if err := e.sdkWrapper.CreateHealthChecks(e.project, e.generateHealthCheck(rule, port)); err != nil { + blog.Errorf("CreateHealthChecks failed, err: %s", err.Error()) + return err } return nil } @@ -485,7 +483,7 @@ func (e *GCLB) generateHealthCheck(rule networkextensionv1.ListenerRule, port in } if rule.ListenerAttribute == nil || rule.ListenerAttribute.HealthCheck == nil { hc.HttpHealthCheck = &compute.HTTPHealthCheck{Port: 80} - hc.Type = ProtocolHTTP + hc.Type = "HTTP" } if rule.ListenerAttribute != nil && rule.ListenerAttribute.HealthCheck != nil { if rule.ListenerAttribute.HealthCheck.IntervalTime != 0 { @@ -504,17 +502,17 @@ func (e *GCLB) generateHealthCheck(rule networkextensionv1.ListenerRule, port in hc.Type = rule.ListenerAttribute.HealthCheck.HealthCheckProtocol } switch hc.Type { - case ProtocolHTTP: + case "HTTP": hc.HttpHealthCheck = &compute.HTTPHealthCheck{ Port: int64(rule.ListenerAttribute.HealthCheck.HealthCheckPort), RequestPath: rule.ListenerAttribute.HealthCheck.HTTPCheckPath, } - case ProtocolHTTPS: + case "HTTPS": hc.HttpsHealthCheck = &compute.HTTPSHealthCheck{ Port: int64(rule.ListenerAttribute.HealthCheck.HealthCheckPort), RequestPath: rule.ListenerAttribute.HealthCheck.HTTPCheckPath, } - case ProtocolTCP: + case "TCP": hc.TcpHealthCheck = &compute.TCPHealthCheck{ Port: int64(rule.ListenerAttribute.HealthCheck.HealthCheckPort), } @@ -528,7 +526,7 @@ func (e *GCLB) ensureL7BackendService(rule networkextensionv1.ListenerRule, prot name := getRuleName(rule.Domain, rule.Path, port) _, err := e.sdkWrapper.GetBackendServices(e.project, name) if err != nil { - if isNotFound(err) { + if IsNotFound(err) { bs := &compute.BackendService{ Name: name, LoadBalancingScheme: "EXTERNAL", @@ -536,12 +534,12 @@ func (e *GCLB) ensureL7BackendService(rule networkextensionv1.ListenerRule, prot HealthChecks: []string{"global/healthChecks/" + name}, } if rule.ListenerAttribute != nil && rule.ListenerAttribute.BackendInsecure { - bs.Protocol = ProtocolHTTP + bs.Protocol = "HTTP" } - inErr := e.sdkWrapper.CreateBackendService(e.project, bs) - if inErr != nil { - blog.Errorf("CreateBackendService failed, err: %s", inErr.Error()) - return "", inErr + err := e.sdkWrapper.CreateBackendService(e.project, bs) + if err != nil { + blog.Errorf("CreateBackendService failed, err: %s", err.Error()) + return "", err } } else { blog.Errorf("GetBackendServices failed, err: %s", err.Error()) @@ -588,9 +586,9 @@ func (e *GCLB) ensureNEGs(targetGroup *networkextensionv1.ListenerTargetGroup, b newNegs := e.generateNEGs(zones, zone, backendServiceName) for _, v := range newNegs { if _, ok := existNegsMap[v.Name]; !ok { - inErr := e.sdkWrapper.CreateNetworkEndpointGroups(e.project, v.Zone, v.Name, network, subnetwork) - if inErr != nil { - return inErr + err := e.sdkWrapper.CreateNetworkEndpointGroups(e.project, v.Zone, v.Name, network, subnetwork) + if err != nil { + return err } } } @@ -841,27 +839,27 @@ func (e *GCLB) deleteL4Listener(listener *networkextensionv1.Listener) error { func (e *GCLB) deleteL7Listener(listener *networkextensionv1.Listener) error { // delete forwarding-rules - if err := e.sdkWrapper.DeleteForwardingRules(e.project, listener.Name); isError(err) { + if err := e.sdkWrapper.DeleteForwardingRules(e.project, listener.Name); err != nil && !IsNotFound(err) { blog.Errorf("DeleteForwardingRules failed, err: %s", err.Error()) return err } // delete target http(s) proxy if listener.Spec.Protocol == ProtocolHTTP { - if err := e.sdkWrapper.DeleteTargetHTTPProxy(e.project, listener.Name); isError(err) { + if err := e.sdkWrapper.DeleteTargetHTTPProxy(e.project, listener.Name); err != nil && !IsNotFound(err) { blog.Errorf("DeleteTargetHTTPProxy failed, err: %s", err.Error()) return err } } if listener.Spec.Protocol == ProtocolHTTPS { - if err := e.sdkWrapper.DeleteTargetHTTPSProxy(e.project, listener.Name); isError(err) { + if err := e.sdkWrapper.DeleteTargetHTTPSProxy(e.project, listener.Name); err != nil && !IsNotFound(err) { blog.Errorf("DeleteTargetHTTPSProxy failed, err: %s", err.Error()) return err } } // delete url-maps - if err := e.sdkWrapper.DeleteURLMaps(e.project, listener.Name); isError(err) { + if err := e.sdkWrapper.DeleteURLMaps(e.project, listener.Name); err != nil && !IsNotFound(err) { blog.Errorf("DeleteURLMaps failed, err: %s", err.Error()) return err } @@ -869,27 +867,32 @@ func (e *GCLB) deleteL7Listener(listener *networkextensionv1.Listener) error { for _, rule := range listener.Spec.Rules { bsName := getRuleName(rule.Domain, rule.Path, listener.Spec.Port) defaultBsName := getRuleName(listener.Name, "", listener.Spec.Port) - - if err := e.deleteDefaultResource(defaultBsName); err != nil { + // delete default health check + if err := e.sdkWrapper.DeleteHealthCheck(e.project, defaultBsName); err != nil && !IsNotFound(err) { + blog.Errorf("DeleteHealthCheck failed, err: %s", err.Error()) + return err + } + // delete default backend service + if err := e.sdkWrapper.DeleteBackendService(e.project, defaultBsName); err != nil && !IsNotFound(err) { + blog.Errorf("DeleteBackendService failed, err: %s", err.Error()) return err } - // delete health-checks - if err := e.sdkWrapper.DeleteHealthCheck(e.project, bsName); isError(err) { + if err := e.sdkWrapper.DeleteHealthCheck(e.project, bsName); err != nil && !IsNotFound(err) { blog.Errorf("DeleteHealthCheck failed, err: %s", err.Error()) return err } // get backend service bs, err := e.sdkWrapper.GetBackendServices(e.project, bsName) if err != nil { - if isNotFound(err) { + if IsNotFound(err) { continue } blog.Errorf("GetBackendServices failed, err: %s", err.Error()) return err } // delete backend-services - if err := e.sdkWrapper.DeleteBackendService(e.project, bsName); isError(err) { + if err := e.sdkWrapper.DeleteBackendService(e.project, bsName); err != nil && !IsNotFound(err) { blog.Errorf("DeleteBackendService failed, err: %s", err.Error()) return err } @@ -924,17 +927,3 @@ func (e *GCLB) deleteEndpoints(listener *networkextensionv1.Listener) error { } return nil } - -func (e *GCLB) deleteDefaultResource(defaultBsName string) error { - // delete default health check - if err := e.sdkWrapper.DeleteHealthCheck(e.project, defaultBsName); err != nil && !isNotFound(err) { - blog.Errorf("DeleteHealthCheck failed, err: %s", err.Error()) - return err - } - // delete default backend service - if err := e.sdkWrapper.DeleteBackendService(e.project, defaultBsName); err != nil && !isNotFound(err) { - blog.Errorf("DeleteBackendService failed, err: %s", err.Error()) - return err - } - return nil -} diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/gcp/sdk.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/gcp/sdk.go index 5ec1430c7e..95d950a191 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/gcp/sdk.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/gcp/sdk.go @@ -15,16 +15,20 @@ package gcp import ( "context" "fmt" + "net/http" + "os" + "runtime" "strconv" + "strings" "time" - "golang.org/x/oauth2/google" - "google.golang.org/api/compute/v1" - "github.com/Tencent/bk-bcs/bcs-common/common/blog" "github.com/Tencent/bk-bcs/bcs-common/pkg/throttle" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/metrics" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-network/pkg/common" + "golang.org/x/oauth2/google" + "google.golang.org/api/compute/v1" + "google.golang.org/api/googleapi" ) // SdkWrapper wrapper for gcp sdk @@ -103,6 +107,105 @@ func NewSdkWrapperWithSecretIDKey(credentials []byte) (*SdkWrapper, error) { return NewSdkWrapper() } +func (sw *SdkWrapper) loadEnv() error { + if len(sw.credentials) == 0 { + sw.credentials = []byte(os.Getenv(EnvNameGCPCredentials)) + } + + qpsStr := os.Getenv(EnvNameGCPRateLimitQPS) + if len(qpsStr) != 0 { + qps, err := strconv.ParseInt(qpsStr, 10, 64) + if err != nil { + blog.Warnf("parse rate limit qps %s failed, err %s, use default %d", + qpsStr, err.Error(), defaultThrottleQPS) + sw.ratelimitqps = int64(defaultThrottleQPS) + } else { + sw.ratelimitqps = qps + } + } else { + sw.ratelimitqps = int64(defaultThrottleQPS) + } + + bucketSizeStr := os.Getenv(EnvNameGCPRateLimitBucketSize) + if len(bucketSizeStr) != 0 { + bucketSize, err := strconv.ParseInt(bucketSizeStr, 10, 64) + if err != nil { + blog.Warnf("parse rate limit bucket size %s failed, err %s, use default %d", + bucketSizeStr, err.Error(), defaultBucketSize) + sw.ratelimitbucketSize = int64(defaultBucketSize) + } else { + sw.ratelimitbucketSize = bucketSize + } + } else { + sw.ratelimitbucketSize = int64(defaultBucketSize) + } + return nil +} + +// call tryThrottle before each api call +func (sw *SdkWrapper) tryThrottle() { + now := time.Now() + sw.throttler.Accept() + if latency := time.Since(now); latency > maxLatency { + pc, _, _, _ := runtime.Caller(2) + callerName := runtime.FuncForPC(pc).Name() + blog.Infof("Throttling request took %d ms, function: %s", latency, callerName) + } +} + +// IsNotFound returns true if the error is resource not found +func IsNotFound(err error) bool { + if err == nil { + return false + } + ae, ok := err.(*googleapi.Error) + return ok && ae.Code == http.StatusNotFound +} + +// Wait wait for cloud api async +func (sw *SdkWrapper) Wait(ctx context.Context, project string, op *compute.Operation) error { + tk := time.NewTicker(defaultPollingInterval) + for { + select { + case <-ctx.Done(): + return ctx.Err() + case <-tk.C: + var resp *compute.Operation + var err error + blog.Infof("wait for operation %s", op.Name) + if op.Region != "" { + regionStrs := strings.Split(op.Region, "/") + region := regionStrs[len(regionStrs)-1] + resp, err = sw.computeService.RegionOperations.Get(project, region, op.Name).Context(ctx).Do() + } + if op.Zone != "" { + zoneStrs := strings.Split(op.Zone, "/") + zone := zoneStrs[len(zoneStrs)-1] + resp, err = sw.computeService.ZoneOperations.Get(project, zone, op.Name).Context(ctx).Do() + } else { + resp, err = sw.computeService.GlobalOperations.Get(project, op.Name).Context(ctx).Do() + } + if err != nil { + blog.Errorf("wait for operation %s failed, err %s", op.Name, err.Error()) + return err + } + if resp == nil { + return fmt.Errorf("operation %s not found", op.Name) + } + if resp.Status == "DONE" { + if resp.Error != nil { + e, err := resp.Error.MarshalJSON() + if err != nil { + return err + } + return fmt.Errorf("operation %s failed, error: %s", resp.Name, string(e)) + } + return nil + } + } + } +} + // GetAddress get address by name, if region is Global, it will get global address func (sw *SdkWrapper) GetAddress(project, region, name string) (*compute.Address, error) { blog.V(3).Infof("GetAddress input: project/%s, region/%s, name/%s", project, region, name) @@ -220,12 +323,11 @@ func (sw *SdkWrapper) CreateNetworkEndpointGroups(project, zone, name, network, return fmt.Errorf(errMsg) } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() - if inErr := sw.Wait(ctx, project, op); inErr != nil { + if err := sw.Wait(ctx, project, op); err != nil { mf(metrics.LibCallStatusTimeout) - errMsg := fmt.Sprintf("CreateNetworkEndpointGroups failed, err %s", inErr.Error()) + errMsg := fmt.Sprintf("CreateNetworkEndpointGroups failed, err %s", err.Error()) blog.Errorf(errMsg) return fmt.Errorf(errMsg) } @@ -256,14 +358,13 @@ func (sw *SdkWrapper) DeleteNetworkEndpointGroups(project, zone, name string) er return err } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() - if inErr := sw.Wait(ctx, project, op); inErr != nil { + if err := sw.Wait(ctx, project, op); err != nil { mf(metrics.LibCallStatusTimeout) - errMsg := fmt.Sprintf("DeleteNetworkEndpointGroups failed, err %s", inErr.Error()) + errMsg := fmt.Sprintf("DeleteNetworkEndpointGroups failed, err %s", err.Error()) blog.Errorf(errMsg) - return inErr + return err } blog.V(3).Infof("DeleteNetworkEndpointGroups response: %s", common.ToJsonString(op)) @@ -384,12 +485,11 @@ func (sw *SdkWrapper) CreateHealthChecks(project string, healthCheck *compute.He blog.Errorf(errMsg) return fmt.Errorf(errMsg) } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() - if inErr := sw.Wait(ctx, project, resp); inErr != nil { + if err := sw.Wait(ctx, project, resp); err != nil { mf(metrics.LibCallStatusTimeout) - errMsg := fmt.Sprintf("CreateHealthChecks failed, err %s", inErr.Error()) + errMsg := fmt.Sprintf("CreateHealthChecks failed, err %s", err.Error()) blog.Errorf(errMsg) return fmt.Errorf(errMsg) } @@ -420,12 +520,11 @@ func (sw *SdkWrapper) UpdateHealthChecks(project string, healthCheck *compute.He blog.Errorf(errMsg) return fmt.Errorf(errMsg) } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() - if inErr := sw.Wait(ctx, project, resp); inErr != nil { + if err := sw.Wait(ctx, project, resp); err != nil { mf(metrics.LibCallStatusTimeout) - errMsg := fmt.Sprintf("UpdateHealthChecks failed, err %s", inErr.Error()) + errMsg := fmt.Sprintf("UpdateHealthChecks failed, err %s", err.Error()) blog.Errorf(errMsg) return fmt.Errorf(errMsg) } @@ -482,7 +581,6 @@ func (sw *SdkWrapper) CreateBackendService(project string, backendService *compu blog.Errorf(errMsg) return fmt.Errorf(errMsg) } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() if err := sw.Wait(ctx, project, resp); err != nil { @@ -570,7 +668,6 @@ func (sw *SdkWrapper) CreateURLMap(project string, urlMap *compute.UrlMap) error blog.Errorf(errMsg) return fmt.Errorf(errMsg) } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() if err := sw.Wait(ctx, project, resp); err != nil { @@ -632,7 +729,6 @@ func (sw *SdkWrapper) CreateTargetHTTPProxy(project string, targetHTTPProxy *com blog.Errorf(errMsg) return fmt.Errorf(errMsg) } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() if err := sw.Wait(ctx, project, resp); err != nil { @@ -694,7 +790,6 @@ func (sw *SdkWrapper) CreateTargetHTTPSProxy(project string, targetHTTPSProxy *c blog.Errorf(errMsg) return fmt.Errorf(errMsg) } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() if err := sw.Wait(ctx, project, resp); err != nil { @@ -731,7 +826,6 @@ func (sw *SdkWrapper) PatchBackendService(project, name string, backendService * blog.Errorf(errMsg) return fmt.Errorf(errMsg) } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() if err := sw.Wait(ctx, project, resp); err != nil { @@ -821,7 +915,6 @@ func (sw *SdkWrapper) AttachNetworkEndpoints(project, zone, name string, endpoin blog.Errorf(errMsg) return fmt.Errorf(errMsg) } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() if err := sw.Wait(ctx, project, resp); err != nil { @@ -859,7 +952,6 @@ func (sw *SdkWrapper) DetachNetworkEndpoints(project, zone, name string, endpoin blog.Errorf(errMsg) return fmt.Errorf(errMsg) } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() if err := sw.Wait(ctx, project, resp); err != nil { @@ -895,7 +987,6 @@ func (sw *SdkWrapper) PatchURLMaps(project, name string, urlMap *compute.UrlMap) blog.Errorf(errMsg) return fmt.Errorf(errMsg) } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() if err := sw.Wait(ctx, project, resp); err != nil { @@ -931,7 +1022,6 @@ func (sw *SdkWrapper) DeleteForwardingRules(project, name string) error { blog.Errorf(errMsg) return err } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() if err := sw.Wait(ctx, project, resp); err != nil { @@ -967,7 +1057,6 @@ func (sw *SdkWrapper) DeleteURLMaps(project, name string) error { blog.Errorf(errMsg) return err } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() if err := sw.Wait(ctx, project, resp); err != nil { @@ -1003,7 +1092,6 @@ func (sw *SdkWrapper) DeleteTargetHTTPProxy(project, name string) error { blog.Errorf(errMsg) return err } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() if err := sw.Wait(ctx, project, resp); err != nil { @@ -1039,7 +1127,6 @@ func (sw *SdkWrapper) DeleteTargetHTTPSProxy(project, name string) error { blog.Errorf(errMsg) return err } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() if err := sw.Wait(ctx, project, resp); err != nil { @@ -1075,7 +1162,6 @@ func (sw *SdkWrapper) DeleteHealthCheck(project, name string) error { blog.Errorf(errMsg) return err } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() if err := sw.Wait(ctx, project, resp); err != nil { @@ -1111,7 +1197,6 @@ func (sw *SdkWrapper) DeleteBackendService(project, name string) error { blog.Errorf(errMsg) return err } - // add default timeout to rpc call ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) defer cancel() if err := sw.Wait(ctx, project, resp); err != nil { diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/gcp/sdkhelper.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/gcp/sdkhelper.go deleted file mode 100644 index ddc710cec0..0000000000 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/gcp/sdkhelper.go +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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 gcp - -import ( - "context" - "fmt" - "os" - "runtime" - "strconv" - "strings" - "time" - - "google.golang.org/api/compute/v1" - - "github.com/Tencent/bk-bcs/bcs-common/common/blog" -) - -func (sw *SdkWrapper) loadEnv() error { - if len(sw.credentials) == 0 { - sw.credentials = []byte(os.Getenv(EnvNameGCPCredentials)) - } - - qpsStr := os.Getenv(EnvNameGCPRateLimitQPS) - if len(qpsStr) != 0 { - qps, err := strconv.ParseInt(qpsStr, 10, 64) - if err != nil { - blog.Warnf("parse rate limit qps %s failed, err %s, use default %d", - qpsStr, err.Error(), defaultThrottleQPS) - sw.ratelimitqps = int64(defaultThrottleQPS) - } else { - sw.ratelimitqps = qps - } - } else { - sw.ratelimitqps = int64(defaultThrottleQPS) - } - - bucketSizeStr := os.Getenv(EnvNameGCPRateLimitBucketSize) - if len(bucketSizeStr) != 0 { - bucketSize, err := strconv.ParseInt(bucketSizeStr, 10, 64) - if err != nil { - blog.Warnf("parse rate limit bucket size %s failed, err %s, use default %d", - bucketSizeStr, err.Error(), defaultBucketSize) - sw.ratelimitbucketSize = int64(defaultBucketSize) - } else { - sw.ratelimitbucketSize = bucketSize - } - } else { - sw.ratelimitbucketSize = int64(defaultBucketSize) - } - return nil -} - -// call tryThrottle before each api call -func (sw *SdkWrapper) tryThrottle() { - now := time.Now() - sw.throttler.Accept() - if latency := time.Since(now); latency > maxLatency { - pc, _, _, _ := runtime.Caller(2) - callerName := runtime.FuncForPC(pc).Name() - blog.Infof("Throttling request took %d ms, function: %s", latency, callerName) - } -} - -// Wait wait for cloud api async -func (sw *SdkWrapper) Wait(ctx context.Context, project string, op *compute.Operation) error { - tk := time.NewTicker(defaultPollingInterval) - for { - select { - case <-ctx.Done(): - return ctx.Err() - case <-tk.C: - var resp *compute.Operation - var err error - blog.Infof("wait for operation %s", op.Name) - if op.Region != "" { - regionStrs := strings.Split(op.Region, "/") - region := regionStrs[len(regionStrs)-1] - resp, err = sw.computeService.RegionOperations.Get(project, region, op.Name).Context(ctx).Do() - } - if op.Zone != "" { - zoneStrs := strings.Split(op.Zone, "/") - zone := zoneStrs[len(zoneStrs)-1] - resp, err = sw.computeService.ZoneOperations.Get(project, zone, op.Name).Context(ctx).Do() - } else { - resp, err = sw.computeService.GlobalOperations.Get(project, op.Name).Context(ctx).Do() - } - if err != nil { - blog.Errorf("wait for operation %s failed, err %s", op.Name, err.Error()) - return err - } - if resp == nil { - return fmt.Errorf("operation %s not found", op.Name) - } - if resp.Status == "DONE" { - if resp.Error != nil { - e, err := resp.Error.MarshalJSON() - if err != nil { - return err - } - return fmt.Errorf("operation %s failed, error: %s", resp.Name, string(e)) - } - return nil - } - } - } -} diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/gcp/validate.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/gcp/validate.go index 79965df603..1aa542144d 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/gcp/validate.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/gcp/validate.go @@ -81,8 +81,11 @@ func (g *GclbValidater) validateIngressRule(rule *networkextensionv1.IngressRule if rule.Port <= 0 || rule.Port >= 65536 { return false, fmt.Sprintf("invalid port %d, available [1-65535]", rule.Port) } - if ok, msg := g.validateProtocol(rule.Protocol); !ok { - return false, msg + if rule.Protocol != ProtocolHTTP && + rule.Protocol != ProtocolHTTPS && + rule.Protocol != ProtocolTCP && + rule.Protocol != ProtocolUDP { + return false, fmt.Sprintf("invalid protocol %s, available [http, https, tcp, udp]", rule.Protocol) } if rule.Protocol == ProtocolHTTP && (rule.Port != 80 && rule.Port != 8080) { return false, fmt.Sprintf("invalid port %d for protocol %s, available [80, 8080]", rule.Port, rule.Protocol) @@ -91,6 +94,9 @@ func (g *GclbValidater) validateIngressRule(rule *networkextensionv1.IngressRule if rule.Port != 443 { return false, "https protocol only support 443 port" } + if rule.Certificate == nil { + return false, "certificate cannot be empty for protocol https" + } if ok, msg := g.validateCertificate(rule.Certificate); !ok { return ok, msg } @@ -98,8 +104,10 @@ func (g *GclbValidater) validateIngressRule(rule *networkextensionv1.IngressRule switch rule.Protocol { case ProtocolHTTP, ProtocolHTTPS: - if ok, msg := g.validateApplicationListenerAttr(rule.ListenerAttribute); !ok { - return ok, msg + if rule.ListenerAttribute != nil { + if ok, msg := g.validateApplicationListenerAttribute(rule.ListenerAttribute); !ok { + return ok, msg + } } for i := range rule.Routes { if ok, msg := g.validateListenerRoute(&rule.Routes[i]); !ok { @@ -107,8 +115,10 @@ func (g *GclbValidater) validateIngressRule(rule *networkextensionv1.IngressRule } } case ProtocolTCP, ProtocolUDP: - if ok, msg := g.validateNetworkListenerAttribute(rule.ListenerAttribute); !ok { - return ok, msg + if rule.ListenerAttribute != nil { + if ok, msg := g.validateNetworkListenerAttribute(rule.ListenerAttribute); !ok { + return ok, msg + } } for i := range rule.Services { if ok, msg := g.validateListenerService(&rule.Services[i]); !ok { @@ -119,11 +129,8 @@ func (g *GclbValidater) validateIngressRule(rule *networkextensionv1.IngressRule return true, "" } -// validateApplicationListenerAttr check application lb listener attribute -func (g *GclbValidater) validateApplicationListenerAttr(attr *networkextensionv1.IngressListenerAttribute) (bool, string) { - if attr == nil { - return true, "" - } +// validateAppListenerAttribute check application lb listener attribute +func (g *GclbValidater) validateApplicationListenerAttribute(attr *networkextensionv1.IngressListenerAttribute) (bool, string) { // validate health check if attr.HealthCheck == nil { return true, "" @@ -150,17 +157,11 @@ func (g *GclbValidater) validateApplicationListenerAttr(attr *networkextensionv1 // validateNetworkListenerAttribute check network lb listener attribute func (g *GclbValidater) validateNetworkListenerAttribute(attr *networkextensionv1.IngressListenerAttribute) (bool, string) { - if attr == nil { - return true, "" - } return true, "" } // validateCertificate check listener certificate func (g *GclbValidater) validateCertificate(certs *networkextensionv1.IngressListenerCertificate) (bool, string) { - if certs == nil { - return false, "certificate cannot be empty for protocol https" - } if len(certs.CertID) == 0 { return false, "certID cannot be empty" } @@ -209,7 +210,7 @@ func (g *GclbValidater) validateListenerRoute(r *networkextensionv1.Layer7Route) return false, "domain cannot be empty for 7 layer listener" } if r.ListenerAttribute != nil { - if ok, msg := g.validateApplicationListenerAttr(r.ListenerAttribute); !ok { + if ok, msg := g.validateApplicationListenerAttribute(r.ListenerAttribute); !ok { return ok, msg } } @@ -226,7 +227,7 @@ func (g *GclbValidater) validatePortMappingRoute(r *networkextensionv1.IngressPo return false, "domain cannot be empty for 7 layer listener" } if r.ListenerAttribute != nil { - if ok, msg := g.validateApplicationListenerAttr(r.ListenerAttribute); !ok { + if ok, msg := g.validateApplicationListenerAttribute(r.ListenerAttribute); !ok { return ok, msg } } @@ -246,13 +247,3 @@ func (g *GclbValidater) validateListenerService(svc *networkextensionv1.ServiceR } return true, "" } - -func (g *GclbValidater) validateProtocol(protocol string) (bool, string) { - if protocol != ProtocolHTTP && - protocol != ProtocolHTTPS && - protocol != ProtocolTCP && - protocol != ProtocolUDP { - return false, fmt.Sprintf("invalid protocol %s, available [http, https, tcp, udp]", protocol) - } - return true, "" -} diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/clb.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/clb.go index c2dd5cdc7a..6ceb0e77dc 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/clb.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/clb.go @@ -215,7 +215,23 @@ func (c *Clb) EnsureMultiListeners( if err != nil { return nil, err } - addListeners, updatedListeners, deleteCloudListeners := compareListener(lbID, cloudListenerMap, listeners) + addListeners := make([]*networkextensionv1.Listener, 0) + updatedListeners := make([]*networkextensionv1.Listener, 0) + deleteCloudListeners := make([]*networkextensionv1.Listener, 0) + for _, li := range listeners { + cloudLi, ok := cloudListenerMap[common.GetListenerNameWithProtocol( + lbID, li.Spec.Protocol, li.Spec.Port, li.Spec.EndPort)] + if !ok { + addListeners = append(addListeners, li) + } else { + if strings.ToLower(cloudLi.Spec.Protocol) != strings.ToLower(li.Spec.Protocol) { + deleteCloudListeners = append(deleteCloudListeners, cloudLi) + addListeners = append(addListeners, li) + } else { + updatedListeners = append(updatedListeners, li) + } + } + } if len(deleteCloudListeners) != 0 { var delListenerIDs []string @@ -230,13 +246,97 @@ func (c *Clb) EnsureMultiListeners( } retMap := make(map[string]cloud.Result) - for liName, res := range c.resolveCreateListener(region, addListeners) { - retMap[liName] = res + addListenerGroups := splitListenersToDiffProtocol(addListeners) + for _, group := range addListenerGroups { + if len(group) != 0 { + batches := splitListenersToDiffBatch(group) + for _, batch := range batches { + switch group[0].Spec.Protocol { + case ClbProtocolHTTP, ClbProtocolHTTPS: + liIDMap, err := c.batchCreate7LayerListener(region, batch) + if err != nil { + blog.Warnf("batch create 7 layer listener failed, err %s", err.Error()) + for _, listener := range batch { + retMap[listener.GetName()] = cloud.Result{IsError: true, Err: err} + } + continue + } + for liName, res := range liIDMap { + retMap[liName] = res + } + case ClbProtocolTCP, ClbProtocolUDP: + liIDMap, err := c.batchCreate4LayerListener(region, batch) + if err != nil { + blog.Warnf("batch create 4 layer listener failed, err %s", err.Error()) + for _, listener := range batch { + retMap[listener.GetName()] = cloud.Result{IsError: true, Err: err} + } + continue + } + for liName, res := range liIDMap { + retMap[liName] = res + } + default: + blog.Warnf("invalid batch protocol %s", group[0].Spec.Protocol) + continue + } + } + } } - for liName, res := range c.resolveUpdateListener(region, updatedListeners, cloudListenerMap) { - retMap[liName] = res + updateListenerGroups := splitListenersToDiffProtocol(updatedListeners) + for _, group := range updateListenerGroups { + if len(group) != 0 { + cloudListenerGroup := make([]*networkextensionv1.Listener, 0) + for _, li := range group { + cloudListenerGroup = append(cloudListenerGroup, cloudListenerMap[common.GetListenerNameWithProtocol( + lbID, li.Spec.Protocol, li.Spec.Port, li.Spec.EndPort)]) + } + switch group[0].Spec.Protocol { + case ClbProtocolHTTP, ClbProtocolHTTPS: + isErrArr, err := c.batchUpdate7LayerListeners(region, group, cloudListenerGroup) + if err != nil { + blog.Warnf("batch update 7 layer listeners %s failed, err %s", getListenerNames(group), err.Error()) + for _, listener := range group { + retMap[listener.GetName()] = cloud.Result{IsError: true, Err: err} + } + continue + } + for index, err := range isErrArr { + if err == nil { + retMap[group[index].GetName()] = cloud.Result{ + IsError: false, + Res: cloudListenerGroup[index].Status.ListenerID} + } else { + retMap[group[index].GetName()] = cloud.Result{IsError: true, Err: err} + blog.Warnf("update 7 layer listener %s failed in batch, err: %+v", group[index].GetName(), err) + } + } + case ClbProtocolTCP, ClbProtocolUDP: + isErrArr, err := c.batchUpdate4LayerListener(region, group, cloudListenerGroup) + if err != nil { + blog.Infof("batch update 4 layer listeners %s failed, err %s", getListenerNames(group), err.Error()) + for _, listener := range group { + retMap[listener.GetName()] = cloud.Result{IsError: true, Err: err} + } + continue + } + for index, err := range isErrArr { + if err == nil { + retMap[group[index].GetName()] = cloud.Result{IsError: false, + Res: cloudListenerGroup[index].Status.ListenerID} + } else { + retMap[group[index].GetName()] = cloud.Result{IsError: true, Err: err} + blog.Warnf("update 4 layer listener %s failed in batch", group[index].GetName()) + } + } + default: + blog.Warnf("invalid batch protocol %s", group[0].Spec.Protocol) + continue + } + } } + return retMap, nil } diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/helperbatch.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/helperbatch.go index 3784bee6a1..dea521cfbe 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/helperbatch.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/helperbatch.go @@ -15,6 +15,7 @@ package tencentcloud import ( "fmt" "reflect" + "strings" "sync" "time" @@ -50,11 +51,41 @@ func (c *Clb) batchDescribeListeners(region, lbID string, ports []int) ( return nil, err } cloud.StatRequest("DescribeListeners", cloud.MetricAPISuccess, ctime, time.Now()) + + retListenerMap := make(map[string]*networkextensionv1.Listener) + var listenerIDs []string if len(resp.Response.Listeners) == 0 { return nil, nil } - - listenerIDs, retListenerMap, ruleIDAttrMap, ruleIDCertMap := transferCloudListener(lbID, resp, portMap) + ruleIDAttrMap := make(map[string]*networkextensionv1.IngressListenerAttribute) + ruleIDCertMap := make(map[string]*networkextensionv1.IngressListenerCertificate) + for _, cloudLi := range resp.Response.Listeners { + // only care about listener with given ports + if _, ok := portMap[int(*cloudLi.Port)]; !ok { + continue + } + listenerIDs = append(listenerIDs, *cloudLi.ListenerId) + li := &networkextensionv1.Listener{} + li.Spec.LoadbalancerID = lbID + li.Spec.Port = int(*cloudLi.Port) + // get segment listener end port + if cloudLi.EndPort != nil && *cloudLi.EndPort > 0 { + li.Spec.EndPort = int(*cloudLi.EndPort) + } + li.Spec.Protocol = strings.ToLower(*cloudLi.Protocol) + li.Spec.Certificate = convertCertificate(cloudLi.Certificate) + li.Spec.ListenerAttribute = convertListenerAttribute(cloudLi) + if len(cloudLi.Rules) != 0 { + for _, respRule := range cloudLi.Rules { + if respRule.LocationId != nil { + ruleIDAttrMap[*respRule.LocationId] = convertRuleAttribute(respRule) + ruleIDCertMap[*respRule.LocationId] = convertCertificate(respRule.Certificate) + } + } + } + li.Status.ListenerID = *cloudLi.ListenerId + retListenerMap[common.GetListenerNameWithProtocol(lbID, li.Spec.Protocol, li.Spec.Port, li.Spec.EndPort)] = li + } // 2. describe listener targets if len(listenerIDs) == 0 { @@ -218,10 +249,8 @@ func (c *Clb) batchCreateSegment4LayerListener( } // on tencent cloud, api cannot create multiple listener segment in one time - // use goroutine to speed up failedListenerNameMap := sync.Map{} successListenerNameMap := sync.Map{} - // 使用channel研制goroutine数量 ch := make(chan struct{}, MaxSegmentListenerCurrentCreateEachTime) wg := sync.WaitGroup{} wg.Add(len(listeners)) @@ -232,8 +261,7 @@ func (c *Clb) batchCreateSegment4LayerListener( wg.Done() <-ch }() - // 记录每个监听器是否创建成功 - listenerID, err := c.createL4ListenerWithoutTg(region, li) + listenerID, err := c.create4LayerListenerWithoutTargetGroup(region, li) if err != nil { err = errors.Wrapf(err, "create 4 layer listener %s/%s failed", li.GetNamespace(), li.GetName()) blog.Warnf("%v", err) @@ -249,7 +277,6 @@ func (c *Clb) batchCreateSegment4LayerListener( tgReq := tclb.NewBatchRegisterTargetsRequest() tgReq.LoadBalancerId = tcommon.StringPtr(listeners[0].Spec.LoadbalancerID) for _, li := range listeners { - // 只处理创建成功的监听器 if _, ok := failedListenerNameMap.Load(li.GetName()); ok { continue } @@ -279,14 +306,11 @@ func (c *Clb) batchCreateSegment4LayerListener( } } // collect all listener - // successListenerNameMap 记录创建成功的监听器 - // failedListenerNameMap 记录创建失败的监听器 - // failedListenerIDMap 记录注册target失败的监听器 retMap := make(map[string]cloud.Result) for _, li := range listeners { if liID, ok := successListenerNameMap.Load(li.GetName()); ok { liIDStr := liID.(string) - if err, inOk := failedListenerIDMap[liID.(string)]; inOk { + if err, ok := failedListenerIDMap[liID.(string)]; ok { retMap[li.GetName()] = cloud.Result{IsError: true, Err: err} } else { retMap[li.GetName()] = cloud.Result{IsError: false, Res: liIDStr} @@ -300,7 +324,7 @@ func (c *Clb) batchCreateSegment4LayerListener( } // used by batchCreateSegment4LayerListener -func (c *Clb) createL4ListenerWithoutTg( +func (c *Clb) create4LayerListenerWithoutTargetGroup( region string, listener *networkextensionv1.Listener) (string, error) { // construct request for creating listener req := tclb.NewCreateListenerRequest() @@ -313,7 +337,6 @@ func (c *Clb) createL4ListenerWithoutTg( } req.ListenerNames = tcommon.StringPtrs([]string{listener.GetName()}) req.Protocol = tcommon.StringPtr(listener.Spec.Protocol) - // translate listenerAttribute to cloud request field if listener.Spec.ListenerAttribute != nil { if listener.Spec.ListenerAttribute.SessionTime != 0 { req.SessionExpireTime = tcommon.Int64Ptr(int64(listener.Spec.ListenerAttribute.SessionTime)) @@ -356,7 +379,7 @@ func (c *Clb) batchUpdate4LayerListener( } } // get different targets - addBackends, delBackends, updateWeightBackends := compareTargetGroup( + addBackends, delBackends, updateWeightBackends := getDiffBackendListBetweenTargetGroup( cloudListener.Spec.TargetGroup, ingressListener.Spec.TargetGroup) if len(addBackends) != 0 { backendRegMap[cloudListener.Status.ListenerID] = addBackends @@ -448,27 +471,24 @@ func (c *Clb) batchCreate7LayerListener(region string, listeners []*networkexten } failedListenerIDMap := make(map[string]error) - for liIndex, li := range listeners { - for _, rule := range li.Spec.Rules { - // 为每个监听器创建规则 - inErr := c.addListenerRule(region, li.Spec.LoadbalancerID, listenerIDs[liIndex], - li.Spec.ListenerAttribute, rule) - if inErr != nil { - inErr = errors.Wrapf(inErr, "add listener rule %v for listener %s/%s failed", rule, li.GetName(), - li.GetNamespace()) - blog.Warnf(inErr.Error()) - failedListenerIDMap[listenerIDs[liIndex]] = inErr + for liIndex, listener := range listeners { + for _, rule := range listener.Spec.Rules { + err := c.addListenerRule(region, listener.Spec.LoadbalancerID, listenerIDs[liIndex], + listener.Spec.ListenerAttribute, rule) + if err != nil { + err = errors.Wrapf(err, "add listener rule %v for listener %s/%s failed", rule, listener.GetName(), + listener.GetNamespace()) + blog.Warnf(err.Error()) + failedListenerIDMap[listenerIDs[liIndex]] = err } } } - // 收集每个listener的执行结果 - // listener.Name -> Result retMap := make(map[string]cloud.Result) for index, id := range listenerIDs { - if inErr, ok := failedListenerIDMap[id]; !ok { + if err, ok := failedListenerIDMap[id]; !ok { retMap[listeners[index].GetName()] = cloud.Result{IsError: false, Res: id} } else { - retMap[listeners[index].GetName()] = cloud.Result{IsError: true, Err: inErr} + retMap[listeners[index].GetName()] = cloud.Result{IsError: true, Err: err} } } return retMap, nil @@ -507,13 +527,12 @@ func (c *Clb) batchUpdate7LayerListeners(region string, ingressListeners []*netw len(ingressListeners), len(cloudListeners)) } - // 记录每个listener更新时的错误 listenerErrArr := make([]error, len(ingressListeners)) backendRegMap := make(map[string]map[string][]networkextensionv1.ListenerBackend) backendDeregMap := make(map[string]map[string][]networkextensionv1.ListenerBackend) backendModMap := make(map[string]map[string][]networkextensionv1.ListenerBackend) for index, li := range ingressListeners { - backendAdds, backendDels, backendChanges, foundErr := c.updateL7ListenerAndCollectRsChanges( + backendAdds, backendDels, backendChanges, foundErr := c.updateHTTPListenerAndCollectRsChanges( region, li, cloudListeners[index]) if len(backendAdds) != 0 { backendRegMap[cloudListeners[index].Status.ListenerID] = backendAdds @@ -565,7 +584,7 @@ func (c *Clb) batchUpdate7LayerListeners(region string, ingressListeners []*netw // update 7 layer listener and collect rs change // return the map of the map of targets to register, targets to be deregister, the map of targets to modify weight -func (c *Clb) updateL7ListenerAndCollectRsChanges( +func (c *Clb) updateHTTPListenerAndCollectRsChanges( region string, ingressListener, cloudListener *networkextensionv1.Listener) ( map[string][]networkextensionv1.ListenerBackend, map[string][]networkextensionv1.ListenerBackend, @@ -585,7 +604,7 @@ func (c *Clb) updateL7ListenerAndCollectRsChanges( resultErr = multierror.Append(resultErr, err) } } - // get different rules + // get differet rules addRules, delRules, updateOldRules, updateRules := getDiffBetweenListenerRule(cloudListener, ingressListener) // do delete rules for _, rule := range delRules { @@ -632,7 +651,7 @@ func (c *Clb) updateL7ListenerAndCollectRsChanges( } } // get different targets - addBackends, delBackends, updateWeightBackends := compareTargetGroup( + addBackends, delBackends, updateWeightBackends := getDiffBackendListBetweenTargetGroup( existedRule.TargetGroup, rule.TargetGroup) if len(addBackends) != 0 { batchRegTargets[existedRule.RuleID] = addBackends @@ -709,7 +728,6 @@ func (c *Clb) batchDeregisterRuleBackend(region, lbID string, return failedListenerIDs, nil } -// batchChangeRuleBackendWeight change rule backend weight func (c *Clb) batchChangeRuleBackendWeight(region, lbID string, ruleBackendMap map[string]map[string][]networkextensionv1.ListenerBackend) error { req := tclb.NewBatchModifyTargetWeightRequest() @@ -739,7 +757,6 @@ func (c *Clb) batchChangeRuleBackendWeight(region, lbID string, return nil } -// batchRegisterListenerBackend register backend to target group func (c *Clb) batchRegisterListenerBackend(region, lbID string, liBackendMap map[string][]networkextensionv1.ListenerBackend) (map[string]error, error) { req := tclb.NewBatchRegisterTargetsRequest() @@ -767,7 +784,6 @@ func (c *Clb) batchRegisterListenerBackend(region, lbID string, return failedListenerIDs, nil } -// batchDeregisterListenerBackend deregister backend from target func (c *Clb) batchDeregisterListenerBackend(region, lbID string, liBackendMap map[string][]networkextensionv1.ListenerBackend) ([]string, error) { req := tclb.NewBatchDeregisterTargetsRequest() @@ -795,7 +811,6 @@ func (c *Clb) batchDeregisterListenerBackend(region, lbID string, return failedListenerIDs, nil } -// batchChangeListenerBackendWeight batch change weight func (c *Clb) batchChangeListenerBackendWeight(region, lbID string, liBackendMap map[string][]networkextensionv1.ListenerBackend) error { req := tclb.NewBatchModifyTargetWeightRequest() @@ -821,118 +836,3 @@ func (c *Clb) batchChangeListenerBackendWeight(region, lbID string, cloud.StatRequest("BatchModifyTargetWeight", cloud.MetricAPISuccess, ctime, time.Now()) return nil } - -// resolveCreateListener create listener -func (c *Clb) resolveCreateListener(region string, addListeners []*networkextensionv1.Listener) map[string]cloud.Result { - retMap := make(map[string]cloud.Result) - addListenerGroups := splitListenersToDiffProtocol(addListeners) - for _, group := range addListenerGroups { - if len(group) != 0 { - // split listeners batch by its attribute and cert - batches := splitListenersToDiffBatch(group) - for _, batch := range batches { - liIDMap, err := c.resolveCreateListenerBatch(region, group[0].Spec.Protocol, batch) - if err != nil { - for _, listener := range batch { - retMap[listener.GetName()] = cloud.Result{IsError: true, Err: err} - } - continue - } - - for liName, res := range liIDMap { - retMap[liName] = res - } - } - } - } - return retMap -} - -// resolveCreateListenerBatch listeners in same batch have same lb and attribute&cert -func (c *Clb) resolveCreateListenerBatch(region, protocol string, batch []*networkextensionv1.Listener) (map[string]cloud.Result, - error) { - switch protocol { - case ClbProtocolHTTP, ClbProtocolHTTPS: - liIDMap, err := c.batchCreate7LayerListener(region, batch) - if err != nil { - blog.Warnf("batch create 7 layer listener failed, err %s", err.Error()) - return nil, err - } - return liIDMap, nil - case ClbProtocolTCP, ClbProtocolUDP: - liIDMap, err := c.batchCreate4LayerListener(region, batch) - if err != nil { - blog.Warnf("batch create 4 layer listener failed, err %s", err.Error()) - return nil, err - } - return liIDMap, nil - default: - blog.Warnf("invalid batch protocol %s", protocol) - return nil, fmt.Errorf("invalid batch protocol %s", protocol) - } -} - -// resolveUpdateListener update listeners -func (c *Clb) resolveUpdateListener(region string, updatedListeners []*networkextensionv1.Listener, - cloudListenerMap map[string]*networkextensionv1.Listener, -) map[string]cloud.Result { - retMap := make(map[string]cloud.Result) - // split listener by protocol - updateListenerGroups := splitListenersToDiffProtocol(updatedListeners) - for _, group := range updateListenerGroups { - if len(group) != 0 { - isErrArr, err := c.resolveUpdateListenerGroup(region, group, cloudListenerMap) - // 如果err,认为这一批listener全部更新失败 - if err != nil { - for _, listener := range group { - retMap[listener.GetName()] = cloud.Result{IsError: true, Err: err} - } - continue - } - // 根据云接口返回的Err,细分每个listener的失败原因 - for index, inErr := range isErrArr { - if inErr == nil { - retMap[group[index].GetName()] = cloud.Result{ - IsError: false, - Res: group[index].Status.ListenerID} - } else { - retMap[group[index].GetName()] = cloud.Result{IsError: true, Err: inErr} - blog.Warnf("update 7 layer listener %s failed in batch, err: %+v", group[index].GetName(), inErr) - } - } - } - } - return retMap -} - -// resolveUpdateListenerGroup update listener group. -// group listeners have same protocol -func (c *Clb) resolveUpdateListenerGroup(region string, group []*networkextensionv1.Listener, - cloudListenerMap map[string]*networkextensionv1.Listener) ([]error, error) { - cloudListenerGroup := make([]*networkextensionv1.Listener, 0) - for _, li := range group { - cloudListenerGroup = append(cloudListenerGroup, cloudListenerMap[common.GetListenerNameWithProtocol( - li.Spec.LoadbalancerID, li.Spec.Protocol, li.Spec.Port, li.Spec.EndPort)]) - } - switch group[0].Spec.Protocol { - case ClbProtocolHTTP, ClbProtocolHTTPS: - // layer7 -> http / https - isErrArr, err := c.batchUpdate7LayerListeners(region, group, cloudListenerGroup) - if err != nil { - blog.Warnf("batch update 7 layer listeners %s failed, err %s", getListenerNames(group), err.Error()) - return nil, err - } - return isErrArr, nil - case ClbProtocolTCP, ClbProtocolUDP: - // layer4 -< tcp / udp - isErrArr, err := c.batchUpdate4LayerListener(region, group, cloudListenerGroup) - if err != nil { - blog.Infof("batch update 4 layer listeners %s failed, err %s", getListenerNames(group), err.Error()) - return nil, err - } - return isErrArr, nil - default: - blog.Warnf("invalid batch protocol %s", group[0].Spec.Protocol) - return nil, fmt.Errorf("invalid batch protocol %s", group[0].Spec.Protocol) - } -} diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/sdk.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/sdk.go index 45e4909488..506b622a1b 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/sdk.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/sdk.go @@ -14,6 +14,9 @@ package tencentcloud import ( "fmt" + "os" + "runtime" + "strconv" "time" "github.com/pkg/errors" @@ -140,6 +143,138 @@ func NewSdkWrapperWithSecretIDKey(id, key string) (*SdkWrapper, error) { return sw, nil } +// load config for environment variables +func (sw *SdkWrapper) loadEnv() error { + clbDomain := os.Getenv(EnvNameTencentCloudClbDomain) + secretID := os.Getenv(EnvNameTencentCloudAccessKeyID) + secretKey := os.Getenv(EnvNameTencentCloudAccessKey) + sw.domain = clbDomain + sw.secretID = secretID + sw.secretKey = secretKey + + qpsStr := os.Getenv(EnvNameTencentCloudRateLimitQPS) + if len(qpsStr) != 0 { + qps, err := strconv.ParseInt(qpsStr, 10, 64) + if err != nil { + blog.Warnf("parse rate limit qps %s failed, err %s, use default %d", + qpsStr, err.Error(), defaultThrottleQPS) + sw.ratelimitqps = int64(defaultThrottleQPS) + } else { + sw.ratelimitqps = qps + } + } else { + sw.ratelimitqps = int64(defaultThrottleQPS) + } + + bucketSizeStr := os.Getenv(EnvNameTencentCloudRateLimitBucketSize) + if len(bucketSizeStr) != 0 { + bucketSize, err := strconv.ParseInt(bucketSizeStr, 10, 64) + if err != nil { + blog.Warnf("parse rate limit bucket size %s failed, err %s, use default %d", + bucketSizeStr, err.Error(), defaultBucketSize) + sw.ratelimitbucketSize = int64(defaultBucketSize) + } else { + sw.ratelimitbucketSize = bucketSize + } + } else { + sw.ratelimitbucketSize = int64(defaultBucketSize) + } + return nil +} + +// getRegionClient create region client +func (sw *SdkWrapper) getRegionClient(region string) (*tclb.Client, error) { + cli, ok := sw.clbCliMap[region] + if !ok { + newCli, err := tclb.NewClient(sw.credential, region, sw.cpf) + if err != nil { + blog.Errorf("create clb client for region %s failed, err %s", region, err.Error()) + return nil, fmt.Errorf("create clb client for region %s failed, err %s", region, err.Error()) + } + sw.clbCliMap[region] = newCli + return newCli, nil + } + return cli, nil +} + +// checkErrCode common method for check tencent cloud sdk err +func (sw *SdkWrapper) checkErrCode(err *terrors.TencentCloudSDKError, metricFunc func(ret string)) { + if err.Code == RequestLimitExceededCode { + blog.Warnf("request exceed limit, have a rest for %d second", waitPeriodLBDealing) + metricFunc(metrics.LibCallStatusExceedLimit) + time.Sleep(time.Duration(waitPeriodLBDealing) * time.Second) + } else if err.Code == WrongStatusCode { + blog.Warnf("clb is dealing another action, have a rest for %d second", waitPeriodLBDealing) + metricFunc(metrics.LibCallStatusLBLock) + time.Sleep(time.Duration(waitPeriodLBDealing) * time.Second) + } +} + +// call tryThrottle before each api call +func (sw *SdkWrapper) tryThrottle() { + now := time.Now() + sw.throttler.Accept() + if latency := time.Since(now); latency > maxLatency { + pc, _, _, _ := runtime.Caller(2) + callerName := runtime.FuncForPC(pc).Name() + blog.Infof("Throttling request took %d ms, function: %s", latency, callerName) + } +} + +// waitTaskDone wait asynchronous task done +func (sw *SdkWrapper) waitTaskDone(region, taskID string) error { + blog.V(3).Infof("start waiting for task %s", taskID) + request := tclb.NewDescribeTaskStatusRequest() + request.TaskId = tcommon.StringPtr(taskID) + blog.Infof("describe task status request:\n%s", request.ToJsonString()) + + startTime := time.Now() + mf := func(ret string) { + metrics.ReportLibRequestMetric( + SystemNameInMetricTencentCloud, + HandlerNameInMetricTencentCloudSDK, + "waitTaskDone", ret, startTime) + } + + for counter := 0; counter < maxRetry; counter++ { + // it may exceed limit when describe task result + sw.tryThrottle() + clbCli, err := sw.getRegionClient(region) + if err != nil { + return err + } + response, err := clbCli.DescribeTaskStatus(request) + if err != nil { + if terr, ok := err.(*terrors.TencentCloudSDKError); ok { + sw.checkErrCode(terr, mf) + if terr.Code == RequestLimitExceededCode || terr.Code == WrongStatusCode { + continue + } + } + blog.Errorf("describe task status failed, err %s", err.Error()) + return fmt.Errorf("describe task status failed, err %s", err.Error()) + } + blog.Infof("describe task status response:\n%s", response.ToJsonString()) + // dealing + if *response.Response.Status == TaskStatusDealing { + blog.Infof("task %s is dealing", taskID) + time.Sleep(time.Duration(waitPeriodLBDealing) * time.Second) + continue + // failed + } else if *response.Response.Status == TaskStatusFailed { + blog.Errorf("task %s is failed", taskID) + return fmt.Errorf("task %s is failed", taskID) + // succeed + } else if *response.Response.Status == TaskStatusSucceed { + blog.Infof("task %s is done", taskID) + return nil + } + return fmt.Errorf("error status of task %d", *response.Response.Status) + } + blog.Errorf("describe task status with request %s timeout", request.ToJsonString()) + return fmt.Errorf("describe task status with request %s timeout", request.ToJsonString()) +} + // DescribeLoadBalancers wrap DescribeLoadBalancers func (sw *SdkWrapper) DescribeLoadBalancers(region string, req *tclb.DescribeLoadBalancersRequest) ( *tclb.DescribeLoadBalancersResponse, error) { @@ -909,6 +1044,59 @@ func (sw *SdkWrapper) DeregisterTargets(region string, req *tclb.DeregisterTarge return nil } +// doDeregisterTargets wrap DeregisterTargets +func (sw *SdkWrapper) doDeregisterTargets(region string, req *tclb.DeregisterTargetsRequest) error { + blog.V(3).Infof("DeregisterTargets request: %s", req.ToJsonString()) + var err error + var resp *tclb.DeregisterTargetsResponse + + startTime := time.Now() + mf := func(ret string) { + metrics.ReportLibRequestMetric( + SystemNameInMetricTencentCloud, + HandlerNameInMetricTencentCloudSDK, + "DeregisterTargets", ret, startTime) + } + + counter := 1 + for ; counter <= maxRetry; counter++ { + blog.V(3).Infof("DeregisterTargets try %d/%d", counter, maxRetry) + sw.tryThrottle() + // get client by region + clbCli, inErr := sw.getRegionClient(region) + if inErr != nil { + mf(metrics.LibCallStatusErr) + return inErr + } + resp, err = clbCli.DeregisterTargets(req) + if err != nil { + if terr, ok := err.(*terrors.TencentCloudSDKError); ok { + sw.checkErrCode(terr, mf) + if terr.Code == RequestLimitExceededCode || terr.Code == WrongStatusCode { + continue + } + } + mf(metrics.LibCallStatusErr) + blog.Errorf("DeregisterTargets failed, err %s", err.Error()) + return fmt.Errorf("DeregisterTargets failed, err %s", err.Error()) + } + blog.V(3).Infof("DeregisterTargets response: %s", resp.ToJsonString()) + break + } + if counter > maxRetry { + mf(metrics.LibCallStatusTimeout) + blog.Errorf("DeregisterTargets out of maxRetry %d", maxRetry) + return fmt.Errorf("DeregisterTargets out of maxRetry %d", maxRetry) + } + err = sw.waitTaskDone(region, *resp.Response.RequestId) + if err != nil { + mf(metrics.LibCallStatusErr) + return err + } + mf(metrics.LibCallStatusOK) + return nil +} + // RegisterTargets register targets // the max number target for each operation is 20 // when receiving a big request, just split it to multiple small request @@ -940,6 +1128,58 @@ func (sw *SdkWrapper) RegisterTargets(region string, req *tclb.RegisterTargetsRe return nil } +// doRegisterTargets wrap RegisterTargets +func (sw *SdkWrapper) doRegisterTargets(region string, req *tclb.RegisterTargetsRequest) error { + blog.V(3).Infof("RegisterTargets request: %s", req.ToJsonString()) + var err error + var resp *tclb.RegisterTargetsResponse + + startTime := time.Now() + mf := func(ret string) { + metrics.ReportLibRequestMetric( + SystemNameInMetricTencentCloud, + HandlerNameInMetricTencentCloudSDK, + "RegisterTargets", ret, startTime) + } + + counter := 1 + for ; counter <= maxRetry; counter++ { + blog.V(3).Infof("RegisterTargets try %d/%d", counter, maxRetry) + sw.tryThrottle() + clbCli, inErr := sw.getRegionClient(region) + if inErr != nil { + mf(metrics.LibCallStatusErr) + return inErr + } + resp, err = clbCli.RegisterTargets(req) + if err != nil { + if terr, ok := err.(*terrors.TencentCloudSDKError); ok { + sw.checkErrCode(terr, mf) + if terr.Code == RequestLimitExceededCode || terr.Code == WrongStatusCode { + continue + } + } + mf(metrics.LibCallStatusErr) + blog.Errorf("RegisterTargets failed, err %s", err.Error()) + return fmt.Errorf("RegisterTargets failed, err %s", err.Error()) + } + blog.V(3).Infof("RegisterTargets response: %s", resp.ToJsonString()) + break + } + if counter > maxRetry { + mf(metrics.LibCallStatusTimeout) + blog.Errorf("RegisterTargets out of maxRetry %d", maxRetry) + return fmt.Errorf("RegisterTargets out of maxRetry %d", maxRetry) + } + err = sw.waitTaskDone(region, *resp.Response.RequestId) + if err != nil { + mf(metrics.LibCallStatusErr) + return err + } + mf(metrics.LibCallStatusOK) + return nil +} + // ModifyTargetWeight wrap ModifyTargetWeight func (sw *SdkWrapper) ModifyTargetWeight(region string, req *tclb.ModifyTargetWeightRequest) error { blog.V(3).Infof("ModifyTargetWeight request: %s", req.ToJsonString()) @@ -1028,6 +1268,62 @@ func (sw *SdkWrapper) BatchRegisterTargets(region string, req *tclb.BatchRegiste return failedListenerIDMap } +// doBatchRegisterTargets batch register clb targets +func (sw *SdkWrapper) doBatchRegisterTargets(region string, req *tclb.BatchRegisterTargetsRequest) ([]string, error) { + blog.V(3).Infof("BatchRegisterTargets request: %s", req.ToJsonString()) + var err error + var resp *tclb.BatchRegisterTargetsResponse + startTime := time.Now() + mf := func(ret string) { + metrics.ReportLibRequestMetric( + SystemNameInMetricTencentCloud, + HandlerNameInMetricTencentCloudSDK, + "BatchRegisterTargets", ret, startTime) + } + + counter := 1 + for ; counter <= maxRetry; counter++ { + blog.V(3).Infof("BatchRegisterTargets try %d/%d", counter, maxRetry) + sw.tryThrottle() + clbCli, inErr := sw.getRegionClient(region) + if inErr != nil { + mf(metrics.LibCallStatusErr) + return nil, inErr + } + resp, err = clbCli.BatchRegisterTargets(req) + if err != nil { + if terr, ok := err.(*terrors.TencentCloudSDKError); ok { + sw.checkErrCode(terr, mf) + if terr.Code == RequestLimitExceededCode || terr.Code == WrongStatusCode { + continue + } + } + mf(metrics.LibCallStatusErr) + blog.Errorf("BatchRegisterTargets failed, err %s", err.Error()) + return nil, fmt.Errorf("BatchRegisterTargets failed, err %s", err.Error()) + } + blog.V(3).Infof("BatchRegisterTargets response: %s", resp.ToJsonString()) + break + } + if counter > maxRetry { + mf(metrics.LibCallStatusTimeout) + blog.Errorf("BatchRegisterTargets out of maxRetry %d", maxRetry) + return nil, fmt.Errorf("BatchRegisterTargets out of maxRetry %d", maxRetry) + } + err = sw.waitTaskDone(region, *resp.Response.RequestId) + if err != nil { + mf(metrics.LibCallStatusErr) + return nil, err + } + mf(metrics.LibCallStatusOK) + + var failedListenerIDs []string + if len(resp.Response.FailListenerIdSet) != 0 { + failedListenerIDs = tcommon.StringValues(resp.Response.FailListenerIdSet) + } + return failedListenerIDs, nil +} + // BatchDeregisterTargets batch deregister clb targets func (sw *SdkWrapper) BatchDeregisterTargets(region string, req *tclb.BatchDeregisterTargetsRequest) []string { rounds := len(req.Targets) / MaxTargetForBatchRegisterEachTime @@ -1063,6 +1359,63 @@ func (sw *SdkWrapper) BatchDeregisterTargets(region string, req *tclb.BatchDereg return failedListenerIDs } +// batch deregister clb targets +func (sw *SdkWrapper) doBatchDeregisterTargets(region string, req *tclb.BatchDeregisterTargetsRequest) ( + []string, error) { + blog.V(3).Infof("BatchDeregisterTargets request: %s", req.ToJsonString()) + var err error + var resp *tclb.BatchDeregisterTargetsResponse + startTime := time.Now() + mf := func(ret string) { + metrics.ReportLibRequestMetric( + SystemNameInMetricTencentCloud, + HandlerNameInMetricTencentCloudSDK, + "BatchDeregisterTargets", ret, startTime) + } + + counter := 1 + for ; counter <= maxRetry; counter++ { + blog.V(3).Infof("BatchDeregisterTargets try %d/%d", counter, maxRetry) + sw.tryThrottle() + clbCli, inErr := sw.getRegionClient(region) + if inErr != nil { + mf(metrics.LibCallStatusErr) + return nil, inErr + } + resp, err = clbCli.BatchDeregisterTargets(req) + if err != nil { + if terr, ok := err.(*terrors.TencentCloudSDKError); ok { + sw.checkErrCode(terr, mf) + if terr.Code == RequestLimitExceededCode || terr.Code == WrongStatusCode { + continue + } + } + mf(metrics.LibCallStatusErr) + blog.Errorf("BatchDeregisterTargets failed, err %s", err.Error()) + return nil, fmt.Errorf("BatchDeregisterTargets failed, err %s", err.Error()) + } + blog.V(3).Infof("BatchDeregisterTargets response: %s", resp.ToJsonString()) + break + } + if counter > maxRetry { + mf(metrics.LibCallStatusTimeout) + blog.Errorf("BatchDeregisterTargets out of maxRetry %d", maxRetry) + return nil, fmt.Errorf("BatchDeregisterTargets out of maxRetry %d", maxRetry) + } + err = sw.waitTaskDone(region, *resp.Response.RequestId) + if err != nil { + mf(metrics.LibCallStatusErr) + return nil, err + } + mf(metrics.LibCallStatusOK) + + var failedListenerIDs []string + if len(resp.Response.FailListenerIdSet) != 0 { + failedListenerIDs = tcommon.StringValues(resp.Response.FailListenerIdSet) + } + return failedListenerIDs, nil +} + // BatchModifyTargetWeight batch modify target weight func (sw *SdkWrapper) BatchModifyTargetWeight(region string, req *tclb.BatchModifyTargetWeightRequest) error { rounds := len(req.ModifyList) / MaxTargetForBatchRegisterEachTime @@ -1089,6 +1442,57 @@ func (sw *SdkWrapper) BatchModifyTargetWeight(region string, req *tclb.BatchModi return nil } +// batch modify target weight +func (sw *SdkWrapper) doBatchModifyTargetWeight(region string, req *tclb.BatchModifyTargetWeightRequest) error { + blog.V(3).Infof("BatchModifyTargetWeight request: %s", req.ToJsonString()) + var err error + var resp *tclb.BatchModifyTargetWeightResponse + startTime := time.Now() + mf := func(ret string) { + metrics.ReportLibRequestMetric( + SystemNameInMetricTencentCloud, + HandlerNameInMetricTencentCloudSDK, + "BatchModifyTargetWeight", ret, startTime) + } + + counter := 1 + for ; counter <= maxRetry; counter++ { + blog.V(3).Infof("BatchModifyTargetWeight try %d/%d", counter, maxRetry) + sw.tryThrottle() + clbCli, inErr := sw.getRegionClient(region) + if inErr != nil { + mf(metrics.LibCallStatusErr) + return inErr + } + resp, err = clbCli.BatchModifyTargetWeight(req) + if err != nil { + if terr, ok := err.(*terrors.TencentCloudSDKError); ok { + sw.checkErrCode(terr, mf) + if terr.Code == RequestLimitExceededCode || terr.Code == WrongStatusCode { + continue + } + } + mf(metrics.LibCallStatusErr) + blog.Errorf("BatchModifyTargetWeight failed, err %s", err.Error()) + return fmt.Errorf("BatchModifyTargetWeight failed, err %s", err.Error()) + } + blog.V(3).Infof("BatchModifyTargetWeight response: %s", resp.ToJsonString()) + break + } + if counter > maxRetry { + mf(metrics.LibCallStatusTimeout) + blog.Errorf("BatchModifyTargetWeight out of maxRetry %d", maxRetry) + return fmt.Errorf("BatchModifyTargetWeight out of maxRetry %d", maxRetry) + } + err = sw.waitTaskDone(region, *resp.Response.RequestId) + if err != nil { + mf(metrics.LibCallStatusErr) + return err + } + mf(metrics.LibCallStatusOK) + return nil +} + // DescribeTargetHealth describe health status of loadbalance rs func (sw *SdkWrapper) DescribeTargetHealth(region string, req *tclb.DescribeTargetHealthRequest) (*tclb.DescribeTargetHealthResponse, error) { @@ -1124,3 +1528,51 @@ func (sw *SdkWrapper) DescribeTargetHealth(region string, } return resp, nil } + +func (sw *SdkWrapper) doDescribeTargetHealth(region string, + req *tclb.DescribeTargetHealthRequest) (*tclb.DescribeTargetHealthResponse, error) { + blog.V(5).Infof("DescribeTargetHealth request: %s", req.ToJsonString()) + var err error + var resp *tclb.DescribeTargetHealthResponse + + startTime := time.Now() + mf := func(ret string) { + metrics.ReportLibRequestMetric( + SystemNameInMetricTencentCloud, + HandlerNameInMetricTencentCloudSDK, + "DescribeTargetHealth", ret, startTime) + } + + counter := 1 + for ; counter <= maxRetry; counter++ { + blog.V(5).Infof("DescribeTargetHealth try %d/%d", counter, maxRetry) + sw.tryThrottle() + // get client by region + clbCli, inErr := sw.getRegionClient(region) + if inErr != nil { + mf(metrics.LibCallStatusErr) + return nil, inErr + } + resp, err = clbCli.DescribeTargetHealth(req) + if err != nil { + if terr, ok := err.(*terrors.TencentCloudSDKError); ok { + sw.checkErrCode(terr, mf) + if terr.Code == RequestLimitExceededCode || terr.Code == WrongStatusCode { + continue + } + } + mf(metrics.LibCallStatusErr) + blog.Errorf("DescribeTargetHealth failed, err %s", err.Error()) + return nil, fmt.Errorf("DescribeTargetHealth failed, err %s", err.Error()) + } + blog.V(5).Infof("DescribeTargetHealth response: %s", resp.ToJsonString()) + break + } + if counter > maxRetry { + mf(metrics.LibCallStatusErr) + blog.Errorf("DescribeTargetHealth out of maxRetry %d", maxRetry) + return nil, fmt.Errorf("DescribeTargetHealth out of maxRetry %d", maxRetry) + } + mf(metrics.LibCallStatusOK) + return resp, nil +} diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/sdkhelper.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/sdkhelper.go deleted file mode 100644 index 27dcd3507b..0000000000 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/sdkhelper.go +++ /dev/null @@ -1,494 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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 tencentcloud - -import ( - "fmt" - "os" - "runtime" - "strconv" - "time" - - tclb "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb/v20180317" - tcommon "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" - terrors "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors" - - "github.com/Tencent/bk-bcs/bcs-common/common/blog" - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/metrics" -) - -// load config for environment variables -func (sw *SdkWrapper) loadEnv() error { - // 请求腾讯云API使用的域名 - clbDomain := os.Getenv(EnvNameTencentCloudClbDomain) - // 腾讯云密钥ID - secretID := os.Getenv(EnvNameTencentCloudAccessKeyID) - // 腾讯云密钥Key - secretKey := os.Getenv(EnvNameTencentCloudAccessKey) - sw.domain = clbDomain - sw.secretID = secretID - sw.secretKey = secretKey - - // 本地限制的请求API QPS - qpsStr := os.Getenv(EnvNameTencentCloudRateLimitQPS) - if len(qpsStr) != 0 { - qps, err := strconv.ParseInt(qpsStr, 10, 64) - if err != nil { - blog.Warnf("parse rate limit qps %s failed, err %s, use default %d", - qpsStr, err.Error(), defaultThrottleQPS) - sw.ratelimitqps = int64(defaultThrottleQPS) - } else { - sw.ratelimitqps = qps - } - } else { - sw.ratelimitqps = int64(defaultThrottleQPS) - } - - bucketSizeStr := os.Getenv(EnvNameTencentCloudRateLimitBucketSize) - if len(bucketSizeStr) != 0 { - bucketSize, err := strconv.ParseInt(bucketSizeStr, 10, 64) - if err != nil { - blog.Warnf("parse rate limit bucket size %s failed, err %s, use default %d", - bucketSizeStr, err.Error(), defaultBucketSize) - sw.ratelimitbucketSize = int64(defaultBucketSize) - } else { - sw.ratelimitbucketSize = bucketSize - } - } else { - sw.ratelimitbucketSize = int64(defaultBucketSize) - } - return nil -} - -// getRegionClient create region client -func (sw *SdkWrapper) getRegionClient(region string) (*tclb.Client, error) { - cli, ok := sw.clbCliMap[region] - if !ok { - newCli, err := tclb.NewClient(sw.credential, region, sw.cpf) - if err != nil { - blog.Errorf("create clb client for region %s failed, err %s", region, err.Error()) - return nil, fmt.Errorf("create clb client for region %s failed, err %s", region, err.Error()) - } - sw.clbCliMap[region] = newCli - return newCli, nil - } - return cli, nil -} - -// checkErrCode common method for check tencent cloud sdk err -func (sw *SdkWrapper) checkErrCode(err *terrors.TencentCloudSDKError, metricFunc func(ret string)) { - if err.Code == RequestLimitExceededCode { // API请求速率超过QPS - blog.Warnf("request exceed limit, have a rest for %d second", waitPeriodLBDealing) - metricFunc(metrics.LibCallStatusExceedLimit) - time.Sleep(time.Duration(waitPeriodLBDealing) * time.Second) - } else if err.Code == WrongStatusCode { // 通常是由于有多个请求同时操作LB(如同时创建/删除监听器) - blog.Warnf("clb is dealing another action, have a rest for %d second", waitPeriodLBDealing) - metricFunc(metrics.LibCallStatusLBLock) - time.Sleep(time.Duration(waitPeriodLBDealing) * time.Second) - } -} - -// call tryThrottle before each api call -func (sw *SdkWrapper) tryThrottle() { - now := time.Now() - sw.throttler.Accept() - if latency := time.Since(now); latency > maxLatency { - pc, _, _, _ := runtime.Caller(2) - callerName := runtime.FuncForPC(pc).Name() // 通过调用栈获取方法名称 - blog.Infof("Throttling request took %d ms, function: %s", latency, callerName) - } -} - -// waitTaskDone wait asynchronous task done -func (sw *SdkWrapper) waitTaskDone(region, taskID string) error { - blog.V(3).Infof("start waiting for task %s", taskID) - request := tclb.NewDescribeTaskStatusRequest() - request.TaskId = tcommon.StringPtr(taskID) - blog.Infof("describe task status request:\n%s", request.ToJsonString()) - - startTime := time.Now() - // 统计API调用延时/状态 - mf := func(ret string) { - metrics.ReportLibRequestMetric( - SystemNameInMetricTencentCloud, - HandlerNameInMetricTencentCloudSDK, - "waitTaskDone", ret, startTime) - } - - for counter := 0; counter < maxRetry; counter++ { - // it may exceed limit when describe task result - sw.tryThrottle() - clbCli, err := sw.getRegionClient(region) - if err != nil { - return err - } - response, err := clbCli.DescribeTaskStatus(request) - if err != nil { - if terr, ok := err.(*terrors.TencentCloudSDKError); ok { - sw.checkErrCode(terr, mf) - if terr.Code == RequestLimitExceededCode || terr.Code == WrongStatusCode { - continue - } - } - blog.Errorf("describe task status failed, err %s", err.Error()) - return fmt.Errorf("describe task status failed, err %s", err.Error()) - } - blog.Infof("describe task status response:\n%s", response.ToJsonString()) - // dealing - if *response.Response.Status == TaskStatusDealing { - blog.Infof("task %s is dealing", taskID) - time.Sleep(time.Duration(waitPeriodLBDealing) * time.Second) - continue - // failed - } else if *response.Response.Status == TaskStatusFailed { - blog.Errorf("task %s is failed", taskID) - return fmt.Errorf("task %s is failed", taskID) - // succeed - } else if *response.Response.Status == TaskStatusSucceed { - blog.Infof("task %s is done", taskID) - return nil - } - return fmt.Errorf("error status of task %d", *response.Response.Status) - } - blog.Errorf("describe task status with request %s timeout", request.ToJsonString()) - return fmt.Errorf("describe task status with request %s timeout", request.ToJsonString()) -} - -// doDeregisterTargets wrap DeregisterTargets -func (sw *SdkWrapper) doDeregisterTargets(region string, req *tclb.DeregisterTargetsRequest) error { - blog.V(3).Infof("DeregisterTargets request: %s", req.ToJsonString()) - var err error - var resp *tclb.DeregisterTargetsResponse - - startTime := time.Now() - // 统计API调用延时/状态 - mf := func(ret string) { - metrics.ReportLibRequestMetric( - SystemNameInMetricTencentCloud, - HandlerNameInMetricTencentCloudSDK, - "DeregisterTargets", ret, startTime) - } - - counter := 1 - for ; counter <= maxRetry; counter++ { - blog.V(3).Infof("DeregisterTargets try %d/%d", counter, maxRetry) - sw.tryThrottle() - // get client by region - clbCli, inErr := sw.getRegionClient(region) - if inErr != nil { - mf(metrics.LibCallStatusErr) - return inErr - } - resp, err = clbCli.DeregisterTargets(req) - if err != nil { - if terr, ok := err.(*terrors.TencentCloudSDKError); ok { - sw.checkErrCode(terr, mf) - if terr.Code == RequestLimitExceededCode || terr.Code == WrongStatusCode { - continue - } - } - mf(metrics.LibCallStatusErr) - blog.Errorf("DeregisterTargets failed, err %s", err.Error()) - return fmt.Errorf("DeregisterTargets failed, err %s", err.Error()) - } - blog.V(3).Infof("DeregisterTargets response: %s", resp.ToJsonString()) - break - } - if counter > maxRetry { - mf(metrics.LibCallStatusTimeout) - blog.Errorf("DeregisterTargets out of maxRetry %d", maxRetry) - return fmt.Errorf("DeregisterTargets out of maxRetry %d", maxRetry) - } - // 等待异步请求执行完毕 - err = sw.waitTaskDone(region, *resp.Response.RequestId) - if err != nil { - mf(metrics.LibCallStatusErr) - return err - } - mf(metrics.LibCallStatusOK) - return nil -} - -// doRegisterTargets wrap RegisterTargets -func (sw *SdkWrapper) doRegisterTargets(region string, req *tclb.RegisterTargetsRequest) error { - blog.V(3).Infof("RegisterTargets request: %s", req.ToJsonString()) - var err error - var resp *tclb.RegisterTargetsResponse - - startTime := time.Now() - // 统计API调用延时/状态 - mf := func(ret string) { - metrics.ReportLibRequestMetric( - SystemNameInMetricTencentCloud, - HandlerNameInMetricTencentCloudSDK, - "RegisterTargets", ret, startTime) - } - - counter := 1 - for ; counter <= maxRetry; counter++ { - blog.V(3).Infof("RegisterTargets try %d/%d", counter, maxRetry) - sw.tryThrottle() - clbCli, inErr := sw.getRegionClient(region) - if inErr != nil { - mf(metrics.LibCallStatusErr) - return inErr - } - resp, err = clbCli.RegisterTargets(req) - if err != nil { - if terr, ok := err.(*terrors.TencentCloudSDKError); ok { - sw.checkErrCode(terr, mf) - if terr.Code == RequestLimitExceededCode || terr.Code == WrongStatusCode { - continue - } - } - mf(metrics.LibCallStatusErr) - blog.Errorf("RegisterTargets failed, err %s", err.Error()) - return fmt.Errorf("RegisterTargets failed, err %s", err.Error()) - } - blog.V(3).Infof("RegisterTargets response: %s", resp.ToJsonString()) - break - } - if counter > maxRetry { - mf(metrics.LibCallStatusTimeout) - blog.Errorf("RegisterTargets out of maxRetry %d", maxRetry) - return fmt.Errorf("RegisterTargets out of maxRetry %d", maxRetry) - } - // 等待异步请求执行完毕 - err = sw.waitTaskDone(region, *resp.Response.RequestId) - if err != nil { - mf(metrics.LibCallStatusErr) - return err - } - mf(metrics.LibCallStatusOK) - return nil -} - -// doBatchRegisterTargets batch register clb targets -func (sw *SdkWrapper) doBatchRegisterTargets(region string, req *tclb.BatchRegisterTargetsRequest) ([]string, error) { - blog.V(3).Infof("BatchRegisterTargets request: %s", req.ToJsonString()) - var err error - var resp *tclb.BatchRegisterTargetsResponse - startTime := time.Now() - // 统计API调用延时/状态 - mf := func(ret string) { - metrics.ReportLibRequestMetric( - SystemNameInMetricTencentCloud, - HandlerNameInMetricTencentCloudSDK, - "BatchRegisterTargets", ret, startTime) - } - - counter := 1 - for ; counter <= maxRetry; counter++ { - blog.V(3).Infof("BatchRegisterTargets try %d/%d", counter, maxRetry) - sw.tryThrottle() - clbCli, inErr := sw.getRegionClient(region) - if inErr != nil { - mf(metrics.LibCallStatusErr) - return nil, inErr - } - resp, err = clbCli.BatchRegisterTargets(req) - if err != nil { - if terr, ok := err.(*terrors.TencentCloudSDKError); ok { - sw.checkErrCode(terr, mf) - if terr.Code == RequestLimitExceededCode || terr.Code == WrongStatusCode { - continue - } - } - mf(metrics.LibCallStatusErr) - blog.Errorf("BatchRegisterTargets failed, err %s", err.Error()) - return nil, fmt.Errorf("BatchRegisterTargets failed, err %s", err.Error()) - } - blog.V(3).Infof("BatchRegisterTargets response: %s", resp.ToJsonString()) - break - } - if counter > maxRetry { - mf(metrics.LibCallStatusTimeout) - blog.Errorf("BatchRegisterTargets out of maxRetry %d", maxRetry) - return nil, fmt.Errorf("BatchRegisterTargets out of maxRetry %d", maxRetry) - } - // 等待异步请求执行完毕 - err = sw.waitTaskDone(region, *resp.Response.RequestId) - if err != nil { - mf(metrics.LibCallStatusErr) - return nil, err - } - mf(metrics.LibCallStatusOK) - - var failedListenerIDs []string - if len(resp.Response.FailListenerIdSet) != 0 { - failedListenerIDs = tcommon.StringValues(resp.Response.FailListenerIdSet) - } - return failedListenerIDs, nil -} - -// batch deregister clb targets -func (sw *SdkWrapper) doBatchDeregisterTargets(region string, req *tclb.BatchDeregisterTargetsRequest) ( - []string, error) { - blog.V(3).Infof("BatchDeregisterTargets request: %s", req.ToJsonString()) - var err error - var resp *tclb.BatchDeregisterTargetsResponse - startTime := time.Now() - // 统计API调用延时/状态 - mf := func(ret string) { - metrics.ReportLibRequestMetric( - SystemNameInMetricTencentCloud, - HandlerNameInMetricTencentCloudSDK, - "BatchDeregisterTargets", ret, startTime) - } - - counter := 1 - for ; counter <= maxRetry; counter++ { - blog.V(3).Infof("BatchDeregisterTargets try %d/%d", counter, maxRetry) - sw.tryThrottle() - clbCli, inErr := sw.getRegionClient(region) - if inErr != nil { - mf(metrics.LibCallStatusErr) - return nil, inErr - } - resp, err = clbCli.BatchDeregisterTargets(req) - if err != nil { - if terr, ok := err.(*terrors.TencentCloudSDKError); ok { - sw.checkErrCode(terr, mf) - if terr.Code == RequestLimitExceededCode || terr.Code == WrongStatusCode { - continue - } - } - mf(metrics.LibCallStatusErr) - blog.Errorf("BatchDeregisterTargets failed, err %s", err.Error()) - return nil, fmt.Errorf("BatchDeregisterTargets failed, err %s", err.Error()) - } - blog.V(3).Infof("BatchDeregisterTargets response: %s", resp.ToJsonString()) - break - } - if counter > maxRetry { - mf(metrics.LibCallStatusTimeout) - blog.Errorf("BatchDeregisterTargets out of maxRetry %d", maxRetry) - return nil, fmt.Errorf("BatchDeregisterTargets out of maxRetry %d", maxRetry) - } - // 等待异步请求执行完毕 - err = sw.waitTaskDone(region, *resp.Response.RequestId) - if err != nil { - mf(metrics.LibCallStatusErr) - return nil, err - } - mf(metrics.LibCallStatusOK) - - var failedListenerIDs []string - if len(resp.Response.FailListenerIdSet) != 0 { - failedListenerIDs = tcommon.StringValues(resp.Response.FailListenerIdSet) - } - return failedListenerIDs, nil -} - -// batch modify target weight -func (sw *SdkWrapper) doBatchModifyTargetWeight(region string, req *tclb.BatchModifyTargetWeightRequest) error { - blog.V(3).Infof("BatchModifyTargetWeight request: %s", req.ToJsonString()) - var err error - var resp *tclb.BatchModifyTargetWeightResponse - startTime := time.Now() - // 统计API调用延时/状态 - mf := func(ret string) { - metrics.ReportLibRequestMetric( - SystemNameInMetricTencentCloud, - HandlerNameInMetricTencentCloudSDK, - "BatchModifyTargetWeight", ret, startTime) - } - - counter := 1 - for ; counter <= maxRetry; counter++ { - blog.V(3).Infof("BatchModifyTargetWeight try %d/%d", counter, maxRetry) - sw.tryThrottle() - clbCli, inErr := sw.getRegionClient(region) - if inErr != nil { - mf(metrics.LibCallStatusErr) - return inErr - } - resp, err = clbCli.BatchModifyTargetWeight(req) - if err != nil { - if terr, ok := err.(*terrors.TencentCloudSDKError); ok { - sw.checkErrCode(terr, mf) - if terr.Code == RequestLimitExceededCode || terr.Code == WrongStatusCode { - continue - } - } - mf(metrics.LibCallStatusErr) - blog.Errorf("BatchModifyTargetWeight failed, err %s", err.Error()) - return fmt.Errorf("BatchModifyTargetWeight failed, err %s", err.Error()) - } - blog.V(3).Infof("BatchModifyTargetWeight response: %s", resp.ToJsonString()) - break - } - if counter > maxRetry { - mf(metrics.LibCallStatusTimeout) - blog.Errorf("BatchModifyTargetWeight out of maxRetry %d", maxRetry) - return fmt.Errorf("BatchModifyTargetWeight out of maxRetry %d", maxRetry) - } - // 等待异步请求执行完毕 - err = sw.waitTaskDone(region, *resp.Response.RequestId) - if err != nil { - mf(metrics.LibCallStatusErr) - return err - } - mf(metrics.LibCallStatusOK) - return nil -} - -func (sw *SdkWrapper) doDescribeTargetHealth(region string, - req *tclb.DescribeTargetHealthRequest) (*tclb.DescribeTargetHealthResponse, error) { - blog.V(5).Infof("DescribeTargetHealth request: %s", req.ToJsonString()) - var err error - var resp *tclb.DescribeTargetHealthResponse - - startTime := time.Now() - // 统计API调用延时/状态 - mf := func(ret string) { - metrics.ReportLibRequestMetric( - SystemNameInMetricTencentCloud, - HandlerNameInMetricTencentCloudSDK, - "DescribeTargetHealth", ret, startTime) - } - - counter := 1 - for ; counter <= maxRetry; counter++ { - blog.V(5).Infof("DescribeTargetHealth try %d/%d", counter, maxRetry) - sw.tryThrottle() - // get client by region - clbCli, inErr := sw.getRegionClient(region) - if inErr != nil { - mf(metrics.LibCallStatusErr) - return nil, inErr - } - resp, err = clbCli.DescribeTargetHealth(req) - if err != nil { - if terr, ok := err.(*terrors.TencentCloudSDKError); ok { - sw.checkErrCode(terr, mf) - if terr.Code == RequestLimitExceededCode || terr.Code == WrongStatusCode { - continue - } - } - mf(metrics.LibCallStatusErr) - blog.Errorf("DescribeTargetHealth failed, err %s", err.Error()) - return nil, fmt.Errorf("DescribeTargetHealth failed, err %s", err.Error()) - } - blog.V(5).Infof("DescribeTargetHealth response: %s", resp.ToJsonString()) - break - } - if counter > maxRetry { - mf(metrics.LibCallStatusErr) - blog.Errorf("DescribeTargetHealth out of maxRetry %d", maxRetry) - return nil, fmt.Errorf("DescribeTargetHealth out of maxRetry %d", maxRetry) - } - mf(metrics.LibCallStatusOK) - return resp, nil -} diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/util.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/util.go index 4184edfd9f..7a9baafb34 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/util.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/util.go @@ -15,13 +15,11 @@ package tencentcloud import ( "reflect" "strconv" - "strings" tclb "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb/v20180317" tcommon "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud" - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/common" networkextensionv1 "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/apis/networkextension/v1" ) @@ -191,12 +189,10 @@ func transIngressCertificate(tc *networkextensionv1.IngressListenerCertificate) return certInput } -// getIPPortKey return certain format func getIPPortKey(ip string, port int) string { return ip + ":" + strconv.Itoa(port) } -// getTargets transfer crd targetGroup to clb request field func getTargets(tg *networkextensionv1.ListenerTargetGroup) []*tclb.Target { if tg == nil { return nil @@ -212,11 +208,6 @@ func getTargets(tg *networkextensionv1.ListenerTargetGroup) []*tclb.Target { return retTargets } -// getDiffBetweenTargetGroup compare targetGroup between cloud and local -// return addTarget/delTarget/updateTarget -// addTarget: in local but not in cloud -// delTarget: in cloud but not in local -// updateTarget: ip&port both in cloud and local, but weight different func getDiffBetweenTargetGroup(existedTg, newTg *networkextensionv1.ListenerTargetGroup) ( []*tclb.Target, []*tclb.Target, []*tclb.Target) { @@ -270,8 +261,7 @@ func getDiffBetweenTargetGroup(existedTg, newTg *networkextensionv1.ListenerTarg return addTargets, delTargets, updateWeightTargets } -// compareTargetGroup -func compareTargetGroup(existedTg, newTg *networkextensionv1.ListenerTargetGroup) ( +func getDiffBackendListBetweenTargetGroup(existedTg, newTg *networkextensionv1.ListenerTargetGroup) ( []networkextensionv1.ListenerBackend, []networkextensionv1.ListenerBackend, []networkextensionv1.ListenerBackend) { existedBackendsMap := make(map[string]networkextensionv1.ListenerBackend) @@ -313,7 +303,6 @@ func compareTargetGroup(existedTg, newTg *networkextensionv1.ListenerTargetGroup return addBackends, delBackends, updateWeightBackends } -// getDomainPathKey return certain format func getDomainPathKey(domain, path string) string { return domain + path } @@ -336,12 +325,8 @@ func needUpdateAttribute(oldAttr, newAttr *networkextensionv1.IngressListenerAtt if oldAttr.HealthCheck == nil { return true } - - return needUpdateHealthCheck(newAttr.HealthCheck, oldAttr.HealthCheck) -} - -// needUpdateHealthCheck return true if health check need update -func needUpdateHealthCheck(newHealth, oldHealth *networkextensionv1.ListenerHealthCheck) bool { + newHealth := newAttr.HealthCheck + oldHealth := oldAttr.HealthCheck if newHealth.Enabled != oldHealth.Enabled { return true } @@ -354,16 +339,9 @@ func needUpdateHealthCheck(newHealth, oldHealth *networkextensionv1.ListenerHeal (newHealth.Timeout != 0 && newHealth.Timeout != oldHealth.Timeout) { return true } - return false } -// getDiffBetweenListenerRule compare listener Rule in cloud and local -// return addRules, delRules, updateOldRules, updatedRules -// - addRule: in local but not in cloud -// - delRule: in cloud but not in local -// - updatedRule: both in cloud and local, but attr different -// - updateOldRules: localRule before update, have same order of updatedRule func getDiffBetweenListenerRule(existedListener, newListener *networkextensionv1.Listener) ( []networkextensionv1.ListenerRule, []networkextensionv1.ListenerRule, []networkextensionv1.ListenerRule, []networkextensionv1.ListenerRule) { @@ -413,7 +391,6 @@ func getDiffBetweenListenerRule(existedListener, newListener *networkextensionv1 return addRules, delRules, updateOldRules, updatedRules } -// splitListenersToDiffProtocol split listener by its protocol func splitListenersToDiffProtocol(listenerList []*networkextensionv1.Listener) [][]*networkextensionv1.Listener { retMap := make(map[string][]*networkextensionv1.Listener) for _, li := range listenerList { @@ -465,7 +442,6 @@ func splitListenersToDiffBatch(listenerList []*networkextensionv1.Listener) [][] return retList } -// getListenerNames return []string of listener name func getListenerNames(listenerList []*networkextensionv1.Listener) []string { var retList []string for _, li := range listenerList { @@ -474,7 +450,6 @@ func getListenerNames(listenerList []*networkextensionv1.Listener) []string { return retList } -// convertHealthStatus transfer cloud status to local func convertHealthStatus(status string) string { var statusStr string switch status { @@ -487,66 +462,3 @@ func convertHealthStatus(status string) string { } return statusStr } - -// transferCloudListener transfer cloud listener to local listener -func transferCloudListener(lbID string, cloudLiResp *tclb.DescribeListenersResponse, portMap map[int]struct{}) ( - []string, map[string]*networkextensionv1.Listener, map[string]*networkextensionv1.IngressListenerAttribute, - map[string]*networkextensionv1.IngressListenerCertificate) { - var listenerIDs []string - retListenerMap := make(map[string]*networkextensionv1.Listener) - ruleIDAttrMap := make(map[string]*networkextensionv1.IngressListenerAttribute) - ruleIDCertMap := make(map[string]*networkextensionv1.IngressListenerCertificate) - - for _, cloudLi := range cloudLiResp.Response.Listeners { - // only care about listener with given ports - if _, ok := portMap[int(*cloudLi.Port)]; !ok { - continue - } - listenerIDs = append(listenerIDs, *cloudLi.ListenerId) - li := &networkextensionv1.Listener{} - li.Spec.LoadbalancerID = lbID - li.Spec.Port = int(*cloudLi.Port) - // get segment listener end port - if cloudLi.EndPort != nil && *cloudLi.EndPort > 0 { - li.Spec.EndPort = int(*cloudLi.EndPort) - } - li.Spec.Protocol = strings.ToLower(*cloudLi.Protocol) - li.Spec.Certificate = convertCertificate(cloudLi.Certificate) - li.Spec.ListenerAttribute = convertListenerAttribute(cloudLi) - if len(cloudLi.Rules) != 0 { - for _, respRule := range cloudLi.Rules { - if respRule.LocationId != nil { - ruleIDAttrMap[*respRule.LocationId] = convertRuleAttribute(respRule) - ruleIDCertMap[*respRule.LocationId] = convertCertificate(respRule.Certificate) - } - } - } - li.Status.ListenerID = *cloudLi.ListenerId - retListenerMap[common.GetListenerNameWithProtocol(lbID, li.Spec.Protocol, li.Spec.Port, li.Spec.EndPort)] = li - } - - return listenerIDs, retListenerMap, ruleIDAttrMap, ruleIDCertMap -} - -// compareListener compare listener of cloud and local -func compareListener(lbID string, cloudListenerMap map[string]*networkextensionv1.Listener, - localListener []*networkextensionv1.Listener) ([]*networkextensionv1.Listener, []*networkextensionv1.Listener, []*networkextensionv1.Listener) { - addListeners := make([]*networkextensionv1.Listener, 0) - updatedListeners := make([]*networkextensionv1.Listener, 0) - deleteCloudListeners := make([]*networkextensionv1.Listener, 0) - for _, li := range localListener { - cloudLi, ok := cloudListenerMap[common.GetListenerNameWithProtocol( - lbID, li.Spec.Protocol, li.Spec.Port, li.Spec.EndPort)] - if !ok { - addListeners = append(addListeners, li) - } else { - if strings.ToLower(cloudLi.Spec.Protocol) != strings.ToLower(li.Spec.Protocol) { - deleteCloudListeners = append(deleteCloudListeners, cloudLi) - addListeners = append(addListeners, li) - } else { - updatedListeners = append(updatedListeners, li) - } - } - } - return addListeners, updatedListeners, deleteCloudListeners -} diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/validate.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/validate.go index f832199dcc..a01e6053e7 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/validate.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud/tencentcloud/validate.go @@ -152,37 +152,27 @@ func (cv *ClbValidater) validateListenerAttribute(attr *networkextensionv1.Ingre return false, fmt.Sprintf("invalid lb policy %s, available [WRR, LEAST_CONN]", attr.LbPolicy) } } - if valid, msg := cv.validateHealthCheck(attr.HealthCheck); !valid { - return false, msg - } - return true, "" -} - -func (cv *ClbValidater) validateHealthCheck(healthCheck *networkextensionv1.ListenerHealthCheck) (bool, string) { - if healthCheck == nil || healthCheck.Enabled == false { - return true, "" - } - - if healthCheck.HealthNum != 0 && (healthCheck.HealthNum < 2 || healthCheck.HealthNum > 10) { - return false, fmt.Sprintf("invalid healthNum %d, available [2, 10]", healthCheck.HealthNum) - } - if healthCheck.UnHealthNum != 0 && - (healthCheck.UnHealthNum < 2 || healthCheck.UnHealthNum > 10) { - return false, fmt.Sprintf("invalid unHealthNum %d, available [2, 10]", healthCheck.UnHealthNum) - } - if healthCheck.Timeout != 0 && - (healthCheck.Timeout < 2 || healthCheck.Timeout > 60) { - return false, fmt.Sprintf("invalid timeout %d, available [2, 60]", healthCheck.Timeout) - } - if healthCheck.IntervalTime != 0 && - (healthCheck.IntervalTime < 5 || healthCheck.IntervalTime > 300) { - return false, fmt.Sprintf("invalid interval time %d, available [5, 300]", healthCheck.IntervalTime) - } - if healthCheck.HTTPCode != 0 && - (healthCheck.HTTPCode < 1 || healthCheck.HTTPCode > 31) { - return false, fmt.Sprintf("invalid httpCode %d, available [1, 31]", healthCheck.HTTPCode) + if attr.HealthCheck != nil && attr.HealthCheck.Enabled { + if attr.HealthCheck.HealthNum != 0 && (attr.HealthCheck.HealthNum < 2 || attr.HealthCheck.HealthNum > 10) { + return false, fmt.Sprintf("invalid healthNum %d, available [2, 10]", attr.HealthCheck.HealthNum) + } + if attr.HealthCheck.UnHealthNum != 0 && + (attr.HealthCheck.UnHealthNum < 2 || attr.HealthCheck.UnHealthNum > 10) { + return false, fmt.Sprintf("invalid unHealthNum %d, available [2, 10]", attr.HealthCheck.UnHealthNum) + } + if attr.HealthCheck.Timeout != 0 && + (attr.HealthCheck.Timeout < 2 || attr.HealthCheck.Timeout > 60) { + return false, fmt.Sprintf("invalid timeout %d, available [2, 60]", attr.HealthCheck.Timeout) + } + if attr.HealthCheck.IntervalTime != 0 && + (attr.HealthCheck.IntervalTime < 5 || attr.HealthCheck.IntervalTime > 300) { + return false, fmt.Sprintf("invalid interval time %d, available [5, 300]", attr.HealthCheck.IntervalTime) + } + if attr.HealthCheck.HTTPCode != 0 && + (attr.HealthCheck.HTTPCode < 1 || attr.HealthCheck.HTTPCode > 31) { + return false, fmt.Sprintf("invalid httpCode %d, available [1, 31]", attr.HealthCheck.HTTPCode) + } } - return true, "" } diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloudcollector/cloudcollector.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloudcollector/cloudcollector.go index 6186105199..2b7ac16958 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloudcollector/cloudcollector.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloudcollector/cloudcollector.go @@ -18,12 +18,11 @@ import ( "sync" "time" - "github.com/prometheus/client_golang/prometheus" - "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/Tencent/bk-bcs/bcs-common/common/blog" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloud" networkextensionv1 "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/apis/networkextension/v1" + "github.com/prometheus/client_golang/prometheus" + "sigs.k8s.io/controller-runtime/pkg/client" ) const ( @@ -106,7 +105,6 @@ func (cc *CloudCollector) getLbMap( return retMap } -// Start run func (cc *CloudCollector) Start() { tiker := time.NewTicker(statusUpdateInterval) for { diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloudcollector/statuscache.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloudcollector/statuscache.go index 5641402a5d..590d4c07e8 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloudcollector/statuscache.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/cloudcollector/statuscache.go @@ -1,16 +1,3 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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 cloudcollector import ( @@ -37,9 +24,9 @@ func (sc *StatusCache) UpdateCache(newData map[string][]*cloud.BackendHealthStat sc.mutex.Lock() defer sc.mutex.Unlock() - // clear old data + //clear old data sc.cache = make(map[string][]*cloud.BackendHealthStatus) - // update new data + //update new data for k, v := range newData { sc.cache[k] = v } diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/common/common.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/common/common.go index 1f0408b141..c503ac9e4b 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/common/common.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/common/common.go @@ -13,7 +13,6 @@ package common import ( - // NOCC:gas/crypto(未使用于密钥) "crypto/md5" "fmt" "strconv" @@ -103,7 +102,6 @@ func GetNamespacedNameKey(name, ns string) string { // example: pool1/md5(item1) // because item1 is an anomaly string, so we use md5 to encode it func GetPortPoolListenerLabelKey(portPoolName, itemName string) string { - // NOCC:gas/crypto(未使用于密钥) return portPoolName + "/" + fmt.Sprintf("%x", (md5.Sum([]byte(itemName)))) } diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/conflicthandler/conflict.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/conflicthandler/conflict.go index 37483e2a6d..0d3daeb4fb 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/conflicthandler/conflict.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/conflicthandler/conflict.go @@ -48,12 +48,12 @@ type ConflictHandler struct { } // NewConflictHandler return new conflictHandler -func NewConflictHandler(conflictCheckOpen bool, isTCPUDPPortReuse bool, defaultRegion string, k8sCli client.Client, +func NewConflictHandler(conflictCheckOpen bool, IsTCPUDPPortReuse bool, defaultRegion string, k8sCli client.Client, igc *generator.IngressConverter, eventer record.EventRecorder) *ConflictHandler { return &ConflictHandler{ conflictCheckOpen: conflictCheckOpen, defaultRegion: defaultRegion, - IsTCPUDPPortReuse: isTCPUDPPortReuse, + IsTCPUDPPortReuse: IsTCPUDPPortReuse, k8sClient: k8sCli, ingressConverter: igc, eventer: eventer, diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/generator/ingressconverter.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/generator/ingressconverter.go index 6fded2cdf0..d67500422f 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/generator/ingressconverter.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/generator/ingressconverter.go @@ -594,7 +594,7 @@ func (g *IngressConverter) CheckIngressServiceAvailable(ingress *networkextensio } var msgList []string - for msg := range msgSet { + for msg, _ := range msgSet { msgList = append(msgList, msg) } diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/httpsvr/listener.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/httpsvr/listener.go index 45d76c1293..b5df670d5e 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/httpsvr/listener.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/httpsvr/listener.go @@ -38,7 +38,6 @@ func (h *HttpServerClient) listListener(request *restful.Request, response *rest }, ingress); err != nil { if k8serrors.IsNotFound(err) { blog.Infof("ingress %s/%s not found", request.PathParameter("namespace"), request.PathParameter("name")) - // NOCC:ineffassign/assign(误报) data = CreateResponseData(err, "failed", nil) break } @@ -54,7 +53,6 @@ func (h *HttpServerClient) listListener(request *restful.Request, response *rest if err != nil { blog.Errorf("list listeners filter by ingress %s failed, err %s", request.PathParameter("name"), err.Error()) - // NOCC:ineffassign/assign(误报) data = CreateResponseData(err, "failed", nil) break } @@ -67,7 +65,6 @@ func (h *HttpServerClient) listListener(request *restful.Request, response *rest }, portPool); err != nil { if k8serrors.IsNotFound(err) { blog.Infof("portpool %s/%s not found", request.PathParameter("namespace"), request.PathParameter("name")) - // NOCC:ineffassign/assign(误报) data = CreateResponseData(err, "failed", nil) break } @@ -85,7 +82,6 @@ func (h *HttpServerClient) listListener(request *restful.Request, response *rest if err != nil { blog.Errorf("list listeners filter by port pool item %s failed, err %s", portPool.Spec.PoolItems[i].ItemName, err.Error()) - // NOCC:ineffassign/assign(误报) data = CreateResponseData(err, "failed", nil) break } diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/httpsvr/node.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/httpsvr/node.go index e5fc7ee53a..c4316e176d 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/httpsvr/node.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/httpsvr/node.go @@ -21,28 +21,16 @@ import ( func (h *HttpServerClient) listNode(request *restful.Request, response *restful.Response) { nodeName := request.QueryParameter("node_name") - nodeInternalIP := request.QueryParameter("node_ip") - if nodeName == "" && nodeInternalIP == "" { - _, _ = response.Write(CreateResponseData(errors.New("empty parameter: node_name and node_ip"), "", nil)) + if nodeName == "" { + _, _ = response.Write(CreateResponseData(errors.New("empty parameter: node_name"), "", nil)) return } - var nodeIPs []string - var err error - if nodeName != "" { - nodeIPs, err = h.NodeCache.GetNodeExternalIPsByName(nodeName) - if err != nil { - _, _ = response.Write(CreateResponseData(err, "", nil)) - return - } - } - if nodeInternalIP != "" { - nodeIPs, err = h.NodeCache.GetNodeExternalIPsByIP(nodeInternalIP) - if err != nil { - _, _ = response.Write(CreateResponseData(err, "", nil)) - return - } + nodeIps, err := h.NodeCache.GetNodeIps(nodeName) + if err != nil { + _, _ = response.Write(CreateResponseData(err, "", nil)) + return } - _, _ = response.Write(CreateResponseData(nil, "", nodeIPs)) + _, _ = response.Write(CreateResponseData(nil, "", nodeIps)) } diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/httpsvr/response.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/httpsvr/response.go index 4cedc3b5a1..04f0e8f008 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/httpsvr/response.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/httpsvr/response.go @@ -31,7 +31,7 @@ type APIRespone struct { // CreateResponseData common response func CreateResponseData(err error, msg string, data interface{}) []byte { - var resp *APIRespone + resp := &APIRespone{} if err != nil { resp = errResponseDefault(err) diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/nodecache/nodecache.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/nodecache/nodecache.go index 369b5abf0f..3ed3bd825b 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/nodecache/nodecache.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/nodecache/nodecache.go @@ -30,11 +30,10 @@ import ( // NodeCache cache node info type NodeCache struct { - isInit bool - nodeInfoMapByName *sync.Map - nodeInfoMapByIP *sync.Map - k8sClient client.Client - nodeClient cloudnode.NodeClient + isInit bool + nodeInfoMap *sync.Map + k8sClient client.Client + nodeClient cloudnode.NodeClient sync.Mutex } @@ -42,18 +41,17 @@ type NodeCache struct { // NewNodeCache return new NodeCache func NewNodeCache(k8sClient client.Client, nodeClient cloudnode.NodeClient) *NodeCache { cache := &NodeCache{ - nodeInfoMapByName: &sync.Map{}, - nodeInfoMapByIP: &sync.Map{}, - isInit: false, - k8sClient: k8sClient, - nodeClient: nodeClient, + nodeInfoMap: &sync.Map{}, + isInit: false, + k8sClient: k8sClient, + nodeClient: nodeClient, } go func() { timeTicker := time.NewTicker(time.Second * 5) for { select { case <-timeTicker.C: - cache.nodeInfoMapByName.Range(func(key, value interface{}) bool { + cache.nodeInfoMap.Range(func(key, value interface{}) bool { blog.V(4).Infof("node cache info: %v %v", key, value) return true }) @@ -65,24 +63,23 @@ func NewNodeCache(k8sClient client.Client, nodeClient cloudnode.NodeClient) *Nod } // SetNodeIps set node ip to cache -func (n *NodeCache) SetNodeIps(node corev1.Node, nodeIPs []string) { +func (n *NodeCache) SetNodeIps(nodeName string, nodeIPs []string) { // init失败时仍尝试保存数据 if err := n.checkInit(); err != nil { err = errors.Wrapf(err, "init node cache failed") blog.Errorf("%s", err.Error()) } - n.nodeInfoMapByName.Store(node.GetName(), nodeIPs) - n.nodeInfoMapByIP.Store(getNodeInternalIP(node), nodeIPs) + n.nodeInfoMap.Store(nodeName, nodeIPs) } -// GetNodeExternalIPsByName get node ip from cache -func (n *NodeCache) GetNodeExternalIPsByName(nodeName string) ([]string, error) { +// GetNodeIps get node ip from cache +func (n *NodeCache) GetNodeIps(nodeName string) ([]string, error) { if n.isInit == false { blog.Errorf("try to get node ip without init") return nil, errors.New("try to get node ip without init") } - val, ok := n.nodeInfoMapByName.Load(nodeName) + val, ok := n.nodeInfoMap.Load(nodeName) if !ok { metrics.IncreaseNodeNotFoundCounter(nodeName) err := errors.Errorf("node[%s] external ips is empty", nodeName) @@ -99,29 +96,6 @@ func (n *NodeCache) GetNodeExternalIPsByName(nodeName string) ([]string, error) return nodeIPs, nil } -// GetNodeExternalIPsByIP get node ip from cache -func (n *NodeCache) GetNodeExternalIPsByIP(nodeInternalIP string) ([]string, error) { - if n.isInit == false { - blog.Errorf("try to get node ip without init") - return nil, errors.New("try to get node ip without init") - } - val, ok := n.nodeInfoMapByIP.Load(nodeInternalIP) - if !ok { - metrics.IncreaseNodeNotFoundCounter(nodeInternalIP) - err := errors.Errorf("node[%s] external ips is empty", nodeInternalIP) - blog.Errorf("%s", err.Error()) - return nil, err - } - - nodeIPs, ok := val.([]string) - if !ok { - err := errors.Errorf("unknown type in node cache, value: %+v", val) - blog.Errorf("%s", err.Error()) - return nil, err - } - return nodeIPs, nil -} - // initCache use node list to build cache func (n *NodeCache) initCache() error { nodeList := &corev1.NodeList{} @@ -140,7 +114,7 @@ func (n *NodeCache) initCache() error { blog.Errorf("get node[%s] external ip list failed, err: %s", node.GetName(), err.Error()) continue } - n.SetNodeIps(node, externalIPList) + n.SetNodeIps(node.GetName(), externalIPList) } return nil @@ -161,13 +135,3 @@ func (n *NodeCache) checkInit() error { } return nil } - -func getNodeInternalIP(node corev1.Node) string { - for _, addr := range node.Status.Addresses { - if addr.Type == corev1.NodeInternalIP { - return addr.Address - } - } - - return "" -} diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/option/option.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/option/option.go index 2e809e8810..23f86d4c96 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/option/option.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/option/option.go @@ -13,16 +13,9 @@ package option import ( - "flag" - "fmt" - "os" - "strconv" - "strings" "time" - "github.com/Tencent/bk-bcs/bcs-common/common/blog" "github.com/Tencent/bk-bcs/bcs-common/common/conf" - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/constant" ) // ControllerOption options for controller @@ -90,16 +83,12 @@ type ControllerOption struct { ServCert ServCert } - -// Conf 服务配置 type Conf struct { ServCert ServCert InsecureAddress string InsecurePort uint VerifyClientTLS bool } - -// ServCert 服务证书配置 type ServCert struct { CAFile string CertFile string @@ -107,94 +96,3 @@ type ServCert struct { CertPasswd string IsSSL bool } - -// SetFromEnv set options by environment -func (op *ControllerOption) SetFromEnv() { - // get env var name for tcp and udp port reuse - isTCPUDPPortReuseStr := os.Getenv(constant.EnvNameIsTCPUDPPortReuse) - if len(isTCPUDPPortReuseStr) != 0 { - blog.Infof("env option %s is %s", constant.EnvNameIsTCPUDPPortReuse, isTCPUDPPortReuseStr) - isTCPUDPPortReuse, err := strconv.ParseBool(isTCPUDPPortReuseStr) - if err != nil { - blog.Errorf("parse bool string %s failed, err %s", isTCPUDPPortReuseStr, err.Error()) - os.Exit(1) - } - if isTCPUDPPortReuse { - op.IsTCPUDPPortReuse = isTCPUDPPortReuse - } - } - - // get env var name for bulk mode - isBulkModeStr := os.Getenv(constant.EnvNameIsBulkMode) - if len(isBulkModeStr) != 0 { - blog.Infof("env option %s is %s", constant.EnvNameIsBulkMode, isBulkModeStr) - isBulkMode, err := strconv.ParseBool(isBulkModeStr) - if err != nil { - blog.Errorf("parse bool string %s failed, err %s", isBulkModeStr, err.Error()) - os.Exit(1) - } - if isBulkMode { - op.IsBulkMode = isBulkMode - } - } - - podIPs := os.Getenv(constant.EnvNamePodIPs) - if len(podIPs) == 0 { - blog.Errorf("empty pod ip") - podIPs = op.Address - } - blog.Infof("pod ips: %s", podIPs) - op.PodIPs = strings.Split(podIPs, ",") -} - -// BindFromCommandLine 读取命令行参数并绑定 -func (op *ControllerOption) BindFromCommandLine() { - var checkIntervalStr string - var verbosity int - flag.StringVar(&op.Address, "address", "127.0.0.1", "address for controller") - flag.IntVar(&op.MetricPort, "metric_port", 8081, "metric port for controller") - flag.IntVar(&op.Port, "port", 8080, "por for controller") - flag.StringVar(&op.Cloud, "cloud", "tencentcloud", "cloud mode for controller") - flag.StringVar(&op.Region, "region", "", "default cloud region for controller") - flag.StringVar(&op.ElectionNamespace, "election_namespace", "bcs-system", "namespace for leader election") - flag.BoolVar(&op.IsNamespaceScope, "is_namespace_scope", false, - "if the ingress can only be associated with the service and workload in the same namespace") - flag.StringVar(&checkIntervalStr, "portbinding_check_interval", "3m", - "check interval of port binding, golang time format") - - flag.StringVar(&op.LogDir, "log_dir", "./logs", "If non-empty, write log files in this directory") - flag.Uint64Var(&op.LogMaxSize, "log_max_size", 500, "Max size (MB) per log file.") - flag.IntVar(&op.LogMaxNum, "log_max_num", 10, "Max num of log file.") - flag.BoolVar(&op.ToStdErr, "logtostderr", false, "log to standard error instead of files") - flag.BoolVar(&op.AlsoToStdErr, "alsologtostderr", false, "log to standard error as well as files") - - flag.IntVar(&verbosity, "v", 0, "log level for V logs") - flag.StringVar(&op.StdErrThreshold, "stderrthreshold", "2", "logs at or above this threshold go to stderr") - flag.StringVar(&op.VModule, "vmodule", "", "comma-separated list of pattern=N settings for file-filtered logging") - flag.StringVar(&op.TraceLocation, "log_backtrace_at", "", "when logging hits line file:N, emit a stack trace") - - flag.StringVar(&op.ServerCertFile, "server_cert_file", "", "server cert file for webhook server") - flag.StringVar(&op.ServerKeyFile, "server_key_file", "", "server key file for webhook server") - - flag.IntVar(&op.KubernetesQPS, "kubernetes_qps", 100, "the qps of k8s client request") - flag.IntVar(&op.KubernetesBurst, "kubernetes_burst", 200, "the burst of k8s client request") - - flag.BoolVar(&op.ConflictCheckOpen, "conflict_check_open", true, "if false, "+ - "skip all conflict checking about ingress and port pool") - flag.BoolVar(&op.NodeInfoExporterOpen, "node_info_exporter_open", false, "if true, "+ - "bcs-ingress-controller will record node info in cluster") - - flag.UintVar(&op.HttpServerPort, "http_svr_port", 8088, "port for ingress controller http server") - flag.IntVar(&op.LBCacheExpiration, "lb_cache_expiration", 60, "lb cache expiration, unit: minute ") - - flag.Parse() - - op.Verbosity = int32(verbosity) - - checkInterval, err := time.ParseDuration(checkIntervalStr) - if err != nil { - fmt.Printf("check interval %s invalid", checkIntervalStr) - os.Exit(1) - } - op.PortBindingCheckInterval = checkInterval -} diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/webhookserver/mutating.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/webhookserver/mutating.go index 5964ee509a..c898535689 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/webhookserver/mutating.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/webhookserver/mutating.go @@ -216,16 +216,16 @@ func (s *Server) mutatingPod(pod *k8scorev1.Pod) ([]PatchOperation, error) { for _, portEntry := range portEntryList { poolKey := getPoolKey(portEntry.poolName, portEntry.poolNamespace) var portPoolItemStatus *networkextensionv1.PortPoolItemStatus - var inErr error + var err error // deal with TCP_UDP protocol // for TCP_UDP protocol, one container port needs both TCP listener port and UDP listener port if portEntry.protocol == constant.PortPoolPortProtocolTCPUDP { var cachePortItemMap map[string]portpoolcache.AllocatedPortItem - portPoolItemStatus, cachePortItemMap, inErr = s.poolCache.AllocateAllProtocolPortBinding(poolKey) - if inErr != nil { + portPoolItemStatus, cachePortItemMap, err = s.poolCache.AllocateAllProtocolPortBinding(poolKey) + if err != nil { s.cleanAllocatedResource(portItemListArr) return nil, fmt.Errorf("allocate protocol %s port from pool %s failed, err %s", - portEntry.protocol, poolKey, inErr.Error()) + portEntry.protocol, poolKey, err.Error()) } var tmpPortItemList []portpoolcache.AllocatedPortItem for _, cachePortItem := range cachePortItemMap { @@ -236,11 +236,11 @@ func (s *Server) mutatingPod(pod *k8scorev1.Pod) ([]PatchOperation, error) { } else { // deal with TCP protocol and UDP protocol var cachePortItem portpoolcache.AllocatedPortItem - portPoolItemStatus, cachePortItem, inErr = s.poolCache.AllocatePortBinding(poolKey, portEntry.protocol) - if inErr != nil { + portPoolItemStatus, cachePortItem, err = s.poolCache.AllocatePortBinding(poolKey, portEntry.protocol) + if err != nil { s.cleanAllocatedResource(portItemListArr) return nil, fmt.Errorf("allocate protocol %s port from pool %s failed, err %s", - portEntry.protocol, poolKey, inErr.Error()) + portEntry.protocol, poolKey, err.Error()) } portItemListArr = append(portItemListArr, []portpoolcache.AllocatedPortItem{cachePortItem}) portPoolItemStatusList = append(portPoolItemStatusList, portPoolItemStatus) @@ -299,7 +299,7 @@ func (s *Server) handleForPodCreateFailed(pod *k8scorev1.Pod, portItemListArr [] defer func() { if r := recover(); r != nil { blog.Errorf("pod '%s/%s' check failed create failed: %v, occurred a panic: %s\n", - pod.GetNamespace(), pod.GetName(), r, string(debug.Stack())) + r, string(debug.Stack())) } }() @@ -370,7 +370,7 @@ func (s *Server) patchPodByBinding( // patch annotations var retPatches []PatchOperation - annotationPortsPatch, err := s.generatePortsAnnoPatchByBinding(pod, portBinding) + annotationPortsPatch, err := s.generatePortsAnnotationPatchByBinding(pod, portBinding) if err != nil { return nil, fmt.Errorf("generate annotations ports by portbinding failed, err %s", err.Error()) } @@ -400,7 +400,7 @@ func (s *Server) patchPodByBinding( } // generate container annotations patch object by existed portbinding object -func (s *Server) generatePortsAnnoPatchByBinding( +func (s *Server) generatePortsAnnotationPatchByBinding( pod *k8scorev1.Pod, portBinding *networkextensionv1.PortBinding) (PatchOperation, error) { portValues, err := json.Marshal(portBinding.Spec.PortBindingList) if err != nil { diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/webhookserver/webhookserver.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/webhookserver/webhookserver.go index 892b1551d2..70f7e34fa3 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/webhookserver/webhookserver.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/webhookserver/webhookserver.go @@ -111,7 +111,6 @@ func (s *Server) Start(stop <-chan struct{}) error { mux.HandleFunc("/portpool/v1/mutate", s.HandleMutatingWebhook) mux.HandleFunc("/crd/v1/validate", s.HandleValidatingCRD) mux.HandleFunc("/ingress/v1/mutate", s.HandlerValidatingIngress) - // 兼容IPV6 s.ipv6Server.Server.Handler = mux go func() { @@ -159,12 +158,10 @@ func (s *Server) HandleValidatingCRD(w http.ResponseWriter, r *http.Request) { s.handleWebhook(w, r, "validateCRD", newDelegateToV1AdmitHandler(s.validatingCRDDelete)) } -// HandlerValidatingIngress handler validating ingress webhook request func (s *Server) HandlerValidatingIngress(w http.ResponseWriter, r *http.Request) { s.handleWebhook(w, r, "validateIngress", newDelegateToV1AdmitHandler(s.mutatingIngress)) } -// handleWebhook 新旧版本K8S Webhook的返回结构体不一致, 这里需要自动适配 func (s *Server) handleWebhook( w http.ResponseWriter, r *http.Request, handleName string, admit admitHandler) { @@ -248,7 +245,6 @@ func (s *Server) handleWebhook( metrics.ReportAPIRequestMetric(handleName, r.Method, strconv.Itoa(http.StatusOK), startTime) } -// validatingWebhook 校验portpool更新,避免端口冲突 func (s *Server) validatingWebhook(ar v1.AdmissionReview) *v1.AdmissionResponse { req := ar.Request // only hook create and update operation @@ -280,7 +276,6 @@ func (s *Server) validatingWebhook(ar v1.AdmissionReview) *v1.AdmissionResponse return &v1.AdmissionResponse{Allowed: true} } -// mutatingIngress 校验用户对ingress的更新,包括端口冲突和配置, warning级别的错误会patch到ingress的注解上 func (s *Server) mutatingIngress(ar v1.AdmissionReview) *v1.AdmissionResponse { req := ar.Request // only hook create and update operation @@ -326,9 +321,7 @@ func (s *Server) mutatingIngress(ar v1.AdmissionReview) *v1.AdmissionResponse { } } -// mutatingWebhook 根据用户注解,分配端口池端口到Pod func (s *Server) mutatingWebhook(ar v1.AdmissionReview) (response *v1.AdmissionResponse) { - // 统计webhook执行成功/失败次数 defer func() { if response == nil || response.Allowed == false { metrics.IncreasePodCreateCounter(false) @@ -387,7 +380,6 @@ func (s *Server) mutatingWebhook(ar v1.AdmissionReview) (response *v1.AdmissionR } } -// validatingCRDDelete 根据删除策略,避免用户误删除正在使用中的CRD,导致相关资源被销毁 func (s *Server) validatingCRDDelete(ar v1.AdmissionReview) *v1.AdmissionResponse { allowResp := &v1.AdmissionResponse{Allowed: true} req := ar.Request diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/worker/synchronizer.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/worker/synchronizer.go index fb9e6b039d..7147c4e491 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/worker/synchronizer.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/worker/synchronizer.go @@ -38,9 +38,6 @@ const ( ) // EventHandler handler for listener event -// 上层为每个LB ID维护一个EventHandler, 处理该LB相关的所有监听器事件 -// 当ListenerController收到Listener Event后,交由对应LB的EventHandler处理 -// EventHandler将event存在Cache中,通过Ticker每三分钟处理一次 (为了使用batch接口提升处理效率) type EventHandler struct { ctx context.Context @@ -148,7 +145,6 @@ func (h *EventHandler) doHandleMulti() error { for _, event := range h.eventRecvCache.List() { blog.Infof("[worker %s] eventType: %s, listener: %s/%s", h.lbID, event.Type, event.Name, event.Namespace) - // 实际处理时再获取listener,避免listener短时间内的多次变化被拆分到多次处理中 listener := &networkextensionv1.Listener{} nsName := k8stypes.NamespacedName{ Namespace: event.Namespace, @@ -251,7 +247,6 @@ func (h *EventHandler) ensureMultiListeners(listeners []*networkextensionv1.List } var listenerIDMap map[string]cloud.Result var err error - // 通过EndPort区分端口段监听器 if listeners[0].Spec.EndPort > 0 { listenerIDMap, err = h.lbClient.EnsureMultiSegmentListeners(h.region, h.lbID, listeners) } else { @@ -265,9 +260,9 @@ func (h *EventHandler) ensureMultiListeners(listeners []*networkextensionv1.List Name: li.GetName(), } h.recordListenerFailedEvent(li, err) - if inErr := h.patchListenerStatus(li, "", networkextensionv1.ListenerStatusNotSynced, - err.Error()); inErr != nil { - blog.Warnf("patch listener id of %s/%s failed, err %s", li.GetName(), li.GetNamespace(), inErr.Error()) + if err := h.patchListenerStatus(li, "", networkextensionv1.ListenerStatusNotSynced, + err.Error()); err != nil { + blog.Warnf("patch listener id of %s/%s failed, err %s", li.GetName(), li.GetNamespace(), err.Error()) } h.eventQueue.AddRateLimited(obj) h.eventQueue.Done(obj) @@ -322,47 +317,33 @@ func (h *EventHandler) deleteMultiListeners(listeners []*networkextensionv1.List case constant.ProtocolHTTP, constant.ProtocolHTTPS: protocolLayer = constant.ProtocolLayerApplication } - // 删除时判断LB是否存在,避免监听器删除接口调用失败,进而导致相关资源无法释放 - if h.lbClient.IsNamespaced() { - _, err = h.lbClient.DescribeLoadBalancerWithNs(listeners[0].Namespace, h.region, h.lbID, "", protocolLayer) - } else { - _, err = h.lbClient.DescribeLoadBalancer(h.region, h.lbID, "", protocolLayer) - } - if err != nil && err != cloud.ErrLoadbalancerNotFound { - blog.Errorf("cloud lb client DescribeLoadBalancer failed, err %s", err.Error()) - for _, li := range listeners { - obj := k8stypes.NamespacedName{ - Namespace: li.GetNamespace(), - Name: li.GetName(), - } - h.recordListenerDeleteFailedEvent(li, err) - h.eventQueue.AddRateLimited(obj) - h.eventQueue.Done(obj) + if _, err = h.lbClient.DescribeLoadBalancer(h.region, h.lbID, "", protocolLayer); err != nil { + if err != cloud.ErrLoadbalancerNotFound { + blog.Errorf("cloud lb client DescribeLoadBalancer failed, err %s", err.Error()) + return } - return - } - - err = h.lbClient.DeleteMultiListeners(h.region, h.lbID, listeners) - if err != nil { - blog.Warnf("delete listeners failed, requeue listeners, err: %s", err.Error()) - for _, li := range listeners { - obj := k8stypes.NamespacedName{ - Namespace: li.GetNamespace(), - Name: li.GetName(), + } else { + err = h.lbClient.DeleteMultiListeners(h.region, h.lbID, listeners) + if err != nil { + blog.Warnf("delete listeners failed, requeue listeners, err: %s", err.Error()) + for _, li := range listeners { + obj := k8stypes.NamespacedName{ + Namespace: li.GetNamespace(), + Name: li.GetName(), + } + h.recordListenerDeleteFailedEvent(li, err) + h.eventQueue.AddRateLimited(obj) + h.eventQueue.Done(obj) } - h.recordListenerDeleteFailedEvent(li, err) - h.eventQueue.AddRateLimited(obj) - h.eventQueue.Done(obj) + return } - return } - for _, li := range listeners { li.Finalizers = common.RemoveString(li.Finalizers, constant.FinalizerNameBcsIngressController) - inErr := h.k8sCli.Update(context.Background(), li, &client.UpdateOptions{}) - if inErr != nil { + err := h.k8sCli.Update(context.Background(), li, &client.UpdateOptions{}) + if err != nil { blog.Warnf("failed to remove finalizer from listener %s/%s, err %s", - li.GetNamespace(), li.GetName(), inErr.Error()) + li.GetNamespace(), li.GetName(), err.Error()) obj := k8stypes.NamespacedName{ Namespace: li.GetNamespace(), Name: li.GetName(), @@ -413,9 +394,9 @@ func (h *EventHandler) ensureListener(li *networkextensionv1.Listener) error { if err != nil { h.recordListenerFailedEvent(li, err) blog.Errorf("cloud lb client EnsureSegmentListener failed, err %s", err.Error()) - if inErr := h.patchListenerStatus(li, "", networkextensionv1.ListenerStatusNotSynced, - err.Error()); inErr != nil { - blog.Warnf("patch listener id of %s/%s failed, err %s", li.GetName(), li.GetNamespace(), inErr.Error()) + if err := h.patchListenerStatus(li, "", networkextensionv1.ListenerStatusNotSynced, + err.Error()); err != nil { + blog.Warnf("patch listener id of %s/%s failed, err %s", li.GetName(), li.GetNamespace(), err.Error()) } return fmt.Errorf("cloud lb client EnsureSegmentListener failed, err %s", err.Error()) } @@ -424,9 +405,9 @@ func (h *EventHandler) ensureListener(li *networkextensionv1.Listener) error { if err != nil { h.recordListenerFailedEvent(li, err) blog.Errorf("cloud lb client EnsureListener failed, err %s", err.Error()) - if inErr := h.patchListenerStatus(li, "", networkextensionv1.ListenerStatusNotSynced, - err.Error()); inErr != nil { - blog.Warnf("patch listener id of %s/%s failed, err %s", li.GetName(), li.GetNamespace(), inErr.Error()) + if err := h.patchListenerStatus(li, "", networkextensionv1.ListenerStatusNotSynced, + err.Error()); err != nil { + blog.Warnf("patch listener id of %s/%s failed, err %s", li.GetName(), li.GetNamespace(), err.Error()) } return fmt.Errorf("cloud lb client EnsureListener failed, err %s", err.Error()) } diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/main.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/main.go index 594d607e9b..3e4ac667ee 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/main.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/main.go @@ -14,10 +14,12 @@ package main import ( "context" + "flag" "fmt" "net/http" "os" "strconv" + "strings" "time" gocache "github.com/patrickmn/go-cache" @@ -29,13 +31,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" - "k8s.io/apimachinery/pkg/runtime" - clientgoscheme "k8s.io/client-go/kubernetes/scheme" - _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - "sigs.k8s.io/controller-runtime/pkg/metrics" - "github.com/Tencent/bk-bcs/bcs-common/common/blog" "github.com/Tencent/bk-bcs/bcs-common/common/http/httpserver" "github.com/Tencent/bk-bcs/bcs-common/common/http/ipv6server" @@ -66,6 +61,13 @@ import ( portbindingctrl "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portbindingcontroller" portpoolctrl "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portpoolcontroller" networkextensionv1 "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/apis/networkextension/v1" + + "k8s.io/apimachinery/pkg/runtime" + clientgoscheme "k8s.io/client-go/kubernetes/scheme" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/log/zap" + "sigs.k8s.io/controller-runtime/pkg/metrics" ) var ( @@ -81,14 +83,94 @@ func init() { func main() { opts := &option.ControllerOption{} - opts.BindFromCommandLine() + var verbosity int + var checkIntervalStr string + flag.StringVar(&opts.Address, "address", "127.0.0.1", "address for controller") + flag.IntVar(&opts.MetricPort, "metric_port", 8081, "metric port for controller") + flag.IntVar(&opts.Port, "port", 8080, "por for controller") + flag.StringVar(&opts.Cloud, "cloud", "tencentcloud", "cloud mode for controller") + flag.StringVar(&opts.Region, "region", "", "default cloud region for controller") + flag.StringVar(&opts.ElectionNamespace, "election_namespace", "bcs-system", "namespace for leader election") + flag.BoolVar(&opts.IsNamespaceScope, "is_namespace_scope", false, + "if the ingress can only be associated with the service and workload in the same namespace") + flag.StringVar(&checkIntervalStr, "portbinding_check_interval", "3m", + "check interval of port binding, golang time format") + + flag.StringVar(&opts.LogDir, "log_dir", "./logs", "If non-empty, write log files in this directory") + flag.Uint64Var(&opts.LogMaxSize, "log_max_size", 500, "Max size (MB) per log file.") + flag.IntVar(&opts.LogMaxNum, "log_max_num", 10, "Max num of log file.") + flag.BoolVar(&opts.ToStdErr, "logtostderr", false, "log to standard error instead of files") + flag.BoolVar(&opts.AlsoToStdErr, "alsologtostderr", false, "log to standard error as well as files") + + flag.IntVar(&verbosity, "v", 0, "log level for V logs") + flag.StringVar(&opts.StdErrThreshold, "stderrthreshold", "2", "logs at or above this threshold go to stderr") + flag.StringVar(&opts.VModule, "vmodule", "", "comma-separated list of pattern=N settings for file-filtered logging") + flag.StringVar(&opts.TraceLocation, "log_backtrace_at", "", "when logging hits line file:N, emit a stack trace") + + flag.StringVar(&opts.ServerCertFile, "server_cert_file", "", "server cert file for webhook server") + flag.StringVar(&opts.ServerKeyFile, "server_key_file", "", "server key file for webhook server") + + flag.IntVar(&opts.KubernetesQPS, "kubernetes_qps", 100, "the qps of k8s client request") + flag.IntVar(&opts.KubernetesBurst, "kubernetes_burst", 200, "the burst of k8s client request") + + flag.BoolVar(&opts.ConflictCheckOpen, "conflict_check_open", true, "if false, "+ + "skip all conflict checking about ingress and port pool") + flag.BoolVar(&opts.NodeInfoExporterOpen, "node_info_exporter_open", false, "if true, "+ + "bcs-ingress-controller will record node info in cluster") + + flag.UintVar(&opts.HttpServerPort, "http_svr_port", 8088, "port for ingress controller http server") + flag.IntVar(&opts.LBCacheExpiration, "lb_cache_expiration", 60, "lb cache expiration, unit: minute ") + + flag.Parse() + + opts.Verbosity = int32(verbosity) + checkInterval, err := time.ParseDuration(checkIntervalStr) + if err != nil { + fmt.Printf("check interval %s invalid", checkIntervalStr) + os.Exit(1) + } + opts.PortBindingCheckInterval = checkInterval blog.InitLogs(opts.LogConfig) defer blog.CloseLogs() ctrl.SetLogger(zap.New(zap.UseDevMode(false))) - opts.SetFromEnv() + // get env var name for tcp and udp port reuse + isTCPUDPPortReuseStr := os.Getenv(constant.EnvNameIsTCPUDPPortReuse) + if len(isTCPUDPPortReuseStr) != 0 { + blog.Infof("env option %s is %s", constant.EnvNameIsTCPUDPPortReuse, isTCPUDPPortReuseStr) + isTCPUDPPortReuse, err := strconv.ParseBool(isTCPUDPPortReuseStr) + if err != nil { + blog.Errorf("parse bool string %s failed, err %s", isTCPUDPPortReuseStr, err.Error()) + os.Exit(1) + } + if isTCPUDPPortReuse { + opts.IsTCPUDPPortReuse = isTCPUDPPortReuse + } + } + + // get env var name for bulk mode + isBulkModeStr := os.Getenv(constant.EnvNameIsBulkMode) + if len(isBulkModeStr) != 0 { + blog.Infof("env option %s is %s", constant.EnvNameIsBulkMode, isBulkModeStr) + isBulkMode, err := strconv.ParseBool(isBulkModeStr) + if err != nil { + blog.Errorf("parse bool string %s failed, err %s", isBulkModeStr, err.Error()) + os.Exit(1) + } + if isBulkMode { + opts.IsBulkMode = isBulkMode + } + } + + podIPs := os.Getenv(constant.EnvNamePodIPs) + if len(podIPs) == 0 { + blog.Errorf("empty pod ip") + podIPs = opts.Address + } + blog.Infof("pod ips: %s", podIPs) + opts.PodIPs = strings.Split(podIPs, ",") // init port pool cache portPoolCache := portpoolcache.NewCache() @@ -96,12 +178,11 @@ func main() { mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, - MetricsBindAddress: "0", // "0"表示禁用默认的Metric Service, 需要使用自己的实现支持IPV6 + MetricsBindAddress: "0", LeaderElection: true, LeaderElectionID: "33fb49e.cloudlbconroller.bkbcs.tencent.com", LeaderElectionNamespace: opts.ElectionNamespace, NewClient: func(cache cache.Cache, config *rest.Config, options client.Options) (client.Client, error) { - // 调高对K8S client的QPS限制,优化大批量监听器时的处理效率 config.QPS = float32(opts.KubernetesQPS) config.Burst = opts.KubernetesBurst // Create the Client for Write operations. @@ -137,7 +218,68 @@ func main() { } go eventWatcher.Start(context.Background()) - validater, lbClient, nodeClient := initClient(opts, mgr.GetClient(), eventWatcher) + var validater cloud.Validater + var lbClient cloud.LoadBalance + var nodeClient cloudnode.NodeClient + switch opts.Cloud { + case constant.CloudTencent: + validater = tencentcloud.NewClbValidater() + if !opts.IsNamespaceScope { + lbClient, err = tencentcloud.NewClb() + if err != nil { + blog.Errorf("init cloud failed, err %s", err.Error()) + os.Exit(1) + } + } else { + lbClient = namespacedlb.NewNamespacedLB(mgr.GetClient(), eventWatcher, + tencentcloud.NewClbWithSecret) + } + nodeClient = native.NewNativeNodeClient() + + case constant.CloudAWS: + validater = aws.NewELbValidater() + if !opts.IsNamespaceScope { + lbClient, err = aws.NewElb() + if err != nil { + blog.Errorf("init cloud failed, err %s", err.Error()) + os.Exit(1) + } + } else { + lbClient = namespacedlb.NewNamespacedLB(mgr.GetClient(), eventWatcher, aws.NewElbWithSecret) + } + nodeClient = native.NewNativeNodeClient() + + case constant.CloudGCP: + validater = gcp.NewGclbValidater() + if !opts.IsNamespaceScope { + lbClient, err = gcp.NewGclb(mgr.GetClient(), eventWatcher) + if err != nil { + blog.Errorf("init cloud failed, err %s", err.Error()) + os.Exit(1) + } + } else { + lbClient = namespacedlb.NewNamespacedLB(mgr.GetClient(), eventWatcher, + gcp.NewGclbWithSecret) + } + nodeClient = native.NewNativeNodeClient() + + case constant.CloudAzure: + validater = azure.NewAlbValidater() + if !opts.IsNamespaceScope { + lbClient, err = azure.NewAlb() + if err != nil { + blog.Errorf("init cloud failed, err %s", err.Error()) + os.Exit(1) + } + } else { + lbClient = namespacedlb.NewNamespacedLB(mgr.GetClient(), eventWatcher, azure.NewAlbWithSecret) + } + nodeClient = native.NewNativeNodeClient() + + default: + blog.Errorf("unknown cloud type '%s'", opts.Cloud) + os.Exit(1) + } if len(opts.Region) == 0 { blog.Errorf("region cannot be empty") @@ -258,11 +400,11 @@ func initInClusterClient() (*kubernetes.Clientset, error) { if err != nil { return nil, errors.Wrapf(err, "get in-cluster config failed") } - cli, err := kubernetes.NewForConfig(cfg) + client, err := kubernetes.NewForConfig(cfg) if err != nil { return nil, errors.Wrapf(err, "create in-cluster client failed") } - return cli, nil + return client, nil } // runPrometheusMetrics starting prometheus metrics handler @@ -279,9 +421,6 @@ func runPrometheusMetrics(op *option.ControllerOption) { } // initHttpServer init ingress controller http server -// httpServer提供 -// 1. 集群内Ingress/PortPool/PortBinding/Listener等信息的查询 -// 2. 维护节点信息,提供接口给Pod获取所在节点的信息 func initHttpServer(op *option.ControllerOption, mgr manager.Manager, nodeCache *nodecache.NodeCache) error { server := httpserver.NewHttpServer(op.HttpServerPort, op.Address, "") if op.Conf.ServCert.IsSSL { @@ -306,72 +445,3 @@ func initHttpServer(op *option.ControllerOption, mgr manager.Manager, nodeCache } return nil } - -// initClient 根据使用云厂商的不同,返回对应云厂商的实现 -func initClient(opts *option.ControllerOption, cli client.Client, eventWatcher eventer.WatchEventInterface) (cloud. - Validater, cloud.LoadBalance, cloudnode.NodeClient) { - var validater cloud.Validater - var lbClient cloud.LoadBalance - var nodeClient cloudnode.NodeClient - var err error - switch opts.Cloud { - case constant.CloudTencent: - validater = tencentcloud.NewClbValidater() - if !opts.IsNamespaceScope { - lbClient, err = tencentcloud.NewClb() - if err != nil { - blog.Errorf("init cloud failed, err %s", err.Error()) - os.Exit(1) - } - } else { - lbClient = namespacedlb.NewNamespacedLB(cli, eventWatcher, - tencentcloud.NewClbWithSecret) - } - nodeClient = native.NewNativeNodeClient() - - case constant.CloudAWS: - validater = aws.NewELbValidater() - if !opts.IsNamespaceScope { - lbClient, err = aws.NewElb() - if err != nil { - blog.Errorf("init cloud failed, err %s", err.Error()) - os.Exit(1) - } - } else { - lbClient = namespacedlb.NewNamespacedLB(cli, eventWatcher, aws.NewElbWithSecret) - } - nodeClient = native.NewNativeNodeClient() - - case constant.CloudGCP: - validater = gcp.NewGclbValidater() - if !opts.IsNamespaceScope { - lbClient, err = gcp.NewGclb(cli, eventWatcher) - if err != nil { - blog.Errorf("init cloud failed, err %s", err.Error()) - os.Exit(1) - } - } else { - lbClient = namespacedlb.NewNamespacedLB(cli, eventWatcher, - gcp.NewGclbWithSecret) - } - nodeClient = native.NewNativeNodeClient() - - case constant.CloudAzure: - validater = azure.NewAlbValidater() - if !opts.IsNamespaceScope { - lbClient, err = azure.NewAlb() - if err != nil { - blog.Errorf("init cloud failed, err %s", err.Error()) - os.Exit(1) - } - } else { - lbClient = namespacedlb.NewNamespacedLB(cli, eventWatcher, azure.NewAlbWithSecret) - } - nodeClient = native.NewNativeNodeClient() - - default: - blog.Errorf("unknown cloud type '%s'", opts.Cloud) - os.Exit(1) - } - return validater, lbClient, nodeClient -} diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/nodecontroller/nodecontroller.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/nodecontroller/nodecontroller.go index d835fabf32..3dc23a3473 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/nodecontroller/nodecontroller.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/nodecontroller/nodecontroller.go @@ -82,7 +82,7 @@ func (r *NodeReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { } blog.Infof("update node %s ip list: %s", node.Name, externalIpList) - r.nodeCache.SetNodeIps(*node, externalIpList) + r.nodeCache.SetNodeIps(node.Name, externalIpList) return ctrl.Result{}, nil } diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portbindingcontroller/portbinding.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portbindingcontroller/portbinding.go index b1071877e1..9a6af6fe10 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portbindingcontroller/portbinding.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portbindingcontroller/portbinding.go @@ -61,7 +61,6 @@ func (pbh *portBindingHandler) ensurePortBinding( var newBindingStatusList []*networkextensionv1.PortBindingStatusItem for _, item := range portBinding.Spec.PortBindingList { var curStatus *networkextensionv1.PortBindingStatusItem - // 找到和spec中item对应的status for _, tmpStatus := range portBinding.Status.PortBindingStatusList { if tmpStatus.PoolName == item.PoolName && tmpStatus.PoolNamespace == item.PoolNamespace && @@ -77,7 +76,6 @@ func (pbh *portBindingHandler) ensurePortBinding( portBinding.Status.PortBindingStatusList = newBindingStatusList retry := false unreadyNum := 0 - // 不断重试等待所有item对应的监听器就绪 for _, status := range portBinding.Status.PortBindingStatusList { if status.Status != constant.PortBindingItemStatusReady { unreadyNum++ @@ -101,7 +99,6 @@ func (pbh *portBindingHandler) ensurePortBinding( portBinding.GetName(), portBinding.GetNamespace(), err.Error()) } - // 根据portBinding status更新相关状态 if err := pbh.postPortBindingUpdateStatus(rawStatus, updateStatus, portBinding); err != nil { return true, err } @@ -112,7 +109,6 @@ func (pbh *portBindingHandler) ensurePortBinding( return true, err } - // 当portBinding的部分字段发生变化时,需要同步更新pod上的注解 if err := pbh.ensurePod(pod, portBinding); err != nil { return true, errors.Wrapf(err, "ensurePod[%s/%s] failed", pod.GetNamespace(), pod.GetName()) } @@ -122,7 +118,6 @@ func (pbh *portBindingHandler) ensurePortBinding( return retry, nil } -// updatePodCondition 在pod.condition上记录portBinding的绑定状态 func (pbh *portBindingHandler) updatePodCondition(pod *k8scorev1.Pod, status string) error { if _, ok := pod.Annotations[constant.AnnotationForPortPoolReadinessGate]; !ok { return nil @@ -221,7 +216,6 @@ func (pbh *portBindingHandler) cleanPortBinding(portBinding *networkextensionv1. } portBinding.Status.PortBindingStatusList = nil for _, item := range portBinding.Spec.PortBindingList { - // 将item对应监听器的targetGroup重新设置为空 itemStatus := pbh.itemHandler.deleteItem(item) portBinding.Status.PortBindingStatusList = append(portBinding.Status.PortBindingStatusList, itemStatus) } @@ -249,7 +243,6 @@ func (pbh *portBindingHandler) cleanPortBinding(portBinding *networkextensionv1. return notCleanedNum != 0, nil } -// ensurePod update pod annotation if portBinding related field changed func (pbh *portBindingHandler) ensurePod(pod *k8scorev1.Pod, portBinding *networkextensionv1.PortBinding) error { portBindingItemMap := make(map[string]*networkextensionv1.PortBindingItem) for _, portBindingItem := range portBinding.Spec.PortBindingList { @@ -299,14 +292,12 @@ func (pbh *portBindingHandler) ensurePod(pod *k8scorev1.Pod, portBinding *networ return nil } -// patchPortBindingAnnotation patch annotation to portbinding func (pbh *portBindingHandler) patchPortBindingAnnotation( portbinding *networkextensionv1.PortBinding, notReadyTimestamp string, ) error { patchStruct := map[string]interface{}{ "metadata": map[string]interface{}{ "annotations": map[string]interface{}{ - // 记录portBinding最近一次变为NotReady的时间 constant.AnnotationForPortBindingNotReadyTimestamp: notReadyTimestamp, }, }, @@ -344,7 +335,6 @@ func (pbh *portBindingHandler) postPortBindingUpdateStatus(rawStatus, updateStat if notReadyTime, err := time.Parse(time.RFC3339Nano, notReadyTimeStr); err != nil { blog.Warnf("parse not ready timestamp failed, err: %s", err.Error()) } else { - // 上报绑定时间到Metric metrics.ReportPortBindMetric(notReadyTime) } if err := pbh.patchPortBindingAnnotation(portBinding, ""); err != nil { diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portbindingcontroller/portbindingcontroller.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portbindingcontroller/portbindingcontroller.go index 3734fe1e1c..3c3515a4ad 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portbindingcontroller/portbindingcontroller.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portbindingcontroller/portbindingcontroller.go @@ -165,9 +165,7 @@ func (pbr *PortBindingReconciler) Reconcile(req ctrl.Request) (ctrl.Result, erro return ctrl.Result{}, nil } -// createPortBinding create PortBinding by pods annotation func (pbr *PortBindingReconciler) createPortBinding(pod *k8scorev1.Pod) (ctrl.Result, error) { - // 1. 根据pod的注解(由webhook分配)获取对应的绑定端口 annotationValue, ok := pod.Annotations[constant.AnnotationForPortPoolBindings] if !ok { blog.Warnf("pod %s/%s has no annotation %s", @@ -180,7 +178,6 @@ func (pbr *PortBindingReconciler) createPortBinding(pod *k8scorev1.Pod) (ctrl.Re pod.GetName(), pod.GetNamespace(), constant.AnnotationForPortPoolPorts, err.Error(), annotationValue) return ctrl.Result{}, nil } - // 2. 根据Pod需要的绑定端口创建并初始化PortBinding podPortBinding := &networkextensionv1.PortBinding{} podPortBinding.SetName(pod.GetName()) podPortBinding.SetNamespace(pod.GetNamespace()) @@ -213,16 +210,8 @@ func (pbr *PortBindingReconciler) createPortBinding(pod *k8scorev1.Pod) (ctrl.Re return ctrl.Result{}, nil } -// cleanPortBinding clean portbinding resource -// 删除portBinding顺序 -// 1. 删除Pod,进入clean流程 -// 2. 根据portBinding的item,清理相关的listener资源 -// 3. 等待所有item清理完毕后,记portBinding status为cleaned -// 4. delete portBinding(加上DeletionTimeStamp) -// 5. 移除portBinding Finalizers, 并从缓存中释放占用的端口 func (pbr *PortBindingReconciler) cleanPortBinding(portBinding *networkextensionv1.PortBinding) (ctrl.Result, error) { if portBinding.Status.Status == constant.PortBindingStatusCleaned { - // 支持绑定端口保留,如果在expired内pod重新创建,还会复用相同的portBinding数据 expired, err := isPortBindingExpired(portBinding) if !expired && err == nil { return ctrl.Result{ diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portpoolcontroller/portpool.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portpoolcontroller/portpool.go index ccc56dc10b..97fe7e46aa 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portpoolcontroller/portpool.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portpoolcontroller/portpool.go @@ -131,7 +131,18 @@ func (pph *PortPoolHandler) ensurePortPool(pool *networkextensionv1.PortPool) (b pool.Status.PoolItemStatuses = append(pool.Status.PoolItemStatuses, ts) } - pool.Status.Status = checkPortPoolStatus(pool) + statusReady := true + for _, ts := range pool.Status.PoolItemStatuses { + if ts.Status != constant.PortPoolItemStatusReady { + statusReady = false + break + } + } + if statusReady { + pool.Status.Status = constant.PortPoolStatusReady + } else { + pool.Status.Status = constant.PortPoolStatusNotReady + } err := pph.k8sClient.Status().Update(context.Background(), pool, &client.UpdateOptions{}) if err != nil { @@ -143,9 +154,37 @@ func (pph *PortPoolHandler) ensurePortPool(pool *networkextensionv1.PortPool) (b return true, errors.Wrapf(err, "pool[%s/%s] ensurePortBinding failed", pool.GetNamespace(), pool.GetName()) } - // update related cache + pph.poolCache.Lock() + defer pph.poolCache.Unlock() + + // delete item from pool cache poolKey := ingresscommon.GetNamespacedNameKey(pool.GetName(), pool.GetNamespace()) - pph.ensureCache(poolKey, tmpItemsStatus, successDeletedKeyMap, failedDeletedKeyMap, newItemStatusList, updateItemStatusMap) + for _, itemStatus := range tmpItemsStatus { + itemKey := itemStatus.GetKey() + if _, ok := successDeletedKeyMap[itemKey]; !ok { + if _, inOk := failedDeletedKeyMap[itemKey]; inOk { + pph.poolCache.SetPortPoolItemStatus(poolKey, itemStatus) + blog.Infof("set port pool %s item %s status to %s", + poolKey, itemStatus.ItemName, constant.PortPoolItemStatusDeleting) + } + } else { + pph.poolCache.DeletePortPoolItem(poolKey, itemKey) + blog.Infof("delete port pool %s item %s", poolKey, itemStatus.ItemName) + } + } + // add item to pool cache + for _, itemStatus := range newItemStatusList { + if err := pph.poolCache.AddPortPoolItem(poolKey, itemStatus); err != nil { + blog.Warnf("failed to add port pool %s item %v to cache, err %s", poolKey, itemStatus, err.Error()) + } else { + blog.Infof("add port pool %s item %v to cache", poolKey, itemStatus) + } + } + // update item status + for _, itemStatus := range updateItemStatusMap { + pph.poolCache.SetPortPoolItemStatus(poolKey, itemStatus) + blog.Infof("set port pool %s item %s status to %s", poolKey, itemStatus.ItemName, itemStatus.Status) + } if len(failedDeletedKeyMap) != 0 || shouldRetry { return true, nil @@ -272,38 +311,3 @@ func (pph *PortPoolHandler) ensurePortBinding(pool *networkextensionv1.PortPool) return nil } - -func (pph *PortPoolHandler) ensureCache(poolKey string, tmpItemsStatus []*networkextensionv1.PortPoolItemStatus, - successDeletedKeyMap, failedDeletedKeyMap map[string]struct{}, newItemStatusList []*networkextensionv1. - PortPoolItemStatus, updateItemStatusMap map[string]*networkextensionv1.PortPoolItemStatus) { - - pph.poolCache.Lock() - defer pph.poolCache.Unlock() - - for _, itemStatus := range tmpItemsStatus { - itemKey := itemStatus.GetKey() - if _, ok := successDeletedKeyMap[itemKey]; !ok { - if _, inOk := failedDeletedKeyMap[itemKey]; inOk { - pph.poolCache.SetPortPoolItemStatus(poolKey, itemStatus) - blog.Infof("set port pool %s item %s status to %s", - poolKey, itemStatus.ItemName, constant.PortPoolItemStatusDeleting) - } - } else { - pph.poolCache.DeletePortPoolItem(poolKey, itemKey) - blog.Infof("delete port pool %s item %s", poolKey, itemStatus.ItemName) - } - } - // add item to pool cache - for _, itemStatus := range newItemStatusList { - if err := pph.poolCache.AddPortPoolItem(poolKey, itemStatus); err != nil { - blog.Warnf("failed to add port pool %s item %v to cache, err %s", poolKey, itemStatus, err.Error()) - } else { - blog.Infof("add port pool %s item %v to cache", poolKey, itemStatus) - } - } - // update item status - for _, itemStatus := range updateItemStatusMap { - pph.poolCache.SetPortPoolItemStatus(poolKey, itemStatus) - blog.Infof("set port pool %s item %s status to %s", poolKey, itemStatus.ItemName, itemStatus.Status) - } -} diff --git a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portpoolcontroller/util.go b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portpoolcontroller/util.go index 5827798d3d..1943464c2b 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portpoolcontroller/util.go +++ b/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/portpoolcontroller/util.go @@ -15,7 +15,6 @@ package portpoolcontroller import ( "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/common" - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/bcs-network/bcs-ingress-controller/internal/constant" netextv1 "github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/apis/networkextension/v1" ) @@ -32,17 +31,3 @@ func checkListenerLabels(labels map[string]string, portPoolName, itemName string return true } - -func checkPortPoolStatus(pool *netextv1.PortPool) string { - statusReady := true - for _, ts := range pool.Status.PoolItemStatuses { - if ts.Status != constant.PortPoolItemStatusReady { - statusReady = false - break - } - } - if statusReady { - return constant.PortPoolStatusReady - } - return constant.PortPoolStatusNotReady -} diff --git a/bcs-runtime/bcs-k8s/bcs-network/go.mod b/bcs-runtime/bcs-k8s/bcs-network/go.mod index 76ca91c060..c8e78cf47f 100644 --- a/bcs-runtime/bcs-k8s/bcs-network/go.mod +++ b/bcs-runtime/bcs-k8s/bcs-network/go.mod @@ -4,7 +4,7 @@ go 1.17 replace ( bitbucket.org/ww/goautoneg => github.com/adjust/goautoneg v0.0.0-20150426214442-d788f35a0315 - github.com/Tencent/bk-bcs/bcs-common => github.com/Tencent/bk-bcs/bcs-common v0.0.0-20230607093333-1f5cd2719e19 + github.com/Tencent/bk-bcs/bcs-common => github.com/Tencent/bk-bcs/bcs-common v0.0.0-20221205083018-bf769e1603a5 github.com/Tencent/bk-bcs/bcs-k8s/kubedeprecated => github.com/Tencent/bk-bcs/bcs-k8s/kubedeprecated v0.0.0-20210117140338-aeaed29b1997 github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes => ../kubernetes github.com/containernetworking/cni => github.com/containernetworking/cni v0.6.0 @@ -26,7 +26,7 @@ replace ( require ( cloud.google.com/go/compute v1.5.0 // indirect - github.com/Tencent/bk-bcs/bcs-common v0.0.0-20230607093333-1f5cd2719e19 + github.com/Tencent/bk-bcs/bcs-common v0.0.0-00010101000000-000000000000 github.com/Tencent/bk-bcs/bcs-k8s/kubedeprecated v0.0.0-00010101000000-000000000000 github.com/Tencent/bk-bcs/bcs-mesos/mesosv2 v0.0.0-20210117140338-aeaed29b1997 github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes v0.0.0-00010101000000-000000000000 @@ -41,12 +41,12 @@ require ( github.com/emicklei/go-restful v2.15.0+incompatible github.com/fsnotify/fsnotify v1.5.4 github.com/fsouza/go-dockerclient v1.7.3 - github.com/go-logr/logr v1.2.3 - github.com/golang/glog v1.0.0 + github.com/go-logr/logr v1.2.1 + github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.2 github.com/google/uuid v1.3.0 - github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/grpc-ecosystem/grpc-gateway v1.14.6 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/prometheus/client_golang v1.11.0 github.com/tencentcloud/tencentcloud-sdk-go v1.0.132 @@ -56,7 +56,7 @@ require ( golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect google.golang.org/api v0.70.0 google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf - google.golang.org/grpc v1.46.0 + google.golang.org/grpc v1.44.0 gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.23.1 k8s.io/apimachinery v0.23.1 @@ -67,6 +67,7 @@ require ( require ( github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect + github.com/BurntSushi/toml v1.1.0 // indirect github.com/Microsoft/go-winio v0.5.2 // indirect github.com/Microsoft/hcsshim v0.8.14 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.4 // indirect @@ -82,6 +83,7 @@ require ( github.com/docker/docker v20.10.7+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.4.0 // indirect + github.com/envoyproxy/protoc-gen-validate v0.1.0 // indirect github.com/evanphx/json-patch v4.9.0+incompatible // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/go-logr/zapr v0.1.0 // indirect @@ -102,7 +104,7 @@ require ( github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/micro/go-micro/v2 v2.9.1 // indirect github.com/miekg/dns v1.1.50 // indirect - github.com/mitchellh/hashstructure v1.1.0 // indirect + github.com/mitchellh/hashstructure v1.0.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/morikuni/aec v1.0.0 // indirect @@ -121,10 +123,12 @@ require ( github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect go.mongodb.org/mongo-driver v1.5.3 // indirect go.opencensus.io v0.23.0 // indirect - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.17.0 // indirect + go.uber.org/atomic v1.5.0 // indirect + go.uber.org/multierr v1.3.0 // indirect + go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee // indirect + go.uber.org/zap v1.13.0 // indirect golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect + golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect golang.org/x/text v0.3.7 // indirect @@ -133,6 +137,7 @@ require ( google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect + honnef.co/go/tools v0.0.1-2020.1.4 // indirect k8s.io/apiextensions-apiserver v0.20.0 k8s.io/klog v1.0.0 // indirect k8s.io/klog/v2 v2.30.0 // indirect @@ -153,7 +158,6 @@ require ( require ( github.com/deckarep/golang-set v1.8.0 github.com/hashicorp/go-multierror v1.1.0 - golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 ) require ( @@ -162,7 +166,6 @@ require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/Tencent/bk-bcs/bcs-runtime/bcs-k8s/kubernetes/common v0.0.0-20220330120237-0bbed74dcf6d // indirect - github.com/Tencent/bk-bcs/bcs-services/pkg v0.0.0-20220926153300-4e631deaebe4 // indirect github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 // indirect github.com/emicklei/go-restful-openapi v1.4.1 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect @@ -170,7 +173,6 @@ require ( github.com/go-openapi/spec v0.19.3 // indirect github.com/go-openapi/swag v0.19.5 // indirect github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/mailru/easyjson v0.7.0 // indirect @@ -178,7 +180,6 @@ require ( github.com/moby/sys/mount v0.2.0 // indirect github.com/moby/sys/mountinfo v0.4.0 // indirect github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect - github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect ) diff --git a/bcs-runtime/bcs-mesos/bcs-consoleproxy/app/app.go b/bcs-runtime/bcs-mesos/bcs-consoleproxy/app/app.go index 9fb3aa57b0..dca38fef36 100644 --- a/bcs-runtime/bcs-mesos/bcs-consoleproxy/app/app.go +++ b/bcs-runtime/bcs-mesos/bcs-consoleproxy/app/app.go @@ -15,8 +15,6 @@ package app import ( - "os" - "github.com/Tencent/bk-bcs/bcs-common/common" "github.com/Tencent/bk-bcs/bcs-common/common/blog" comconf "github.com/Tencent/bk-bcs/bcs-common/common/conf" @@ -24,6 +22,7 @@ import ( "github.com/Tencent/bk-bcs/bcs-runtime/bcs-mesos/bcs-consoleproxy/console-proxy/api" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-mesos/bcs-consoleproxy/console-proxy/config" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-mesos/bcs-consoleproxy/console-proxy/manager" + "os" ) // ConsoleProxy is an console proxy struct @@ -72,7 +71,7 @@ func setConfig(op *options.ConsoleProxyOption) { op.Conf.IsAuth = op.IsAuth op.Conf.IsOneSeesion = op.IsOneSession - // server cert directory + // server cert directoty if op.CertConfig.ServerCertFile != "" && op.CertConfig.CAFile != "" && op.CertConfig.ServerKeyFile != "" { diff --git a/bcs-runtime/bcs-mesos/bcs-consoleproxy/console-proxy/manager/console.go b/bcs-runtime/bcs-mesos/bcs-consoleproxy/console-proxy/manager/console.go index a0b122b8c7..c21b9aea79 100644 --- a/bcs-runtime/bcs-mesos/bcs-consoleproxy/console-proxy/manager/console.go +++ b/bcs-runtime/bcs-mesos/bcs-consoleproxy/console-proxy/manager/console.go @@ -19,13 +19,11 @@ import ( "net/http" "fmt" - "time" - - docker "github.com/fsouza/go-dockerclient" - "github.com/gorilla/websocket" - "github.com/Tencent/bk-bcs/bcs-common/common/blog" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-mesos/bcs-consoleproxy/console-proxy/types" + "github.com/fsouza/go-dockerclient" + "github.com/gorilla/websocket" + "time" ) // ConsoleCopywritingFailed is a response string @@ -118,7 +116,8 @@ func (m *manager) StartExec(w http.ResponseWriter, r *http.Request, conf *types. blog.Warnf("container %s has established connection", conf.ContainerID) for _, i := range ConsoleCopywritingFailed { - if err = ws.WriteMessage(websocket.TextMessage, []byte(i)); err != nil { + err := ws.WriteMessage(websocket.TextMessage, []byte(i)) + if err != nil { m.Unlock() ResponseJSON(w, http.StatusInternalServerError, errMsg{err.Error()}) return @@ -154,7 +153,7 @@ func (m *manager) StartExec(w http.ResponseWriter, r *http.Request, conf *types. for { select { case <-ticker.C: - if err = ws.WriteMessage(websocket.PingMessage, []byte{}); err != nil { + if err := ws.WriteMessage(websocket.PingMessage, []byte{}); err != nil { return } } diff --git a/bcs-runtime/bcs-mesos/bcs-consoleproxy/console-proxy/manager/interface.go b/bcs-runtime/bcs-mesos/bcs-consoleproxy/console-proxy/manager/interface.go index c562112a65..a5cf7027b9 100644 --- a/bcs-runtime/bcs-mesos/bcs-consoleproxy/console-proxy/manager/interface.go +++ b/bcs-runtime/bcs-mesos/bcs-consoleproxy/console-proxy/manager/interface.go @@ -14,15 +14,18 @@ package manager import ( - "net/http" - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-mesos/bcs-consoleproxy/console-proxy/types" + "net/http" ) // Manager is an interface type Manager interface { + // Start TODO + // start Start() error + // StartExec TODO + // handler container web console StartExec(http.ResponseWriter, *http.Request, *types.WebSocketConfig) CreateExec(http.ResponseWriter, *http.Request, *types.WebSocketConfig) ResizeExec(http.ResponseWriter, *http.Request, *types.WebSocketConfig) diff --git a/bcs-runtime/bcs-mesos/bcs-process-daemon/process-daemon/manager/download.go b/bcs-runtime/bcs-mesos/bcs-process-daemon/process-daemon/manager/download.go index 9e624bcae0..1c64057b50 100644 --- a/bcs-runtime/bcs-mesos/bcs-process-daemon/process-daemon/manager/download.go +++ b/bcs-runtime/bcs-mesos/bcs-process-daemon/process-daemon/manager/download.go @@ -15,7 +15,7 @@ package manager import ( "compress/gzip" - "crypto/md5" // nolint + "crypto/md5" "encoding/base64" "encoding/json" "fmt" @@ -87,7 +87,7 @@ func (m *manager) downloadAndTarProcessPackages(processInfo *types.ProcessInfo) _, err = os.Stat(uriPack.ExtractDir) if err != nil { blog.Errorf("process %s ExtractDir %s not exist, and need mkdir", processInfo.Id, uriPack.ExtractDir) - err = os.MkdirAll(filepath.Dir(uriPack.ExtractDir), 0755) // nolint + err = os.MkdirAll(filepath.Dir(uriPack.ExtractDir), 0755) if err != nil { blog.Errorf("process %s mkdir %s error %s", processInfo.Id, filepath.Dir(uriPack.OutputDir), err.Error()) return err @@ -210,7 +210,7 @@ func (m *manager) downloadProcessPackages(processInfo *types.ProcessInfo) (bool, }*/ var packMd5 string - h := md5.New() // nolint + h := md5.New() f, err := os.Open(uriPack.PackagesFile) if err != nil { blog.Errorf("process %s open PackagesFile %s error %s", processInfo.Id, uriPack.PackagesFile, err.Error()) @@ -234,13 +234,13 @@ func (m *manager) downloadProcessPackages(processInfo *types.ProcessInfo) (bool, DownloadRESP: blog.Errorf("process %s PackagesFile %s md5 %s is invalid, and need download", processInfo.Id, uriPack.PackagesFile, packMd5) - err = os.MkdirAll(filepath.Dir(uriPack.PackagesFile), 0755) // nolint + err = os.MkdirAll(filepath.Dir(uriPack.PackagesFile), 0755) if err != nil { blog.Errorf("process %s mkdir %s error %s", processInfo.Id, filepath.Dir(uriPack.PackagesFile), err.Error()) return false, err } - file, err := os.OpenFile(uriPack.PackagesFile, os.O_RDWR|os.O_CREATE, 0644) // nolint + file, err := os.OpenFile(uriPack.PackagesFile, os.O_RDWR|os.O_CREATE, 0644) if err != nil { blog.Errorf("process %s openfile %s error %s", processInfo.Id, uriPack.PackagesFile, err.Error()) return false, err diff --git a/bcs-runtime/bcs-mesos/bcs-process-daemon/process-daemon/manager/manager.go b/bcs-runtime/bcs-mesos/bcs-process-daemon/process-daemon/manager/manager.go index 958fe57836..990d6bfed0 100644 --- a/bcs-runtime/bcs-mesos/bcs-process-daemon/process-daemon/manager/manager.go +++ b/bcs-runtime/bcs-mesos/bcs-process-daemon/process-daemon/manager/manager.go @@ -17,7 +17,13 @@ package manager import ( "bytes" "fmt" + "github.com/Tencent/bk-bcs/bcs-common/common/blog" + "github.com/Tencent/bk-bcs/bcs-common/common/http/httpclient" + "github.com/Tencent/bk-bcs/bcs-runtime/bcs-mesos/bcs-process-daemon/process-daemon/config" + "github.com/Tencent/bk-bcs/bcs-runtime/bcs-mesos/bcs-process-daemon/process-daemon/store" + "github.com/Tencent/bk-bcs/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/types" "io/ioutil" + "k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/json" "os" "os/exec" "os/user" @@ -28,14 +34,6 @@ import ( "sync" "syscall" "time" - - "k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/json" - - "github.com/Tencent/bk-bcs/bcs-common/common/blog" - "github.com/Tencent/bk-bcs/bcs-common/common/http/httpclient" - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-mesos/bcs-process-daemon/process-daemon/config" - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-mesos/bcs-process-daemon/process-daemon/store" - "github.com/Tencent/bk-bcs/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/types" ) const ( @@ -379,7 +377,7 @@ func (m *manager) symlinkWorkdir(processInfo *types.ProcessInfo) error { _, err := os.Stat(uriPack.OutputDir) if err != nil { blog.Errorf("process %s stat file %s error %s", processInfo.Id, uriPack.User, err.Error()) - err = os.MkdirAll(filepath.Dir(uriPack.OutputDir), 0755) // nolint + err = os.MkdirAll(filepath.Dir(uriPack.OutputDir), 0755) if err != nil { blog.Errorf("process %s mkdir %s error %s", processInfo.Id, filepath.Dir(uriPack.OutputDir), err.Error()) return err @@ -437,8 +435,7 @@ func (m *manager) startProcess(processInfo *types.ProcessInfo) { // lookup proc user, example user00 if processInfo.User != "" { - var u *user.User - u, err = user.Lookup(processInfo.User) + u, err := user.Lookup(processInfo.User) if err != nil { blog.Errorf("process %s lookup user %s error %s", processInfo.Id, processInfo.User, err.Error()) } else { @@ -488,6 +485,7 @@ func (m *manager) loopCheckProcess() { m.Lock() for _, process := range m.processInfos { + // todo /*if time.Now().Unix()-process.ExecutorHeartBeatTime>ProcessHeartBeatPeriodSeconds { if process.StatusInfo.Status==types.ProcessStatusStopped { blog.Errorf("process %s status %s heartbeat timeout, and delete it",process.Id, diff --git a/bcs-runtime/bcs-mesos/bcs-process-executor/app/app.go b/bcs-runtime/bcs-mesos/bcs-process-executor/app/app.go index d08d5708f9..0cf215d187 100644 --- a/bcs-runtime/bcs-mesos/bcs-process-executor/app/app.go +++ b/bcs-runtime/bcs-mesos/bcs-process-executor/app/app.go @@ -38,9 +38,9 @@ func Run() { } driver.Start() - interrupt := make(chan os.Signal, 10) - signal.Notify(interrupt, syscall.SIGINT, syscall.SIGKILL, syscall.SIGTERM) - go handleSysSignal(interrupt, bcsExecutor) + interupt := make(chan os.Signal, 10) + signal.Notify(interupt, syscall.SIGINT, syscall.SIGKILL, syscall.SIGTERM) + go handleSysSignal(interupt, bcsExecutor) go handleExecutorFinish(bcsExecutor) } diff --git a/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/driver/driver.go b/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/driver/driver.go index dce5bdef4c..ce694e2080 100644 --- a/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/driver/driver.go +++ b/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/driver/driver.go @@ -297,7 +297,7 @@ func (driver *ExecutorDriver) handleMessage(from *upid.UPID, pbMsg *protoExec.Ev // parse to BcsMessage var bcsMessage bcstype.BcsMessage - if err = json.Unmarshal(data, &bcsMessage); err != nil { + if err := json.Unmarshal([]byte(data), &bcsMessage); err != nil { blog.Errorf("unmarshal data %s to BcsMessage error %s", data, err.Error()) return } diff --git a/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/driver/reader.go b/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/driver/reader.go index efa84a5773..0f4d644280 100644 --- a/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/driver/reader.go +++ b/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/driver/reader.go @@ -46,8 +46,7 @@ func (rr *reader) Read(p []byte) (n int, err error) { rr.pending, err = rr.size() continue } - var read int - hi := min(rr.pending, uint64(len(p))) + read, hi := 0, min(rr.pending, uint64(len(p))) read, err = rr.r.Read(p[:hi]) n += read p = p[read:] diff --git a/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/executor/executor.go b/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/executor/executor.go index c87a48feb7..d57f8c5be2 100644 --- a/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/executor/executor.go +++ b/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/executor/executor.go @@ -30,7 +30,7 @@ import ( "github.com/Tencent/bk-bcs/bcs-common/common/blog" "github.com/Tencent/bk-bcs/bcs-common/pkg/scheduler/mesosproto/mesos" bcstype "github.com/Tencent/bk-bcs/bcs-common/pkg/scheduler/schetypes" - procdaemon "github.com/Tencent/bk-bcs/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/proc-daemon" + proc_daemon "github.com/Tencent/bk-bcs/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/proc-daemon" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/types" "github.com/golang/protobuf/proto" @@ -49,7 +49,7 @@ type bcsExecutor struct { tasks map[string]*types.ProcessTaskInfo // key: taskinfo id status types.ExecutorStatus callbackFuncs map[types.CallbackFuncType]interface{} - procDaemon procdaemon.ProcDaemon + procDaemon proc_daemon.ProcDaemon ackUpdates map[string]*mesos.TaskStatus // key: taskinfo id updatesLocks sync.RWMutex @@ -66,7 +66,7 @@ func NewExecutor(cxt context.Context) Executor { tasks: make(map[string]*types.ProcessTaskInfo), callbackFuncs: make(map[types.CallbackFuncType]interface{}), status: types.ExecutorStatusUnknown, - procDaemon: procdaemon.NewDaemon(), + procDaemon: proc_daemon.NewDaemon(), ackUpdates: make(map[string]*mesos.TaskStatus), } @@ -100,8 +100,7 @@ func (e *bcsExecutor) LaunchTaskgroup(taskgroup *mesos.TaskGroupInfo) { // craete process taskinfo for _, task := range taskgroup.GetTasks() { - var proc *types.ProcessTaskInfo - proc, err = createProcessTaskinfo(task) + proc, err := createProcessTaskinfo(task) if err != nil { blog.Errorf("Launch task %s failed, update task status TASK_ERROR", task.GetTaskId().GetValue()) e.updateTaskStatus(task.GetTaskId().GetValue(), types.TaskStatusError, err.Error()) @@ -666,8 +665,7 @@ func writeLocalFile(localFile *types.LocalFile) error { // set file user if localFile.User != "root" { - var u *user.User - u, err = user.Lookup(localFile.User) + u, err := user.Lookup(localFile.User) if err != nil { blog.Errorf("write localfile %s lookup user %s eror %s", localFile.To, localFile.User, err.Error()) } else { diff --git a/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/proc-daemon/connection.go b/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/proc-daemon/connection.go index d148ea6c72..cebbe41290 100644 --- a/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/proc-daemon/connection.go +++ b/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/proc-daemon/connection.go @@ -11,7 +11,7 @@ * */ -package procdaemon +package proc_daemon import ( "fmt" @@ -21,10 +21,9 @@ import ( "time" "encoding/json" - "strings" - "github.com/Tencent/bk-bcs/bcs-common/common" bhttp "github.com/Tencent/bk-bcs/bcs-common/common/http" + "strings" ) const ( diff --git a/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/proc-daemon/daemon.go b/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/proc-daemon/daemon.go index 27413a4507..6e845d3e50 100644 --- a/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/proc-daemon/daemon.go +++ b/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/proc-daemon/daemon.go @@ -11,15 +11,13 @@ * */ -package procdaemon +package proc_daemon import ( "fmt" - - "k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/json" - "github.com/Tencent/bk-bcs/bcs-common/common/blog" "github.com/Tencent/bk-bcs/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/types" + "k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/json" ) const ( diff --git a/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/proc-daemon/interface.go b/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/proc-daemon/interface.go index 7c238d37b7..1448383480 100644 --- a/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/proc-daemon/interface.go +++ b/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/proc-daemon/interface.go @@ -11,7 +11,7 @@ * */ -package procdaemon +package proc_daemon import ( "github.com/Tencent/bk-bcs/bcs-runtime/bcs-mesos/bcs-process-executor/process-executor/types" diff --git a/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/controller/appnode/appnode_controller.go b/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/controller/appnode/appnode_controller.go index 73cda7480b..9d8e680ff9 100644 --- a/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/controller/appnode/appnode_controller.go +++ b/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/controller/appnode/appnode_controller.go @@ -89,6 +89,7 @@ type ReconcileAppNode struct { // Reconcile reads that state of the cluster for a AppNode object and makes changes based on the state read // and what is in the AppNode.Spec +// TODO(user): Modify this Reconcile function to implement your Controller logic. The scaffolding writes // a Deployment as an example // Automatically generate RBAC rules to allow the Controller to read and write Deployments // +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete @@ -142,11 +143,13 @@ func (r *ReconcileAppNode) handleQueue() { default: blog.Warnf("ReconcileAppNode get unknown Event Type: %s.", event.Type) } + // todo(DeveloperJim) default info for timeout? } } } // onAdd add new AppSvc to kube-apiserver +// todo(DeveloperJim): push event queue back when operation failed? func (r *ReconcileAppNode) onAdd(node *meshv1.AppNode) { instance := &meshv1.AppNode{} key, kerr := client.ObjectKeyFromObject(node) @@ -163,7 +166,7 @@ func (r *ReconcileAppNode) onAdd(node *meshv1.AppNode) { if err != nil { if errors.IsNotFound(err) { // Object not found, create new one directly - if err = r.Create(context.TODO(), node); err != nil { + if err := r.Create(context.TODO(), node); err != nil { blog.Errorf("ReconcileAppNode create new AppNode %s failed, %s", key.String(), err.Error()) return } @@ -207,7 +210,7 @@ func (r *ReconcileAppNode) onUpdate(node *meshv1.AppNode) { if err != nil { if errors.IsNotFound(err) { // Object not found, create new one directly - if err = r.Create(context.TODO(), node); err != nil { + if err := r.Create(context.TODO(), node); err != nil { blog.Errorf("ReconcileAppNode create new AppNode %s on EventUpated failed, %s", key.String(), err.Error()) return } diff --git a/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/controller/appsvc/appsvc_controller.go b/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/controller/appsvc/appsvc_controller.go index f1ec4a5db6..229ea08689 100644 --- a/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/controller/appsvc/appsvc_controller.go +++ b/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/controller/appsvc/appsvc_controller.go @@ -73,6 +73,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error { return err } + // TODO(user): Modify this to be the types you create // Uncomment watch a Deployment created by AppSvc - change this for objects you create return nil } @@ -90,6 +91,7 @@ type ReconcileAppSvc struct { // Reconcile reads that state of the cluster for a AppSvc object and makes changes based on the state read // and what is in the AppSvc.Spec +// TODO(user): Modify this Reconcile function to implement your Controller logic. The scaffolding writes // a Deployment as an example // Automatically generate RBAC rules to allow the Controller to read and write Deployments // +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete @@ -141,11 +143,13 @@ func (r *ReconcileAppSvc) handleQueue() { default: blog.Warnf("ReconcilerAppSvc get unknown Event Type: %s.", event.Type) } + // todo(DeveloperJim) default info for timeout? } } } // onAdd add new AppSvc to kube-apiserver +// todo(DeveloperJim): push event queue back when operation failed? func (r *ReconcileAppSvc) onAdd(svc *meshv1.AppSvc) { instance := &meshv1.AppSvc{} key, kerr := client.ObjectKeyFromObject(svc) @@ -161,7 +165,7 @@ func (r *ReconcileAppSvc) onAdd(svc *meshv1.AppSvc) { if err != nil { if errors.IsNotFound(err) { // Object not found, create new one directly - if err = r.Create(context.TODO(), svc); err != nil { + if err := r.Create(context.TODO(), svc); err != nil { blog.Errorf("ReconcileAppSvc create new AppSvc %s failed, %s", key.String(), err.Error()) return } @@ -202,7 +206,7 @@ func (r *ReconcileAppSvc) onUpdate(svc *meshv1.AppSvc) { if err != nil { if errors.IsNotFound(err) { // Object not found, create new one directly - if err = r.Create(context.TODO(), svc); err != nil { + if err := r.Create(context.TODO(), svc); err != nil { blog.Errorf("ReconcileAppSvc create new AppSvc %s on EventUpated failed, %s", key.String(), err.Error()) return } diff --git a/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/controller/ns/tools.go b/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/controller/ns/tools.go index 4d7846ef89..bbedd8352b 100644 --- a/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/controller/ns/tools.go +++ b/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/controller/ns/tools.go @@ -15,7 +15,6 @@ package ns import ( "context" - "github.com/Tencent/bk-bcs/bcs-common/common/blog" corev1 "k8s.io/api/core/v1" @@ -39,6 +38,7 @@ func CheckNamespace(c cache.Cache, cli client.Client, name string) error { ObjectMeta: metav1.ObjectMeta{ Name: name, }, + // todo(DeveloperJim): add spec & status after testing } err := c.Get(context.TODO(), namespaceName, ns) if err == nil { diff --git a/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/discovery/bcs/taskgroup.go b/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/discovery/bcs/taskgroup.go index 9775aad08e..bd9aaa0900 100644 --- a/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/discovery/bcs/taskgroup.go +++ b/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/discovery/bcs/taskgroup.go @@ -317,7 +317,6 @@ func (s *taskGroupController) convertTaskGroupToAppNode(taskGroup *TaskGroup) *v } func (s *taskGroupController) convertPortMapping(ports []*schetypes.PortMapping) (out []v1.NodePort) { - out = make([]v1.NodePort, 0) for _, port := range ports { nport := v1.NodePort{ Name: port.Name, @@ -327,7 +326,7 @@ func (s *taskGroupController) convertPortMapping(ports []*schetypes.PortMapping) } out = append(out, nport) } - return out + return } func newTaskGroupCache(hosts []string) (*taskGroupController, error) { diff --git a/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/discovery/interface.go b/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/discovery/interface.go index 010357c775..226c56450b 100644 --- a/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/discovery/interface.go +++ b/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/discovery/interface.go @@ -20,7 +20,7 @@ import ( "k8s.io/apimachinery/pkg/labels" ) -// Cluster maintenance resource for specified cluster, offer cluster api for +// Cluster maintance resource for specified cluster, offer cluster api for // getting & listing all discovery datas type Cluster interface { // GetName get cluster name diff --git a/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/rdiscover/rdiscover.go b/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/rdiscover/rdiscover.go index 901b1f1daa..24c37feec5 100644 --- a/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/rdiscover/rdiscover.go +++ b/bcs-runtime/bcs-mesos/bmsf-mesh/bmsf-mesos-adapter/rdiscover/rdiscover.go @@ -159,7 +159,7 @@ func (ad *AdapterDiscover) registerAdapter() error { host, err := os.Hostname() if err != nil { blog.Error("mesos adapter get hostname err: %s", err.Error()) - host = "UNKNOWN" + host = "UNKOWN" } serverInfo := types.ServerInfo{} serverInfo.IP = ad.ip @@ -169,6 +169,7 @@ func (ad *AdapterDiscover) registerAdapter() error { serverInfo.Version = version.GetVersion() serverInfo.Cluster = ad.clusterID serverInfo.HostName = host + // TODO: support https serverInfo.Scheme = "http" serverInfoByte, err := json.Marshal(serverInfo) if err != nil { diff --git a/bcs-scenarios/bcs-gitops-manager/cmd/manager/cmd.go b/bcs-scenarios/bcs-gitops-manager/cmd/manager/cmd.go index fa9af3b1c9..60ee168f9f 100644 --- a/bcs-scenarios/bcs-gitops-manager/cmd/manager/cmd.go +++ b/bcs-scenarios/bcs-gitops-manager/cmd/manager/cmd.go @@ -23,8 +23,8 @@ import ( ) var ( - commandName = "bcs-gitops-manager" - configFile = "./bcs-gitops-manager.json" + commandName string = "bcs-gitops-manager" + configFile string = "./bcs-gitops-manager.json" ) // NewCommand create command line for gitops manager diff --git a/bcs-scenarios/bcs-gitops-manager/cmd/proxy/server/cmd.go b/bcs-scenarios/bcs-gitops-manager/cmd/proxy/server/cmd.go index 49427efaa6..a06a3939bd 100644 --- a/bcs-scenarios/bcs-gitops-manager/cmd/proxy/server/cmd.go +++ b/bcs-scenarios/bcs-gitops-manager/cmd/proxy/server/cmd.go @@ -23,8 +23,8 @@ import ( ) var ( - commandName = "bcs-gitops-proxy" - configFile = "./bcs-gitops-proxy.json" + commandName string = "bcs-gitops-proxy" + configFile string = "./bcs-gitops-proxy.json" ) // NewCommand create command line for gitops manager diff --git a/bcs-scenarios/bcs-gitops-manager/go.mod b/bcs-scenarios/bcs-gitops-manager/go.mod index f7a33bcc70..b60b708d61 100644 --- a/bcs-scenarios/bcs-gitops-manager/go.mod +++ b/bcs-scenarios/bcs-gitops-manager/go.mod @@ -5,8 +5,6 @@ go 1.16 require ( github.com/Tencent/bk-bcs/bcs-common v0.0.0-20220919094211-a1b246e54e5a github.com/Tencent/bk-bcs/bcs-services/pkg v0.0.0-20220923140150-350b3bc988eb - github.com/alecthomas/gometalinter v3.0.0+incompatible // indirect - github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/argoproj/argo-cd/v2 v2.6.2 github.com/asim/go-micro/plugins/client/grpc/v4 v4.7.0 github.com/asim/go-micro/plugins/registry/etcd/v4 v4.7.0 @@ -18,8 +16,6 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 - github.com/nicksnyder/go-i18n v1.10.1 // indirect - github.com/pelletier/go-toml v1.9.5 // indirect github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 @@ -27,7 +23,6 @@ require ( google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc google.golang.org/grpc v1.51.0 google.golang.org/protobuf v1.28.1 - gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20191105091915-95d230a53780 // indirect k8s.io/apimachinery v0.24.2 k8s.io/kubernetes v1.24.2 ) diff --git a/bcs-scenarios/bcs-gitops-manager/handler/project.go b/bcs-scenarios/bcs-gitops-manager/handler/project.go index 784bd583a5..69b623df26 100644 --- a/bcs-scenarios/bcs-gitops-manager/handler/project.go +++ b/bcs-scenarios/bcs-gitops-manager/handler/project.go @@ -1,15 +1,3 @@ -/* - * Tencent is pleased to support the open source community by making Blueking Container Service available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * Licensed under the MIT License (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * http://opensource.org/licenses/MIT - * 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 handler import ( @@ -56,7 +44,7 @@ func (e *BcsGitopsHandler) checkStartupProjectPermission(ctx context.Context, pr return nil } -// StartupProject will start the project and sync all the clusters +// StartupProject implementation func (e *BcsGitopsHandler) StartupProject(ctx context.Context, req *pb.ProjectSyncRequest, resp *pb.GitOpsResponse) error { if err := req.Validate(); err != nil { diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/common/const.go b/bcs-scenarios/bcs-gitops-manager/pkg/common/const.go index bc7a8a9943..d23c1e3d97 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/common/const.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/common/const.go @@ -49,7 +49,4 @@ const ( ClusterAliaName = "bkbcs.tencent.com/clusterAliaName" // ClusterEnv defines the cluster env ClusterEnv = "bkbcs.tencent.com/clusterEnv" - - // InClusterName defines the cluster which is 'in-cluster', reserve cluster - InClusterName = "in-cluster" ) diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/common/options.go b/bcs-scenarios/bcs-gitops-manager/pkg/common/options.go index 4c3ef57c13..872e3866d7 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/common/options.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/common/options.go @@ -65,7 +65,7 @@ func (c *ClientConfig) Complete() error { if err != nil { return fmt.Errorf("loading client side tls configuration failed, %s", err.Error()) } - // NOTE: clean setting when releasing office version + // todo(DeveloperJim): clean setting when releasing office verion c.ClientTLS = cliConfig c.ClientTLS.ClientAuth = tls.NoClientCert c.ClientTLS.InsecureSkipVerify = true diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/controller/cluster.go b/bcs-scenarios/bcs-gitops-manager/pkg/controller/cluster.go index 89f7b8dc7d..17374fc7fd 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/controller/cluster.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/controller/cluster.go @@ -26,7 +26,6 @@ import ( "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" "github.com/Tencent/bk-bcs/bcs-common/common/blog" - "github.com/Tencent/bk-bcs/bcs-common/pkg/bcsapi/clustermanager" cm "github.com/Tencent/bk-bcs/bcs-common/pkg/bcsapi/clustermanager" "github.com/Tencent/bk-bcs/bcs-scenarios/bcs-gitops-manager/pkg/common" "github.com/Tencent/bk-bcs/bcs-scenarios/bcs-gitops-manager/pkg/utils" @@ -86,9 +85,6 @@ func (control *cluster) Stop() { // will work until context cancel. func (control *cluster) SingleStart(ctx context.Context) { blog.Infof("cluster controller single start....") - if err := control.innerLoop(ctx); err != nil { - blog.Errorf("inner loop first failed: %s", err.Error()) - } tick := time.NewTicker(time.Second * time.Duration(control.option.Interval)) defer tick.Stop() for { @@ -126,23 +122,15 @@ func (control *cluster) ForceSync(projectCode, clusterID string) { blog.Warnf("cluster-manager found no cluster %s", clusterID) return } - if response.Data.IsShared { - return - } - - cls := response.Data - argoCluster, err := control.option.Storage.GetCluster(context.Background(), cls.ClusterID) + exist, err := control.checkClusterExist(context.Background(), response.Data) if err != nil { - blog.Errorf("query cluster '%s' from storage failed: %s", cls.ClusterID, err.Error()) + blog.Errorf("cluster controller confirm cluster %s exsitencen failure, %s", clusterID, err.Error()) return } - if argoCluster != nil { - if err = control.updateToStorage(context.Background(), cls, argoCluster); err != nil { - blog.Errorf("update cluster '%s' to storage failed: %s", cls.ClusterID, err.Error()) - } + if exist { + blog.Infof("cluster controller found cluster %s already exist, skip", clusterID) return } - appPro, err := control.option.Storage.GetProject(context.Background(), projectCode) if err != nil { blog.Errorf("cluster controller get project %s for cluster %s from storage failure, %s", @@ -229,61 +217,6 @@ func (control *cluster) syncClustersByProject(ctx context.Context, projectID str appPro *v1alpha1.AppProject) error { control.Lock() defer control.Unlock() - - clusterMap, err := control.buildClustersByProject(ctx, projectID) - if err != nil { - return errors.Wrapf(err, "list clusters from project managerfor project [%s]%s failed", - appPro.Name, projectID) - } - argoClusterMap, err := control.buildArgoClusters(ctx, projectID) - if err != nil { - return errors.Wrapf(err, "list clusters from argo stage for project '%s' failed", projectID) - } - - needUpdate, needCreate, needDelete := control.compareClusters(clusterMap, argoClusterMap) - for _, clsID := range needUpdate { - cls := clusterMap[clsID] - argoCls := argoClusterMap[clsID] - if err = control.updateToStorage(ctx, cls, argoCls); err != nil { - blog.Errorf("cluster '%s' update to argo storage failed: %s", clsID, err.Error()) - continue - } - blog.Infof("update cluster '%s' to argo storage success", clsID) - } - for _, clsID := range needCreate { - cls := clusterMap[clsID] - if err = control.saveToStorage(ctx, cls, appPro); err != nil { - blog.Errorf("cluster '%s' save to argo storage failed: %s", clsID, err.Error()) - continue - } - blog.Infof("save cluster '%s' to argo storage success", clsID) - } - for _, clsID := range needDelete { - if err = control.option.Storage.DeleteCluster(ctx, clsID); err != nil { - blog.Errorf("delete cluster '%s' from argo storage failed: %s", clsID, err.Error()) - continue - } - blog.Infof("delete cluster '%s' argo success", clsID) - } - return nil -} - -func (control *cluster) buildArgoClusters(ctx context.Context, - projectID string) (map[string]*v1alpha1.Cluster, error) { - argoClusters, err := control.option.Storage.ListClustersByProject(ctx, projectID) - if err != nil { - return nil, errors.Wrapf(err, "list clusters by project '%s' failed", projectID) - } - argoClusterMap := make(map[string]*v1alpha1.Cluster) - for i := range argoClusters.Items { - item := argoClusters.Items[i] - argoClusterMap[item.Name] = &item - } - return argoClusterMap, nil -} - -func (control *cluster) buildClustersByProject(ctx context.Context, - projectID string) (map[string]*clustermanager.Cluster, error) { bcsCtx := metadata.NewOutgoingContext(ctx, metadata.New(map[string]string{ "Authorization": fmt.Sprintf("Bearer %s", control.option.APIToken), @@ -291,47 +224,51 @@ func (control *cluster) buildClustersByProject(ctx context.Context, ) clusters, err := control.client.ListCluster(bcsCtx, &cm.ListClusterReq{ProjectID: projectID}) if err != nil { - return nil, errors.Wrapf(err, "list clusters failed") + return errors.Wrapf(err, "list all clusters for project [%s]%s failed", appPro.Name, projectID) } if clusters.Code != 0 { - return nil, errors.Errorf("list clusters resp code not 0 build %d: %s", - clusters.Code, clusters.Message) + return errors.Errorf("list all clusters fro project [%s]%s resp code not 0 but %d: %s", + appPro.Name, projectID, clusters.Code, clusters.Message) } - clusterMap := make(map[string]*clustermanager.Cluster) - for _, item := range clusters.Data { - if !item.IsShared { - clusterMap[item.ClusterID] = item - } + if len(clusters.Data) == 0 { + blog.Warnf("list all clusters fro project [%s]%s not have clusters", appPro.Name, projectID) + return nil } - return clusterMap, nil -} - -func (control *cluster) compareClusters(clusterMap map[string]*clustermanager.Cluster, - argoClusterMap map[string]*v1alpha1.Cluster) ([]string, []string, []string) { - needUpdate := make([]string, 0) - needCreate := make([]string, 0) - needDelete := make([]string, 0) - for clsID := range clusterMap { - _, ok := argoClusterMap[clsID] - if ok { - needUpdate = append(needUpdate, clsID) - } else { - needCreate = append(needCreate, clsID) + for _, cls := range clusters.Data { + exist, err := control.checkClusterExist(ctx, cls) + if err != nil { + blog.Errorf("cluster controller confirm cluster %s existence failure, %s. wait for next tick", + cls.ClusterID, err.Error()) + continue } - } - for clsID := range argoClusterMap { - if _, ok := clusterMap[clsID]; !ok { - needDelete = append(needDelete, clsID) + if exist { + blog.Infof("cluster %s exist in gitops storage, skip", cls.ClusterID) + continue + } + if err := control.saveToStorage(ctx, cls, appPro); err != nil { + blog.Errorf("cluster controller save cluster %s to storage for project [%s]%s failure, %s", + cls.ClusterID, appPro.Name, projectID, err.Error()) + continue } + blog.Infof("cluster controller add new cluster %s for project [%s]%s", + cls.ClusterID, appPro.Name, projectID) } - return needUpdate, needCreate, needDelete + return nil } -// updateToStorage check the cluster whether exist. If existed, we need +// checkClusterExist check the cluster whether exist. If existed, we need // check the cluster's name whether changed, and update the cluster object // from argocd. -func (control *cluster) updateToStorage(ctx context.Context, cls *cm.Cluster, - argoCluster *v1alpha1.Cluster) error { +func (control *cluster) checkClusterExist(ctx context.Context, cls *cm.Cluster) (bool, error) { + argoCluster, err := control.option.Storage.GetCluster(ctx, cls.ClusterID) + if err != nil { + return false, errors.Wrapf(err, "query cluster '%s' from storage failed", cls.ClusterID) + } + if argoCluster == nil { + blog.Warnf("no cluster %s found in storage", cls.ClusterID) + return false, nil + } + // we should check the cluster's attr whether there has been a change, if changed // need to update to argocd storage needUpdate := false @@ -344,13 +281,13 @@ func (control *cluster) updateToStorage(ctx context.Context, cls *cm.Cluster, argoCluster.Annotations[common.ClusterEnv] = cls.Environment } if !needUpdate { - return nil + return true, nil } // the cluster will be updated if cluster alias name is changed if err := control.option.Storage.UpdateCluster(ctx, argoCluster); err != nil { - return errors.Wrapf(err, "update cluster '%s' from gitops storage failed", cls.ClusterID) + return false, errors.Wrapf(err, "update cluster '%s' from gitops storage failed", cls.ClusterID) } - return nil + return true, nil } func (control *cluster) saveToStorage(ctx context.Context, cls *cm.Cluster, project *v1alpha1.AppProject) error { diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/application.go b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/application.go index 3b944f73ba..c6731b68a5 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/application.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/application.go @@ -20,7 +20,6 @@ import ( "io/ioutil" "net/http" "strconv" - "strings" "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" "github.com/gorilla/mux" @@ -29,13 +28,11 @@ import ( "github.com/Tencent/bk-bcs/bcs-common/common/blog" "github.com/Tencent/bk-bcs/bcs-common/pkg/auth/iam" "github.com/Tencent/bk-bcs/bcs-scenarios/bcs-gitops-manager/pkg/common" - "github.com/Tencent/bk-bcs/bcs-scenarios/bcs-gitops-manager/pkg/store" ) // AppPlugin for internal project authorization type AppPlugin struct { *mux.Router - storage store.Store middleware MiddlewareInterface } @@ -71,7 +68,7 @@ type AppPlugin struct { // // Init all project sub path handler -// project plugin is a subRouter, all path registered is relative +// project plugin is a subRouter, all path registed is relative func (plugin *AppPlugin) Init() error { // POST /api/v1/applications, create new application plugin.Path("").Methods("POST"). @@ -80,21 +77,16 @@ func (plugin *AppPlugin) Init() error { plugin.Path("").Methods("GET").Queries("projects", "{projects}"). Handler(plugin.middleware.HttpWrapper(plugin.listApplicationsHandler)) - plugin.Path("/{name}/clean").Methods("DELETE"). - Handler(plugin.middleware.HttpWrapper(plugin.applicationCleanHandler)) // Put,Patch,Delete with preifx /api/v1/applications/{name} - appRouter := plugin.PathPrefix("/{name}").Subrouter() - appRouter.Path("/clean").Methods("DELETE"). - Handler(plugin.middleware.HttpWrapper(plugin.applicationCleanHandler)) - appRouter.PathPrefix("").Methods("PUT", "POST", "DELETE", "PATCH"). + plugin.PathPrefix("/{name}").Methods("PUT", "POST", "DELETE", "PATCH"). Handler(plugin.middleware.HttpWrapper(plugin.applicationEditHandler)) // GET with prefix /api/v1/applications/{name} - appRouter.PathPrefix("").Methods("GET"). + plugin.PathPrefix("/{name}").Methods("GET"). Handler(plugin.middleware.HttpWrapper(plugin.applicationViewsHandler)) - // NOTE: GET /api/v1/stream/applications?project={project} - // NOTE: GET /api/v1/stream/applications/{name}/resource-tree + // todo(DeveloperJim): GET /api/v1/stream/applications?project={project} + // todo(DeveloperJim): GET /api/v1/stream/applications/{name}/resource-tree blog.Infof("argocd application plugin init successfully") return nil } @@ -130,10 +122,6 @@ func (plugin *AppPlugin) createApplicationHandler(ctx context.Context, r *http.R } } - // setting application name with project prefix - if !strings.HasPrefix(app.Name, app.Spec.Project+"-") { - app.Name = app.Spec.Project + "-" + app.Name - } // setting control annotations if app.Annotations == nil { app.Annotations = make(map[string]string) @@ -195,33 +183,6 @@ func (plugin *AppPlugin) applicationEditHandler(ctx context.Context, r *http.Req return nil } -func (plugin *AppPlugin) applicationCleanHandler(ctx context.Context, r *http.Request) *httpResponse { - appName := mux.Vars(r)["name"] - if appName == "" { - return &httpResponse{ - statusCode: http.StatusBadRequest, - err: fmt.Errorf("request application name cannot be empty"), - } - } - app, statusCode, err := plugin.middleware.CheckApplicationPermission(ctx, appName, iam.ProjectEdit) - if statusCode != http.StatusOK { - return &httpResponse{ - statusCode: statusCode, - err: err, - } - } - if err = plugin.storage.DeleteApplicationResource(ctx, app); err != nil { - return &httpResponse{ - statusCode: http.StatusInternalServerError, - err: err, - } - } - return &httpResponse{ - statusCode: http.StatusOK, - obj: "clean application subresource success", - } -} - // GET with prefix /api/v1/applications/{name} func (plugin *AppPlugin) applicationViewsHandler(ctx context.Context, r *http.Request) *httpResponse { appName := mux.Vars(r)["name"] diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/argocd.go b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/argocd.go index 20b42b13f4..aa305fa395 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/argocd.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/argocd.go @@ -85,7 +85,6 @@ func (ops *ArgocdProxy) initArgoPathHandler() error { middleware: middleware, } appPlugin := &AppPlugin{ - storage: ops.option.Storage, Router: ops.PathPrefix(common.GitOpsProxyURL + "/api/v1/applications").Subrouter(), middleware: middleware, } diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/grpc.go b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/grpc.go index 130ea601c8..fa788535a0 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/grpc.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/grpc.go @@ -23,7 +23,6 @@ import ( "strings" "github.com/argoproj/argo-cd/v2/pkg/apiclient/application" - "github.com/argoproj/argo-cd/v2/pkg/apiclient/cluster" "github.com/argoproj/argo-cd/v2/pkg/apiclient/project" argorepo "github.com/argoproj/argo-cd/v2/pkg/apiclient/repository" "github.com/gorilla/mux" @@ -54,49 +53,20 @@ type GrpcPlugin struct { // 参见: github.com/argoproj/argocd/v2/cmd/argocd/commands func (plugin *GrpcPlugin) Init() error { grpcAccessUrlHandlers = map[string]argoGrpcHandler{ - "/project.ProjectService/List": plugin.handleProjectList, - "/project.ProjectService/GetDetailedProject": plugin.handleProjectGet, - "/project.ProjectService/Get": plugin.handleProjectGet, - + "/project.ProjectService/List": plugin.handleProjectList, + "/project.ProjectService/GetDetailedProject": plugin.handleProjectGet, "/repository.RepositoryService/ListRepositories": plugin.handleRepoList, "/repository.RepositoryService/Get": plugin.handleRepoGet, "/repository.RepositoryService/ValidateAccess": plugin.handleRepoAccess, "/repository.RepositoryService/CreateRepository": plugin.handleRepoCreate, "/repository.RepositoryService/DeleteRepository": plugin.handleRepoDelete, - "/repository.RepositoryService/ListRefs": nil, - "/repository.RepositoryService/ListApps": nil, - "/repository.RepositoryService/GetAppDetails": nil, - "/repository.RepositoryService/GetHelmCharts": nil, - - "/cluster.ClusterService/List": plugin.handleClusterList, - "/cluster.SettingsService/Get": plugin.handleClusterSettingGet, - "/cluster.ClusterService/Get": plugin.handleClusterGet, - - "/application.ApplicationService/List": plugin.handleAppList, - "/application.ApplicationService/Get": plugin.handleAppGet, - "/application.ApplicationService/Create": plugin.handleAppCreate, - "/application.ApplicationService/Sync": plugin.handleAppSync, - "/application.ApplicationService/Watch": plugin.handleAppWatch, - "/application.ApplicationService/Delete": plugin.handleAppDelete, - "/application.ApplicationService/Update": plugin.handleAppUpdate, - "/application.ApplicationService/UpdateSpec": plugin.handleAppUpdateSpec, - "/application.ApplicationService/Patch": plugin.handleAppPatch, - "/application.ApplicationService/ListResourceEvents": plugin.handleAppListResourceEvents, - "/application.ApplicationService/GetApplicationSyncWindows": plugin.handleAppGetApplicationSyncWindows, - "/application.ApplicationService/RevisionMetadata": plugin.handleAppRevisionMetadata, - "/application.ApplicationService/GetManifests": plugin.handleAppGetManifests, - "/application.ApplicationService/ManagedResources": plugin.handleAppManagedResources, - "/application.ApplicationService/ResourceTree": plugin.handleAppResourceTree, - "/application.ApplicationService/Rollback": plugin.handleAppRollback, - "/application.ApplicationService/TerminateOperation": plugin.handleAppTerminateOperation, - "/application.ApplicationService/GetResource": plugin.handleAppGetResource, - "/application.ApplicationService/PatchResource": plugin.handleAppPatchResource, - "/application.ApplicationService/ListResourceActions": plugin.handleAppListResourceActions, - "/application.ApplicationService/RunResourceAction": plugin.handleAppRunResourceAction, - "/application.ApplicationService/DeleteResource": plugin.handleAppDeleteResource, - "/application.ApplicationService/PodLogs": plugin.handleAppPodLogs, - "/application.ApplicationService/ListLinks": plugin.handleAppListLinks, - "/application.ApplicationService/ListResourceLinks": plugin.handleAppListResourceLinks, + "/cluster.ClusterService/List": plugin.handleClusterList, + "/application.ApplicationService/List": plugin.handleAppList, + "/application.ApplicationService/Get": plugin.handleAppGet, + "/application.ApplicationService/Create": plugin.handleAppCreate, + "/application.ApplicationService/Sync": plugin.handleAppSync, + "/application.ApplicationService/Delete": plugin.handleAppDelete, + // "y/application.ApplicationService/Watch": nil, } plugin.Path("").Handler(plugin.middleware.HttpWrapper(plugin.serve)) return nil @@ -136,7 +106,7 @@ func (plugin *GrpcPlugin) parseRequestBytes(request []byte) ([]byte, error) { return request[5 : bodyLen+5], nil } -func (plugin *GrpcPlugin) readRequestBody(ctx context.Context, req *http.Request, query interface{}) error { +func (plugin *GrpcPlugin) readRequestBody(req *http.Request, query interface{}) error { bs, err := ioutil.ReadAll(req.Body) if err != nil { return errors.Wrapf(err, "read request body failed") @@ -168,7 +138,6 @@ func (plugin *GrpcPlugin) rewriteRequestBody(req *http.Request, body interface{} return len(result), nil } -// handleProjectList will handle the grpc request of list project func (plugin *GrpcPlugin) handleProjectList(ctx context.Context, req *http.Request) *httpResponse { projectList, statusCode, err := plugin.middleware.ListProjects(ctx) if statusCode != http.StatusOK { @@ -184,10 +153,9 @@ func (plugin *GrpcPlugin) handleProjectList(ctx context.Context, req *http.Reque } } -// handleProjectGet will return project details by project name func (plugin *GrpcPlugin) handleProjectGet(ctx context.Context, req *http.Request) *httpResponse { query := &project.ProjectQuery{} - if err := plugin.readRequestBody(ctx, req, query); err != nil { + if err := plugin.readRequestBody(req, query); err != nil { return &httpResponse{ statusCode: http.StatusBadRequest, err: err, @@ -203,7 +171,6 @@ func (plugin *GrpcPlugin) handleProjectGet(ctx context.Context, req *http.Reques return nil } -// handleRepoList will return repo list func (plugin *GrpcPlugin) handleRepoList(ctx context.Context, req *http.Request) *httpResponse { projectList, statusCode, err := plugin.middleware.ListProjects(ctx) if statusCode != http.StatusOK { @@ -230,10 +197,9 @@ func (plugin *GrpcPlugin) handleRepoList(ctx context.Context, req *http.Request) } } -// handleRepoGet will return repo details by repo name func (plugin *GrpcPlugin) handleRepoGet(ctx context.Context, req *http.Request) *httpResponse { query := &argorepo.RepoQuery{} - if err := plugin.readRequestBody(ctx, req, query); err != nil { + if err := plugin.readRequestBody(req, query); err != nil { return &httpResponse{ statusCode: http.StatusBadRequest, err: err, @@ -253,10 +219,9 @@ func (plugin *GrpcPlugin) handleRepoGet(ctx context.Context, req *http.Request) } } -// handleRepoAccess will check repo access func (plugin *GrpcPlugin) handleRepoAccess(ctx context.Context, req *http.Request) *httpResponse { repoAccess := &argorepo.RepoAccessQuery{} - if err := plugin.readRequestBody(ctx, req, repoAccess); err != nil { + if err := plugin.readRequestBody(req, repoAccess); err != nil { return &httpResponse{ statusCode: http.StatusBadRequest, err: err, @@ -278,10 +243,9 @@ func (plugin *GrpcPlugin) handleRepoAccess(ctx context.Context, req *http.Reques return nil } -// handleRepoCreate will create repo to argocd func (plugin *GrpcPlugin) handleRepoCreate(ctx context.Context, req *http.Request) *httpResponse { repoCreate := &argorepo.RepoCreateRequest{} - if err := plugin.readRequestBody(ctx, req, repoCreate); err != nil { + if err := plugin.readRequestBody(req, repoCreate); err != nil { return &httpResponse{ statusCode: http.StatusBadRequest, err: err, @@ -303,60 +267,9 @@ func (plugin *GrpcPlugin) handleRepoCreate(ctx context.Context, req *http.Reques return nil } -// handleRepoDelete will delete repo from argocd func (plugin *GrpcPlugin) handleRepoDelete(ctx context.Context, req *http.Request) *httpResponse { query := &argorepo.RepoQuery{} - if err := plugin.readRequestBody(ctx, req, query); err != nil { - return &httpResponse{ - statusCode: http.StatusBadRequest, - err: err, - } - } - if query.Repo == "" { - return &httpResponse{ - statusCode: http.StatusBadRequest, - err: fmt.Errorf("delete repo request repo cannot empty"), - } - } - _, statusCode, err := plugin.middleware.CheckRepositoryPermission(ctx, query.Repo, iam.ProjectView) - if statusCode != http.StatusOK { - return &httpResponse{ - statusCode: statusCode, - err: errors.Wrapf(err, "check repo '%s' permission failed", query.Repo), - } - } - return nil -} - -// handleRepoListRefs will list repo refs from argocd -func (plugin *GrpcPlugin) handleRepoListRefs(ctx context.Context, req *http.Request) *httpResponse { - query := &argorepo.RepoQuery{} - if err := plugin.readRequestBody(ctx, req, query); err != nil { - return &httpResponse{ - statusCode: http.StatusBadRequest, - err: err, - } - } - if query.Repo == "" { - return &httpResponse{ - statusCode: http.StatusBadRequest, - err: fmt.Errorf("delete repo request repo cannot empty"), - } - } - _, statusCode, err := plugin.middleware.CheckRepositoryPermission(ctx, query.Repo, iam.ProjectView) - if statusCode != http.StatusOK { - return &httpResponse{ - statusCode: statusCode, - err: errors.Wrapf(err, "check repo '%s' permission failed", query.Repo), - } - } - return nil -} - -// handleRepoListApps will handle repo list apps -func (plugin *GrpcPlugin) handleRepoListApps(ctx context.Context, req *http.Request) *httpResponse { - query := &argorepo.RepoAppsQuery{} - if err := plugin.readRequestBody(ctx, req, query); err != nil { + if err := plugin.readRequestBody(req, query); err != nil { return &httpResponse{ statusCode: http.StatusBadRequest, err: err, @@ -378,57 +291,6 @@ func (plugin *GrpcPlugin) handleRepoListApps(ctx context.Context, req *http.Requ return nil } -// handleRepoGetAppDetails will handle repo get application details -func (plugin *GrpcPlugin) handleRepoGetAppDetails(ctx context.Context, req *http.Request) *httpResponse { - query := &argorepo.RepoAppDetailsQuery{} - if err := plugin.readRequestBody(ctx, req, query); err != nil { - return &httpResponse{ - statusCode: http.StatusBadRequest, - err: err, - } - } - if query.Source.RepoURL == "" { - return &httpResponse{ - statusCode: http.StatusBadRequest, - err: fmt.Errorf("delete repo request repo cannot empty"), - } - } - _, statusCode, err := plugin.middleware.CheckRepositoryPermission(ctx, query.Source.RepoURL, iam.ProjectView) - if statusCode != http.StatusOK { - return &httpResponse{ - statusCode: statusCode, - err: errors.Wrapf(err, "check repo '%s' permission failed", query.Source.RepoURL), - } - } - return nil -} - -// handleRepoGetHelmCharts will handle repo get helm charts -func (plugin *GrpcPlugin) handleRepoGetHelmCharts(ctx context.Context, req *http.Request) *httpResponse { - query := &argorepo.RepoQuery{} - if err := plugin.readRequestBody(ctx, req, query); err != nil { - return &httpResponse{ - statusCode: http.StatusBadRequest, - err: err, - } - } - if query.Repo == "" { - return &httpResponse{ - statusCode: http.StatusBadRequest, - err: fmt.Errorf("delete repo request repo cannot empty"), - } - } - _, statusCode, err := plugin.middleware.CheckRepositoryPermission(ctx, query.Repo, iam.ProjectView) - if statusCode != http.StatusOK { - return &httpResponse{ - statusCode: statusCode, - err: errors.Wrapf(err, "check repo '%s' permission failed", query.Repo), - } - } - return nil -} - -// handleClusterList will handle cluster list func (plugin *GrpcPlugin) handleClusterList(ctx context.Context, req *http.Request) *httpResponse { projectList, statusCode, err := plugin.middleware.ListProjects(ctx) if statusCode != http.StatusOK { @@ -456,47 +318,6 @@ func (plugin *GrpcPlugin) handleClusterList(ctx context.Context, req *http.Reque } } -// parseClusterName will parse cluster name and check it -func (plugin *GrpcPlugin) parseClusterName(server string) (string, error) { - arr := strings.Split(server, "/") - clusterID := arr[len(arr)-1] - if !strings.HasPrefix(clusterID, "BCS-K8S-") { - return "", errors.Errorf("parse cluster '%s' failed", server) - } - return clusterID, nil -} - -// handleClusterGet will handle cluster get, return cluster details -func (plugin *GrpcPlugin) handleClusterGet(ctx context.Context, req *http.Request) *httpResponse { - query := &cluster.ClusterQuery{} - if err := plugin.readRequestBody(ctx, req, query); err != nil { - return &httpResponse{ - statusCode: http.StatusBadRequest, - err: err, - } - } - clusterID, err := plugin.parseClusterName(query.Server) - if err != nil { - return &httpResponse{ - statusCode: http.StatusInternalServerError, - err: errors.Wrapf(err, "parse cluster server failed"), - } - } - statusCode, err := plugin.middleware.CheckClusterPermission(ctx, clusterID, iam.ClusterView) - if err != nil { - return &httpResponse{ - statusCode: statusCode, - err: errors.Wrapf(err, "check application '%s' permission failed", query.Name), - } - } - return nil -} - -func (plugin *GrpcPlugin) handleClusterSettingGet(ctx context.Context, req *http.Request) *httpResponse { - return nil -} - -// handleAppList will handle application list, return applications func (plugin *GrpcPlugin) handleAppList(ctx context.Context, req *http.Request) *httpResponse { projectList, statusCode, err := plugin.middleware.ListProjects(ctx) if statusCode != http.StatusOK { @@ -524,29 +345,31 @@ func (plugin *GrpcPlugin) handleAppList(ctx context.Context, req *http.Request) } } -// handleAppGet handle application get, return application details func (plugin *GrpcPlugin) handleAppGet(ctx context.Context, req *http.Request) *httpResponse { query := &application.ApplicationQuery{} - if err := plugin.readRequestBody(ctx, req, query); err != nil { + if err := plugin.readRequestBody(req, query); err != nil { return &httpResponse{ statusCode: http.StatusBadRequest, err: err, } } - _, statusCode, err := plugin.middleware.CheckApplicationPermission(ctx, *query.Name, iam.ProjectView) + app, statusCode, err := plugin.middleware.CheckApplicationPermission(ctx, *query.Name, iam.ProjectView) if err != nil { return &httpResponse{ statusCode: statusCode, err: errors.Wrapf(err, "check application '%s' permission failed", *query.Name), } } - return nil + return &httpResponse{ + isGrpc: true, + statusCode: http.StatusOK, + obj: app, + } } -// handleAppCreate handle application create func (plugin *GrpcPlugin) handleAppCreate(ctx context.Context, req *http.Request) *httpResponse { appCreate := &application.ApplicationCreateRequest{} - if err := plugin.readRequestBody(ctx, req, appCreate); err != nil { + if err := plugin.readRequestBody(req, appCreate); err != nil { return &httpResponse{ statusCode: http.StatusBadRequest, err: err, @@ -560,22 +383,20 @@ func (plugin *GrpcPlugin) handleAppCreate(ctx context.Context, req *http.Request err: errors.Errorf("project information lost"), } } - argoProject, statusCode, err := plugin.middleware.CheckProjectPermission(ctx, projectName, iam.ProjectEdit) + argoProject, statusCode, err := plugin.middleware.CheckProjectPermission(ctx, projectName, + iam.ProjectEdit) if statusCode != http.StatusOK { return &httpResponse{ statusCode: statusCode, err: errors.Wrapf(err, "check application '%s' permission failed", projectName), } } - // setting application name with project prefix - if !strings.HasPrefix(appCreate.Application.Name, projectName+"-") { - appCreate.Application.Name = projectName + "-" + appCreate.Application.Name - } // setting control annotations if appCreate.Application.Annotations == nil { appCreate.Application.Annotations = make(map[string]string) } - appCreate.Application.Annotations[common.ProjectIDKey] = common.GetBCSProjectID(argoProject.Annotations) + appCreate.Application.Annotations[common.ProjectIDKey] = + common.GetBCSProjectID(argoProject.Annotations) appCreate.Application.Annotations[common.ProjectBusinessIDKey] = argoProject.Annotations[common.ProjectBusinessIDKey] contentLen, err := plugin.rewriteRequestBody(req, appCreate) @@ -590,218 +411,43 @@ func (plugin *GrpcPlugin) handleAppCreate(ctx context.Context, req *http.Request return nil } -// handleAppSync will handle application sync func (plugin *GrpcPlugin) handleAppSync(ctx context.Context, req *http.Request) *httpResponse { query := &application.ApplicationSyncRequest{} - if err := plugin.readRequestBody(ctx, req, query); err != nil { + if err := plugin.readRequestBody(req, query); err != nil { return &httpResponse{ statusCode: http.StatusBadRequest, err: err, } } - return plugin.handleAppCommon(ctx, *query.Name, iam.ProjectEdit) + _, statusCode, err := plugin.middleware.CheckApplicationPermission(ctx, *query.Name, iam.ProjectEdit) + if statusCode != http.StatusOK { + return &httpResponse{ + statusCode: statusCode, + err: errors.Wrapf(err, "check application '%s' permission failed", *query.Name), + } + } + return nil } -// handleAppDelete will handle application delete func (plugin *GrpcPlugin) handleAppDelete(ctx context.Context, req *http.Request) *httpResponse { appDelete := &application.ApplicationDeleteRequest{} - if err := plugin.readRequestBody(ctx, req, appDelete); err != nil { + if err := plugin.readRequestBody(req, appDelete); err != nil { return &httpResponse{ statusCode: http.StatusBadRequest, err: err, } } - return plugin.handleAppCommon(ctx, *appDelete.Name, iam.ProjectEdit) -} - -// handleAppWatch will handle application watch -func (plugin *GrpcPlugin) handleAppWatch(ctx context.Context, req *http.Request) *httpResponse { - appWatch := new(application.ApplicationQuery) - if err := plugin.readRequestBody(ctx, req, appWatch); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appWatch.Name, iam.ProjectEdit) -} - -// handleAppUpdate will handle application update -func (plugin *GrpcPlugin) handleAppUpdate(ctx context.Context, req *http.Request) *httpResponse { - appUpdate := &application.ApplicationUpdateRequest{} - if err := plugin.readRequestBody(ctx, req, appUpdate); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, appUpdate.Application.Name, iam.ProjectEdit) -} - -// handleAppUpdateSpec will handle application update spec information -func (plugin *GrpcPlugin) handleAppUpdateSpec(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.ApplicationUpdateSpecRequest) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.Name, iam.ProjectEdit) -} - -// handleAppPatch handle application patch -func (plugin *GrpcPlugin) handleAppPatch(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.ApplicationPatchRequest) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.Name, iam.ProjectEdit) -} - -// handleAppListResourceEvents handle application list resource events -func (plugin *GrpcPlugin) handleAppListResourceEvents(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.ApplicationResourceEventsQuery) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.Name, iam.ProjectEdit) -} - -// handleAppGetApplicationSyncWindows handle application sync windows -func (plugin *GrpcPlugin) handleAppGetApplicationSyncWindows(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.ApplicationSyncWindowsQuery) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.Name, iam.ProjectEdit) -} - -// handleAppRevisionMetadata handle application revision metadata -func (plugin *GrpcPlugin) handleAppRevisionMetadata(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.RevisionMetadataQuery) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.Name, iam.ProjectEdit) -} - -// handleAppGetManifests handle application get manifests -func (plugin *GrpcPlugin) handleAppGetManifests(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.ApplicationManifestQuery) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.Name, iam.ProjectEdit) -} - -// handleAppManagedResources handle application managed resources -func (plugin *GrpcPlugin) handleAppManagedResources(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.ResourcesQuery) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.ApplicationName, iam.ProjectEdit) -} - -// handleAppResourceTree handle application resource tree -func (plugin *GrpcPlugin) handleAppResourceTree(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.ResourcesQuery) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.ApplicationName, iam.ProjectEdit) -} - -// handleAppRollback handle application rollback -func (plugin *GrpcPlugin) handleAppRollback(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.ApplicationRollbackRequest) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.Name, iam.ProjectEdit) -} - -// handleAppTerminateOperation handle application termination operator -func (plugin *GrpcPlugin) handleAppTerminateOperation(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.OperationTerminateRequest) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.Name, iam.ProjectEdit) -} - -// handleAppGetResource handle application get resource -func (plugin *GrpcPlugin) handleAppGetResource(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.ApplicationResourceRequest) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.Name, iam.ProjectEdit) -} - -// handleAppPatchResource handle application patch resource -func (plugin *GrpcPlugin) handleAppPatchResource(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.ApplicationResourcePatchRequest) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.Name, iam.ProjectEdit) -} - -// handleAppListResourceActions handle application list resource actions -func (plugin *GrpcPlugin) handleAppListResourceActions(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.ApplicationResourceRequest) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.Name, iam.ProjectEdit) -} - -// handleAppRunResourceAction handle application run resource action -func (plugin *GrpcPlugin) handleAppRunResourceAction(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.ResourceActionRunRequest) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.Name, iam.ProjectEdit) -} - -// handleAppDeleteResource handle application delete resource -func (plugin *GrpcPlugin) handleAppDeleteResource(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.ApplicationResourceDeleteRequest) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.Name, iam.ProjectEdit) -} - -// handleAppPodLogs handle application pod logs -func (plugin *GrpcPlugin) handleAppPodLogs(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.ApplicationPodLogsQuery) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.Name, iam.ProjectEdit) -} - -// handleAppListLinks handle application list links -func (plugin *GrpcPlugin) handleAppListLinks(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.ListAppLinksRequest) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.Name, iam.ProjectEdit) -} - -// handleAppListResourceLinks handle application list resource links -func (plugin *GrpcPlugin) handleAppListResourceLinks(ctx context.Context, req *http.Request) *httpResponse { - appReq := new(application.ApplicationResourceRequest) - if err := plugin.readRequestBody(ctx, req, appReq); err != nil { - return &httpResponse{statusCode: http.StatusBadRequest, err: err} - } - return plugin.handleAppCommon(ctx, *appReq.Name, iam.ProjectEdit) -} - -// handleAppCommon handle application common handler -func (plugin *GrpcPlugin) handleAppCommon(ctx context.Context, appName string, actionID iam.ActionID) *httpResponse { - _, statusCode, err := plugin.middleware.CheckApplicationPermission(ctx, appName, actionID) + _, statusCode, err := plugin.middleware.CheckApplicationPermission(ctx, *appDelete.Name, iam.ProjectEdit) if statusCode != http.StatusOK { return &httpResponse{ statusCode: statusCode, - err: errors.Wrapf(err, "check application '%s' permission failed", appName), + err: errors.Wrapf(err, "check application '%s' permission failed", *appDelete.Name), } } return nil } + +// handleAppWatch 暂时不处理 watch 动作 +func (plugin *GrpcPlugin) handleAppWatch(ctx context.Context, req *http.Request) *httpResponse { + return nil +} diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/middleware.go b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/middleware.go index 20b9709325..4c235e2a63 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/middleware.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/middleware.go @@ -47,11 +47,9 @@ type httpResponse struct { err error } -type ContextKey string - const ( - ctxKeyRequestID ContextKey = "requestID" - ctxKeyUser ContextKey = "user" + ctxKeyRequestID = "requestID" + ctxKeyUser = "user" ) // ServeHTTP 接收请求的入口,获取请求登录态信息并设置到 context 中 @@ -81,7 +79,8 @@ func (p *httpWrapper) ServeHTTP(rw http.ResponseWriter, r *http.Request) { } // 如果返回对象为空,直接返回错误给客户端 if resp.obj == nil { - blog.Warnf("[requestID=%s] handler return code '%d': %s", requestID, resp.statusCode, resp.err.Error()) + blog.Warnf("[requestID=%s] handler return code '%d': %s", + requestID, resp.statusCode, resp.err.Error()) http.Error(rw, resp.err.Error(), resp.statusCode) return } @@ -94,7 +93,7 @@ func (p *httpWrapper) ServeHTTP(rw http.ResponseWriter, r *http.Request) { // MiddlewareInterface defines the middleware interface type MiddlewareInterface interface { - HttpWrapper(handler httpHandler) http.Handler + HttpWrapper(handler httpHandler) *httpWrapper ListProjects(ctx context.Context) (*v1alpha1.AppProjectList, int, error) CheckProjectPermission(ctx context.Context, projectName string, @@ -134,7 +133,7 @@ func NewMiddlewareHandler(option *proxy.GitOpsOptions, session *Session) Middlew } // HttpWrapper 创建 http wrapper 中间件 -func (h *MiddlewareHandler) HttpWrapper(handler httpHandler) http.Handler { +func (h *MiddlewareHandler) HttpWrapper(handler httpHandler) *httpWrapper { return &httpWrapper{ handler: handler, option: h.option, @@ -255,7 +254,7 @@ func (h *MiddlewareHandler) CheckClusterPermission(ctx context.Context, clusterN } projectID := common.GetBCSProjectID(argoCluster.Annotations) if projectID == "" { - return http.StatusForbidden, errors.Errorf("cluster no project control information") + return http.StatusForbidden, errors.Errorf("cluster no project control infomation") } var permit bool diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/project.go b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/project.go index 47ab1a159e..28d0136451 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/project.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/project.go @@ -30,7 +30,7 @@ type ProjectPlugin struct { } // Init all project sub path handler -// project plugin is a subRouter, all path registered is relative +// project plugin is a subRouter, all path registed is relative func (plugin *ProjectPlugin) Init() error { // not allow requests // POST /api/v1/projects diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/repository.go b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/repository.go index 4059569fe1..7ca3e69ef1 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/repository.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/repository.go @@ -34,7 +34,7 @@ type RepositoryPlugin struct { } // Init all project sub path handler -// project plugin is a subRouter, all path registered is relative +// project plugin is a subRouter, all path registed is relative func (plugin *RepositoryPlugin) Init() error { plugin.UseEncodedPath() // GET /api/v1/repositories?projects={projects} @@ -63,7 +63,7 @@ func (plugin *RepositoryPlugin) Init() error { func (plugin *RepositoryPlugin) listRepositoryHandler(ctx context.Context, r *http.Request) *httpResponse { projectName := r.URL.Query().Get("projects") repositoryList, statusCode, err := plugin.middleware. - ListRepositories(ctx, []string{projectName}, true) + ListRepositories(ctx, []string{projectName}, false) if statusCode != http.StatusOK { return &httpResponse{ statusCode: statusCode, @@ -94,7 +94,7 @@ func (plugin *RepositoryPlugin) repositoryCreateHandler(ctx context.Context, r * } } localRepo := &repository{} - if err = json.Unmarshal(body, localRepo); err != nil { + if err := json.Unmarshal(body, localRepo); err != nil { return &httpResponse{ err: errors.Wrapf(err, "unmarshal body failed"), statusCode: http.StatusBadRequest, diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/session.go b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/session.go index 2b18e51c28..1a91658775 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/session.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/session.go @@ -59,7 +59,7 @@ func (s *Session) ServeHTTP(rw http.ResponseWriter, req *http.Request) { res.Write([]byte("GitOps Proxy session failure")) // nolint }, Transport: &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // nolint + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, }, ModifyResponse: func(r *http.Response) error { blog.Infof("GitOps proxy %s response header details: %+v, status %s, code: %d", diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/stream.go b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/stream.go index 9c2cb2b945..042611217c 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/stream.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/stream.go @@ -36,7 +36,7 @@ type StreamPlugin struct { } // Init all project sub path handler -// project plugin is a subRouter, all path registered is relative +// project plugin is a subRouter, all path registed is relative func (plugin *StreamPlugin) Init() error { // done(DeveloperJim): GET /api/v1/stream/applications?projects={projects} plugin.Path("").Methods("GET").Queries("projects", "{projects}"). diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/webhook.go b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/webhook.go index 6ebe20b366..90c6483429 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/webhook.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/argocd/webhook.go @@ -38,6 +38,7 @@ func (plugin *WebhookPlugin) Init() error { return nil } +// TODO: webhook 保证性能,暂时只做登录态校验 func (plugin *WebhookPlugin) executeWebhook(ctx context.Context, r *http.Request) *httpResponse { user := ctx.Value("user").(*proxy.UserInfo) blog.Infof("user %s request webhook", user.GetUser()) diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/proxy.go b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/proxy.go index 15092100fa..74eecfe928 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/proxy/proxy.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/proxy/proxy.go @@ -122,9 +122,7 @@ func JSONResponse(w http.ResponseWriter, obj interface{}) { } var ( - grpcSuffixBytes = []byte{128, 0, 0, 0, 54, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121, 112, 101, 58, 32, 97, - 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 103, 114, 112, 99, 43, 112, 114, 111, 116, 111, 13, 10, - 103, 114, 112, 99, 45, 115, 116, 97, 116, 117, 115, 58, 32, 48, 13, 10} + grpcSuffixBytes = []byte{128, 0, 0, 0, 54, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121, 112, 101, 58, 32, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 103, 114, 112, 99, 43, 112, 114, 111, 116, 111, 13, 10, 103, 114, 112, 99, 45, 115, 116, 97, 116, 117, 115, 58, 32, 48, 13, 10} ) // GRPCResponse 将对象通过 grpc 的数据格式返回 diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/store/argocd.go b/bcs-scenarios/bcs-gitops-manager/pkg/store/argocd.go index 7df4fe50d3..7c9818a488 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/store/argocd.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/store/argocd.go @@ -23,7 +23,7 @@ import ( "strings" api "github.com/argoproj/argo-cd/v2/pkg/apiclient" - appclient "github.com/argoproj/argo-cd/v2/pkg/apiclient/application" + "github.com/argoproj/argo-cd/v2/pkg/apiclient/application" "github.com/argoproj/argo-cd/v2/pkg/apiclient/cluster" "github.com/argoproj/argo-cd/v2/pkg/apiclient/project" "github.com/argoproj/argo-cd/v2/pkg/apiclient/repository" @@ -31,7 +31,6 @@ import ( "github.com/pkg/errors" "github.com/Tencent/bk-bcs/bcs-common/common/blog" - "github.com/Tencent/bk-bcs/bcs-scenarios/bcs-gitops-manager/pkg/common" ) type argo struct { @@ -43,6 +42,7 @@ type argo struct { // Init control interface func (cd *argo) Init() error { + initializer := []func() error{ cd.initToken, cd.initBasicClient, } @@ -66,8 +66,8 @@ func (cd *argo) GetOptions() *Options { // CreateProject interface func (cd *argo) CreateProject(ctx context.Context, pro *v1alpha1.AppProject) error { - // NOTE: create new single connection per request - // ! please make more attention to performance issue + // todo(DeveloperJim): create new single connection per request + // ! please make more attension to performance issue connection, client, err := cd.basicClient.NewProjectClient() if err != nil { return errors.Wrapf(err, "argocd init project client failed") @@ -128,8 +128,8 @@ func (cd *argo) ListProjects(ctx context.Context) (*v1alpha1.AppProjectList, err // CreateCluster interface func (cd *argo) CreateCluster(ctx context.Context, cls *v1alpha1.Cluster) error { - // NOTE: create new single connection per request - // ! please make more attention to performance issue + // todo(DeveloperJim): create new single connection per request + // ! please make more attension to performance issue connection, client, err := cd.basicClient.NewClusterClient() if err != nil { return errors.Wrapf(err, "argocd init cluster client failed") @@ -142,29 +142,10 @@ func (cd *argo) CreateCluster(ctx context.Context, cls *v1alpha1.Cluster) error return nil } -// DeleteCluster delete cluster by clusterID -func (cd *argo) DeleteCluster(ctx context.Context, name string) error { - connection, client, err := cd.basicClient.NewClusterClient() - if err != nil { - return errors.Wrapf(err, "argocd init cluster client failed") - } - defer connection.Close() // nolint - if _, err = client.Delete(ctx, &cluster.ClusterQuery{Name: name}); err != nil { - // argocd return 403(PermissionDenied) when cluster do not exist - // !make sure that gitops-manager has admin access - if strings.Contains(err.Error(), "code = PermissionDenied") { - blog.Warnf("argocd delete cluster %s warning: %s", name, err.Error()) - return nil - } - return errors.Wrapf(err, "delete cluster failed") - } - return nil -} - // GetCluster interface func (cd *argo) GetCluster(ctx context.Context, name string) (*v1alpha1.Cluster, error) { // create new single connection per request - // ! please make more attention to performance issue + // ! please make more attension to performance issue connection, client, err := cd.basicClient.NewClusterClient() if err != nil { return nil, errors.Wrapf(err, "argocd init cluster client failed") @@ -215,36 +196,9 @@ func (cd *argo) ListCluster(ctx context.Context) (*v1alpha1.ClusterList, error) return cls, nil } -// ListClustersByProject will list clusters by project id -func (cd *argo) ListClustersByProject(ctx context.Context, project string) (*v1alpha1.ClusterList, error) { - connection, client, err := cd.basicClient.NewClusterClient() - if err != nil { - return nil, errors.Wrapf(err, "argocd init cluster client failed") - } - defer connection.Close() // nolint - cls, err := client.List(ctx, &cluster.ClusterQuery{}) - if err != nil { - return nil, errors.Wrapf(err, "argocd list all clusters failed") - } - - clusters := make([]v1alpha1.Cluster, 0, len(cls.Items)) - for _, item := range cls.Items { - projectID, ok := item.Annotations[common.ProjectIDKey] - if !ok || (projectID == "" && item.Name != common.InClusterName) { - blog.Errorf("cluster '%s' not have project id annotation", item.Name) - continue - } - if projectID == project { - clusters = append(clusters, item) - } - } - cls.Items = clusters - return cls, nil -} - // repo name perhaps encoded, such as: https%253A%252F%252Fgit.fake.com%252Ftest%252Fhelloworld.git. // So we should urldecode the repo name twice. It also works fine when repo is normal. -func (cd *argo) decodeRepoUrl(repo string) (string, error) { +func (cd *argo) decoreRepoUrl(repo string) (string, error) { t, err := url.PathUnescape(repo) if err != nil { return "", errors.Wrapf(err, "decode failed") @@ -259,12 +213,12 @@ func (cd *argo) decodeRepoUrl(repo string) (string, error) { // GetRepository interface func (cd *argo) GetRepository(ctx context.Context, repo string) (*v1alpha1.Repository, error) { var err error - repo, err = cd.decodeRepoUrl(repo) + repo, err = cd.decoreRepoUrl(repo) if err != nil { return nil, errors.Wrapf(err, "get repository failed with decode repo '%s'", repo) } // create new single connection per request - // ! please make more attention to performance issue + // ! please make more attension to performance issue connection, client, err := cd.basicClient.NewRepoClient() if err != nil { return nil, errors.Wrapf(err, "argocd init repo client failed") @@ -298,13 +252,13 @@ func (cd *argo) ListRepository(ctx context.Context) (*v1alpha1.RepositoryList, e // GetApplication will return application by name func (cd *argo) GetApplication(ctx context.Context, name string) (*v1alpha1.Application, error) { // create new single connection per request - // ! please make more attention to performance issue + // ! please make more attension to performance issue connection, client, err := cd.basicClient.NewApplicationClient() if err != nil { return nil, errors.Wrapf(err, "argocd init application client failed") } defer connection.Close() // nolint - app, err := client.Get(ctx, &appclient.ApplicationQuery{Name: &name}) + app, err := client.Get(ctx, &application.ApplicationQuery{Name: &name}) if err != nil { if strings.Contains(err.Error(), "code = NotFound") { blog.Warnf("argocd get application %s warning, %s", name, err.Error()) @@ -322,7 +276,7 @@ func (cd *argo) ListApplications(ctx context.Context, option *ListAppOptions) (* return nil, errors.Wrapf(err, "argocd init application client failed") } defer connection.Close() // nolint - apps, err := client.List(ctx, &appclient.ApplicationQuery{Projects: []string{option.Project}}) + apps, err := client.List(ctx, &application.ApplicationQuery{Projects: []string{option.Project}}) if err != nil { return nil, errors.Wrapf(err, "argocd list application for project '%s' failed", option.Project) } @@ -334,39 +288,6 @@ func (cd *argo) GetToken(ctx context.Context) string { return cd.token } -// DeleteApplicationResource will delete all resources for application -func (cd *argo) DeleteApplicationResource(ctx context.Context, application *v1alpha1.Application) error { - server := application.Spec.Destination.Server - closer, appClient, err := cd.basicClient.NewApplicationClient() - if err != nil { - return errors.Wrapf(err, "argocd init application client failed") - } - defer closer.Close() // nolint - errs := make([]string, 0) - for _, resource := range application.Status.Resources { - _, err = appClient.DeleteResource(ctx, &appclient.ApplicationResourceDeleteRequest{ - Name: &application.Name, - Kind: &resource.Kind, - Namespace: &resource.Namespace, - Group: &resource.Group, - Version: &resource.Version, - ResourceName: &resource.Name, - }) - if err != nil { - errs = append(errs, fmt.Sprintf("delete resource '%s/%s/%s' failed for cluster '%s': %s", - resource.Group, resource.Kind, resource.Name, server, err.Error())) - } else { - blog.Infof("delete resource '%s/%s/%s' for cluster '%s' with application '%s' success", - resource.Group, resource.Kind, resource.Name, server, application.Name) - } - } - if len(errs) != 0 { - return errors.Errorf("delete application '%s' sub resource failed: %s", - application.Name, strings.Join(errs, ",")) - } - return nil -} - func (cd *argo) initToken() error { // authorization doc: https://argo-cd.readthedocs.io/en/stable/developer-guide/api-docs/ //$ curl $ARGOCD_SERVER/api/v1/session -d $'{"username":"admin","password":"password"}' @@ -382,12 +303,12 @@ func (cd *argo) initToken() error { } client := http.Client{ Transport: &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // nolint + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, }, } - argoUrl := fmt.Sprintf("https://%s/api/v1/session", cd.option.Service) + url := fmt.Sprintf("https://%s/api/v1/session", cd.option.Service) response, err := client.Post( - argoUrl, + url, "application/json", bytes.NewBuffer(reqBytes), ) diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/store/store.go b/bcs-scenarios/bcs-gitops-manager/pkg/store/store.go index f4190882c7..18ec3f494a 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/store/store.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/store/store.go @@ -47,9 +47,7 @@ type Store interface { CreateCluster(ctx context.Context, cluster *v1alpha1.Cluster) error GetCluster(ctx context.Context, name string) (*v1alpha1.Cluster, error) ListCluster(ctx context.Context) (*v1alpha1.ClusterList, error) - ListClustersByProject(ctx context.Context, project string) (*v1alpha1.ClusterList, error) UpdateCluster(ctx context.Context, cluster *v1alpha1.Cluster) error - DeleteCluster(ctx context.Context, name string) error // Repository interface GetRepository(ctx context.Context, repo string) (*v1alpha1.Repository, error) @@ -61,8 +59,6 @@ type Store interface { // authentication token GetToken(ctx context.Context) string - - DeleteApplicationResource(ctx context.Context, application *v1alpha1.Application) error } // NewStore create storage client diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/tunnel/peermanager.go b/bcs-scenarios/bcs-gitops-manager/pkg/tunnel/peermanager.go index 793649c84b..335187e136 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/tunnel/peermanager.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/tunnel/peermanager.go @@ -125,7 +125,7 @@ func (pm *PeerManager) peerSyncLoop() { return case <-event: // handle read service - blog.Infof("PeerManager received %s event, ready to update peer information", + blog.Infof("PeerManager recieve %s event, ready to update peer information", pm.options.PeerServiceName) go pm.peerSyncLoop() return @@ -143,9 +143,10 @@ func (pm *PeerManager) handleWatchEvent(watcher registry.Watcher, ch chan<- stru // when watcher was cancel, err is 'could not get next' blog.Errorf("PeerManager discovery watch faild, %s. GetService & recover watch", err.Error()) return + } else { + blog.Infof("PeerManager watch %s event %s, services details: %+v", + pm.options.PeerServiceName, results.Action, results.Service.Nodes) } - blog.Infof("PeerManager watch %s event %s, services details: %+v", - pm.options.PeerServiceName, results.Action, results.Service.Nodes) ch <- struct{}{} } diff --git a/bcs-scenarios/bcs-gitops-manager/pkg/tunnel/tunnelmanager.go b/bcs-scenarios/bcs-gitops-manager/pkg/tunnel/tunnelmanager.go index ca3755231e..028434b07d 100644 --- a/bcs-scenarios/bcs-gitops-manager/pkg/tunnel/tunnelmanager.go +++ b/bcs-scenarios/bcs-gitops-manager/pkg/tunnel/tunnelmanager.go @@ -165,7 +165,7 @@ func (tm *TunnelManager) ServeHTTP(rw http.ResponseWriter, req *http.Request) { // lookupBackendTransport according clusterID, transport is entry point // for backend cluster. Transport will be cache for reuse. -// NOTE: health check for transport? +// todo(DeveloperJim): health check for transport? func (tm *TunnelManager) lookupBackendEntryPoint(clusterID string) (*proxy.UpgradeAwareHandler, error) { if !tm.tunnelSvr.HasSession(clusterID) { return nil, fmt.Errorf("no session in tunnel") @@ -235,7 +235,7 @@ func (tm *TunnelManager) authorizer(req *http.Request) (string, bool, error) { return clusterID, true, nil } if oldCls.ServerAddress != serverAddr { - // backend cluster instance switches, + // backend cluster instance switchs, // reset tranport for reconnection oldCls.ServerAddress = serverAddr if oldCls.MiddleTransport != nil { diff --git a/bcs-scenarios/kourse/go.mod b/bcs-scenarios/kourse/go.mod index b058ca3a4b..676f75d5ec 100644 --- a/bcs-scenarios/kourse/go.mod +++ b/bcs-scenarios/kourse/go.mod @@ -1,82 +1,77 @@ module github.com/Tencent/bk-bcs/bcs-scenarios/kourse -go 1.20 +go 1.17 replace ( bitbucket.org/ww/goautoneg => github.com/adjust/goautoneg v0.0.0-20150426214442-d788f35a0315 github.com/coreos/bbolt v1.3.4 => go.etcd.io/bbolt v1.3.4 + github.com/go-logr/logr => github.com/go-logr/logr v0.4.0 + github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.4.1 go.etcd.io/bbolt v1.3.4 => github.com/coreos/bbolt v1.3.4 google.golang.org/grpc => google.golang.org/grpc v1.26.0 - k8s.io/api => k8s.io/api v0.26.5 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.26.5 - k8s.io/apimachinery => k8s.io/apimachinery v0.26.5 - k8s.io/apiserver => k8s.io/apiserver v0.26.5 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.26.5 - k8s.io/client-go => k8s.io/client-go v0.26.5 - k8s.io/cloud-provider => k8s.io/cloud-provider v0.26.5 - k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.26.5 - k8s.io/code-generator => k8s.io/code-generator v0.26.5 - k8s.io/component-base => k8s.io/component-base v0.26.5 - k8s.io/component-helpers => k8s.io/component-helpers v0.26.5 - k8s.io/controller-manager => k8s.io/controller-manager v0.26.5 - k8s.io/cri-api => k8s.io/cri-api v0.26.5 - k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.26.5 - k8s.io/klog/v2 => k8s.io/klog/v2 v2.80.1 - k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.26.5 - k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.26.5 - k8s.io/kube-proxy => k8s.io/kube-proxy v0.26.5 - k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.26.5 - k8s.io/kubectl => k8s.io/kubectl v0.26.5 - k8s.io/kubelet => k8s.io/kubelet v0.26.5 - k8s.io/kubernetes => k8s.io/kubernetes v1.26.5 - k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.26.5 - k8s.io/metrics => k8s.io/metrics v0.26.5 - k8s.io/mount-utils => k8s.io/mount-utils v0.26.5 - k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.26.5 + k8s.io/api => k8s.io/api v0.20.0 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.20.0 + k8s.io/apimachinery => k8s.io/apimachinery v0.20.0 + k8s.io/apiserver => k8s.io/apiserver v0.20.0 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.20.0 + k8s.io/client-go => k8s.io/client-go v0.20.0 + k8s.io/cloud-provider => k8s.io/cloud-provider v0.20.0 + k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.20.0 + k8s.io/code-generator => k8s.io/code-generator v0.20.0 + k8s.io/component-base => k8s.io/component-base v0.20.0 + k8s.io/component-helpers => k8s.io/component-helpers v0.20.0 + k8s.io/controller-manager => k8s.io/controller-manager v0.20.0 + k8s.io/cri-api => k8s.io/cri-api v0.20.0 + k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.20.0 + k8s.io/klog/v2 => k8s.io/klog/v2 v2.4.0 + k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.20.0 + k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.20.0 + k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd + k8s.io/kube-proxy => k8s.io/kube-proxy v0.20.0 + k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.20.0 + k8s.io/kubectl => k8s.io/kubectl v0.20.0 + k8s.io/kubelet => k8s.io/kubelet v0.20.0 + k8s.io/kubernetes => k8s.io/kubernetes v1.20.0 + k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.20.0 + k8s.io/metrics => k8s.io/metrics v0.20.0 + k8s.io/mount-utils => k8s.io/mount-utils v0.20.0 + k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.20.0 ) require ( - k8s.io/api v0.26.5 - k8s.io/apimachinery v0.26.5 - k8s.io/client-go v0.26.5 + k8s.io/api v0.24.0 + k8s.io/apimachinery v0.24.0 + k8s.io/client-go v0.20.0 k8s.io/kubernetes v0.0.0-00010101000000-000000000000 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emicklei/go-restful/v3 v3.9.0 // indirect - github.com/evanphx/json-patch v4.12.0+incompatible // indirect - github.com/go-logr/logr v1.2.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-openapi/swag v0.19.14 // indirect + github.com/evanphx/json-patch v4.9.0+incompatible // indirect + github.com/go-logr/logr v1.2.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.2 // indirect - github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/golang/protobuf v1.4.3 // indirect + github.com/google/go-cmp v0.5.2 // indirect github.com/google/gofuzz v1.1.0 // indirect - github.com/josharian/intern v1.0.0 // indirect + github.com/googleapis/gnostic v0.4.1 // indirect + github.com/hashicorp/golang-lru v0.5.1 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/mailru/easyjson v0.7.6 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pkg/errors v0.9.1 // indirect - golang.org/x/net v0.8.0 // indirect - golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect - golang.org/x/sys v0.6.0 // indirect - golang.org/x/term v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect - golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.28.1 // indirect + golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 // indirect + golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect + golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect + golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect + golang.org/x/text v0.3.7 // indirect + golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect + google.golang.org/appengine v1.6.5 // indirect + google.golang.org/protobuf v1.25.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/klog/v2 v2.80.1 // indirect - k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect - k8s.io/utils v0.0.0-20221107191617-1a15be271d1d // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + k8s.io/klog/v2 v2.60.1 // indirect + k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd // indirect + k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect + sigs.k8s.io/yaml v1.2.0 // indirect ) diff --git a/bcs-scenarios/kourse/manifests/tkex.tencent.com_gamedeployments.yaml b/bcs-scenarios/kourse/manifests/tkex.tencent.com_gamedeployments.yaml index 0d60af4a76..b19fc39b88 100644 --- a/bcs-scenarios/kourse/manifests/tkex.tencent.com_gamedeployments.yaml +++ b/bcs-scenarios/kourse/manifests/tkex.tencent.com_gamedeployments.yaml @@ -572,75 +572,11 @@ spec: ANDed. type: object type: object - namespaceSelector: - description: A label query over the set - of namespaces that the term applies to. - The term is applied to the union of the - namespaces selected by this field and - the ones listed in the namespaces field. - null selector and null or empty namespaces - list means "this pod's namespace". An - empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The - requirements are ANDed. - items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. - properties: - key: - description: key is the label - key that the selector applies - to. - type: string - operator: - description: operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. - This array is replaced during - a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of - {key,value} pairs. A single {key,value} - in the matchLabels map is equivalent - to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are - ANDed. - type: object - type: object namespaces: - description: namespaces specifies a static - list of namespace names that the term - applies to. The term is applied to the - union of the namespaces listed in this - field and the ones selected by namespaceSelector. - null or empty namespaces list and null - namespaceSelector means "this pod's namespace". + description: namespaces specifies which + namespaces the labelSelector applies to + (matches against); null or empty list + means "this pod's namespace" items: type: string type: array @@ -742,71 +678,10 @@ spec: only "value". The requirements are ANDed. type: object type: object - namespaceSelector: - description: A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by - this field and the ones listed in the namespaces - field. null selector and null or empty namespaces - list means "this pod's namespace". An empty - selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: operator represents a - key's relationship to a set of values. - Valid operators are In, NotIn, Exists - and DoesNotExist. - type: string - values: - description: values is an array of - string values. If the operator is - In or NotIn, the values array must - be non-empty. If the operator is - Exists or DoesNotExist, the values - array must be empty. This array - is replaced during a strategic merge - patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. - type: object - type: object namespaces: - description: namespaces specifies a static list - of namespace names that the term applies to. - The term is applied to the union of the namespaces - listed in this field and the ones selected - by namespaceSelector. null or empty namespaces - list and null namespaceSelector means "this - pod's namespace". + description: namespaces specifies which namespaces + the labelSelector applies to (matches against); + null or empty list means "this pod's namespace" items: type: string type: array @@ -908,75 +783,11 @@ spec: ANDed. type: object type: object - namespaceSelector: - description: A label query over the set - of namespaces that the term applies to. - The term is applied to the union of the - namespaces selected by this field and - the ones listed in the namespaces field. - null selector and null or empty namespaces - list means "this pod's namespace". An - empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The - requirements are ANDed. - items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. - properties: - key: - description: key is the label - key that the selector applies - to. - type: string - operator: - description: operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. - This array is replaced during - a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of - {key,value} pairs. A single {key,value} - in the matchLabels map is equivalent - to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are - ANDed. - type: object - type: object namespaces: - description: namespaces specifies a static - list of namespace names that the term - applies to. The term is applied to the - union of the namespaces listed in this - field and the ones selected by namespaceSelector. - null or empty namespaces list and null - namespaceSelector means "this pod's namespace". + description: namespaces specifies which + namespaces the labelSelector applies to + (matches against); null or empty list + means "this pod's namespace" items: type: string type: array @@ -1078,71 +889,10 @@ spec: only "value". The requirements are ANDed. type: object type: object - namespaceSelector: - description: A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by - this field and the ones listed in the namespaces - field. null selector and null or empty namespaces - list means "this pod's namespace". An empty - selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: operator represents a - key's relationship to a set of values. - Valid operators are In, NotIn, Exists - and DoesNotExist. - type: string - values: - description: values is an array of - string values. If the operator is - In or NotIn, the values array must - be non-empty. If the operator is - Exists or DoesNotExist, the values - array must be empty. This array - is replaced during a strategic merge - patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. - type: object - type: object namespaces: - description: namespaces specifies a static list - of namespace names that the term applies to. - The term is applied to the union of the namespaces - listed in this field and the ones selected - by namespaceSelector. null or empty namespaces - list and null namespaceSelector means "this - pod's namespace". + description: namespaces specifies which namespaces + the labelSelector applies to (matches against); + null or empty list means "this pod's namespace" items: type: string type: array @@ -1175,32 +925,29 @@ spec: to run within a pod. properties: args: - description: 'Arguments to the entrypoint. The container + description: 'Arguments to the entrypoint. The docker image''s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the - reference in the input string will be unchanged. Double - $$ are reduced to a single $, which allows for escaping - the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + reference in the input string will be unchanged. The + $(VAR_NAME) syntax can be escaped with a double $$, + ie: $$(VAR_NAME). Escaped references will never be + expanded, regardless of whether the variable exists + or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array command: description: 'Entrypoint array. Not executed within - a shell. The container image''s ENTRYPOINT is used - if this is not provided. Variable references $(VAR_NAME) + a shell. The docker image''s ENTRYPOINT is used if + this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the - input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) - syntax: i.e. "$$(VAR_NAME)" will produce the string - literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists - or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array @@ -1217,16 +964,14 @@ spec: type: string value: description: 'Variable references $(VAR_NAME) - are expanded using the previously defined environment + are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. - Double $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" - will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless - of whether the variable exists or not. Defaults - to "".' + The $(VAR_NAME) syntax can be escaped with a + double $$, ie: $$(VAR_NAME). Escaped references + will never be expanded, regardless of whether + the variable exists or not. Defaults to "".' type: string valueFrom: description: Source for the environment variable's @@ -1371,7 +1116,7 @@ spec: type: object type: array image: - description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images + description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.' @@ -1396,7 +1141,9 @@ spec: info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following + should be specified. Exec specifies the action + to take. properties: command: description: Command is the command line @@ -1430,10 +1177,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. - This will be canonicalized upon - output, so case-variant names will - be understood as the same header. + description: The header field name type: string value: description: The header field value @@ -1464,11 +1208,10 @@ spec: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward - compatibility. There are no validation of - this field and lifecycle hooks will fail in - runtime when tcp handler is specified. + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' properties: host: description: 'Optional: Host name to connect @@ -1493,17 +1236,20 @@ spec: or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes - or exits. The Pod''s termination grace period - countdown begins before the PreStop hook is executed. - Regardless of the outcome of the handler, the - container will eventually terminate within the - Pod''s termination grace period (unless delayed - by finalizers). Other management of the container - blocks until the hook completes or until the termination - grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + or exits. The reason for termination is passed + to the handler. The Pod''s termination grace period + countdown begins before the PreStop hooked is + executed. Regardless of the outcome of the handler, + the container will eventually terminate within + the Pod''s termination grace period. Other management + of the container blocks until the hook completes + or until the termination grace period is reached. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following + should be specified. Exec specifies the action + to take. properties: command: description: Command is the command line @@ -1537,10 +1283,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. - This will be canonicalized upon - output, so case-variant names will - be understood as the same header. + description: The header field name type: string value: description: The header field value @@ -1571,11 +1314,10 @@ spec: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward - compatibility. There are no validation of - this field and lifecycle hooks will fail in - runtime when tcp handler is specified. + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' properties: host: description: 'Optional: Host name to connect @@ -1601,7 +1343,8 @@ spec: be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -1623,26 +1366,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -1660,10 +1383,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -1711,8 +1431,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -1729,25 +1450,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -1762,13 +1464,13 @@ spec: type: string ports: description: List of ports to expose from the container. - Not specifying a port here DOES NOT prevent that port - from being exposed. Any port which is listening on - the default "0.0.0.0" address inside a container will - be accessible from the network. Modifying this array - with strategic merge patch may corrupt the data. For - more information See https://github.com/kubernetes/kubernetes/issues/108255. - Cannot be updated. + Exposing a port here gives the system additional information + about the network connections a container uses, but + is primarily informational. Not specifying a port + here DOES NOT prevent that port from being exposed. + Any port which is listening on the default "0.0.0.0" + address inside a container will be accessible from + the network. Cannot be updated. items: description: ContainerPort represents a network port in a single container. @@ -1816,7 +1518,8 @@ spec: the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -1838,26 +1541,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -1875,10 +1558,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -1926,8 +1606,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -1944,25 +1625,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -1972,32 +1634,8 @@ spec: type: object resources: description: 'Compute Resources required by this container. - Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' properties: - claims: - description: "Claims lists the names of resources, - defined in spec.resourceClaims, that are used - by this container. \n This is an alpha field and - requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can - only be set for containers." - items: - description: ResourceClaim references one entry - in PodSpec.ResourceClaims. - properties: - name: - description: Name must match the name of one - entry in pod.spec.resourceClaims of the - Pod where this field is used. It makes that - resource available inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map limits: additionalProperties: anyOf: @@ -2006,7 +1644,7 @@ spec: pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Limits describes the maximum amount - of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object requests: additionalProperties: @@ -2019,14 +1657,13 @@ spec: of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to - an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object type: object securityContext: - description: 'SecurityContext defines the security options - the container should be run with. If set, the fields - of SecurityContext override the equivalent fields - of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + description: 'Security options the pod should run with. + More info: https://kubernetes.io/docs/concepts/policy/security-context/ + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' properties: allowPrivilegeEscalation: description: 'AllowPrivilegeEscalation controls @@ -2035,14 +1672,12 @@ spec: if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) - has CAP_SYS_ADMIN Note that this field cannot - be set when spec.os.name is windows.' + has CAP_SYS_ADMIN' type: boolean capabilities: description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities - granted by the container runtime. Note that this - field cannot be set when spec.os.name is windows. + granted by the container runtime. properties: add: description: Added capabilities @@ -2062,9 +1697,7 @@ spec: privileged: description: Run container in privileged mode. Processes in privileged containers are essentially equivalent - to root on the host. Defaults to false. Note that - this field cannot be set when spec.os.name is - windows. + to root on the host. Defaults to false. type: boolean procMount: description: procMount denotes the type of proc @@ -2072,13 +1705,11 @@ spec: DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to - be enabled. Note that this field cannot be set - when spec.os.name is windows. + be enabled. type: string readOnlyRootFilesystem: description: Whether this container has a read-only - root filesystem. Default is false. Note that this - field cannot be set when spec.os.name is windows. + root filesystem. Default is false. type: boolean runAsGroup: description: The GID to run the entrypoint of the @@ -2086,8 +1717,6 @@ spec: May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is windows. format: int64 type: integer runAsNonRoot: @@ -2107,8 +1736,7 @@ spec: in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in - SecurityContext takes precedence. Note that this - field cannot be set when spec.os.name is windows. + SecurityContext takes precedence. format: int64 type: integer seLinuxOptions: @@ -2118,8 +1746,6 @@ spec: container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is windows. properties: level: description: Level is SELinux level label that @@ -2142,8 +1768,7 @@ spec: description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container - options override the pod options. Note that this - field cannot be set when spec.os.name is windows. + options override the pod options. properties: localhostProfile: description: localhostProfile indicates a profile @@ -2171,8 +1796,6 @@ spec: from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is linux. properties: gmsaCredentialSpec: description: GMSACredentialSpec is where the @@ -2184,20 +1807,6 @@ spec: description: GMSACredentialSpecName is the name of the GMSA credential spec to use. type: string - hostProcess: - description: HostProcess determines if a container - should be run as a 'Host Process' container. - This field is alpha-level and will only be - honored by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the - feature flag will result in errors when validating - the Pod. All of a Pod's containers must have - the same effective HostProcess value (it is - not allowed to have a mix of HostProcess containers - and non-HostProcess containers). In addition, - if HostProcess is true then HostNetwork must - also be set to true. - type: boolean runAsUserName: description: The UserName in Windows to run the entrypoint of the container process. Defaults @@ -2221,7 +1830,8 @@ spec: operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -2243,26 +1853,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -2280,10 +1870,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -2331,8 +1918,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -2349,25 +1937,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -2556,45 +2125,46 @@ spec: be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. + This field is alpha-level and is only honored by servers + that enable the EphemeralContainers feature. items: - description: "An EphemeralContainer is a temporary container - that you may add to an existing Pod for user-initiated + description: An EphemeralContainer is a container that may + be added temporarily to an existing pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not - be restarted when they exit or when a Pod is removed or - restarted. The kubelet may evict a Pod if an ephemeral - container causes the Pod to exceed its resource allocation. - \n To add an ephemeral container, use the ephemeralcontainers - subresource of an existing Pod. Ephemeral containers may - not be removed or restarted." + be restarted when they exit or when a pod is removed or + restarted. If an ephemeral container causes a pod to exceed + its resource allocation, the pod may be evicted. Ephemeral + containers may not be added by directly updating the pod + spec. They must be added via the pod's ephemeralcontainers + subresource, and they will appear in the pod spec once + added. This is an alpha feature enabled by the EphemeralContainers + feature flag. properties: args: - description: 'Arguments to the entrypoint. The image''s - CMD is used if this is not provided. Variable references - $(VAR_NAME) are expanded using the container''s environment. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + description: 'Arguments to the entrypoint. The docker + image''s CMD is used if this is not provided. Variable + references $(VAR_NAME) are expanded using the container''s + environment. If a variable cannot be resolved, the + reference in the input string will be unchanged. The + $(VAR_NAME) syntax can be escaped with a double $$, + ie: $$(VAR_NAME). Escaped references will never be + expanded, regardless of whether the variable exists + or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array command: description: 'Entrypoint array. Not executed within - a shell. The image''s ENTRYPOINT is used if this is - not provided. Variable references $(VAR_NAME) are - expanded using the container''s environment. If a - variable cannot be resolved, the reference in the - input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) - syntax: i.e. "$$(VAR_NAME)" will produce the string - literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists - or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + a shell. The docker image''s ENTRYPOINT is used if + this is not provided. Variable references $(VAR_NAME) + are expanded using the container''s environment. If + a variable cannot be resolved, the reference in the + input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array @@ -2611,16 +2181,14 @@ spec: type: string value: description: 'Variable references $(VAR_NAME) - are expanded using the previously defined environment + are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. - Double $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" - will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless - of whether the variable exists or not. Defaults - to "".' + The $(VAR_NAME) syntax can be escaped with a + double $$, ie: $$(VAR_NAME). Escaped references + will never be expanded, regardless of whether + the variable exists or not. Defaults to "".' type: string valueFrom: description: Source for the environment variable's @@ -2765,7 +2333,7 @@ spec: type: object type: array image: - description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images' + description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images' type: string imagePullPolicy: description: 'Image pull policy. One of Always, Never, @@ -2786,7 +2354,9 @@ spec: info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following + should be specified. Exec specifies the action + to take. properties: command: description: Command is the command line @@ -2820,10 +2390,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. - This will be canonicalized upon - output, so case-variant names will - be understood as the same header. + description: The header field name type: string value: description: The header field value @@ -2854,11 +2421,10 @@ spec: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward - compatibility. There are no validation of - this field and lifecycle hooks will fail in - runtime when tcp handler is specified. + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' properties: host: description: 'Optional: Host name to connect @@ -2883,17 +2449,20 @@ spec: or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes - or exits. The Pod''s termination grace period - countdown begins before the PreStop hook is executed. - Regardless of the outcome of the handler, the - container will eventually terminate within the - Pod''s termination grace period (unless delayed - by finalizers). Other management of the container - blocks until the hook completes or until the termination - grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + or exits. The reason for termination is passed + to the handler. The Pod''s termination grace period + countdown begins before the PreStop hooked is + executed. Regardless of the outcome of the handler, + the container will eventually terminate within + the Pod''s termination grace period. Other management + of the container blocks until the hook completes + or until the termination grace period is reached. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following + should be specified. Exec specifies the action + to take. properties: command: description: Command is the command line @@ -2927,10 +2496,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. - This will be canonicalized upon - output, so case-variant names will - be understood as the same header. + description: The header field name type: string value: description: The header field value @@ -2961,11 +2527,10 @@ spec: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward - compatibility. There are no validation of - this field and lifecycle hooks will fail in - runtime when tcp handler is specified. + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' properties: host: description: 'Optional: Host name to connect @@ -2989,7 +2554,8 @@ spec: description: Probes are not allowed for ephemeral containers. properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -3011,26 +2577,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -3048,10 +2594,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -3099,8 +2642,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -3117,25 +2661,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -3187,15 +2712,12 @@ spec: - containerPort type: object type: array - x-kubernetes-list-map-keys: - - containerPort - - protocol - x-kubernetes-list-type: map readinessProbe: description: Probes are not allowed for ephemeral containers. properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -3217,26 +2739,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -3254,10 +2756,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -3305,8 +2804,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -3323,25 +2823,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -3354,30 +2835,6 @@ spec: containers. Ephemeral containers use spare resources already allocated to the pod. properties: - claims: - description: "Claims lists the names of resources, - defined in spec.resourceClaims, that are used - by this container. \n This is an alpha field and - requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can - only be set for containers." - items: - description: ResourceClaim references one entry - in PodSpec.ResourceClaims. - properties: - name: - description: Name must match the name of one - entry in pod.spec.resourceClaims of the - Pod where this field is used. It makes that - resource available inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map limits: additionalProperties: anyOf: @@ -3386,7 +2843,7 @@ spec: pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Limits describes the maximum amount - of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object requests: additionalProperties: @@ -3399,14 +2856,12 @@ spec: of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to - an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object type: object securityContext: - description: 'Optional: SecurityContext defines the - security options the ephemeral container should be - run with. If set, the fields of SecurityContext override - the equivalent fields of PodSecurityContext.' + description: SecurityContext is not allowed for ephemeral + containers. properties: allowPrivilegeEscalation: description: 'AllowPrivilegeEscalation controls @@ -3415,14 +2870,12 @@ spec: if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) - has CAP_SYS_ADMIN Note that this field cannot - be set when spec.os.name is windows.' + has CAP_SYS_ADMIN' type: boolean capabilities: description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities - granted by the container runtime. Note that this - field cannot be set when spec.os.name is windows. + granted by the container runtime. properties: add: description: Added capabilities @@ -3442,9 +2895,7 @@ spec: privileged: description: Run container in privileged mode. Processes in privileged containers are essentially equivalent - to root on the host. Defaults to false. Note that - this field cannot be set when spec.os.name is - windows. + to root on the host. Defaults to false. type: boolean procMount: description: procMount denotes the type of proc @@ -3452,13 +2903,11 @@ spec: DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to - be enabled. Note that this field cannot be set - when spec.os.name is windows. + be enabled. type: string readOnlyRootFilesystem: description: Whether this container has a read-only - root filesystem. Default is false. Note that this - field cannot be set when spec.os.name is windows. + root filesystem. Default is false. type: boolean runAsGroup: description: The GID to run the entrypoint of the @@ -3466,8 +2915,6 @@ spec: May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is windows. format: int64 type: integer runAsNonRoot: @@ -3487,8 +2934,7 @@ spec: in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in - SecurityContext takes precedence. Note that this - field cannot be set when spec.os.name is windows. + SecurityContext takes precedence. format: int64 type: integer seLinuxOptions: @@ -3498,8 +2944,6 @@ spec: container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is windows. properties: level: description: Level is SELinux level label that @@ -3522,8 +2966,7 @@ spec: description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container - options override the pod options. Note that this - field cannot be set when spec.os.name is windows. + options override the pod options. properties: localhostProfile: description: localhostProfile indicates a profile @@ -3551,8 +2994,6 @@ spec: from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is linux. properties: gmsaCredentialSpec: description: GMSACredentialSpec is where the @@ -3564,20 +3005,6 @@ spec: description: GMSACredentialSpecName is the name of the GMSA credential spec to use. type: string - hostProcess: - description: HostProcess determines if a container - should be run as a 'Host Process' container. - This field is alpha-level and will only be - honored by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the - feature flag will result in errors when validating - the Pod. All of a Pod's containers must have - the same effective HostProcess value (it is - not allowed to have a mix of HostProcess containers - and non-HostProcess containers). In addition, - if HostProcess is true then HostNetwork must - also be set to true. - type: boolean runAsUserName: description: The UserName in Windows to run the entrypoint of the container process. Defaults @@ -3593,7 +3020,8 @@ spec: description: Probes are not allowed for ephemeral containers. properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -3615,26 +3043,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -3652,10 +3060,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -3703,8 +3108,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -3721,25 +3127,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -3767,15 +3154,13 @@ spec: will never receive an EOF. Default is false type: boolean targetContainerName: - description: "If set, the name of the container from + description: If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then - the ephemeral container uses the namespaces configured - in the Pod spec. \n The container runtime must implement - support for this feature. If the runtime does not - support namespace targeting then the result of setting - this field is undefined." + the ephemeral container is run in whatever namespaces + are shared for the pod. Note that the container runtime + must support this feature. type: string terminationMessagePath: description: 'Optional: Path at which the file to which @@ -3827,8 +3212,7 @@ spec: type: array volumeMounts: description: Pod volumes to mount into the container's - filesystem. Subpath mounts are not allowed for ephemeral - containers. Cannot be updated. + filesystem. Cannot be updated. items: description: VolumeMount describes a mounting of a Volume within a container. @@ -3913,19 +3297,6 @@ spec: description: 'Use the host''s pid namespace. Optional: Default to false.' type: boolean - hostUsers: - description: 'Use the host''s user namespace. Optional: Default - to true. If set to true or not present, the pod will be - run in the host user namespace, useful for when the pod - needs a feature only available to the host user namespace, - such as loading a kernel module with CAP_SYS_MODULE. When - set to false, a new userns is created for the pod. Setting - false is useful for mitigating container breakout vulnerabilities - even allowing users to run their containers as root without - actually having root privileges on the host. This field - is alpha-level and is only honored by servers that enable - the UserNamespacesSupport feature.' - type: boolean hostname: description: Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. @@ -3935,7 +3306,8 @@ spec: to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations - for them to use. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' + for them to use. For example, in the case of docker, only + DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' items: description: LocalObjectReference contains enough information to let you locate the referenced object inside the same @@ -3967,32 +3339,29 @@ spec: to run within a pod. properties: args: - description: 'Arguments to the entrypoint. The container + description: 'Arguments to the entrypoint. The docker image''s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the - reference in the input string will be unchanged. Double - $$ are reduced to a single $, which allows for escaping - the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + reference in the input string will be unchanged. The + $(VAR_NAME) syntax can be escaped with a double $$, + ie: $$(VAR_NAME). Escaped references will never be + expanded, regardless of whether the variable exists + or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array command: description: 'Entrypoint array. Not executed within - a shell. The container image''s ENTRYPOINT is used - if this is not provided. Variable references $(VAR_NAME) + a shell. The docker image''s ENTRYPOINT is used if + this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the - input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) - syntax: i.e. "$$(VAR_NAME)" will produce the string - literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists - or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array @@ -4009,16 +3378,14 @@ spec: type: string value: description: 'Variable references $(VAR_NAME) - are expanded using the previously defined environment + are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. - Double $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" - will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless - of whether the variable exists or not. Defaults - to "".' + The $(VAR_NAME) syntax can be escaped with a + double $$, ie: $$(VAR_NAME). Escaped references + will never be expanded, regardless of whether + the variable exists or not. Defaults to "".' type: string valueFrom: description: Source for the environment variable's @@ -4163,7 +3530,7 @@ spec: type: object type: array image: - description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images + description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.' @@ -4188,7 +3555,9 @@ spec: info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following + should be specified. Exec specifies the action + to take. properties: command: description: Command is the command line @@ -4222,10 +3591,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. - This will be canonicalized upon - output, so case-variant names will - be understood as the same header. + description: The header field name type: string value: description: The header field value @@ -4256,11 +3622,10 @@ spec: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward - compatibility. There are no validation of - this field and lifecycle hooks will fail in - runtime when tcp handler is specified. + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' properties: host: description: 'Optional: Host name to connect @@ -4285,17 +3650,20 @@ spec: or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes - or exits. The Pod''s termination grace period - countdown begins before the PreStop hook is executed. - Regardless of the outcome of the handler, the - container will eventually terminate within the - Pod''s termination grace period (unless delayed - by finalizers). Other management of the container - blocks until the hook completes or until the termination - grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + or exits. The reason for termination is passed + to the handler. The Pod''s termination grace period + countdown begins before the PreStop hooked is + executed. Regardless of the outcome of the handler, + the container will eventually terminate within + the Pod''s termination grace period. Other management + of the container blocks until the hook completes + or until the termination grace period is reached. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following + should be specified. Exec specifies the action + to take. properties: command: description: Command is the command line @@ -4329,10 +3697,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. - This will be canonicalized upon - output, so case-variant names will - be understood as the same header. + description: The header field name type: string value: description: The header field value @@ -4363,11 +3728,10 @@ spec: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward - compatibility. There are no validation of - this field and lifecycle hooks will fail in - runtime when tcp handler is specified. + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' properties: host: description: 'Optional: Host name to connect @@ -4393,7 +3757,8 @@ spec: be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -4415,26 +3780,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -4452,10 +3797,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -4503,8 +3845,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -4521,25 +3864,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -4554,13 +3878,13 @@ spec: type: string ports: description: List of ports to expose from the container. - Not specifying a port here DOES NOT prevent that port - from being exposed. Any port which is listening on - the default "0.0.0.0" address inside a container will - be accessible from the network. Modifying this array - with strategic merge patch may corrupt the data. For - more information See https://github.com/kubernetes/kubernetes/issues/108255. - Cannot be updated. + Exposing a port here gives the system additional information + about the network connections a container uses, but + is primarily informational. Not specifying a port + here DOES NOT prevent that port from being exposed. + Any port which is listening on the default "0.0.0.0" + address inside a container will be accessible from + the network. Cannot be updated. items: description: ContainerPort represents a network port in a single container. @@ -4608,7 +3932,8 @@ spec: the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -4630,26 +3955,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -4667,10 +3972,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -4718,8 +4020,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -4736,25 +4039,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -4764,32 +4048,8 @@ spec: type: object resources: description: 'Compute Resources required by this container. - Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' properties: - claims: - description: "Claims lists the names of resources, - defined in spec.resourceClaims, that are used - by this container. \n This is an alpha field and - requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can - only be set for containers." - items: - description: ResourceClaim references one entry - in PodSpec.ResourceClaims. - properties: - name: - description: Name must match the name of one - entry in pod.spec.resourceClaims of the - Pod where this field is used. It makes that - resource available inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map limits: additionalProperties: anyOf: @@ -4798,7 +4058,7 @@ spec: pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Limits describes the maximum amount - of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object requests: additionalProperties: @@ -4811,14 +4071,13 @@ spec: of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to - an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object type: object securityContext: - description: 'SecurityContext defines the security options - the container should be run with. If set, the fields - of SecurityContext override the equivalent fields - of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + description: 'Security options the pod should run with. + More info: https://kubernetes.io/docs/concepts/policy/security-context/ + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' properties: allowPrivilegeEscalation: description: 'AllowPrivilegeEscalation controls @@ -4827,14 +4086,12 @@ spec: if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) - has CAP_SYS_ADMIN Note that this field cannot - be set when spec.os.name is windows.' + has CAP_SYS_ADMIN' type: boolean capabilities: description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities - granted by the container runtime. Note that this - field cannot be set when spec.os.name is windows. + granted by the container runtime. properties: add: description: Added capabilities @@ -4854,9 +4111,7 @@ spec: privileged: description: Run container in privileged mode. Processes in privileged containers are essentially equivalent - to root on the host. Defaults to false. Note that - this field cannot be set when spec.os.name is - windows. + to root on the host. Defaults to false. type: boolean procMount: description: procMount denotes the type of proc @@ -4864,13 +4119,11 @@ spec: DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to - be enabled. Note that this field cannot be set - when spec.os.name is windows. + be enabled. type: string readOnlyRootFilesystem: description: Whether this container has a read-only - root filesystem. Default is false. Note that this - field cannot be set when spec.os.name is windows. + root filesystem. Default is false. type: boolean runAsGroup: description: The GID to run the entrypoint of the @@ -4878,8 +4131,6 @@ spec: May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is windows. format: int64 type: integer runAsNonRoot: @@ -4899,8 +4150,7 @@ spec: in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in - SecurityContext takes precedence. Note that this - field cannot be set when spec.os.name is windows. + SecurityContext takes precedence. format: int64 type: integer seLinuxOptions: @@ -4910,8 +4160,6 @@ spec: container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is windows. properties: level: description: Level is SELinux level label that @@ -4934,8 +4182,7 @@ spec: description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container - options override the pod options. Note that this - field cannot be set when spec.os.name is windows. + options override the pod options. properties: localhostProfile: description: localhostProfile indicates a profile @@ -4963,8 +4210,6 @@ spec: from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is linux. properties: gmsaCredentialSpec: description: GMSACredentialSpec is where the @@ -4976,20 +4221,6 @@ spec: description: GMSACredentialSpecName is the name of the GMSA credential spec to use. type: string - hostProcess: - description: HostProcess determines if a container - should be run as a 'Host Process' container. - This field is alpha-level and will only be - honored by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the - feature flag will result in errors when validating - the Pod. All of a Pod's containers must have - the same effective HostProcess value (it is - not allowed to have a mix of HostProcess containers - and non-HostProcess containers). In addition, - if HostProcess is true then HostNetwork must - also be set to true. - type: boolean runAsUserName: description: The UserName in Windows to run the entrypoint of the container process. Defaults @@ -5013,7 +4244,8 @@ spec: operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -5035,26 +4267,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -5072,10 +4284,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -5123,8 +4332,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -5141,25 +4351,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -5303,34 +4494,6 @@ spec: a node''s labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' type: object - x-kubernetes-map-type: atomic - os: - description: "Specifies the OS of the containers in the pod. - Some pod and container fields are restricted if this is - set. \n If the OS field is set to linux, the following fields - must be unset: -securityContext.windowsOptions \n If the - OS field is set to windows, following fields must be unset: - - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.securityContext.seLinuxOptions - - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - - spec.shareProcessNamespace - spec.securityContext.runAsUser - - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - - spec.containers[*]." - properties: - name: - description: 'Name is the name of the operating system. - The currently supported values are linux and windows. - Additional value may be defined in future and can be - one of: https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration - Clients should expect to handle additional values and - treat unrecognized values in this field as os: null' - type: string - required: - - name - type: object overhead: additionalProperties: anyOf: @@ -5348,12 +4511,15 @@ spec: is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More - info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md' + info: https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md + This field is alpha-level as of Kubernetes v1.16, and is + only honored by servers that enable the PodOverhead feature.' type: object preemptionPolicy: description: PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. - Defaults to PreemptLowerPriority if unset. + Defaults to PreemptLowerPriority if unset. This field is + beta-level, gated by the NonPreemptingPriority feature-gate. type: string priority: description: The priority value. Various system components @@ -5377,7 +4543,7 @@ spec: description: 'If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness - gates have status equal to "True" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates' + gates have status equal to "True" More info: https://git.k8s.io/enhancements/keps/sig-network/0007-pod-ready%2B%2B.md' items: description: PodReadinessGate contains the reference to a pod condition @@ -5390,60 +4556,6 @@ spec: - conditionType type: object type: array - resourceClaims: - description: "ResourceClaims defines which ResourceClaims - must be allocated and reserved before the Pod is allowed - to start. The resources will be made available to those - containers which consume them by name. \n This is an alpha - field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." - items: - description: PodResourceClaim references exactly one ResourceClaim - through a ClaimSource. It adds a name to it that uniquely - identifies the ResourceClaim inside the Pod. Containers - that need access to the ResourceClaim reference it with - this name. - properties: - name: - description: Name uniquely identifies this resource - claim inside the pod. This must be a DNS_LABEL. - type: string - source: - description: Source describes where to find the ResourceClaim. - properties: - resourceClaimName: - description: ResourceClaimName is the name of a - ResourceClaim object in the same namespace as - this pod. - type: string - resourceClaimTemplateName: - description: "ResourceClaimTemplateName is the name - of a ResourceClaimTemplate object in the same - namespace as this pod. \n The template will be - used to create a new ResourceClaim, which will - be bound to this pod. When this pod is deleted, - the ResourceClaim will also be deleted. The name - of the ResourceClaim will be -, where is the PodResourceClaim.Name. - Pod validation will reject the pod if the concatenated - name is not valid for a ResourceClaim (e.g. too - long). \n An existing ResourceClaim with that - name that is not owned by the pod will not be - used for the pod to avoid using an unrelated resource - by mistake. Scheduling and pod startup are then - blocked until the unrelated ResourceClaim is removed. - \n This field is immutable and no changes will - be made to the corresponding ResourceClaim by - the control plane after creating the ResourceClaim." - type: string - type: object - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map restartPolicy: description: 'Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. @@ -5456,34 +4568,14 @@ spec: the pod will not be run. If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. - More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class' + More info: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md + This is a beta feature as of Kubernetes v1.14.' type: string schedulerName: description: If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. type: string - schedulingGates: - description: "SchedulingGates is an opaque list of values - that if specified will block scheduling the pod. More info: - \ https://git.k8s.io/enhancements/keps/sig-scheduling/3521-pod-scheduling-readiness. - \n This is an alpha-level feature enabled by PodSchedulingReadiness - feature gate." - items: - description: PodSchedulingGate is associated to a Pod to - guard its scheduling. - properties: - name: - description: Name of the scheduling gate. Each scheduling - gate must have a unique name field. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map securityContext: description: 'SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See @@ -5498,8 +4590,7 @@ spec: in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw---- \n If unset, the Kubelet will not modify the ownership and permissions of any - volume. Note that this field cannot be set when spec.os.name - is windows." + volume." format: int64 type: integer fsGroupChangePolicy: @@ -5510,16 +4601,14 @@ spec: permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are "OnRootMismatch" and "Always". If not specified, - "Always" is used. Note that this field cannot be set - when spec.os.name is windows.' + "Always" is used.' type: string runAsGroup: description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext - takes precedence for that container. Note that this - field cannot be set when spec.os.name is windows. + takes precedence for that container. format: int64 type: integer runAsNonRoot: @@ -5538,8 +4627,7 @@ spec: if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence - for that container. Note that this field cannot be set - when spec.os.name is windows. + for that container. format: int64 type: integer seLinuxOptions: @@ -5548,8 +4636,7 @@ spec: allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext - takes precedence for that container. Note that this - field cannot be set when spec.os.name is windows. + takes precedence for that container. properties: level: description: Level is SELinux level label that applies @@ -5570,8 +4657,7 @@ spec: type: object seccompProfile: description: The seccomp options to use by the containers - in this pod. Note that this field cannot be set when - spec.os.name is windows. + in this pod. properties: localhostProfile: description: localhostProfile indicates a profile @@ -5595,14 +4681,8 @@ spec: supplementalGroups: description: A list of groups applied to the first process run in each container, in addition to the container's - primary GID, the fsGroup (if specified), and group memberships - defined in the container image for the uid of the container - process. If unspecified, no additional groups are added - to any container. Note that group memberships defined - in the container image for the uid of the container - process are still effective, even if they are not included - in this list. Note that this field cannot be set when - spec.os.name is windows. + primary GID. If unspecified, no groups will be added + to any container. items: format: int64 type: integer @@ -5610,8 +4690,7 @@ spec: sysctls: description: Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by - the container runtime) might fail to launch. Note that - this field cannot be set when spec.os.name is windows. + the container runtime) might fail to launch. items: description: Sysctl defines a kernel parameter to be set @@ -5632,8 +4711,7 @@ spec: all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. Note - that this field cannot be set when spec.os.name is linux. + specified in SecurityContext takes precedence. properties: gmsaCredentialSpec: description: GMSACredentialSpec is where the GMSA @@ -5645,19 +4723,6 @@ spec: description: GMSACredentialSpecName is the name of the GMSA credential spec to use. type: string - hostProcess: - description: HostProcess determines if a container - should be run as a 'Host Process' container. This - field is alpha-level and will only be honored by - components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the feature - flag will result in errors when validating the Pod. - All of a Pod's containers must have the same effective - HostProcess value (it is not allowed to have a mix - of HostProcess containers and non-HostProcess containers). In - addition, if HostProcess is true then HostNetwork - must also be set to true. - type: boolean runAsUserName: description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified @@ -5705,10 +4770,9 @@ spec: description: Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity to - shut down). If this value is nil, the default grace period - will be used instead. The grace period is the duration in - seconds after the processes running in the pod are sent + delete immediately. If this value is nil, the default grace + period will be used instead. The grace period is the duration + in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults @@ -5815,100 +4879,31 @@ spec: requirements are ANDed. type: object type: object - matchLabelKeys: - description: MatchLabelKeys is a set of pod label keys - to select the pods over which spreading will be calculated. - The keys are used to lookup values from the incoming - pod labels, those key-value labels are ANDed with - labelSelector to select the group of existing pods - over which spreading will be calculated for the incoming - pod. Keys that don't exist in the incoming pod labels - will be ignored. A null or empty list means only match - against labelSelector. - items: - type: string - type: array - x-kubernetes-list-type: atomic maxSkew: description: 'MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and - the global minimum. The global minimum is the minimum - number of matching pods in an eligible domain or zero - if the number of eligible domains is less than MinDomains. - For example, in a 3-zone cluster, MaxSkew is set to - 1, and pods with the same labelSelector spread as - 2/2/1: In this case, the global minimum is 1. | zone1 - | zone2 | zone3 | | P P | P P | P | - if MaxSkew - is 1, incoming pod can only be scheduled to zone3 - to become 2/2/2; scheduling it onto zone1(zone2) would - make the ActualSkew(3-1) on zone1(zone2) violate MaxSkew(1). - - if MaxSkew is 2, incoming pod can be scheduled onto - any zone. When `whenUnsatisfiable=ScheduleAnyway`, + the global minimum. For example, in a 3-zone cluster, + MaxSkew is set to 1, and pods with the same labelSelector + spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | + - if MaxSkew is 1, incoming pod can only be scheduled + to zone3 to become 1/1/1; scheduling it onto zone1(zone2) + would make the ActualSkew(2-0) on zone1(zone2) violate + MaxSkew(1). - if MaxSkew is 2, incoming pod can be + scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It''s a required field. Default value is 1 and 0 is not allowed.' format: int32 type: integer - minDomains: - description: "MinDomains indicates a minimum number - of eligible domains. When the number of eligible domains - with matching topology keys is less than minDomains, - Pod Topology Spread treats \"global minimum\" as 0, - and then the calculation of Skew is performed. And - when the number of eligible domains with matching - topology keys equals or greater than minDomains, this - value has no effect on scheduling. As a result, when - the number of eligible domains is less than minDomains, - scheduler won't schedule more than maxSkew Pods to - those domains. If value is nil, the constraint behaves - as if MinDomains is equal to 1. Valid values are integers - greater than 0. When value is not nil, WhenUnsatisfiable - must be DoNotSchedule. \n For example, in a 3-zone - cluster, MaxSkew is set to 2, MinDomains is set to - 5 and pods with the same labelSelector spread as 2/2/2: - | zone1 | zone2 | zone3 | | P P | P P | P P | - The number of domains is less than 5(MinDomains), - so \"global minimum\" is treated as 0." - format: int32 - type: integer - nodeAffinityPolicy: - description: "NodeAffinityPolicy indicates how we will - treat Pod's nodeAffinity/nodeSelector when calculating - pod topology spread skew. Options are: - Honor: only - nodes matching nodeAffinity/nodeSelector are included - in the calculations. - Ignore: nodeAffinity/nodeSelector - are ignored. All nodes are included in the calculations. - \n If this value is nil, the behavior is equivalent - to the Honor policy. This is a beta-level feature - default enabled by the NodeInclusionPolicyInPodTopologySpread - feature flag." - type: string - nodeTaintsPolicy: - description: "NodeTaintsPolicy indicates how we will - treat node taints when calculating pod topology spread - skew. Options are: - Honor: nodes without taints, - along with tainted nodes for which the incoming pod - has a toleration, are included. - Ignore: node taints - are ignored. All nodes are included. \n If this value - is nil, the behavior is equivalent to the Ignore policy. - This is a beta-level feature default enabled by the - NodeInclusionPolicyInPodTopologySpread feature flag." - type: string topologyKey: description: TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each as a "bucket", and try - to put balanced number of pods into each bucket. We - define a domain as a particular instance of a topology. - Also, we define an eligible domain as a domain whose - nodes meet the requirements of nodeAffinityPolicy - and nodeTaintsPolicy. e.g. If TopologyKey is "kubernetes.io/hostname", - each Node is a domain of that topology. And, if TopologyKey - is "topology.kubernetes.io/zone", each zone is a domain - of that topology. It's a required field. + to put balanced number of pods into each bucket. It's + a required field. type: string whenUnsatisfiable: description: 'WhenUnsatisfiable indicates how to deal @@ -5919,7 +4914,7 @@ spec: higher precedence to topologies that would help reduce the skew. A constraint is considered "Unsatisfiable" for an incoming pod if and only if every possible - node assignment for that pod would violate "MaxSkew" + node assigment for that pod would violate "MaxSkew" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P @@ -5948,128 +4943,123 @@ spec: may be accessed by any container in the pod. properties: awsElasticBlockStore: - description: 'awsElasticBlockStore represents an AWS + description: 'AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' properties: fsType: - description: 'fsType is the filesystem type of the - volume that you want to mount. Tip: Ensure that - the filesystem type is supported by the host operating - system. Examples: "ext4", "xfs", "ntfs". Implicitly - inferred to be "ext4" if unspecified. More info: - https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + description: 'Filesystem type of the volume that + you want to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore TODO: how do we prevent errors in the filesystem from compromising the machine' type: string partition: - description: 'partition is the partition in the - volume that you want to mount. If omitted, the - default is to mount by volume name. Examples: - For volume /dev/sda1, you specify the partition - as "1". Similarly, the volume partition for /dev/sda - is "0" (or you can leave the property empty).' + description: 'The partition in the volume that you + want to mount. If omitted, the default is to mount + by volume name. Examples: For volume /dev/sda1, + you specify the partition as "1". Similarly, the + volume partition for /dev/sda is "0" (or you can + leave the property empty).' format: int32 type: integer readOnly: - description: 'readOnly value true will force the - readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: 'Specify "true" to force and set the + ReadOnly property in VolumeMounts to "true". If + omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' type: boolean volumeID: - description: 'volumeID is unique ID of the persistent - disk resource in AWS (Amazon EBS volume). More - info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: 'Unique ID of the persistent disk resource + in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' type: string required: - volumeID type: object azureDisk: - description: azureDisk represents an Azure Data Disk + description: AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. properties: cachingMode: - description: 'cachingMode is the Host Caching mode: - None, Read Only, Read Write.' + description: 'Host Caching mode: None, Read Only, + Read Write.' type: string diskName: - description: diskName is the Name of the data disk - in the blob storage + description: The Name of the data disk in the blob + storage type: string diskURI: - description: diskURI is the URI of data disk in - the blob storage + description: The URI the data disk in the blob storage type: string fsType: - description: fsType is Filesystem type to mount. - Must be a filesystem type supported by the host - operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + description: Filesystem type to mount. Must be a + filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string kind: - description: 'kind expected values are Shared: multiple - blob disks per storage account Dedicated: single - blob disk per storage account Managed: azure - managed data disk (only in managed availability - set). defaults to shared' + description: 'Expected values Shared: multiple blob + disks per storage account Dedicated: single blob + disk per storage account Managed: azure managed + data disk (only in managed availability set). + defaults to shared' type: string readOnly: - description: readOnly Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting - in VolumeMounts. + description: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts. type: boolean required: - diskName - diskURI type: object azureFile: - description: azureFile represents an Azure File Service + description: AzureFile represents an Azure File Service mount on the host and bind mount to the pod. properties: readOnly: - description: readOnly defaults to false (read/write). - ReadOnly here will force the ReadOnly setting - in VolumeMounts. + description: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts. type: boolean secretName: - description: secretName is the name of secret that - contains Azure Storage Account Name and Key + description: the name of secret that contains Azure + Storage Account Name and Key type: string shareName: - description: shareName is the azure share Name + description: Share Name type: string required: - secretName - shareName type: object cephfs: - description: cephFS represents a Ceph FS mount on the + description: CephFS represents a Ceph FS mount on the host that shares a pod's lifetime properties: monitors: - description: 'monitors is Required: Monitors is - a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'Required: Monitors is a collection + of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' items: type: string type: array path: - description: 'path is Optional: Used as the mounted - root, rather than the full Ceph tree, default - is /' + description: 'Optional: Used as the mounted root, + rather than the full Ceph tree, default is /' type: string readOnly: - description: 'readOnly is Optional: Defaults to - false (read/write). ReadOnly here will force the - ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'Optional: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: boolean secretFile: - description: 'secretFile is Optional: SecretFile - is the path to key ring for User, default is /etc/ceph/user.secret + description: 'Optional: SecretFile is the path to + key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: string secretRef: - description: 'secretRef is Optional: SecretRef is - reference to the authentication secret for User, - default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'Optional: SecretRef is reference to + the authentication secret for User, default is + empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' properties: name: description: 'Name of the referent. More info: @@ -6079,32 +5069,31 @@ spec: type: string type: object user: - description: 'user is optional: User is the rados - user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'Optional: User is the rados user name, + default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: string required: - monitors type: object cinder: - description: 'cinder represents a cinder volume attached + description: 'Cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' properties: fsType: - description: 'fsType is the filesystem type to mount. - Must be a filesystem type supported by the host - operating system. Examples: "ext4", "xfs", "ntfs". - Implicitly inferred to be "ext4" if unspecified. - More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: 'Filesystem type to mount. Must be + a filesystem type supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. More info: + https://examples.k8s.io/mysql-cinder-pd/README.md' type: string readOnly: - description: 'readOnly defaults to false (read/write). + description: 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' type: boolean secretRef: - description: 'secretRef is optional: points to a - secret object containing parameters used to connect - to OpenStack.' + description: 'Optional: points to a secret object + containing parameters used to connect to OpenStack.' properties: name: description: 'Name of the referent. More info: @@ -6114,32 +5103,32 @@ spec: type: string type: object volumeID: - description: 'volumeID used to identify the volume + description: 'volume id used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' type: string required: - volumeID type: object configMap: - description: configMap represents a configMap that should + description: ConfigMap represents a configMap that should populate this volume properties: defaultMode: - description: 'defaultMode is optional: mode bits - used to set permissions on created files by default. - Must be an octal value between 0000 and 0777 or - a decimal value between 0 and 511. YAML accepts - both octal and decimal values, JSON requires decimal - values for mode bits. Defaults to 0644. Directories - within the path are not affected by this setting. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: 'Optional: mode bits used to set permissions + on created files by default. Must be an octal + value between 0000 and 0777 or a decimal value + between 0 and 511. YAML accepts both octal and + decimal values, JSON requires decimal values for + mode bits. Defaults to 0644. Directories within + the path are not affected by this setting. This + might be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' format: int32 type: integer items: - description: items if unspecified, each key-value - pair in the Data field of the referenced ConfigMap + description: If unspecified, each key-value pair + in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified @@ -6154,28 +5143,26 @@ spec: a volume. properties: key: - description: key is the key to project. + description: The key to project. type: string mode: - description: 'mode is Optional: mode bits - used to set permissions on this file. Must - be an octal value between 0000 and 0777 - or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON - requires decimal values for mode bits. If - not specified, the volume defaultMode will - be used. This might be in conflict with - other options that affect the file mode, - like fsGroup, and the result can be other - mode bits set.' + description: 'Optional: mode bits used to + set permissions on this file. Must be an + octal value between 0000 and 0777 or a decimal + value between 0 and 511. YAML accepts both + octal and decimal values, JSON requires + decimal values for mode bits. If not specified, + the volume defaultMode will be used. This + might be in conflict with other options + that affect the file mode, like fsGroup, + and the result can be other mode bits set.' format: int32 type: integer path: - description: path is the relative path of - the file to map the key to. May not be an - absolute path. May not contain the path - element '..'. May not start with the string - '..'. + description: The relative path of the file + to map the key to. May not be an absolute + path. May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -6188,28 +5175,28 @@ spec: uid?' type: string optional: - description: optional specify whether the ConfigMap - or its keys must be defined + description: Specify whether the ConfigMap or its + keys must be defined type: boolean type: object csi: - description: csi (Container Storage Interface) represents + description: CSI (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). properties: driver: - description: driver is the name of the CSI driver + description: Driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster. type: string fsType: - description: fsType to mount. Ex. "ext4", "xfs", - "ntfs". If not provided, the empty value is passed - to the associated CSI driver which will determine - the default filesystem to apply. + description: Filesystem type to mount. Ex. "ext4", + "xfs", "ntfs". If not provided, the empty value + is passed to the associated CSI driver which will + determine the default filesystem to apply. type: string nodePublishSecretRef: - description: nodePublishSecretRef is a reference + description: NodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. @@ -6226,13 +5213,13 @@ spec: type: string type: object readOnly: - description: readOnly specifies a read-only configuration + description: Specifies a read-only configuration for the volume. Defaults to false (read/write). type: boolean volumeAttributes: additionalProperties: type: string - description: volumeAttributes stores driver-specific + description: VolumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values. @@ -6241,7 +5228,7 @@ spec: - driver type: object downwardAPI: - description: downwardAPI represents downward API about + description: DownwardAPI represents downward API about the pod that should populate this volume properties: defaultMode: @@ -6334,41 +5321,40 @@ spec: type: array type: object emptyDir: - description: 'emptyDir represents a temporary directory + description: 'EmptyDir represents a temporary directory that shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' properties: medium: - description: 'medium represents what type of storage - medium should back this directory. The default - is "" which means to use the node''s default medium. - Must be an empty string (default) or Memory. More - info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: 'What type of storage medium should + back this directory. The default is "" which means + to use the node''s default medium. Must be an + empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' type: string sizeLimit: anyOf: - type: integer - type: string - description: 'sizeLimit is the total amount of local - storage required for this EmptyDir volume. The - size limit is also applicable for memory medium. - The maximum usage on memory medium EmptyDir would - be the minimum value between the SizeLimit specified - here and the sum of memory limits of all containers - in a pod. The default is nil which means that - the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' + description: 'Total amount of local storage required + for this EmptyDir volume. The size limit is also + applicable for memory medium. The maximum usage + on memory medium EmptyDir would be the minimum + value between the SizeLimit specified here and + the sum of memory limits of all containers in + a pod. The default is nil which means that the + limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true type: object ephemeral: - description: "ephemeral represents a volume that is - handled by a cluster storage driver. The volume's - lifecycle is tied to the pod that defines it - it - will be created before the pod starts, and deleted - when the pod is removed. \n Use this if: a) the volume - is only needed while the pod runs, b) features of - normal volumes like restoring from snapshot or capacity - \ tracking are needed, c) the storage driver is - specified through a storage class, and d) the storage + description: "Ephemeral represents a volume that is + handled by a cluster storage driver (Alpha feature). + The volume's lifecycle is tied to the pod that defines + it - it will be created before the pod starts, and + deleted when the pod is removed. \n Use this if: a) + the volume is only needed while the pod runs, b) features + of normal volumes like restoring from snapshot or + capacity tracking are needed, c) the storage driver + is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through \ a PersistentVolumeClaim (see EphemeralVolumeSource for more information on the connection between @@ -6380,6 +5366,10 @@ spec: to be used that way - see the documentation of the driver for more information." properties: + readOnly: + description: Specifies a read-only configuration + for the volume. Defaults to false (read/write). + type: boolean volumeClaimTemplate: description: "Will be used to create a stand-alone PVC to provision the volume. The pod in which @@ -6434,28 +5424,26 @@ spec: are also valid here. properties: accessModes: - description: 'accessModes contains the desired + description: 'AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: type: string type: array dataSource: - description: 'dataSource field can be used - to specify either: * An existing VolumeSnapshot + description: 'This field can be used to + specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) - If the provisioner or an external controller - can support the specified data source, - it will create a new volume based on the - contents of the specified data source. - When the AnyVolumeDataSource feature gate - is enabled, dataSource contents will be - copied to dataSourceRef, and dataSourceRef - contents will be copied to dataSource - when dataSourceRef.namespace is not specified. - If the namespace is specified, then dataSourceRef - will not be copied to dataSource.' + * An existing custom resource that implements + data population (Alpha) In order to use + custom resource types that implement data + population, the AnyVolumeDataSource feature + gate must be enabled. If the provisioner + or an external controller can support + the specified data source, it will create + a new volume based on the contents of + the specified data source.' properties: apiGroup: description: APIGroup is the group for @@ -6477,98 +5465,11 @@ spec: - kind - name type: object - dataSourceRef: - description: dataSourceRef specifies the - object from which to populate the volume - with data, if a non-empty volume is desired. - This may be any object from a non-empty - API group (non core object) or a PersistentVolumeClaim - object. When this field is specified, - volume binding will only succeed if the - type of the specified object matches some - installed volume populator or dynamic - provisioner. This field will replace the - functionality of the dataSource field - and as such if both fields are non-empty, - they must have the same value. For backwards - compatibility, when namespace isn't specified - in dataSourceRef, both fields (dataSource - and dataSourceRef) will be set to the - same value automatically if one of them - is empty and the other is non-empty. When - namespace is specified in dataSourceRef, - dataSource isn't set to the same value - and must be empty. - properties: - apiGroup: - description: APIGroup is the group for - the resource being referenced. If - APIGroup is not specified, the specified - Kind must be in the core API group. - For any other third-party types, APIGroup - is required. - type: string - kind: - description: Kind is the type of resource - being referenced - type: string - name: - description: Name is the name of resource - being referenced - type: string - namespace: - description: Namespace is the namespace - of resource being referenced Note - that when a namespace is specified, - a gateway.networking.k8s.io/ReferenceGrant - object is required in the referent - namespace to allow that namespace's - owner to accept the reference. See - the ReferenceGrant documentation for - details. (Alpha) This field requires - the CrossNamespaceVolumeDataSource - feature gate to be enabled. - type: string - required: - - kind - - name - type: object resources: - description: 'resources represents the minimum - resources the volume should have. If RecoverVolumeExpansionFailure - feature is enabled users are allowed to - specify resource requirements that are - lower than previous value but must still - be higher than capacity recorded in the - status field of the claim. More info: - https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: 'Resources represents the minimum + resources the volume should have. More + info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' properties: - claims: - description: "Claims lists the names - of resources, defined in spec.resourceClaims, - that are used by this container. \n - This is an alpha field and requires - enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. - It can only be set for containers." - items: - description: ResourceClaim references - one entry in PodSpec.ResourceClaims. - properties: - name: - description: Name must match the - name of one entry in pod.spec.resourceClaims - of the Pod where this field - is used. It makes that resource - available inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map limits: additionalProperties: anyOf: @@ -6578,7 +5479,7 @@ spec: x-kubernetes-int-or-string: true description: 'Limits describes the maximum amount of compute resources allowed. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object requests: additionalProperties: @@ -6593,12 +5494,12 @@ spec: a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object type: object selector: - description: selector is a label query over - volumes to consider for binding. + description: A label query over volumes + to consider for binding. properties: matchExpressions: description: matchExpressions is a list @@ -6652,9 +5553,8 @@ spec: type: object type: object storageClassName: - description: 'storageClassName is the name - of the StorageClass required by the claim. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: 'Name of the StorageClass required + by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' type: string volumeMode: description: volumeMode defines what type @@ -6663,7 +5563,7 @@ spec: in claim spec. type: string volumeName: - description: volumeName is the binding reference + description: VolumeName is the binding reference to the PersistentVolume backing this claim. type: string type: object @@ -6672,75 +5572,74 @@ spec: type: object type: object fc: - description: fc represents a Fibre Channel resource + description: FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. properties: fsType: - description: 'fsType is the filesystem type to mount. - Must be a filesystem type supported by the host - operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + description: 'Filesystem type to mount. Must be + a filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. TODO: how do we prevent errors in the filesystem from compromising the machine' type: string lun: - description: 'lun is Optional: FC target lun number' + description: 'Optional: FC target lun number' format: int32 type: integer readOnly: - description: 'readOnly is Optional: Defaults to - false (read/write). ReadOnly here will force the - ReadOnly setting in VolumeMounts.' + description: 'Optional: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts.' type: boolean targetWWNs: - description: 'targetWWNs is Optional: FC target - worldwide names (WWNs)' + description: 'Optional: FC target worldwide names + (WWNs)' items: type: string type: array wwids: - description: 'wwids Optional: FC volume world wide - identifiers (wwids) Either wwids or combination - of targetWWNs and lun must be set, but not both - simultaneously.' + description: 'Optional: FC volume world wide identifiers + (wwids) Either wwids or combination of targetWWNs + and lun must be set, but not both simultaneously.' items: type: string type: array type: object flexVolume: - description: flexVolume represents a generic volume + description: FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. properties: driver: - description: driver is the name of the driver to + description: Driver is the name of the driver to use for this volume. type: string fsType: - description: fsType is the filesystem type to mount. - Must be a filesystem type supported by the host - operating system. Ex. "ext4", "xfs", "ntfs". The - default filesystem depends on FlexVolume script. + description: Filesystem type to mount. Must be a + filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". The default + filesystem depends on FlexVolume script. type: string options: additionalProperties: type: string - description: 'options is Optional: this field holds - extra command options if any.' + description: 'Optional: Extra command options if + any.' type: object readOnly: - description: 'readOnly is Optional: defaults to - false (read/write). ReadOnly here will force the - ReadOnly setting in VolumeMounts.' + description: 'Optional: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts.' type: boolean secretRef: - description: 'secretRef is Optional: secretRef is - reference to the secret object containing sensitive - information to pass to the plugin scripts. This - may be empty if no secret object is specified. - If the secret object contains more than one secret, - all secrets are passed to the plugin scripts.' + description: 'Optional: SecretRef is reference to + the secret object containing sensitive information + to pass to the plugin scripts. This may be empty + if no secret object is specified. If the secret + object contains more than one secret, all secrets + are passed to the plugin scripts.' properties: name: description: 'Name of the referent. More info: @@ -6753,28 +5652,28 @@ spec: - driver type: object flocker: - description: flocker represents a Flocker volume attached + description: Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running properties: datasetName: - description: datasetName is Name of the dataset - stored as metadata -> name on the dataset for - Flocker should be considered as deprecated + description: Name of the dataset stored as metadata + -> name on the dataset for Flocker should be considered + as deprecated type: string datasetUUID: - description: datasetUUID is the UUID of the dataset. - This is unique identifier of a Flocker dataset + description: UUID of the dataset. This is unique + identifier of a Flocker dataset type: string type: object gcePersistentDisk: - description: 'gcePersistentDisk represents a GCE Disk + description: 'GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' properties: fsType: - description: 'fsType is filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem + description: 'Filesystem type of the volume that + you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk @@ -6782,22 +5681,21 @@ spec: from compromising the machine' type: string partition: - description: 'partition is the partition in the - volume that you want to mount. If omitted, the - default is to mount by volume name. Examples: - For volume /dev/sda1, you specify the partition - as "1". Similarly, the volume partition for /dev/sda - is "0" (or you can leave the property empty). - More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: 'The partition in the volume that you + want to mount. If omitted, the default is to mount + by volume name. Examples: For volume /dev/sda1, + you specify the partition as "1". Similarly, the + volume partition for /dev/sda is "0" (or you can + leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' format: int32 type: integer pdName: - description: 'pdName is unique name of the PD resource - in GCE. Used to identify the disk in GCE. More - info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: 'Unique name of the PD resource in + GCE. Used to identify the disk in GCE. More info: + https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' type: string readOnly: - description: 'readOnly here will force the ReadOnly + description: 'ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' type: boolean @@ -6805,7 +5703,7 @@ spec: - pdName type: object gitRepo: - description: 'gitRepo represents a git repository at + description: 'GitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo @@ -6813,38 +5711,37 @@ spec: container.' properties: directory: - description: directory is the target directory name. - Must not contain or start with '..'. If '.' is - supplied, the volume directory will be the git - repository. Otherwise, if specified, the volume - will contain the git repository in the subdirectory - with the given name. + description: Target directory name. Must not contain + or start with '..'. If '.' is supplied, the volume + directory will be the git repository. Otherwise, + if specified, the volume will contain the git + repository in the subdirectory with the given + name. type: string repository: - description: repository is the URL + description: Repository URL type: string revision: - description: revision is the commit hash for the - specified revision. + description: Commit hash for the specified revision. type: string required: - repository type: object glusterfs: - description: 'glusterfs represents a Glusterfs mount + description: 'Glusterfs represents a Glusterfs mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' properties: endpoints: - description: 'endpoints is the endpoint name that - details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: 'EndpointsName is the endpoint name + that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: string path: - description: 'path is the Glusterfs volume path. + description: 'Path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: string readOnly: - description: 'readOnly here will force the Glusterfs + description: 'ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: boolean @@ -6853,7 +5750,7 @@ spec: - path type: object hostPath: - description: 'hostPath represents a pre-existing file + description: 'HostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are @@ -6864,73 +5761,71 @@ spec: directories as read/write.' properties: path: - description: 'path of the directory on the host. + description: 'Path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' type: string type: - description: 'type for HostPath Volume Defaults + description: 'Type for HostPath Volume Defaults to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' type: string required: - path type: object iscsi: - description: 'iscsi represents an ISCSI Disk resource + description: 'ISCSI represents an ISCSI Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' properties: chapAuthDiscovery: - description: chapAuthDiscovery defines whether support - iSCSI Discovery CHAP authentication + description: whether support iSCSI Discovery CHAP + authentication type: boolean chapAuthSession: - description: chapAuthSession defines whether support - iSCSI Session CHAP authentication + description: whether support iSCSI Session CHAP + authentication type: boolean fsType: - description: 'fsType is the filesystem type of the - volume that you want to mount. Tip: Ensure that - the filesystem type is supported by the host operating - system. Examples: "ext4", "xfs", "ntfs". Implicitly - inferred to be "ext4" if unspecified. More info: - https://kubernetes.io/docs/concepts/storage/volumes#iscsi + description: 'Filesystem type of the volume that + you want to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi TODO: how do we prevent errors in the filesystem from compromising the machine' type: string initiatorName: - description: initiatorName is the custom iSCSI Initiator - Name. If initiatorName is specified with iscsiInterface - simultaneously, new iSCSI interface : will be created for the connection. + description: Custom iSCSI Initiator Name. If initiatorName + is specified with iscsiInterface simultaneously, + new iSCSI interface : + will be created for the connection. type: string iqn: - description: iqn is the target iSCSI Qualified Name. + description: Target iSCSI Qualified Name. type: string iscsiInterface: - description: iscsiInterface is the interface Name - that uses an iSCSI transport. Defaults to 'default' - (tcp). + description: iSCSI Interface Name that uses an iSCSI + transport. Defaults to 'default' (tcp). type: string lun: - description: lun represents iSCSI Target Lun number. + description: iSCSI Target Lun number. format: int32 type: integer portals: - description: portals is the iSCSI Target Portal - List. The portal is either an IP or ip_addr:port - if the port is other than default (typically TCP - ports 860 and 3260). + description: iSCSI Target Portal List. The portal + is either an IP or ip_addr:port if the port is + other than default (typically TCP ports 860 and + 3260). items: type: string type: array readOnly: - description: readOnly here will force the ReadOnly + description: ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. type: boolean secretRef: - description: secretRef is the CHAP Secret for iSCSI - target and initiator authentication + description: CHAP Secret for iSCSI target and initiator + authentication properties: name: description: 'Name of the referent. More info: @@ -6940,10 +5835,9 @@ spec: type: string type: object targetPortal: - description: targetPortal is iSCSI Target Portal. - The Portal is either an IP or ip_addr:port if - the port is other than default (typically TCP - ports 860 and 3260). + description: iSCSI Target Portal. The Portal is + either an IP or ip_addr:port if the port is other + than default (typically TCP ports 860 and 3260). type: string required: - iqn @@ -6951,24 +5845,24 @@ spec: - targetPortal type: object name: - description: 'name of the volume. Must be a DNS_LABEL - and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + description: 'Volume''s name. Must be a DNS_LABEL and + unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' type: string nfs: - description: 'nfs represents an NFS mount on the host + description: 'NFS represents an NFS mount on the host that shares a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' properties: path: - description: 'path that is exported by the NFS server. + description: 'Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: string readOnly: - description: 'readOnly here will force the NFS export + description: 'ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: boolean server: - description: 'server is the hostname or IP address + description: 'Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: string required: @@ -6976,133 +5870,132 @@ spec: - server type: object persistentVolumeClaim: - description: 'persistentVolumeClaimVolumeSource represents + description: 'PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' properties: claimName: - description: 'claimName is the name of a PersistentVolumeClaim + description: 'ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' type: string readOnly: - description: readOnly Will force the ReadOnly setting - in VolumeMounts. Default false. + description: Will force the ReadOnly setting in + VolumeMounts. Default false. type: boolean required: - claimName type: object photonPersistentDisk: - description: photonPersistentDisk represents a PhotonController + description: PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine properties: fsType: - description: fsType is the filesystem type to mount. - Must be a filesystem type supported by the host - operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + description: Filesystem type to mount. Must be a + filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string pdID: - description: pdID is the ID that identifies Photon - Controller persistent disk + description: ID that identifies Photon Controller + persistent disk type: string required: - pdID type: object portworxVolume: - description: portworxVolume represents a portworx volume + description: PortworxVolume represents a portworx volume attached and mounted on kubelets host machine properties: fsType: - description: fSType represents the filesystem type + description: FSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). - ReadOnly here will force the ReadOnly setting - in VolumeMounts. + description: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts. type: boolean volumeID: - description: volumeID uniquely identifies a Portworx + description: VolumeID uniquely identifies a Portworx volume type: string required: - volumeID type: object projected: - description: projected items for all in one resources - secrets, configmaps, and downward API + description: Items for all in one resources secrets, + configmaps, and downward API properties: defaultMode: - description: defaultMode are the mode bits used - to set permissions on created files by default. - Must be an octal value between 0000 and 0777 or - a decimal value between 0 and 511. YAML accepts - both octal and decimal values, JSON requires decimal - values for mode bits. Directories within the path - are not affected by this setting. This might be - in conflict with other options that affect the - file mode, like fsGroup, and the result can be - other mode bits set. + description: Mode bits used to set permissions on + created files by default. Must be an octal value + between 0000 and 0777 or a decimal value between + 0 and 511. YAML accepts both octal and decimal + values, JSON requires decimal values for mode + bits. Directories within the path are not affected + by this setting. This might be in conflict with + other options that affect the file mode, like + fsGroup, and the result can be other mode bits + set. format: int32 type: integer sources: - description: sources is the list of volume projections + description: list of volume projections items: description: Projection that may be projected along with other supported volume types properties: configMap: - description: configMap information about the - configMap data to project + description: information about the configMap + data to project properties: items: - description: items if unspecified, each - key-value pair in the Data field of - the referenced ConfigMap will be projected - into the volume as a file whose name - is the key and content is the value. - If specified, the listed keys will be - projected into the specified paths, - and unlisted keys will not be present. - If a key is specified which is not present - in the ConfigMap, the volume setup will - error unless it is marked optional. - Paths must be relative and may not contain - the '..' path or start with '..'. + description: If unspecified, each key-value + pair in the Data field of the referenced + ConfigMap will be projected into the + volume as a file whose name is the key + and content is the value. If specified, + the listed keys will be projected into + the specified paths, and unlisted keys + will not be present. If a key is specified + which is not present in the ConfigMap, + the volume setup will error unless it + is marked optional. Paths must be relative + and may not contain the '..' path or + start with '..'. items: description: Maps a string key to a path within a volume. properties: key: - description: key is the key to project. + description: The key to project. type: string mode: - description: 'mode is Optional: - mode bits used to set permissions - on this file. Must be an octal - value between 0000 and 0777 or - a decimal value between 0 and - 511. YAML accepts both octal and - decimal values, JSON requires - decimal values for mode bits. - If not specified, the volume defaultMode - will be used. This might be in - conflict with other options that - affect the file mode, like fsGroup, - and the result can be other mode - bits set.' + description: 'Optional: mode bits + used to set permissions on this + file. Must be an octal value between + 0000 and 0777 or a decimal value + between 0 and 511. YAML accepts + both octal and decimal values, + JSON requires decimal values for + mode bits. If not specified, the + volume defaultMode will be used. + This might be in conflict with + other options that affect the + file mode, like fsGroup, and the + result can be other mode bits + set.' format: int32 type: integer path: - description: path is the relative - path of the file to map the key - to. May not be an absolute path. - May not contain the path element - '..'. May not start with the string + description: The relative path of + the file to map the key to. May + not be an absolute path. May not + contain the path element '..'. + May not start with the string '..'. type: string required: @@ -7117,13 +6010,13 @@ spec: kind, uid?' type: string optional: - description: optional specify whether - the ConfigMap or its keys must be defined + description: Specify whether the ConfigMap + or its keys must be defined type: boolean type: object downwardAPI: - description: downwardAPI information about - the downwardAPI data to project + description: information about the downwardAPI + data to project properties: items: description: Items is a list of DownwardAPIVolume @@ -7213,53 +6106,53 @@ spec: type: array type: object secret: - description: secret information about the - secret data to project + description: information about the secret + data to project properties: items: - description: items if unspecified, each - key-value pair in the Data field of - the referenced Secret will be projected - into the volume as a file whose name - is the key and content is the value. - If specified, the listed keys will be - projected into the specified paths, - and unlisted keys will not be present. - If a key is specified which is not present - in the Secret, the volume setup will - error unless it is marked optional. - Paths must be relative and may not contain - the '..' path or start with '..'. + description: If unspecified, each key-value + pair in the Data field of the referenced + Secret will be projected into the volume + as a file whose name is the key and + content is the value. If specified, + the listed keys will be projected into + the specified paths, and unlisted keys + will not be present. If a key is specified + which is not present in the Secret, + the volume setup will error unless it + is marked optional. Paths must be relative + and may not contain the '..' path or + start with '..'. items: description: Maps a string key to a path within a volume. properties: key: - description: key is the key to project. + description: The key to project. type: string mode: - description: 'mode is Optional: - mode bits used to set permissions - on this file. Must be an octal - value between 0000 and 0777 or - a decimal value between 0 and - 511. YAML accepts both octal and - decimal values, JSON requires - decimal values for mode bits. - If not specified, the volume defaultMode - will be used. This might be in - conflict with other options that - affect the file mode, like fsGroup, - and the result can be other mode - bits set.' + description: 'Optional: mode bits + used to set permissions on this + file. Must be an octal value between + 0000 and 0777 or a decimal value + between 0 and 511. YAML accepts + both octal and decimal values, + JSON requires decimal values for + mode bits. If not specified, the + volume defaultMode will be used. + This might be in conflict with + other options that affect the + file mode, like fsGroup, and the + result can be other mode bits + set.' format: int32 type: integer path: - description: path is the relative - path of the file to map the key - to. May not be an absolute path. - May not contain the path element - '..'. May not start with the string + description: The relative path of + the file to map the key to. May + not be an absolute path. May not + contain the path element '..'. + May not start with the string '..'. type: string required: @@ -7274,16 +6167,16 @@ spec: kind, uid?' type: string optional: - description: optional field specify whether - the Secret or its key must be defined + description: Specify whether the Secret + or its key must be defined type: boolean type: object serviceAccountToken: - description: serviceAccountToken is information - about the serviceAccountToken data to project + description: information about the serviceAccountToken + data to project properties: audience: - description: audience is the intended + description: Audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience @@ -7292,7 +6185,7 @@ spec: the identifier of the apiserver. type: string expirationSeconds: - description: expirationSeconds is the + description: ExpirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume @@ -7306,7 +6199,7 @@ spec: format: int64 type: integer path: - description: path is the path relative + description: Path is the path relative to the mount point of the file to project the token into. type: string @@ -7317,36 +6210,36 @@ spec: type: array type: object quobyte: - description: quobyte represents a Quobyte mount on the + description: Quobyte represents a Quobyte mount on the host that shares a pod's lifetime properties: group: - description: group to map volume access to Default + description: Group to map volume access to Default is no group type: string readOnly: - description: readOnly here will force the Quobyte + description: ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false. type: boolean registry: - description: registry represents a single or multiple + description: Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes type: string tenant: - description: tenant owning the given Quobyte volume + description: Tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin type: string user: - description: user to map volume access to Defaults + description: User to map volume access to Defaults to serivceaccount user type: string volume: - description: volume is a string that references + description: Volume is a string that references an already created Quobyte volume by name. type: string required: @@ -7354,46 +6247,44 @@ spec: - volume type: object rbd: - description: 'rbd represents a Rados Block Device mount + description: 'RBD represents a Rados Block Device mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' properties: fsType: - description: 'fsType is the filesystem type of the - volume that you want to mount. Tip: Ensure that - the filesystem type is supported by the host operating - system. Examples: "ext4", "xfs", "ntfs". Implicitly - inferred to be "ext4" if unspecified. More info: - https://kubernetes.io/docs/concepts/storage/volumes#rbd + description: 'Filesystem type of the volume that + you want to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd TODO: how do we prevent errors in the filesystem from compromising the machine' type: string image: - description: 'image is the rados image name. More - info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string keyring: - description: 'keyring is the path to key ring for + description: 'Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string monitors: - description: 'monitors is a collection of Ceph monitors. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'A collection of Ceph monitors. More + info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' items: type: string type: array pool: - description: 'pool is the rados pool name. Default - is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'The rados pool name. Default is rbd. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string readOnly: - description: 'readOnly here will force the ReadOnly + description: 'ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: boolean secretRef: - description: 'secretRef is name of the authentication + description: 'SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' properties: @@ -7405,38 +6296,37 @@ spec: type: string type: object user: - description: 'user is the rados user name. Default - is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'The rados user name. Default is admin. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string required: - image - monitors type: object scaleIO: - description: scaleIO represents a ScaleIO persistent + description: ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. - Must be a filesystem type supported by the host - operating system. Ex. "ext4", "xfs", "ntfs". Default - is "xfs". + description: Filesystem type to mount. Must be a + filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Default is + "xfs". type: string gateway: - description: gateway is the host address of the - ScaleIO API Gateway. + description: The host address of the ScaleIO API + Gateway. type: string protectionDomain: - description: protectionDomain is the name of the - ScaleIO Protection Domain for the configured storage. + description: The name of the ScaleIO Protection + Domain for the configured storage. type: string readOnly: - description: readOnly Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting - in VolumeMounts. + description: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef references to the secret + description: SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail. @@ -7449,26 +6339,26 @@ spec: type: string type: object sslEnabled: - description: sslEnabled Flag enable/disable SSL - communication with Gateway, default false + description: Flag to enable/disable SSL communication + with Gateway, default false type: boolean storageMode: - description: storageMode indicates whether the storage - for a volume should be ThickProvisioned or ThinProvisioned. + description: Indicates whether the storage for a + volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. type: string storagePool: - description: storagePool is the ScaleIO Storage - Pool associated with the protection domain. + description: The ScaleIO Storage Pool associated + with the protection domain. type: string system: - description: system is the name of the storage system - as configured in ScaleIO. + description: The name of the storage system as configured + in ScaleIO. type: string volumeName: - description: volumeName is the name of a volume - already created in the ScaleIO system that is - associated with this volume source. + description: The name of a volume already created + in the ScaleIO system that is associated with + this volume source. type: string required: - gateway @@ -7476,27 +6366,27 @@ spec: - system type: object secret: - description: 'secret represents a secret that should + description: 'Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' properties: defaultMode: - description: 'defaultMode is Optional: mode bits - used to set permissions on created files by default. - Must be an octal value between 0000 and 0777 or - a decimal value between 0 and 511. YAML accepts - both octal and decimal values, JSON requires decimal - values for mode bits. Defaults to 0644. Directories - within the path are not affected by this setting. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: 'Optional: mode bits used to set permissions + on created files by default. Must be an octal + value between 0000 and 0777 or a decimal value + between 0 and 511. YAML accepts both octal and + decimal values, JSON requires decimal values for + mode bits. Defaults to 0644. Directories within + the path are not affected by this setting. This + might be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' format: int32 type: integer items: - description: items If unspecified, each key-value - pair in the Data field of the referenced Secret - will be projected into the volume as a file whose - name is the key and content is the value. If specified, + description: If unspecified, each key-value pair + in the Data field of the referenced Secret will + be projected into the volume as a file whose name + is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in @@ -7509,28 +6399,26 @@ spec: a volume. properties: key: - description: key is the key to project. + description: The key to project. type: string mode: - description: 'mode is Optional: mode bits - used to set permissions on this file. Must - be an octal value between 0000 and 0777 - or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON - requires decimal values for mode bits. If - not specified, the volume defaultMode will - be used. This might be in conflict with - other options that affect the file mode, - like fsGroup, and the result can be other - mode bits set.' + description: 'Optional: mode bits used to + set permissions on this file. Must be an + octal value between 0000 and 0777 or a decimal + value between 0 and 511. YAML accepts both + octal and decimal values, JSON requires + decimal values for mode bits. If not specified, + the volume defaultMode will be used. This + might be in conflict with other options + that affect the file mode, like fsGroup, + and the result can be other mode bits set.' format: int32 type: integer path: - description: path is the relative path of - the file to map the key to. May not be an - absolute path. May not contain the path - element '..'. May not start with the string - '..'. + description: The relative path of the file + to map the key to. May not be an absolute + path. May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -7538,31 +6426,30 @@ spec: type: object type: array optional: - description: optional field specify whether the - Secret or its keys must be defined + description: Specify whether the Secret or its keys + must be defined type: boolean secretName: - description: 'secretName is the name of the secret - in the pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: 'Name of the secret in the pod''s namespace + to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' type: string type: object storageos: - description: storageOS represents a StorageOS volume + description: StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. - Must be a filesystem type supported by the host - operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + description: Filesystem type to mount. Must be a + filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). - ReadOnly here will force the ReadOnly setting - in VolumeMounts. + description: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef specifies the secret to use + description: SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted. properties: @@ -7574,12 +6461,12 @@ spec: type: string type: object volumeName: - description: volumeName is the human-readable name + description: VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace. type: string volumeNamespace: - description: volumeNamespace specifies the scope + description: VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping @@ -7591,27 +6478,26 @@ spec: type: string type: object vsphereVolume: - description: vsphereVolume represents a vSphere volume + description: VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine properties: fsType: - description: fsType is filesystem type to mount. - Must be a filesystem type supported by the host - operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + description: Filesystem type to mount. Must be a + filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string storagePolicyID: - description: storagePolicyID is the storage Policy - Based Management (SPBM) profile ID associated - with the StoragePolicyName. + description: Storage Policy Based Management (SPBM) + profile ID associated with the StoragePolicyName. type: string storagePolicyName: - description: storagePolicyName is the storage Policy - Based Management (SPBM) profile name. + description: Storage Policy Based Management (SPBM) + profile name. type: string volumePath: - description: volumePath is the path that identifies - vSphere volume vmdk + description: Path that identifies vSphere volume + vmdk type: string required: - volumePath diff --git a/bcs-scenarios/kourse/manifests/tkex.tencent.com_gamestatefulsets.yaml b/bcs-scenarios/kourse/manifests/tkex.tencent.com_gamestatefulsets.yaml index f3ebd6b1de..97940874c5 100644 --- a/bcs-scenarios/kourse/manifests/tkex.tencent.com_gamestatefulsets.yaml +++ b/bcs-scenarios/kourse/manifests/tkex.tencent.com_gamestatefulsets.yaml @@ -597,75 +597,11 @@ spec: ANDed. type: object type: object - namespaceSelector: - description: A label query over the set - of namespaces that the term applies to. - The term is applied to the union of the - namespaces selected by this field and - the ones listed in the namespaces field. - null selector and null or empty namespaces - list means "this pod's namespace". An - empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The - requirements are ANDed. - items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. - properties: - key: - description: key is the label - key that the selector applies - to. - type: string - operator: - description: operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. - This array is replaced during - a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of - {key,value} pairs. A single {key,value} - in the matchLabels map is equivalent - to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are - ANDed. - type: object - type: object namespaces: - description: namespaces specifies a static - list of namespace names that the term - applies to. The term is applied to the - union of the namespaces listed in this - field and the ones selected by namespaceSelector. - null or empty namespaces list and null - namespaceSelector means "this pod's namespace". + description: namespaces specifies which + namespaces the labelSelector applies to + (matches against); null or empty list + means "this pod's namespace" items: type: string type: array @@ -767,71 +703,10 @@ spec: only "value". The requirements are ANDed. type: object type: object - namespaceSelector: - description: A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by - this field and the ones listed in the namespaces - field. null selector and null or empty namespaces - list means "this pod's namespace". An empty - selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: operator represents a - key's relationship to a set of values. - Valid operators are In, NotIn, Exists - and DoesNotExist. - type: string - values: - description: values is an array of - string values. If the operator is - In or NotIn, the values array must - be non-empty. If the operator is - Exists or DoesNotExist, the values - array must be empty. This array - is replaced during a strategic merge - patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. - type: object - type: object namespaces: - description: namespaces specifies a static list - of namespace names that the term applies to. - The term is applied to the union of the namespaces - listed in this field and the ones selected - by namespaceSelector. null or empty namespaces - list and null namespaceSelector means "this - pod's namespace". + description: namespaces specifies which namespaces + the labelSelector applies to (matches against); + null or empty list means "this pod's namespace" items: type: string type: array @@ -933,75 +808,11 @@ spec: ANDed. type: object type: object - namespaceSelector: - description: A label query over the set - of namespaces that the term applies to. - The term is applied to the union of the - namespaces selected by this field and - the ones listed in the namespaces field. - null selector and null or empty namespaces - list means "this pod's namespace". An - empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The - requirements are ANDed. - items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. - properties: - key: - description: key is the label - key that the selector applies - to. - type: string - operator: - description: operator represents - a key's relationship to a set - of values. Valid operators are - In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. - This array is replaced during - a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of - {key,value} pairs. A single {key,value} - in the matchLabels map is equivalent - to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are - ANDed. - type: object - type: object namespaces: - description: namespaces specifies a static - list of namespace names that the term - applies to. The term is applied to the - union of the namespaces listed in this - field and the ones selected by namespaceSelector. - null or empty namespaces list and null - namespaceSelector means "this pod's namespace". + description: namespaces specifies which + namespaces the labelSelector applies to + (matches against); null or empty list + means "this pod's namespace" items: type: string type: array @@ -1103,71 +914,10 @@ spec: only "value". The requirements are ANDed. type: object type: object - namespaceSelector: - description: A label query over the set of namespaces - that the term applies to. The term is applied - to the union of the namespaces selected by - this field and the ones listed in the namespaces - field. null selector and null or empty namespaces - list means "this pod's namespace". An empty - selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: A label selector requirement - is a selector that contains values, - a key, and an operator that relates - the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: operator represents a - key's relationship to a set of values. - Valid operators are In, NotIn, Exists - and DoesNotExist. - type: string - values: - description: values is an array of - string values. If the operator is - In or NotIn, the values array must - be non-empty. If the operator is - Exists or DoesNotExist, the values - array must be empty. This array - is replaced during a strategic merge - patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator - is "In", and the values array contains - only "value". The requirements are ANDed. - type: object - type: object namespaces: - description: namespaces specifies a static list - of namespace names that the term applies to. - The term is applied to the union of the namespaces - listed in this field and the ones selected - by namespaceSelector. null or empty namespaces - list and null namespaceSelector means "this - pod's namespace". + description: namespaces specifies which namespaces + the labelSelector applies to (matches against); + null or empty list means "this pod's namespace" items: type: string type: array @@ -1200,32 +950,29 @@ spec: to run within a pod. properties: args: - description: 'Arguments to the entrypoint. The container + description: 'Arguments to the entrypoint. The docker image''s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the - reference in the input string will be unchanged. Double - $$ are reduced to a single $, which allows for escaping - the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + reference in the input string will be unchanged. The + $(VAR_NAME) syntax can be escaped with a double $$, + ie: $$(VAR_NAME). Escaped references will never be + expanded, regardless of whether the variable exists + or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array command: description: 'Entrypoint array. Not executed within - a shell. The container image''s ENTRYPOINT is used - if this is not provided. Variable references $(VAR_NAME) + a shell. The docker image''s ENTRYPOINT is used if + this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the - input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) - syntax: i.e. "$$(VAR_NAME)" will produce the string - literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists - or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array @@ -1242,16 +989,14 @@ spec: type: string value: description: 'Variable references $(VAR_NAME) - are expanded using the previously defined environment + are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. - Double $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" - will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless - of whether the variable exists or not. Defaults - to "".' + The $(VAR_NAME) syntax can be escaped with a + double $$, ie: $$(VAR_NAME). Escaped references + will never be expanded, regardless of whether + the variable exists or not. Defaults to "".' type: string valueFrom: description: Source for the environment variable's @@ -1396,7 +1141,7 @@ spec: type: object type: array image: - description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images + description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.' @@ -1421,7 +1166,9 @@ spec: info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following + should be specified. Exec specifies the action + to take. properties: command: description: Command is the command line @@ -1455,10 +1202,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. - This will be canonicalized upon - output, so case-variant names will - be understood as the same header. + description: The header field name type: string value: description: The header field value @@ -1489,11 +1233,10 @@ spec: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward - compatibility. There are no validation of - this field and lifecycle hooks will fail in - runtime when tcp handler is specified. + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' properties: host: description: 'Optional: Host name to connect @@ -1518,17 +1261,20 @@ spec: or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes - or exits. The Pod''s termination grace period - countdown begins before the PreStop hook is executed. - Regardless of the outcome of the handler, the - container will eventually terminate within the - Pod''s termination grace period (unless delayed - by finalizers). Other management of the container - blocks until the hook completes or until the termination - grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + or exits. The reason for termination is passed + to the handler. The Pod''s termination grace period + countdown begins before the PreStop hooked is + executed. Regardless of the outcome of the handler, + the container will eventually terminate within + the Pod''s termination grace period. Other management + of the container blocks until the hook completes + or until the termination grace period is reached. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following + should be specified. Exec specifies the action + to take. properties: command: description: Command is the command line @@ -1562,10 +1308,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. - This will be canonicalized upon - output, so case-variant names will - be understood as the same header. + description: The header field name type: string value: description: The header field value @@ -1596,11 +1339,10 @@ spec: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward - compatibility. There are no validation of - this field and lifecycle hooks will fail in - runtime when tcp handler is specified. + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' properties: host: description: 'Optional: Host name to connect @@ -1626,7 +1368,8 @@ spec: be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -1648,26 +1391,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -1685,10 +1408,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -1736,8 +1456,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -1754,25 +1475,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -1787,13 +1489,13 @@ spec: type: string ports: description: List of ports to expose from the container. - Not specifying a port here DOES NOT prevent that port - from being exposed. Any port which is listening on - the default "0.0.0.0" address inside a container will - be accessible from the network. Modifying this array - with strategic merge patch may corrupt the data. For - more information See https://github.com/kubernetes/kubernetes/issues/108255. - Cannot be updated. + Exposing a port here gives the system additional information + about the network connections a container uses, but + is primarily informational. Not specifying a port + here DOES NOT prevent that port from being exposed. + Any port which is listening on the default "0.0.0.0" + address inside a container will be accessible from + the network. Cannot be updated. items: description: ContainerPort represents a network port in a single container. @@ -1841,7 +1543,8 @@ spec: the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -1863,26 +1566,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -1900,10 +1583,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -1951,8 +1631,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -1969,25 +1650,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -1997,32 +1659,8 @@ spec: type: object resources: description: 'Compute Resources required by this container. - Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' properties: - claims: - description: "Claims lists the names of resources, - defined in spec.resourceClaims, that are used - by this container. \n This is an alpha field and - requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can - only be set for containers." - items: - description: ResourceClaim references one entry - in PodSpec.ResourceClaims. - properties: - name: - description: Name must match the name of one - entry in pod.spec.resourceClaims of the - Pod where this field is used. It makes that - resource available inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map limits: additionalProperties: anyOf: @@ -2031,7 +1669,7 @@ spec: pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Limits describes the maximum amount - of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object requests: additionalProperties: @@ -2044,14 +1682,13 @@ spec: of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to - an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object type: object securityContext: - description: 'SecurityContext defines the security options - the container should be run with. If set, the fields - of SecurityContext override the equivalent fields - of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + description: 'Security options the pod should run with. + More info: https://kubernetes.io/docs/concepts/policy/security-context/ + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' properties: allowPrivilegeEscalation: description: 'AllowPrivilegeEscalation controls @@ -2060,14 +1697,12 @@ spec: if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) - has CAP_SYS_ADMIN Note that this field cannot - be set when spec.os.name is windows.' + has CAP_SYS_ADMIN' type: boolean capabilities: description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities - granted by the container runtime. Note that this - field cannot be set when spec.os.name is windows. + granted by the container runtime. properties: add: description: Added capabilities @@ -2087,9 +1722,7 @@ spec: privileged: description: Run container in privileged mode. Processes in privileged containers are essentially equivalent - to root on the host. Defaults to false. Note that - this field cannot be set when spec.os.name is - windows. + to root on the host. Defaults to false. type: boolean procMount: description: procMount denotes the type of proc @@ -2097,13 +1730,11 @@ spec: DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to - be enabled. Note that this field cannot be set - when spec.os.name is windows. + be enabled. type: string readOnlyRootFilesystem: description: Whether this container has a read-only - root filesystem. Default is false. Note that this - field cannot be set when spec.os.name is windows. + root filesystem. Default is false. type: boolean runAsGroup: description: The GID to run the entrypoint of the @@ -2111,8 +1742,6 @@ spec: May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is windows. format: int64 type: integer runAsNonRoot: @@ -2132,8 +1761,7 @@ spec: in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in - SecurityContext takes precedence. Note that this - field cannot be set when spec.os.name is windows. + SecurityContext takes precedence. format: int64 type: integer seLinuxOptions: @@ -2143,8 +1771,6 @@ spec: container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is windows. properties: level: description: Level is SELinux level label that @@ -2167,8 +1793,7 @@ spec: description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container - options override the pod options. Note that this - field cannot be set when spec.os.name is windows. + options override the pod options. properties: localhostProfile: description: localhostProfile indicates a profile @@ -2196,8 +1821,6 @@ spec: from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is linux. properties: gmsaCredentialSpec: description: GMSACredentialSpec is where the @@ -2209,20 +1832,6 @@ spec: description: GMSACredentialSpecName is the name of the GMSA credential spec to use. type: string - hostProcess: - description: HostProcess determines if a container - should be run as a 'Host Process' container. - This field is alpha-level and will only be - honored by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the - feature flag will result in errors when validating - the Pod. All of a Pod's containers must have - the same effective HostProcess value (it is - not allowed to have a mix of HostProcess containers - and non-HostProcess containers). In addition, - if HostProcess is true then HostNetwork must - also be set to true. - type: boolean runAsUserName: description: The UserName in Windows to run the entrypoint of the container process. Defaults @@ -2246,7 +1855,8 @@ spec: operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -2268,26 +1878,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -2305,10 +1895,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -2356,8 +1943,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -2374,25 +1962,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -2581,45 +2150,46 @@ spec: be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. + This field is alpha-level and is only honored by servers + that enable the EphemeralContainers feature. items: - description: "An EphemeralContainer is a temporary container - that you may add to an existing Pod for user-initiated + description: An EphemeralContainer is a container that may + be added temporarily to an existing pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not - be restarted when they exit or when a Pod is removed or - restarted. The kubelet may evict a Pod if an ephemeral - container causes the Pod to exceed its resource allocation. - \n To add an ephemeral container, use the ephemeralcontainers - subresource of an existing Pod. Ephemeral containers may - not be removed or restarted." + be restarted when they exit or when a pod is removed or + restarted. If an ephemeral container causes a pod to exceed + its resource allocation, the pod may be evicted. Ephemeral + containers may not be added by directly updating the pod + spec. They must be added via the pod's ephemeralcontainers + subresource, and they will appear in the pod spec once + added. This is an alpha feature enabled by the EphemeralContainers + feature flag. properties: args: - description: 'Arguments to the entrypoint. The image''s - CMD is used if this is not provided. Variable references - $(VAR_NAME) are expanded using the container''s environment. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + description: 'Arguments to the entrypoint. The docker + image''s CMD is used if this is not provided. Variable + references $(VAR_NAME) are expanded using the container''s + environment. If a variable cannot be resolved, the + reference in the input string will be unchanged. The + $(VAR_NAME) syntax can be escaped with a double $$, + ie: $$(VAR_NAME). Escaped references will never be + expanded, regardless of whether the variable exists + or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array command: description: 'Entrypoint array. Not executed within - a shell. The image''s ENTRYPOINT is used if this is - not provided. Variable references $(VAR_NAME) are - expanded using the container''s environment. If a - variable cannot be resolved, the reference in the - input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) - syntax: i.e. "$$(VAR_NAME)" will produce the string - literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists - or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + a shell. The docker image''s ENTRYPOINT is used if + this is not provided. Variable references $(VAR_NAME) + are expanded using the container''s environment. If + a variable cannot be resolved, the reference in the + input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array @@ -2636,16 +2206,14 @@ spec: type: string value: description: 'Variable references $(VAR_NAME) - are expanded using the previously defined environment + are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. - Double $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" - will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless - of whether the variable exists or not. Defaults - to "".' + The $(VAR_NAME) syntax can be escaped with a + double $$, ie: $$(VAR_NAME). Escaped references + will never be expanded, regardless of whether + the variable exists or not. Defaults to "".' type: string valueFrom: description: Source for the environment variable's @@ -2790,7 +2358,7 @@ spec: type: object type: array image: - description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images' + description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images' type: string imagePullPolicy: description: 'Image pull policy. One of Always, Never, @@ -2811,7 +2379,9 @@ spec: info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following + should be specified. Exec specifies the action + to take. properties: command: description: Command is the command line @@ -2845,10 +2415,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. - This will be canonicalized upon - output, so case-variant names will - be understood as the same header. + description: The header field name type: string value: description: The header field value @@ -2879,11 +2446,10 @@ spec: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward - compatibility. There are no validation of - this field and lifecycle hooks will fail in - runtime when tcp handler is specified. + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' properties: host: description: 'Optional: Host name to connect @@ -2908,17 +2474,20 @@ spec: or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes - or exits. The Pod''s termination grace period - countdown begins before the PreStop hook is executed. - Regardless of the outcome of the handler, the - container will eventually terminate within the - Pod''s termination grace period (unless delayed - by finalizers). Other management of the container - blocks until the hook completes or until the termination - grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + or exits. The reason for termination is passed + to the handler. The Pod''s termination grace period + countdown begins before the PreStop hooked is + executed. Regardless of the outcome of the handler, + the container will eventually terminate within + the Pod''s termination grace period. Other management + of the container blocks until the hook completes + or until the termination grace period is reached. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following + should be specified. Exec specifies the action + to take. properties: command: description: Command is the command line @@ -2952,10 +2521,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. - This will be canonicalized upon - output, so case-variant names will - be understood as the same header. + description: The header field name type: string value: description: The header field value @@ -2986,11 +2552,10 @@ spec: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward - compatibility. There are no validation of - this field and lifecycle hooks will fail in - runtime when tcp handler is specified. + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' properties: host: description: 'Optional: Host name to connect @@ -3014,7 +2579,8 @@ spec: description: Probes are not allowed for ephemeral containers. properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -3036,26 +2602,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -3073,10 +2619,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -3124,8 +2667,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -3142,25 +2686,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -3212,15 +2737,12 @@ spec: - containerPort type: object type: array - x-kubernetes-list-map-keys: - - containerPort - - protocol - x-kubernetes-list-type: map readinessProbe: description: Probes are not allowed for ephemeral containers. properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -3242,26 +2764,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -3279,10 +2781,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -3330,8 +2829,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -3348,25 +2848,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -3379,30 +2860,6 @@ spec: containers. Ephemeral containers use spare resources already allocated to the pod. properties: - claims: - description: "Claims lists the names of resources, - defined in spec.resourceClaims, that are used - by this container. \n This is an alpha field and - requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can - only be set for containers." - items: - description: ResourceClaim references one entry - in PodSpec.ResourceClaims. - properties: - name: - description: Name must match the name of one - entry in pod.spec.resourceClaims of the - Pod where this field is used. It makes that - resource available inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map limits: additionalProperties: anyOf: @@ -3411,7 +2868,7 @@ spec: pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Limits describes the maximum amount - of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object requests: additionalProperties: @@ -3424,14 +2881,12 @@ spec: of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to - an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object type: object securityContext: - description: 'Optional: SecurityContext defines the - security options the ephemeral container should be - run with. If set, the fields of SecurityContext override - the equivalent fields of PodSecurityContext.' + description: SecurityContext is not allowed for ephemeral + containers. properties: allowPrivilegeEscalation: description: 'AllowPrivilegeEscalation controls @@ -3440,14 +2895,12 @@ spec: if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) - has CAP_SYS_ADMIN Note that this field cannot - be set when spec.os.name is windows.' + has CAP_SYS_ADMIN' type: boolean capabilities: description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities - granted by the container runtime. Note that this - field cannot be set when spec.os.name is windows. + granted by the container runtime. properties: add: description: Added capabilities @@ -3467,9 +2920,7 @@ spec: privileged: description: Run container in privileged mode. Processes in privileged containers are essentially equivalent - to root on the host. Defaults to false. Note that - this field cannot be set when spec.os.name is - windows. + to root on the host. Defaults to false. type: boolean procMount: description: procMount denotes the type of proc @@ -3477,13 +2928,11 @@ spec: DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to - be enabled. Note that this field cannot be set - when spec.os.name is windows. + be enabled. type: string readOnlyRootFilesystem: description: Whether this container has a read-only - root filesystem. Default is false. Note that this - field cannot be set when spec.os.name is windows. + root filesystem. Default is false. type: boolean runAsGroup: description: The GID to run the entrypoint of the @@ -3491,8 +2940,6 @@ spec: May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is windows. format: int64 type: integer runAsNonRoot: @@ -3512,8 +2959,7 @@ spec: in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in - SecurityContext takes precedence. Note that this - field cannot be set when spec.os.name is windows. + SecurityContext takes precedence. format: int64 type: integer seLinuxOptions: @@ -3523,8 +2969,6 @@ spec: container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is windows. properties: level: description: Level is SELinux level label that @@ -3547,8 +2991,7 @@ spec: description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container - options override the pod options. Note that this - field cannot be set when spec.os.name is windows. + options override the pod options. properties: localhostProfile: description: localhostProfile indicates a profile @@ -3576,8 +3019,6 @@ spec: from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is linux. properties: gmsaCredentialSpec: description: GMSACredentialSpec is where the @@ -3589,20 +3030,6 @@ spec: description: GMSACredentialSpecName is the name of the GMSA credential spec to use. type: string - hostProcess: - description: HostProcess determines if a container - should be run as a 'Host Process' container. - This field is alpha-level and will only be - honored by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the - feature flag will result in errors when validating - the Pod. All of a Pod's containers must have - the same effective HostProcess value (it is - not allowed to have a mix of HostProcess containers - and non-HostProcess containers). In addition, - if HostProcess is true then HostNetwork must - also be set to true. - type: boolean runAsUserName: description: The UserName in Windows to run the entrypoint of the container process. Defaults @@ -3618,7 +3045,8 @@ spec: description: Probes are not allowed for ephemeral containers. properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -3632,34 +3060,14 @@ spec: treated as live/healthy and non-zero is unhealthy. items: type: string - type: array - type: object - failureThreshold: - description: Minimum consecutive failures for the - probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. - format: int32 - type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port + type: array type: object + failureThreshold: + description: Minimum consecutive failures for the + probe to be considered failed after having succeeded. + Defaults to 3. Minimum value is 1. + format: int32 + type: integer httpGet: description: HTTPGet specifies the http request to perform. @@ -3677,10 +3085,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -3728,8 +3133,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -3746,25 +3152,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -3792,15 +3179,13 @@ spec: will never receive an EOF. Default is false type: boolean targetContainerName: - description: "If set, the name of the container from + description: If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then - the ephemeral container uses the namespaces configured - in the Pod spec. \n The container runtime must implement - support for this feature. If the runtime does not - support namespace targeting then the result of setting - this field is undefined." + the ephemeral container is run in whatever namespaces + are shared for the pod. Note that the container runtime + must support this feature. type: string terminationMessagePath: description: 'Optional: Path at which the file to which @@ -3852,8 +3237,7 @@ spec: type: array volumeMounts: description: Pod volumes to mount into the container's - filesystem. Subpath mounts are not allowed for ephemeral - containers. Cannot be updated. + filesystem. Cannot be updated. items: description: VolumeMount describes a mounting of a Volume within a container. @@ -3938,19 +3322,6 @@ spec: description: 'Use the host''s pid namespace. Optional: Default to false.' type: boolean - hostUsers: - description: 'Use the host''s user namespace. Optional: Default - to true. If set to true or not present, the pod will be - run in the host user namespace, useful for when the pod - needs a feature only available to the host user namespace, - such as loading a kernel module with CAP_SYS_MODULE. When - set to false, a new userns is created for the pod. Setting - false is useful for mitigating container breakout vulnerabilities - even allowing users to run their containers as root without - actually having root privileges on the host. This field - is alpha-level and is only honored by servers that enable - the UserNamespacesSupport feature.' - type: boolean hostname: description: Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. @@ -3960,7 +3331,8 @@ spec: to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations - for them to use. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' + for them to use. For example, in the case of docker, only + DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' items: description: LocalObjectReference contains enough information to let you locate the referenced object inside the same @@ -3992,32 +3364,29 @@ spec: to run within a pod. properties: args: - description: 'Arguments to the entrypoint. The container + description: 'Arguments to the entrypoint. The docker image''s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the - reference in the input string will be unchanged. Double - $$ are reduced to a single $, which allows for escaping - the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Cannot be updated. More info: - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + reference in the input string will be unchanged. The + $(VAR_NAME) syntax can be escaped with a double $$, + ie: $$(VAR_NAME). Escaped references will never be + expanded, regardless of whether the variable exists + or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array command: description: 'Entrypoint array. Not executed within - a shell. The container image''s ENTRYPOINT is used - if this is not provided. Variable references $(VAR_NAME) + a shell. The docker image''s ENTRYPOINT is used if + this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the - input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) - syntax: i.e. "$$(VAR_NAME)" will produce the string - literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists - or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + input string will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot be updated. + More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' items: type: string type: array @@ -4034,16 +3403,14 @@ spec: type: string value: description: 'Variable references $(VAR_NAME) - are expanded using the previously defined environment + are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. - Double $$ are reduced to a single $, which allows - for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" - will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless - of whether the variable exists or not. Defaults - to "".' + The $(VAR_NAME) syntax can be escaped with a + double $$, ie: $$(VAR_NAME). Escaped references + will never be expanded, regardless of whether + the variable exists or not. Defaults to "".' type: string valueFrom: description: Source for the environment variable's @@ -4188,7 +3555,7 @@ spec: type: object type: array image: - description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images + description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.' @@ -4213,7 +3580,9 @@ spec: info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following + should be specified. Exec specifies the action + to take. properties: command: description: Command is the command line @@ -4247,10 +3616,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. - This will be canonicalized upon - output, so case-variant names will - be understood as the same header. + description: The header field name type: string value: description: The header field value @@ -4281,11 +3647,10 @@ spec: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward - compatibility. There are no validation of - this field and lifecycle hooks will fail in - runtime when tcp handler is specified. + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' properties: host: description: 'Optional: Host name to connect @@ -4310,17 +3675,20 @@ spec: or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes - or exits. The Pod''s termination grace period - countdown begins before the PreStop hook is executed. - Regardless of the outcome of the handler, the - container will eventually terminate within the - Pod''s termination grace period (unless delayed - by finalizers). Other management of the container - blocks until the hook completes or until the termination - grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + or exits. The reason for termination is passed + to the handler. The Pod''s termination grace period + countdown begins before the PreStop hooked is + executed. Regardless of the outcome of the handler, + the container will eventually terminate within + the Pod''s termination grace period. Other management + of the container blocks until the hook completes + or until the termination grace period is reached. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following + should be specified. Exec specifies the action + to take. properties: command: description: Command is the command line @@ -4354,10 +3722,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. - This will be canonicalized upon - output, so case-variant names will - be understood as the same header. + description: The header field name type: string value: description: The header field value @@ -4388,11 +3753,10 @@ spec: - port type: object tcpSocket: - description: Deprecated. TCPSocket is NOT supported - as a LifecycleHandler and kept for the backward - compatibility. There are no validation of - this field and lifecycle hooks will fail in - runtime when tcp handler is specified. + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' properties: host: description: 'Optional: Host name to connect @@ -4418,7 +3782,8 @@ spec: be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -4440,26 +3805,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -4477,10 +3822,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -4528,8 +3870,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -4546,25 +3889,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -4579,13 +3903,13 @@ spec: type: string ports: description: List of ports to expose from the container. - Not specifying a port here DOES NOT prevent that port - from being exposed. Any port which is listening on - the default "0.0.0.0" address inside a container will - be accessible from the network. Modifying this array - with strategic merge patch may corrupt the data. For - more information See https://github.com/kubernetes/kubernetes/issues/108255. - Cannot be updated. + Exposing a port here gives the system additional information + about the network connections a container uses, but + is primarily informational. Not specifying a port + here DOES NOT prevent that port from being exposed. + Any port which is listening on the default "0.0.0.0" + address inside a container will be accessible from + the network. Cannot be updated. items: description: ContainerPort represents a network port in a single container. @@ -4633,7 +3957,8 @@ spec: the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -4655,26 +3980,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -4692,10 +3997,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -4743,8 +4045,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -4761,25 +4064,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -4789,32 +4073,8 @@ spec: type: object resources: description: 'Compute Resources required by this container. - Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' properties: - claims: - description: "Claims lists the names of resources, - defined in spec.resourceClaims, that are used - by this container. \n This is an alpha field and - requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. It can - only be set for containers." - items: - description: ResourceClaim references one entry - in PodSpec.ResourceClaims. - properties: - name: - description: Name must match the name of one - entry in pod.spec.resourceClaims of the - Pod where this field is used. It makes that - resource available inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map limits: additionalProperties: anyOf: @@ -4823,7 +4083,7 @@ spec: pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Limits describes the maximum amount - of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object requests: additionalProperties: @@ -4836,14 +4096,13 @@ spec: of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to - an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object type: object securityContext: - description: 'SecurityContext defines the security options - the container should be run with. If set, the fields - of SecurityContext override the equivalent fields - of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + description: 'Security options the pod should run with. + More info: https://kubernetes.io/docs/concepts/policy/security-context/ + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' properties: allowPrivilegeEscalation: description: 'AllowPrivilegeEscalation controls @@ -4852,14 +4111,12 @@ spec: if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) - has CAP_SYS_ADMIN Note that this field cannot - be set when spec.os.name is windows.' + has CAP_SYS_ADMIN' type: boolean capabilities: description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities - granted by the container runtime. Note that this - field cannot be set when spec.os.name is windows. + granted by the container runtime. properties: add: description: Added capabilities @@ -4879,9 +4136,7 @@ spec: privileged: description: Run container in privileged mode. Processes in privileged containers are essentially equivalent - to root on the host. Defaults to false. Note that - this field cannot be set when spec.os.name is - windows. + to root on the host. Defaults to false. type: boolean procMount: description: procMount denotes the type of proc @@ -4889,13 +4144,11 @@ spec: DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to - be enabled. Note that this field cannot be set - when spec.os.name is windows. + be enabled. type: string readOnlyRootFilesystem: description: Whether this container has a read-only - root filesystem. Default is false. Note that this - field cannot be set when spec.os.name is windows. + root filesystem. Default is false. type: boolean runAsGroup: description: The GID to run the entrypoint of the @@ -4903,8 +4156,6 @@ spec: May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is windows. format: int64 type: integer runAsNonRoot: @@ -4924,8 +4175,7 @@ spec: in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in - SecurityContext takes precedence. Note that this - field cannot be set when spec.os.name is windows. + SecurityContext takes precedence. format: int64 type: integer seLinuxOptions: @@ -4935,8 +4185,6 @@ spec: container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is windows. properties: level: description: Level is SELinux level label that @@ -4959,8 +4207,7 @@ spec: description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container - options override the pod options. Note that this - field cannot be set when spec.os.name is windows. + options override the pod options. properties: localhostProfile: description: localhostProfile indicates a profile @@ -4988,8 +4235,6 @@ spec: from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name - is linux. properties: gmsaCredentialSpec: description: GMSACredentialSpec is where the @@ -5001,20 +4246,6 @@ spec: description: GMSACredentialSpecName is the name of the GMSA credential spec to use. type: string - hostProcess: - description: HostProcess determines if a container - should be run as a 'Host Process' container. - This field is alpha-level and will only be - honored by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the - feature flag will result in errors when validating - the Pod. All of a Pod's containers must have - the same effective HostProcess value (it is - not allowed to have a mix of HostProcess containers - and non-HostProcess containers). In addition, - if HostProcess is true then HostNetwork must - also be set to true. - type: boolean runAsUserName: description: The UserName in Windows to run the entrypoint of the container process. Defaults @@ -5038,7 +4269,8 @@ spec: operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' properties: exec: - description: Exec specifies the action to take. + description: One and only one of the following should + be specified. Exec specifies the action to take. properties: command: description: Command is the command line to @@ -5060,26 +4292,6 @@ spec: Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving - a GRPC port. This is a beta field and requires - enabling GRPCContainerProbe feature gate. - properties: - port: - description: Port number of the gRPC service. - Number must be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service - to place in the gRPC HealthCheckRequest (see - https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior - is defined by gRPC." - type: string - required: - - port - type: object httpGet: description: HTTPGet specifies the http request to perform. @@ -5097,10 +4309,7 @@ spec: header to be used in HTTP probes properties: name: - description: The header field name. This - will be canonicalized upon output, so - case-variant names will be understood - as the same header. + description: The header field name type: string value: description: The header field value @@ -5148,8 +4357,9 @@ spec: format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving - a TCP port. + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' properties: host: description: 'Optional: Host name to connect @@ -5166,25 +4376,6 @@ spec: required: - port type: object - terminationGracePeriodSeconds: - description: Optional duration in seconds the pod - needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after - the processes running in the pod are sent a termination - signal and the time when the processes are forcibly - halted with a kill signal. Set this value longer - than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds - will be used. Otherwise, this value overrides - the value provided by the pod spec. Value must - be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity - to shut down). This is a beta field and requires - enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds - is used if unset. - format: int64 - type: integer timeoutSeconds: description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum @@ -5328,34 +4519,6 @@ spec: a node''s labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' type: object - x-kubernetes-map-type: atomic - os: - description: "Specifies the OS of the containers in the pod. - Some pod and container fields are restricted if this is - set. \n If the OS field is set to linux, the following fields - must be unset: -securityContext.windowsOptions \n If the - OS field is set to windows, following fields must be unset: - - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.securityContext.seLinuxOptions - - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - - spec.shareProcessNamespace - spec.securityContext.runAsUser - - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - - spec.containers[*]." - properties: - name: - description: 'Name is the name of the operating system. - The currently supported values are linux and windows. - Additional value may be defined in future and can be - one of: https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration - Clients should expect to handle additional values and - treat unrecognized values in this field as os: null' - type: string - required: - - name - type: object overhead: additionalProperties: anyOf: @@ -5373,12 +4536,15 @@ spec: is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More - info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md' + info: https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md + This field is alpha-level as of Kubernetes v1.16, and is + only honored by servers that enable the PodOverhead feature.' type: object preemptionPolicy: description: PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. - Defaults to PreemptLowerPriority if unset. + Defaults to PreemptLowerPriority if unset. This field is + beta-level, gated by the NonPreemptingPriority feature-gate. type: string priority: description: The priority value. Various system components @@ -5402,7 +4568,7 @@ spec: description: 'If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness - gates have status equal to "True" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates' + gates have status equal to "True" More info: https://git.k8s.io/enhancements/keps/sig-network/0007-pod-ready%2B%2B.md' items: description: PodReadinessGate contains the reference to a pod condition @@ -5415,60 +4581,6 @@ spec: - conditionType type: object type: array - resourceClaims: - description: "ResourceClaims defines which ResourceClaims - must be allocated and reserved before the Pod is allowed - to start. The resources will be made available to those - containers which consume them by name. \n This is an alpha - field and requires enabling the DynamicResourceAllocation - feature gate. \n This field is immutable." - items: - description: PodResourceClaim references exactly one ResourceClaim - through a ClaimSource. It adds a name to it that uniquely - identifies the ResourceClaim inside the Pod. Containers - that need access to the ResourceClaim reference it with - this name. - properties: - name: - description: Name uniquely identifies this resource - claim inside the pod. This must be a DNS_LABEL. - type: string - source: - description: Source describes where to find the ResourceClaim. - properties: - resourceClaimName: - description: ResourceClaimName is the name of a - ResourceClaim object in the same namespace as - this pod. - type: string - resourceClaimTemplateName: - description: "ResourceClaimTemplateName is the name - of a ResourceClaimTemplate object in the same - namespace as this pod. \n The template will be - used to create a new ResourceClaim, which will - be bound to this pod. When this pod is deleted, - the ResourceClaim will also be deleted. The name - of the ResourceClaim will be -, where is the PodResourceClaim.Name. - Pod validation will reject the pod if the concatenated - name is not valid for a ResourceClaim (e.g. too - long). \n An existing ResourceClaim with that - name that is not owned by the pod will not be - used for the pod to avoid using an unrelated resource - by mistake. Scheduling and pod startup are then - blocked until the unrelated ResourceClaim is removed. - \n This field is immutable and no changes will - be made to the corresponding ResourceClaim by - the control plane after creating the ResourceClaim." - type: string - type: object - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map restartPolicy: description: 'Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. @@ -5481,34 +4593,14 @@ spec: the pod will not be run. If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. - More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class' + More info: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md + This is a beta feature as of Kubernetes v1.14.' type: string schedulerName: description: If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. type: string - schedulingGates: - description: "SchedulingGates is an opaque list of values - that if specified will block scheduling the pod. More info: - \ https://git.k8s.io/enhancements/keps/sig-scheduling/3521-pod-scheduling-readiness. - \n This is an alpha-level feature enabled by PodSchedulingReadiness - feature gate." - items: - description: PodSchedulingGate is associated to a Pod to - guard its scheduling. - properties: - name: - description: Name of the scheduling gate. Each scheduling - gate must have a unique name field. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map securityContext: description: 'SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See @@ -5523,8 +4615,7 @@ spec: in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw---- \n If unset, the Kubelet will not modify the ownership and permissions of any - volume. Note that this field cannot be set when spec.os.name - is windows." + volume." format: int64 type: integer fsGroupChangePolicy: @@ -5535,16 +4626,14 @@ spec: permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are "OnRootMismatch" and "Always". If not specified, - "Always" is used. Note that this field cannot be set - when spec.os.name is windows.' + "Always" is used.' type: string runAsGroup: description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext - takes precedence for that container. Note that this - field cannot be set when spec.os.name is windows. + takes precedence for that container. format: int64 type: integer runAsNonRoot: @@ -5563,8 +4652,7 @@ spec: if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence - for that container. Note that this field cannot be set - when spec.os.name is windows. + for that container. format: int64 type: integer seLinuxOptions: @@ -5573,8 +4661,7 @@ spec: allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext - takes precedence for that container. Note that this - field cannot be set when spec.os.name is windows. + takes precedence for that container. properties: level: description: Level is SELinux level label that applies @@ -5595,8 +4682,7 @@ spec: type: object seccompProfile: description: The seccomp options to use by the containers - in this pod. Note that this field cannot be set when - spec.os.name is windows. + in this pod. properties: localhostProfile: description: localhostProfile indicates a profile @@ -5620,14 +4706,8 @@ spec: supplementalGroups: description: A list of groups applied to the first process run in each container, in addition to the container's - primary GID, the fsGroup (if specified), and group memberships - defined in the container image for the uid of the container - process. If unspecified, no additional groups are added - to any container. Note that group memberships defined - in the container image for the uid of the container - process are still effective, even if they are not included - in this list. Note that this field cannot be set when - spec.os.name is windows. + primary GID. If unspecified, no groups will be added + to any container. items: format: int64 type: integer @@ -5635,8 +4715,7 @@ spec: sysctls: description: Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by - the container runtime) might fail to launch. Note that - this field cannot be set when spec.os.name is windows. + the container runtime) might fail to launch. items: description: Sysctl defines a kernel parameter to be set @@ -5657,8 +4736,7 @@ spec: all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value - specified in SecurityContext takes precedence. Note - that this field cannot be set when spec.os.name is linux. + specified in SecurityContext takes precedence. properties: gmsaCredentialSpec: description: GMSACredentialSpec is where the GMSA @@ -5670,19 +4748,6 @@ spec: description: GMSACredentialSpecName is the name of the GMSA credential spec to use. type: string - hostProcess: - description: HostProcess determines if a container - should be run as a 'Host Process' container. This - field is alpha-level and will only be honored by - components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the feature - flag will result in errors when validating the Pod. - All of a Pod's containers must have the same effective - HostProcess value (it is not allowed to have a mix - of HostProcess containers and non-HostProcess containers). In - addition, if HostProcess is true then HostNetwork - must also be set to true. - type: boolean runAsUserName: description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified @@ -5730,10 +4795,9 @@ spec: description: Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates - stop immediately via the kill signal (no opportunity to - shut down). If this value is nil, the default grace period - will be used instead. The grace period is the duration in - seconds after the processes running in the pod are sent + delete immediately. If this value is nil, the default grace + period will be used instead. The grace period is the duration + in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults @@ -5840,100 +4904,31 @@ spec: requirements are ANDed. type: object type: object - matchLabelKeys: - description: MatchLabelKeys is a set of pod label keys - to select the pods over which spreading will be calculated. - The keys are used to lookup values from the incoming - pod labels, those key-value labels are ANDed with - labelSelector to select the group of existing pods - over which spreading will be calculated for the incoming - pod. Keys that don't exist in the incoming pod labels - will be ignored. A null or empty list means only match - against labelSelector. - items: - type: string - type: array - x-kubernetes-list-type: atomic maxSkew: description: 'MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and - the global minimum. The global minimum is the minimum - number of matching pods in an eligible domain or zero - if the number of eligible domains is less than MinDomains. - For example, in a 3-zone cluster, MaxSkew is set to - 1, and pods with the same labelSelector spread as - 2/2/1: In this case, the global minimum is 1. | zone1 - | zone2 | zone3 | | P P | P P | P | - if MaxSkew - is 1, incoming pod can only be scheduled to zone3 - to become 2/2/2; scheduling it onto zone1(zone2) would - make the ActualSkew(3-1) on zone1(zone2) violate MaxSkew(1). - - if MaxSkew is 2, incoming pod can be scheduled onto - any zone. When `whenUnsatisfiable=ScheduleAnyway`, + the global minimum. For example, in a 3-zone cluster, + MaxSkew is set to 1, and pods with the same labelSelector + spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | + - if MaxSkew is 1, incoming pod can only be scheduled + to zone3 to become 1/1/1; scheduling it onto zone1(zone2) + would make the ActualSkew(2-0) on zone1(zone2) violate + MaxSkew(1). - if MaxSkew is 2, incoming pod can be + scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It''s a required field. Default value is 1 and 0 is not allowed.' format: int32 type: integer - minDomains: - description: "MinDomains indicates a minimum number - of eligible domains. When the number of eligible domains - with matching topology keys is less than minDomains, - Pod Topology Spread treats \"global minimum\" as 0, - and then the calculation of Skew is performed. And - when the number of eligible domains with matching - topology keys equals or greater than minDomains, this - value has no effect on scheduling. As a result, when - the number of eligible domains is less than minDomains, - scheduler won't schedule more than maxSkew Pods to - those domains. If value is nil, the constraint behaves - as if MinDomains is equal to 1. Valid values are integers - greater than 0. When value is not nil, WhenUnsatisfiable - must be DoNotSchedule. \n For example, in a 3-zone - cluster, MaxSkew is set to 2, MinDomains is set to - 5 and pods with the same labelSelector spread as 2/2/2: - | zone1 | zone2 | zone3 | | P P | P P | P P | - The number of domains is less than 5(MinDomains), - so \"global minimum\" is treated as 0." - format: int32 - type: integer - nodeAffinityPolicy: - description: "NodeAffinityPolicy indicates how we will - treat Pod's nodeAffinity/nodeSelector when calculating - pod topology spread skew. Options are: - Honor: only - nodes matching nodeAffinity/nodeSelector are included - in the calculations. - Ignore: nodeAffinity/nodeSelector - are ignored. All nodes are included in the calculations. - \n If this value is nil, the behavior is equivalent - to the Honor policy. This is a beta-level feature - default enabled by the NodeInclusionPolicyInPodTopologySpread - feature flag." - type: string - nodeTaintsPolicy: - description: "NodeTaintsPolicy indicates how we will - treat node taints when calculating pod topology spread - skew. Options are: - Honor: nodes without taints, - along with tainted nodes for which the incoming pod - has a toleration, are included. - Ignore: node taints - are ignored. All nodes are included. \n If this value - is nil, the behavior is equivalent to the Ignore policy. - This is a beta-level feature default enabled by the - NodeInclusionPolicyInPodTopologySpread feature flag." - type: string topologyKey: description: TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each as a "bucket", and try - to put balanced number of pods into each bucket. We - define a domain as a particular instance of a topology. - Also, we define an eligible domain as a domain whose - nodes meet the requirements of nodeAffinityPolicy - and nodeTaintsPolicy. e.g. If TopologyKey is "kubernetes.io/hostname", - each Node is a domain of that topology. And, if TopologyKey - is "topology.kubernetes.io/zone", each zone is a domain - of that topology. It's a required field. + to put balanced number of pods into each bucket. It's + a required field. type: string whenUnsatisfiable: description: 'WhenUnsatisfiable indicates how to deal @@ -5944,7 +4939,7 @@ spec: higher precedence to topologies that would help reduce the skew. A constraint is considered "Unsatisfiable" for an incoming pod if and only if every possible - node assignment for that pod would violate "MaxSkew" + node assigment for that pod would violate "MaxSkew" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P @@ -5973,128 +4968,123 @@ spec: may be accessed by any container in the pod. properties: awsElasticBlockStore: - description: 'awsElasticBlockStore represents an AWS + description: 'AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' properties: fsType: - description: 'fsType is the filesystem type of the - volume that you want to mount. Tip: Ensure that - the filesystem type is supported by the host operating - system. Examples: "ext4", "xfs", "ntfs". Implicitly - inferred to be "ext4" if unspecified. More info: - https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + description: 'Filesystem type of the volume that + you want to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore TODO: how do we prevent errors in the filesystem from compromising the machine' type: string partition: - description: 'partition is the partition in the - volume that you want to mount. If omitted, the - default is to mount by volume name. Examples: - For volume /dev/sda1, you specify the partition - as "1". Similarly, the volume partition for /dev/sda - is "0" (or you can leave the property empty).' + description: 'The partition in the volume that you + want to mount. If omitted, the default is to mount + by volume name. Examples: For volume /dev/sda1, + you specify the partition as "1". Similarly, the + volume partition for /dev/sda is "0" (or you can + leave the property empty).' format: int32 type: integer readOnly: - description: 'readOnly value true will force the - readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: 'Specify "true" to force and set the + ReadOnly property in VolumeMounts to "true". If + omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' type: boolean volumeID: - description: 'volumeID is unique ID of the persistent - disk resource in AWS (Amazon EBS volume). More - info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: 'Unique ID of the persistent disk resource + in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' type: string required: - volumeID type: object azureDisk: - description: azureDisk represents an Azure Data Disk + description: AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. properties: cachingMode: - description: 'cachingMode is the Host Caching mode: - None, Read Only, Read Write.' + description: 'Host Caching mode: None, Read Only, + Read Write.' type: string diskName: - description: diskName is the Name of the data disk - in the blob storage + description: The Name of the data disk in the blob + storage type: string diskURI: - description: diskURI is the URI of data disk in - the blob storage + description: The URI the data disk in the blob storage type: string fsType: - description: fsType is Filesystem type to mount. - Must be a filesystem type supported by the host - operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + description: Filesystem type to mount. Must be a + filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string kind: - description: 'kind expected values are Shared: multiple - blob disks per storage account Dedicated: single - blob disk per storage account Managed: azure - managed data disk (only in managed availability - set). defaults to shared' + description: 'Expected values Shared: multiple blob + disks per storage account Dedicated: single blob + disk per storage account Managed: azure managed + data disk (only in managed availability set). + defaults to shared' type: string readOnly: - description: readOnly Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting - in VolumeMounts. + description: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts. type: boolean required: - diskName - diskURI type: object azureFile: - description: azureFile represents an Azure File Service + description: AzureFile represents an Azure File Service mount on the host and bind mount to the pod. properties: readOnly: - description: readOnly defaults to false (read/write). - ReadOnly here will force the ReadOnly setting - in VolumeMounts. + description: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts. type: boolean secretName: - description: secretName is the name of secret that - contains Azure Storage Account Name and Key + description: the name of secret that contains Azure + Storage Account Name and Key type: string shareName: - description: shareName is the azure share Name + description: Share Name type: string required: - secretName - shareName type: object cephfs: - description: cephFS represents a Ceph FS mount on the + description: CephFS represents a Ceph FS mount on the host that shares a pod's lifetime properties: monitors: - description: 'monitors is Required: Monitors is - a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'Required: Monitors is a collection + of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' items: type: string type: array path: - description: 'path is Optional: Used as the mounted - root, rather than the full Ceph tree, default - is /' + description: 'Optional: Used as the mounted root, + rather than the full Ceph tree, default is /' type: string readOnly: - description: 'readOnly is Optional: Defaults to - false (read/write). ReadOnly here will force the - ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'Optional: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: boolean secretFile: - description: 'secretFile is Optional: SecretFile - is the path to key ring for User, default is /etc/ceph/user.secret + description: 'Optional: SecretFile is the path to + key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: string secretRef: - description: 'secretRef is Optional: SecretRef is - reference to the authentication secret for User, - default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'Optional: SecretRef is reference to + the authentication secret for User, default is + empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' properties: name: description: 'Name of the referent. More info: @@ -6104,32 +5094,31 @@ spec: type: string type: object user: - description: 'user is optional: User is the rados - user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'Optional: User is the rados user name, + default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: string required: - monitors type: object cinder: - description: 'cinder represents a cinder volume attached + description: 'Cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' properties: fsType: - description: 'fsType is the filesystem type to mount. - Must be a filesystem type supported by the host - operating system. Examples: "ext4", "xfs", "ntfs". - Implicitly inferred to be "ext4" if unspecified. - More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: 'Filesystem type to mount. Must be + a filesystem type supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. More info: + https://examples.k8s.io/mysql-cinder-pd/README.md' type: string readOnly: - description: 'readOnly defaults to false (read/write). + description: 'Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' type: boolean secretRef: - description: 'secretRef is optional: points to a - secret object containing parameters used to connect - to OpenStack.' + description: 'Optional: points to a secret object + containing parameters used to connect to OpenStack.' properties: name: description: 'Name of the referent. More info: @@ -6139,32 +5128,32 @@ spec: type: string type: object volumeID: - description: 'volumeID used to identify the volume + description: 'volume id used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' type: string required: - volumeID type: object configMap: - description: configMap represents a configMap that should + description: ConfigMap represents a configMap that should populate this volume properties: defaultMode: - description: 'defaultMode is optional: mode bits - used to set permissions on created files by default. - Must be an octal value between 0000 and 0777 or - a decimal value between 0 and 511. YAML accepts - both octal and decimal values, JSON requires decimal - values for mode bits. Defaults to 0644. Directories - within the path are not affected by this setting. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: 'Optional: mode bits used to set permissions + on created files by default. Must be an octal + value between 0000 and 0777 or a decimal value + between 0 and 511. YAML accepts both octal and + decimal values, JSON requires decimal values for + mode bits. Defaults to 0644. Directories within + the path are not affected by this setting. This + might be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' format: int32 type: integer items: - description: items if unspecified, each key-value - pair in the Data field of the referenced ConfigMap + description: If unspecified, each key-value pair + in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified @@ -6179,28 +5168,26 @@ spec: a volume. properties: key: - description: key is the key to project. + description: The key to project. type: string mode: - description: 'mode is Optional: mode bits - used to set permissions on this file. Must - be an octal value between 0000 and 0777 - or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON - requires decimal values for mode bits. If - not specified, the volume defaultMode will - be used. This might be in conflict with - other options that affect the file mode, - like fsGroup, and the result can be other - mode bits set.' + description: 'Optional: mode bits used to + set permissions on this file. Must be an + octal value between 0000 and 0777 or a decimal + value between 0 and 511. YAML accepts both + octal and decimal values, JSON requires + decimal values for mode bits. If not specified, + the volume defaultMode will be used. This + might be in conflict with other options + that affect the file mode, like fsGroup, + and the result can be other mode bits set.' format: int32 type: integer path: - description: path is the relative path of - the file to map the key to. May not be an - absolute path. May not contain the path - element '..'. May not start with the string - '..'. + description: The relative path of the file + to map the key to. May not be an absolute + path. May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -6213,28 +5200,28 @@ spec: uid?' type: string optional: - description: optional specify whether the ConfigMap - or its keys must be defined + description: Specify whether the ConfigMap or its + keys must be defined type: boolean type: object csi: - description: csi (Container Storage Interface) represents + description: CSI (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). properties: driver: - description: driver is the name of the CSI driver + description: Driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster. type: string fsType: - description: fsType to mount. Ex. "ext4", "xfs", - "ntfs". If not provided, the empty value is passed - to the associated CSI driver which will determine - the default filesystem to apply. + description: Filesystem type to mount. Ex. "ext4", + "xfs", "ntfs". If not provided, the empty value + is passed to the associated CSI driver which will + determine the default filesystem to apply. type: string nodePublishSecretRef: - description: nodePublishSecretRef is a reference + description: NodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. @@ -6251,13 +5238,13 @@ spec: type: string type: object readOnly: - description: readOnly specifies a read-only configuration + description: Specifies a read-only configuration for the volume. Defaults to false (read/write). type: boolean volumeAttributes: additionalProperties: type: string - description: volumeAttributes stores driver-specific + description: VolumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values. @@ -6266,7 +5253,7 @@ spec: - driver type: object downwardAPI: - description: downwardAPI represents downward API about + description: DownwardAPI represents downward API about the pod that should populate this volume properties: defaultMode: @@ -6359,41 +5346,40 @@ spec: type: array type: object emptyDir: - description: 'emptyDir represents a temporary directory + description: 'EmptyDir represents a temporary directory that shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' properties: medium: - description: 'medium represents what type of storage - medium should back this directory. The default - is "" which means to use the node''s default medium. - Must be an empty string (default) or Memory. More - info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: 'What type of storage medium should + back this directory. The default is "" which means + to use the node''s default medium. Must be an + empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' type: string sizeLimit: anyOf: - type: integer - type: string - description: 'sizeLimit is the total amount of local - storage required for this EmptyDir volume. The - size limit is also applicable for memory medium. - The maximum usage on memory medium EmptyDir would - be the minimum value between the SizeLimit specified - here and the sum of memory limits of all containers - in a pod. The default is nil which means that - the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' + description: 'Total amount of local storage required + for this EmptyDir volume. The size limit is also + applicable for memory medium. The maximum usage + on memory medium EmptyDir would be the minimum + value between the SizeLimit specified here and + the sum of memory limits of all containers in + a pod. The default is nil which means that the + limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true type: object ephemeral: - description: "ephemeral represents a volume that is - handled by a cluster storage driver. The volume's - lifecycle is tied to the pod that defines it - it - will be created before the pod starts, and deleted - when the pod is removed. \n Use this if: a) the volume - is only needed while the pod runs, b) features of - normal volumes like restoring from snapshot or capacity - \ tracking are needed, c) the storage driver is - specified through a storage class, and d) the storage + description: "Ephemeral represents a volume that is + handled by a cluster storage driver (Alpha feature). + The volume's lifecycle is tied to the pod that defines + it - it will be created before the pod starts, and + deleted when the pod is removed. \n Use this if: a) + the volume is only needed while the pod runs, b) features + of normal volumes like restoring from snapshot or + capacity tracking are needed, c) the storage driver + is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through \ a PersistentVolumeClaim (see EphemeralVolumeSource for more information on the connection between @@ -6405,6 +5391,10 @@ spec: to be used that way - see the documentation of the driver for more information." properties: + readOnly: + description: Specifies a read-only configuration + for the volume. Defaults to false (read/write). + type: boolean volumeClaimTemplate: description: "Will be used to create a stand-alone PVC to provision the volume. The pod in which @@ -6459,71 +5449,26 @@ spec: are also valid here. properties: accessModes: - description: 'accessModes contains the desired + description: 'AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: type: string type: array dataSource: - description: 'dataSource field can be used - to specify either: * An existing VolumeSnapshot + description: 'This field can be used to + specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) - If the provisioner or an external controller - can support the specified data source, - it will create a new volume based on the - contents of the specified data source. - When the AnyVolumeDataSource feature gate - is enabled, dataSource contents will be - copied to dataSourceRef, and dataSourceRef - contents will be copied to dataSource - when dataSourceRef.namespace is not specified. - If the namespace is specified, then dataSourceRef - will not be copied to dataSource.' - properties: - apiGroup: - description: APIGroup is the group for - the resource being referenced. If - APIGroup is not specified, the specified - Kind must be in the core API group. - For any other third-party types, APIGroup - is required. - type: string - kind: - description: Kind is the type of resource - being referenced - type: string - name: - description: Name is the name of resource - being referenced - type: string - required: - - kind - - name - type: object - dataSourceRef: - description: dataSourceRef specifies the - object from which to populate the volume - with data, if a non-empty volume is desired. - This may be any object from a non-empty - API group (non core object) or a PersistentVolumeClaim - object. When this field is specified, - volume binding will only succeed if the - type of the specified object matches some - installed volume populator or dynamic - provisioner. This field will replace the - functionality of the dataSource field - and as such if both fields are non-empty, - they must have the same value. For backwards - compatibility, when namespace isn't specified - in dataSourceRef, both fields (dataSource - and dataSourceRef) will be set to the - same value automatically if one of them - is empty and the other is non-empty. When - namespace is specified in dataSourceRef, - dataSource isn't set to the same value - and must be empty. + * An existing custom resource that implements + data population (Alpha) In order to use + custom resource types that implement data + population, the AnyVolumeDataSource feature + gate must be enabled. If the provisioner + or an external controller can support + the specified data source, it will create + a new volume based on the contents of + the specified data source.' properties: apiGroup: description: APIGroup is the group for @@ -6541,59 +5486,15 @@ spec: description: Name is the name of resource being referenced type: string - namespace: - description: Namespace is the namespace - of resource being referenced Note - that when a namespace is specified, - a gateway.networking.k8s.io/ReferenceGrant - object is required in the referent - namespace to allow that namespace's - owner to accept the reference. See - the ReferenceGrant documentation for - details. (Alpha) This field requires - the CrossNamespaceVolumeDataSource - feature gate to be enabled. - type: string required: - kind - name type: object resources: - description: 'resources represents the minimum - resources the volume should have. If RecoverVolumeExpansionFailure - feature is enabled users are allowed to - specify resource requirements that are - lower than previous value but must still - be higher than capacity recorded in the - status field of the claim. More info: - https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: 'Resources represents the minimum + resources the volume should have. More + info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' properties: - claims: - description: "Claims lists the names - of resources, defined in spec.resourceClaims, - that are used by this container. \n - This is an alpha field and requires - enabling the DynamicResourceAllocation - feature gate. \n This field is immutable. - It can only be set for containers." - items: - description: ResourceClaim references - one entry in PodSpec.ResourceClaims. - properties: - name: - description: Name must match the - name of one entry in pod.spec.resourceClaims - of the Pod where this field - is used. It makes that resource - available inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map limits: additionalProperties: anyOf: @@ -6603,7 +5504,7 @@ spec: x-kubernetes-int-or-string: true description: 'Limits describes the maximum amount of compute resources allowed. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object requests: additionalProperties: @@ -6618,12 +5519,12 @@ spec: a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object type: object selector: - description: selector is a label query over - volumes to consider for binding. + description: A label query over volumes + to consider for binding. properties: matchExpressions: description: matchExpressions is a list @@ -6677,9 +5578,8 @@ spec: type: object type: object storageClassName: - description: 'storageClassName is the name - of the StorageClass required by the claim. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: 'Name of the StorageClass required + by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' type: string volumeMode: description: volumeMode defines what type @@ -6688,7 +5588,7 @@ spec: in claim spec. type: string volumeName: - description: volumeName is the binding reference + description: VolumeName is the binding reference to the PersistentVolume backing this claim. type: string type: object @@ -6697,75 +5597,74 @@ spec: type: object type: object fc: - description: fc represents a Fibre Channel resource + description: FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. properties: fsType: - description: 'fsType is the filesystem type to mount. - Must be a filesystem type supported by the host - operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + description: 'Filesystem type to mount. Must be + a filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. TODO: how do we prevent errors in the filesystem from compromising the machine' type: string lun: - description: 'lun is Optional: FC target lun number' + description: 'Optional: FC target lun number' format: int32 type: integer readOnly: - description: 'readOnly is Optional: Defaults to - false (read/write). ReadOnly here will force the - ReadOnly setting in VolumeMounts.' + description: 'Optional: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts.' type: boolean targetWWNs: - description: 'targetWWNs is Optional: FC target - worldwide names (WWNs)' + description: 'Optional: FC target worldwide names + (WWNs)' items: type: string type: array wwids: - description: 'wwids Optional: FC volume world wide - identifiers (wwids) Either wwids or combination - of targetWWNs and lun must be set, but not both - simultaneously.' + description: 'Optional: FC volume world wide identifiers + (wwids) Either wwids or combination of targetWWNs + and lun must be set, but not both simultaneously.' items: type: string type: array type: object flexVolume: - description: flexVolume represents a generic volume + description: FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. properties: driver: - description: driver is the name of the driver to + description: Driver is the name of the driver to use for this volume. type: string fsType: - description: fsType is the filesystem type to mount. - Must be a filesystem type supported by the host - operating system. Ex. "ext4", "xfs", "ntfs". The - default filesystem depends on FlexVolume script. + description: Filesystem type to mount. Must be a + filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". The default + filesystem depends on FlexVolume script. type: string options: additionalProperties: type: string - description: 'options is Optional: this field holds - extra command options if any.' + description: 'Optional: Extra command options if + any.' type: object readOnly: - description: 'readOnly is Optional: defaults to - false (read/write). ReadOnly here will force the - ReadOnly setting in VolumeMounts.' + description: 'Optional: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts.' type: boolean secretRef: - description: 'secretRef is Optional: secretRef is - reference to the secret object containing sensitive - information to pass to the plugin scripts. This - may be empty if no secret object is specified. - If the secret object contains more than one secret, - all secrets are passed to the plugin scripts.' + description: 'Optional: SecretRef is reference to + the secret object containing sensitive information + to pass to the plugin scripts. This may be empty + if no secret object is specified. If the secret + object contains more than one secret, all secrets + are passed to the plugin scripts.' properties: name: description: 'Name of the referent. More info: @@ -6778,28 +5677,28 @@ spec: - driver type: object flocker: - description: flocker represents a Flocker volume attached + description: Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running properties: datasetName: - description: datasetName is Name of the dataset - stored as metadata -> name on the dataset for - Flocker should be considered as deprecated + description: Name of the dataset stored as metadata + -> name on the dataset for Flocker should be considered + as deprecated type: string datasetUUID: - description: datasetUUID is the UUID of the dataset. - This is unique identifier of a Flocker dataset + description: UUID of the dataset. This is unique + identifier of a Flocker dataset type: string type: object gcePersistentDisk: - description: 'gcePersistentDisk represents a GCE Disk + description: 'GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' properties: fsType: - description: 'fsType is filesystem type of the volume - that you want to mount. Tip: Ensure that the filesystem + description: 'Filesystem type of the volume that + you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk @@ -6807,22 +5706,21 @@ spec: from compromising the machine' type: string partition: - description: 'partition is the partition in the - volume that you want to mount. If omitted, the - default is to mount by volume name. Examples: - For volume /dev/sda1, you specify the partition - as "1". Similarly, the volume partition for /dev/sda - is "0" (or you can leave the property empty). - More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: 'The partition in the volume that you + want to mount. If omitted, the default is to mount + by volume name. Examples: For volume /dev/sda1, + you specify the partition as "1". Similarly, the + volume partition for /dev/sda is "0" (or you can + leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' format: int32 type: integer pdName: - description: 'pdName is unique name of the PD resource - in GCE. Used to identify the disk in GCE. More - info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: 'Unique name of the PD resource in + GCE. Used to identify the disk in GCE. More info: + https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' type: string readOnly: - description: 'readOnly here will force the ReadOnly + description: 'ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' type: boolean @@ -6830,7 +5728,7 @@ spec: - pdName type: object gitRepo: - description: 'gitRepo represents a git repository at + description: 'GitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo @@ -6838,38 +5736,37 @@ spec: container.' properties: directory: - description: directory is the target directory name. - Must not contain or start with '..'. If '.' is - supplied, the volume directory will be the git - repository. Otherwise, if specified, the volume - will contain the git repository in the subdirectory - with the given name. + description: Target directory name. Must not contain + or start with '..'. If '.' is supplied, the volume + directory will be the git repository. Otherwise, + if specified, the volume will contain the git + repository in the subdirectory with the given + name. type: string repository: - description: repository is the URL + description: Repository URL type: string revision: - description: revision is the commit hash for the - specified revision. + description: Commit hash for the specified revision. type: string required: - repository type: object glusterfs: - description: 'glusterfs represents a Glusterfs mount + description: 'Glusterfs represents a Glusterfs mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' properties: endpoints: - description: 'endpoints is the endpoint name that - details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: 'EndpointsName is the endpoint name + that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: string path: - description: 'path is the Glusterfs volume path. + description: 'Path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: string readOnly: - description: 'readOnly here will force the Glusterfs + description: 'ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: boolean @@ -6878,7 +5775,7 @@ spec: - path type: object hostPath: - description: 'hostPath represents a pre-existing file + description: 'HostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are @@ -6889,73 +5786,71 @@ spec: directories as read/write.' properties: path: - description: 'path of the directory on the host. + description: 'Path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' type: string type: - description: 'type for HostPath Volume Defaults + description: 'Type for HostPath Volume Defaults to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' type: string required: - path type: object iscsi: - description: 'iscsi represents an ISCSI Disk resource + description: 'ISCSI represents an ISCSI Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' properties: chapAuthDiscovery: - description: chapAuthDiscovery defines whether support - iSCSI Discovery CHAP authentication + description: whether support iSCSI Discovery CHAP + authentication type: boolean chapAuthSession: - description: chapAuthSession defines whether support - iSCSI Session CHAP authentication + description: whether support iSCSI Session CHAP + authentication type: boolean fsType: - description: 'fsType is the filesystem type of the - volume that you want to mount. Tip: Ensure that - the filesystem type is supported by the host operating - system. Examples: "ext4", "xfs", "ntfs". Implicitly - inferred to be "ext4" if unspecified. More info: - https://kubernetes.io/docs/concepts/storage/volumes#iscsi + description: 'Filesystem type of the volume that + you want to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi TODO: how do we prevent errors in the filesystem from compromising the machine' type: string initiatorName: - description: initiatorName is the custom iSCSI Initiator - Name. If initiatorName is specified with iscsiInterface - simultaneously, new iSCSI interface : will be created for the connection. + description: Custom iSCSI Initiator Name. If initiatorName + is specified with iscsiInterface simultaneously, + new iSCSI interface : + will be created for the connection. type: string iqn: - description: iqn is the target iSCSI Qualified Name. + description: Target iSCSI Qualified Name. type: string iscsiInterface: - description: iscsiInterface is the interface Name - that uses an iSCSI transport. Defaults to 'default' - (tcp). + description: iSCSI Interface Name that uses an iSCSI + transport. Defaults to 'default' (tcp). type: string lun: - description: lun represents iSCSI Target Lun number. + description: iSCSI Target Lun number. format: int32 type: integer portals: - description: portals is the iSCSI Target Portal - List. The portal is either an IP or ip_addr:port - if the port is other than default (typically TCP - ports 860 and 3260). + description: iSCSI Target Portal List. The portal + is either an IP or ip_addr:port if the port is + other than default (typically TCP ports 860 and + 3260). items: type: string type: array readOnly: - description: readOnly here will force the ReadOnly + description: ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. type: boolean secretRef: - description: secretRef is the CHAP Secret for iSCSI - target and initiator authentication + description: CHAP Secret for iSCSI target and initiator + authentication properties: name: description: 'Name of the referent. More info: @@ -6965,10 +5860,9 @@ spec: type: string type: object targetPortal: - description: targetPortal is iSCSI Target Portal. - The Portal is either an IP or ip_addr:port if - the port is other than default (typically TCP - ports 860 and 3260). + description: iSCSI Target Portal. The Portal is + either an IP or ip_addr:port if the port is other + than default (typically TCP ports 860 and 3260). type: string required: - iqn @@ -6976,24 +5870,24 @@ spec: - targetPortal type: object name: - description: 'name of the volume. Must be a DNS_LABEL - and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + description: 'Volume''s name. Must be a DNS_LABEL and + unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' type: string nfs: - description: 'nfs represents an NFS mount on the host + description: 'NFS represents an NFS mount on the host that shares a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' properties: path: - description: 'path that is exported by the NFS server. + description: 'Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: string readOnly: - description: 'readOnly here will force the NFS export + description: 'ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: boolean server: - description: 'server is the hostname or IP address + description: 'Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: string required: @@ -7001,133 +5895,132 @@ spec: - server type: object persistentVolumeClaim: - description: 'persistentVolumeClaimVolumeSource represents + description: 'PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' properties: claimName: - description: 'claimName is the name of a PersistentVolumeClaim + description: 'ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' type: string readOnly: - description: readOnly Will force the ReadOnly setting - in VolumeMounts. Default false. + description: Will force the ReadOnly setting in + VolumeMounts. Default false. type: boolean required: - claimName type: object photonPersistentDisk: - description: photonPersistentDisk represents a PhotonController + description: PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine properties: fsType: - description: fsType is the filesystem type to mount. - Must be a filesystem type supported by the host - operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + description: Filesystem type to mount. Must be a + filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string pdID: - description: pdID is the ID that identifies Photon - Controller persistent disk + description: ID that identifies Photon Controller + persistent disk type: string required: - pdID type: object portworxVolume: - description: portworxVolume represents a portworx volume + description: PortworxVolume represents a portworx volume attached and mounted on kubelets host machine properties: fsType: - description: fSType represents the filesystem type + description: FSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). - ReadOnly here will force the ReadOnly setting - in VolumeMounts. + description: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts. type: boolean volumeID: - description: volumeID uniquely identifies a Portworx + description: VolumeID uniquely identifies a Portworx volume type: string required: - volumeID type: object projected: - description: projected items for all in one resources - secrets, configmaps, and downward API + description: Items for all in one resources secrets, + configmaps, and downward API properties: defaultMode: - description: defaultMode are the mode bits used - to set permissions on created files by default. - Must be an octal value between 0000 and 0777 or - a decimal value between 0 and 511. YAML accepts - both octal and decimal values, JSON requires decimal - values for mode bits. Directories within the path - are not affected by this setting. This might be - in conflict with other options that affect the - file mode, like fsGroup, and the result can be - other mode bits set. + description: Mode bits used to set permissions on + created files by default. Must be an octal value + between 0000 and 0777 or a decimal value between + 0 and 511. YAML accepts both octal and decimal + values, JSON requires decimal values for mode + bits. Directories within the path are not affected + by this setting. This might be in conflict with + other options that affect the file mode, like + fsGroup, and the result can be other mode bits + set. format: int32 type: integer sources: - description: sources is the list of volume projections + description: list of volume projections items: description: Projection that may be projected along with other supported volume types properties: configMap: - description: configMap information about the - configMap data to project + description: information about the configMap + data to project properties: items: - description: items if unspecified, each - key-value pair in the Data field of - the referenced ConfigMap will be projected - into the volume as a file whose name - is the key and content is the value. - If specified, the listed keys will be - projected into the specified paths, - and unlisted keys will not be present. - If a key is specified which is not present - in the ConfigMap, the volume setup will - error unless it is marked optional. - Paths must be relative and may not contain - the '..' path or start with '..'. + description: If unspecified, each key-value + pair in the Data field of the referenced + ConfigMap will be projected into the + volume as a file whose name is the key + and content is the value. If specified, + the listed keys will be projected into + the specified paths, and unlisted keys + will not be present. If a key is specified + which is not present in the ConfigMap, + the volume setup will error unless it + is marked optional. Paths must be relative + and may not contain the '..' path or + start with '..'. items: description: Maps a string key to a path within a volume. properties: key: - description: key is the key to project. + description: The key to project. type: string mode: - description: 'mode is Optional: - mode bits used to set permissions - on this file. Must be an octal - value between 0000 and 0777 or - a decimal value between 0 and - 511. YAML accepts both octal and - decimal values, JSON requires - decimal values for mode bits. - If not specified, the volume defaultMode - will be used. This might be in - conflict with other options that - affect the file mode, like fsGroup, - and the result can be other mode - bits set.' + description: 'Optional: mode bits + used to set permissions on this + file. Must be an octal value between + 0000 and 0777 or a decimal value + between 0 and 511. YAML accepts + both octal and decimal values, + JSON requires decimal values for + mode bits. If not specified, the + volume defaultMode will be used. + This might be in conflict with + other options that affect the + file mode, like fsGroup, and the + result can be other mode bits + set.' format: int32 type: integer path: - description: path is the relative - path of the file to map the key - to. May not be an absolute path. - May not contain the path element - '..'. May not start with the string + description: The relative path of + the file to map the key to. May + not be an absolute path. May not + contain the path element '..'. + May not start with the string '..'. type: string required: @@ -7142,13 +6035,13 @@ spec: kind, uid?' type: string optional: - description: optional specify whether - the ConfigMap or its keys must be defined + description: Specify whether the ConfigMap + or its keys must be defined type: boolean type: object downwardAPI: - description: downwardAPI information about - the downwardAPI data to project + description: information about the downwardAPI + data to project properties: items: description: Items is a list of DownwardAPIVolume @@ -7238,53 +6131,53 @@ spec: type: array type: object secret: - description: secret information about the - secret data to project + description: information about the secret + data to project properties: items: - description: items if unspecified, each - key-value pair in the Data field of - the referenced Secret will be projected - into the volume as a file whose name - is the key and content is the value. - If specified, the listed keys will be - projected into the specified paths, - and unlisted keys will not be present. - If a key is specified which is not present - in the Secret, the volume setup will - error unless it is marked optional. - Paths must be relative and may not contain - the '..' path or start with '..'. + description: If unspecified, each key-value + pair in the Data field of the referenced + Secret will be projected into the volume + as a file whose name is the key and + content is the value. If specified, + the listed keys will be projected into + the specified paths, and unlisted keys + will not be present. If a key is specified + which is not present in the Secret, + the volume setup will error unless it + is marked optional. Paths must be relative + and may not contain the '..' path or + start with '..'. items: description: Maps a string key to a path within a volume. properties: key: - description: key is the key to project. + description: The key to project. type: string mode: - description: 'mode is Optional: - mode bits used to set permissions - on this file. Must be an octal - value between 0000 and 0777 or - a decimal value between 0 and - 511. YAML accepts both octal and - decimal values, JSON requires - decimal values for mode bits. - If not specified, the volume defaultMode - will be used. This might be in - conflict with other options that - affect the file mode, like fsGroup, - and the result can be other mode - bits set.' + description: 'Optional: mode bits + used to set permissions on this + file. Must be an octal value between + 0000 and 0777 or a decimal value + between 0 and 511. YAML accepts + both octal and decimal values, + JSON requires decimal values for + mode bits. If not specified, the + volume defaultMode will be used. + This might be in conflict with + other options that affect the + file mode, like fsGroup, and the + result can be other mode bits + set.' format: int32 type: integer path: - description: path is the relative - path of the file to map the key - to. May not be an absolute path. - May not contain the path element - '..'. May not start with the string + description: The relative path of + the file to map the key to. May + not be an absolute path. May not + contain the path element '..'. + May not start with the string '..'. type: string required: @@ -7299,16 +6192,16 @@ spec: kind, uid?' type: string optional: - description: optional field specify whether - the Secret or its key must be defined + description: Specify whether the Secret + or its key must be defined type: boolean type: object serviceAccountToken: - description: serviceAccountToken is information - about the serviceAccountToken data to project + description: information about the serviceAccountToken + data to project properties: audience: - description: audience is the intended + description: Audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience @@ -7317,7 +6210,7 @@ spec: the identifier of the apiserver. type: string expirationSeconds: - description: expirationSeconds is the + description: ExpirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume @@ -7331,7 +6224,7 @@ spec: format: int64 type: integer path: - description: path is the path relative + description: Path is the path relative to the mount point of the file to project the token into. type: string @@ -7342,36 +6235,36 @@ spec: type: array type: object quobyte: - description: quobyte represents a Quobyte mount on the + description: Quobyte represents a Quobyte mount on the host that shares a pod's lifetime properties: group: - description: group to map volume access to Default + description: Group to map volume access to Default is no group type: string readOnly: - description: readOnly here will force the Quobyte + description: ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false. type: boolean registry: - description: registry represents a single or multiple + description: Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes type: string tenant: - description: tenant owning the given Quobyte volume + description: Tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin type: string user: - description: user to map volume access to Defaults + description: User to map volume access to Defaults to serivceaccount user type: string volume: - description: volume is a string that references + description: Volume is a string that references an already created Quobyte volume by name. type: string required: @@ -7379,46 +6272,44 @@ spec: - volume type: object rbd: - description: 'rbd represents a Rados Block Device mount + description: 'RBD represents a Rados Block Device mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' properties: fsType: - description: 'fsType is the filesystem type of the - volume that you want to mount. Tip: Ensure that - the filesystem type is supported by the host operating - system. Examples: "ext4", "xfs", "ntfs". Implicitly - inferred to be "ext4" if unspecified. More info: - https://kubernetes.io/docs/concepts/storage/volumes#rbd + description: 'Filesystem type of the volume that + you want to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd TODO: how do we prevent errors in the filesystem from compromising the machine' type: string image: - description: 'image is the rados image name. More - info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string keyring: - description: 'keyring is the path to key ring for + description: 'Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string monitors: - description: 'monitors is a collection of Ceph monitors. - More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'A collection of Ceph monitors. More + info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' items: type: string type: array pool: - description: 'pool is the rados pool name. Default - is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'The rados pool name. Default is rbd. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string readOnly: - description: 'readOnly here will force the ReadOnly + description: 'ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: boolean secretRef: - description: 'secretRef is name of the authentication + description: 'SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' properties: @@ -7430,38 +6321,37 @@ spec: type: string type: object user: - description: 'user is the rados user name. Default - is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'The rados user name. Default is admin. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string required: - image - monitors type: object scaleIO: - description: scaleIO represents a ScaleIO persistent + description: ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. - Must be a filesystem type supported by the host - operating system. Ex. "ext4", "xfs", "ntfs". Default - is "xfs". + description: Filesystem type to mount. Must be a + filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Default is + "xfs". type: string gateway: - description: gateway is the host address of the - ScaleIO API Gateway. + description: The host address of the ScaleIO API + Gateway. type: string protectionDomain: - description: protectionDomain is the name of the - ScaleIO Protection Domain for the configured storage. + description: The name of the ScaleIO Protection + Domain for the configured storage. type: string readOnly: - description: readOnly Defaults to false (read/write). - ReadOnly here will force the ReadOnly setting - in VolumeMounts. + description: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef references to the secret + description: SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail. @@ -7474,26 +6364,26 @@ spec: type: string type: object sslEnabled: - description: sslEnabled Flag enable/disable SSL - communication with Gateway, default false + description: Flag to enable/disable SSL communication + with Gateway, default false type: boolean storageMode: - description: storageMode indicates whether the storage - for a volume should be ThickProvisioned or ThinProvisioned. + description: Indicates whether the storage for a + volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. type: string storagePool: - description: storagePool is the ScaleIO Storage - Pool associated with the protection domain. + description: The ScaleIO Storage Pool associated + with the protection domain. type: string system: - description: system is the name of the storage system - as configured in ScaleIO. + description: The name of the storage system as configured + in ScaleIO. type: string volumeName: - description: volumeName is the name of a volume - already created in the ScaleIO system that is - associated with this volume source. + description: The name of a volume already created + in the ScaleIO system that is associated with + this volume source. type: string required: - gateway @@ -7501,27 +6391,27 @@ spec: - system type: object secret: - description: 'secret represents a secret that should + description: 'Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' properties: defaultMode: - description: 'defaultMode is Optional: mode bits - used to set permissions on created files by default. - Must be an octal value between 0000 and 0777 or - a decimal value between 0 and 511. YAML accepts - both octal and decimal values, JSON requires decimal - values for mode bits. Defaults to 0644. Directories - within the path are not affected by this setting. - This might be in conflict with other options that - affect the file mode, like fsGroup, and the result - can be other mode bits set.' + description: 'Optional: mode bits used to set permissions + on created files by default. Must be an octal + value between 0000 and 0777 or a decimal value + between 0 and 511. YAML accepts both octal and + decimal values, JSON requires decimal values for + mode bits. Defaults to 0644. Directories within + the path are not affected by this setting. This + might be in conflict with other options that affect + the file mode, like fsGroup, and the result can + be other mode bits set.' format: int32 type: integer items: - description: items If unspecified, each key-value - pair in the Data field of the referenced Secret - will be projected into the volume as a file whose - name is the key and content is the value. If specified, + description: If unspecified, each key-value pair + in the Data field of the referenced Secret will + be projected into the volume as a file whose name + is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in @@ -7534,28 +6424,26 @@ spec: a volume. properties: key: - description: key is the key to project. + description: The key to project. type: string mode: - description: 'mode is Optional: mode bits - used to set permissions on this file. Must - be an octal value between 0000 and 0777 - or a decimal value between 0 and 511. YAML - accepts both octal and decimal values, JSON - requires decimal values for mode bits. If - not specified, the volume defaultMode will - be used. This might be in conflict with - other options that affect the file mode, - like fsGroup, and the result can be other - mode bits set.' + description: 'Optional: mode bits used to + set permissions on this file. Must be an + octal value between 0000 and 0777 or a decimal + value between 0 and 511. YAML accepts both + octal and decimal values, JSON requires + decimal values for mode bits. If not specified, + the volume defaultMode will be used. This + might be in conflict with other options + that affect the file mode, like fsGroup, + and the result can be other mode bits set.' format: int32 type: integer path: - description: path is the relative path of - the file to map the key to. May not be an - absolute path. May not contain the path - element '..'. May not start with the string - '..'. + description: The relative path of the file + to map the key to. May not be an absolute + path. May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -7563,31 +6451,30 @@ spec: type: object type: array optional: - description: optional field specify whether the - Secret or its keys must be defined + description: Specify whether the Secret or its keys + must be defined type: boolean secretName: - description: 'secretName is the name of the secret - in the pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: 'Name of the secret in the pod''s namespace + to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' type: string type: object storageos: - description: storageOS represents a StorageOS volume + description: StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. - Must be a filesystem type supported by the host - operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + description: Filesystem type to mount. Must be a + filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). - ReadOnly here will force the ReadOnly setting - in VolumeMounts. + description: Defaults to false (read/write). ReadOnly + here will force the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef specifies the secret to use + description: SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted. properties: @@ -7599,12 +6486,12 @@ spec: type: string type: object volumeName: - description: volumeName is the human-readable name + description: VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace. type: string volumeNamespace: - description: volumeNamespace specifies the scope + description: VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping @@ -7616,27 +6503,26 @@ spec: type: string type: object vsphereVolume: - description: vsphereVolume represents a vSphere volume + description: VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine properties: fsType: - description: fsType is filesystem type to mount. - Must be a filesystem type supported by the host - operating system. Ex. "ext4", "xfs", "ntfs". Implicitly + description: Filesystem type to mount. Must be a + filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. type: string storagePolicyID: - description: storagePolicyID is the storage Policy - Based Management (SPBM) profile ID associated - with the StoragePolicyName. + description: Storage Policy Based Management (SPBM) + profile ID associated with the StoragePolicyName. type: string storagePolicyName: - description: storagePolicyName is the storage Policy - Based Management (SPBM) profile name. + description: Storage Policy Based Management (SPBM) + profile name. type: string volumePath: - description: volumePath is the path that identifies - vSphere volume vmdk + description: Path that identifies vSphere volume + vmdk type: string required: - volumePath @@ -7820,60 +6706,26 @@ spec: type: string type: object spec: - description: 'spec defines the desired characteristics of a + description: 'Spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' properties: accessModes: - description: 'accessModes contains the desired access modes + description: 'AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: type: string type: array dataSource: - description: 'dataSource field can be used to specify either: + description: 'This field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) If the provisioner - or an external controller can support the specified data - source, it will create a new volume based on the contents - of the specified data source. When the AnyVolumeDataSource - feature gate is enabled, dataSource contents will be copied - to dataSourceRef, and dataSourceRef contents will be copied - to dataSource when dataSourceRef.namespace is not specified. - If the namespace is specified, then dataSourceRef will - not be copied to dataSource.' - properties: - apiGroup: - description: APIGroup is the group for the resource - being referenced. If APIGroup is not specified, the - specified Kind must be in the core API group. For - any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - dataSourceRef: - description: dataSourceRef specifies the object from which - to populate the volume with data, if a non-empty volume - is desired. This may be any object from a non-empty API - group (non core object) or a PersistentVolumeClaim object. - When this field is specified, volume binding will only - succeed if the type of the specified object matches some - installed volume populator or dynamic provisioner. This - field will replace the functionality of the dataSource - field and as such if both fields are non-empty, they must - have the same value. For backwards compatibility, when - namespace isn't specified in dataSourceRef, both fields - (dataSource and dataSourceRef) will be set to the same - value automatically if one of them is empty and the other - is non-empty. When namespace is specified in dataSourceRef, - dataSource isn't set to the same value and must be empty. + * An existing PVC (PersistentVolumeClaim) * An existing + custom resource that implements data population (Alpha) + In order to use custom resource types that implement data + population, the AnyVolumeDataSource feature gate must + be enabled. If the provisioner or an external controller + can support the specified data source, it will create + a new volume based on the contents of the specified data + source.' properties: apiGroup: description: APIGroup is the group for the resource @@ -7887,51 +6739,14 @@ spec: name: description: Name is the name of resource being referenced type: string - namespace: - description: Namespace is the namespace of resource - being referenced Note that when a namespace is specified, - a gateway.networking.k8s.io/ReferenceGrant object - is required in the referent namespace to allow that - namespace's owner to accept the reference. See the - ReferenceGrant documentation for details. (Alpha) - This field requires the CrossNamespaceVolumeDataSource - feature gate to be enabled. - type: string required: - kind - name type: object resources: - description: 'resources represents the minimum resources - the volume should have. If RecoverVolumeExpansionFailure - feature is enabled users are allowed to specify resource - requirements that are lower than previous value but must - still be higher than capacity recorded in the status field - of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: 'Resources represents the minimum resources + the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' properties: - claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the - DynamicResourceAllocation feature gate. \n This field - is immutable. It can only be set for containers." - items: - description: ResourceClaim references one entry in - PodSpec.ResourceClaims. - properties: - name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where - this field is used. It makes that resource available - inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map limits: additionalProperties: anyOf: @@ -7940,7 +6755,7 @@ spec: pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true description: 'Limits describes the maximum amount of - compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object requests: additionalProperties: @@ -7953,12 +6768,12 @@ spec: of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined - value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' type: object type: object selector: - description: selector is a label query over volumes to consider - for binding. + description: A label query over volumes to consider for + binding. properties: matchExpressions: description: matchExpressions is a list of label selector @@ -8003,8 +6818,8 @@ spec: type: object type: object storageClassName: - description: 'storageClassName is the name of the StorageClass - required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: 'Name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' type: string volumeMode: description: volumeMode defines what type of volume is required @@ -8012,40 +6827,20 @@ spec: included in claim spec. type: string volumeName: - description: volumeName is the binding reference to the + description: VolumeName is the binding reference to the PersistentVolume backing this claim. type: string type: object status: - description: 'status represents the current information/status + description: 'Status represents the current information/status of a persistent volume claim. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' properties: accessModes: - description: 'accessModes contains the actual access modes + description: 'AccessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: type: string type: array - allocatedResources: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: allocatedResources is the storage resource - within AllocatedResources tracks the capacity allocated - to a PVC. It may be larger than the actual capacity when - a volume expansion operation is requested. For storage - quota, the larger value from allocatedResources and PVC.spec.resources - is used. If allocatedResources is not set, PVC.spec.resources - alone is used for quota calculation. If a volume expansion - capacity request is lowered, allocatedResources is only - lowered if there are no expansion operations in progress - and if the actual volume capacity is equal or lower than - the requested capacity. This is an alpha field and requires - enabling RecoverVolumeExpansionFailure feature. - type: object capacity: additionalProperties: anyOf: @@ -8053,37 +6848,36 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: capacity represents the actual resources of - the underlying volume. + description: Represents the actual resources of the underlying + volume. type: object conditions: - description: conditions is the current Condition of persistent - volume claim. If underlying persistent volume is being - resized then the Condition will be set to 'ResizeStarted'. + description: Current Condition of persistent volume claim. + If underlying persistent volume is being resized then + the Condition will be set to 'ResizeStarted'. items: description: PersistentVolumeClaimCondition contails details about state of pvc properties: lastProbeTime: - description: lastProbeTime is the time we probed the - condition. + description: Last time we probed the condition. format: date-time type: string lastTransitionTime: - description: lastTransitionTime is the time the condition - transitioned from one status to another. + description: Last time the condition transitioned + from one status to another. format: date-time type: string message: - description: message is the human-readable message - indicating details about last transition. + description: Human-readable message indicating details + about last transition. type: string reason: - description: reason is a unique, this should be a - short, machine understandable string that gives - the reason for condition's last transition. If it - reports "ResizeStarted" that means the underlying - persistent volume is being resized. + description: Unique, this should be a short, machine + understandable string that gives the reason for + condition's last transition. If it reports "ResizeStarted" + that means the underlying persistent volume is being + resized. type: string status: type: string @@ -8097,14 +6891,7 @@ spec: type: object type: array phase: - description: phase represents the current phase of PersistentVolumeClaim. - type: string - resizeStatus: - description: resizeStatus stores status of resize operation. - ResizeStatus is not set by default but when expansion - is complete resizeStatus is set to empty string by resize - controller or kubelet. This is an alpha field and requires - enabling RecoverVolumeExpansionFailure feature. + description: Phase represents the current phase of PersistentVolumeClaim. type: string type: object type: object @@ -8113,7 +6900,6 @@ spec: - selector - serviceName - template - - updateStrategy type: object status: description: GameStatefulSetStatus represents the current state of a StatefulSet. diff --git a/bcs-scenarios/kourse/pkg/apis/tkex/v1alpha1/gamedeployment_types.go b/bcs-scenarios/kourse/pkg/apis/tkex/v1alpha1/gamedeployment_types.go index 0754ee6725..97ea2596f5 100644 --- a/bcs-scenarios/kourse/pkg/apis/tkex/v1alpha1/gamedeployment_types.go +++ b/bcs-scenarios/kourse/pkg/apis/tkex/v1alpha1/gamedeployment_types.go @@ -20,13 +20,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -const ( - // KindGameDeployment is the kind of GameDeployment - KindGameDeployment = "GameDeployment" - // ResourceGameDeployment is the resource of GameDeployment - ResourceGameDeployment = "gamedeployments" -) - const ( // GameDeploymentInstanceID is a unique id for Pods and PVCs. // Each pod and the pvcs it owns have the same instance-id. diff --git a/bcs-scenarios/kourse/pkg/apis/tkex/v1alpha1/gamestatefulset_types.go b/bcs-scenarios/kourse/pkg/apis/tkex/v1alpha1/gamestatefulset_types.go index 4075157b49..66943c9ecf 100644 --- a/bcs-scenarios/kourse/pkg/apis/tkex/v1alpha1/gamestatefulset_types.go +++ b/bcs-scenarios/kourse/pkg/apis/tkex/v1alpha1/gamestatefulset_types.go @@ -20,13 +20,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -const ( - // KindGameStatefulSet is the kind of GameStatefulSet - KindGameStatefulSet = "GameStatefulSet" - // ResourceGameStatefulSet is the resource of GameStatefulSet - ResourceGameStatefulSet = "gamestatefulsets" -) - const ( // ControllerRevisionHashLabelKey controller revision hash tag ControllerRevisionHashLabelKey = "controller-revision-hash" @@ -218,7 +211,6 @@ type GameStatefulSetSpec struct { // updateStrategy indicates the StatefulSetUpdateStrategy that will be // employed to update Pods in the StatefulSet when a revision is made to // Template. - // +kubebuilder:validation:Required UpdateStrategy GameStatefulSetUpdateStrategy `json:"updateStrategy,omitempty" protobuf:"bytes,7,opt,name=updateStrategy"` // PreDeleteUpdateStrategy indicates the PreDeleteUpdateStrategy that will be employed to diff --git a/bcs-scenarios/kourse/pkg/apis/tkex/v1alpha1/hook_types.go b/bcs-scenarios/kourse/pkg/apis/tkex/v1alpha1/hook_types.go index f4d578517d..a69d7698b3 100644 --- a/bcs-scenarios/kourse/pkg/apis/tkex/v1alpha1/hook_types.go +++ b/bcs-scenarios/kourse/pkg/apis/tkex/v1alpha1/hook_types.go @@ -21,17 +21,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -const ( - // KindHookTemplate is the kind of HookTemplate - KindHookTemplate = "HookTemplate" - // ResourceHookTemplate is the resource of HookTemplate - ResourceHookTemplate = "hooktemplates" - // KindHookRun is the kind of HookRun - KindHookRun = "HookRun" - // ResourceHookRun is the resource of HookRun - ResourceHookRun = "hookruns" -) - const ( // HookPhasePending indicates the hook is pending HookPhasePending HookPhase = "Pending" diff --git a/bcs-scenarios/kourse/pkg/client/clientset/versioned/fake/register.go b/bcs-scenarios/kourse/pkg/client/clientset/versioned/fake/register.go index c719dfe00e..c4aff4f638 100644 --- a/bcs-scenarios/kourse/pkg/client/clientset/versioned/fake/register.go +++ b/bcs-scenarios/kourse/pkg/client/clientset/versioned/fake/register.go @@ -34,14 +34,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/bcs-scenarios/kourse/pkg/client/clientset/versioned/scheme/register.go b/bcs-scenarios/kourse/pkg/client/clientset/versioned/scheme/register.go index 9d5d177b32..00925757d5 100644 --- a/bcs-scenarios/kourse/pkg/client/clientset/versioned/scheme/register.go +++ b/bcs-scenarios/kourse/pkg/client/clientset/versioned/scheme/register.go @@ -34,14 +34,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. diff --git a/bcs-services/bcs-alert-manager/cmd/pkgs/eventhanlder.go b/bcs-services/bcs-alert-manager/cmd/pkgs/eventhanlder.go index 1207f4767f..fac755bce5 100644 --- a/bcs-services/bcs-alert-manager/cmd/pkgs/eventhanlder.go +++ b/bcs-services/bcs-alert-manager/cmd/pkgs/eventhanlder.go @@ -22,16 +22,16 @@ import ( ) const ( - // EventHandleConcurrencyNum xxx + // EventHandleConcurrencyNum TODO // alert-system interface concurrency EventHandleConcurrencyNum = 100 - // EventHandleAlertEventNum xxx + // EventHandleAlertEventNum TODO // alert-system handle batch EventNum EventHandleAlertEventNum = 100 - // EventHandleChanQueueLen xxx + // EventHandleChanQueueLen TODO // alert-system chan QueueLen EventHandleChanQueueLen = 1024 - // EventHandleBatchAggregation xxx + // EventHandleBatchAggregation TODO // alert-system batchAggregation switch EventHandleBatchAggregation = false ) diff --git a/bcs-services/bcs-alert-manager/go.mod b/bcs-services/bcs-alert-manager/go.mod index ebef5dc083..798ce5f527 100644 --- a/bcs-services/bcs-alert-manager/go.mod +++ b/bcs-services/bcs-alert-manager/go.mod @@ -3,32 +3,30 @@ module github.com/Tencent/bk-bcs/bcs-services/bcs-alert-manager go 1.17 replace ( + github.com/Tencent/bk-bcs/bcs-common => github.com/Tencent/bk-bcs/bcs-common v0.0.0-20210818040851-76fdc539dc33 github.com/coreos/bbolt v1.3.4 => go.etcd.io/bbolt v1.3.4 go.etcd.io/bbolt v1.3.4 => github.com/coreos/bbolt v1.3.4 google.golang.org/grpc => google.golang.org/grpc v1.26.0 ) require ( - github.com/Tencent/bk-bcs/bcs-common v0.0.0-20230612022433-f63b3b850fe2 + github.com/Tencent/bk-bcs/bcs-common v0.0.0-20210818040851-76fdc539dc33 github.com/envoyproxy/protoc-gen-validate v0.1.0 - github.com/golang/glog v1.0.0 - github.com/golang/protobuf v1.5.2 - github.com/google/uuid v1.3.0 + github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b + github.com/golang/protobuf v1.4.3 + github.com/google/uuid v1.1.4 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/micro/go-micro/v2 v2.9.1 github.com/parnurzeal/gorequest v0.2.16 - github.com/prometheus/client_golang v1.11.0 - google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 - google.golang.org/grpc v1.46.0 - k8s.io/api v0.23.1 + github.com/prometheus/client_golang v1.9.0 + google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 + google.golang.org/grpc v1.33.1 + k8s.io/api v0.18.6 ) require ( github.com/BurntSushi/toml v0.3.1 // indirect - github.com/Microsoft/go-winio v0.5.0 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect - github.com/acomagu/bufpipe v1.0.3 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bitly/go-simplejson v0.5.0 // indirect github.com/cespare/xxhash/v2 v2.1.1 // indirect @@ -38,73 +36,67 @@ require ( github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect github.com/emirpasic/gods v1.12.0 // indirect - github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/fsnotify/fsnotify v1.4.7 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/go-git/gcfg v1.5.0 // indirect - github.com/go-git/go-billy/v5 v5.3.1 // indirect - github.com/go-git/go-git/v5 v5.4.2 // indirect - github.com/go-logr/logr v1.2.3 // indirect + github.com/go-git/go-billy/v5 v5.0.0 // indirect + github.com/go-git/go-git/v5 v5.1.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/google/btree v1.0.1 // indirect - github.com/google/go-cmp v0.5.7 // indirect - github.com/google/gofuzz v1.2.0 // indirect - github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/google/gofuzz v1.1.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hpcloud/tail v1.0.0 // indirect - github.com/imdario/mergo v0.3.12 // indirect + github.com/imdario/mergo v0.3.9 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect - github.com/mattn/go-colorable v0.1.8 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/json-iterator/go v1.1.10 // indirect + github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/micro/cli/v2 v2.1.2 // indirect github.com/micro/go-plugins/broker/rabbitmq/v2 v2.9.1 // indirect github.com/micro/go-plugins/broker/stan/v2 v2.9.1 // indirect - github.com/miekg/dns v1.1.50 // indirect + github.com/miekg/dns v1.1.27 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/hashstructure v1.1.0 // indirect + github.com/mitchellh/hashstructure v1.0.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/nats-io/nats-server/v2 v2.3.0 // indirect - github.com/nats-io/nats-streaming-server v0.22.0 // indirect - github.com/nats-io/nats.go v1.11.0 // indirect - github.com/nats-io/nkeys v0.3.0 // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/nats-io/jwt v0.3.2 // indirect + github.com/nats-io/nats.go v1.10.0 // indirect + github.com/nats-io/nkeys v0.1.4 // indirect github.com/nats-io/nuid v1.0.1 // indirect - github.com/nats-io/stan.go v0.9.0 // indirect + github.com/nats-io/stan.go v0.8.2 // indirect github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.26.0 // indirect - github.com/prometheus/procfs v0.6.0 // indirect + github.com/prometheus/common v0.15.0 // indirect + github.com/prometheus/procfs v0.2.0 // indirect github.com/russross/blackfriday/v2 v2.0.1 // indirect github.com/sergi/go-diff v1.1.0 // indirect github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect - github.com/smartystreets/assertions v1.0.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/streadway/amqp v1.0.0 // indirect + github.com/streadway/amqp v0.0.0-20200108173154-1c71cc93ed71 // indirect github.com/ugorji/go/codec v1.2.3 // indirect - github.com/xanzy/ssh-agent v0.3.0 // indirect - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.17.0 // indirect - golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect - golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect - golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect - golang.org/x/sys v0.0.0-20220909162455-aba9fc2a8ff2 // indirect - golang.org/x/text v0.3.7 // indirect - golang.org/x/tools v0.1.12 // indirect - google.golang.org/protobuf v1.28.1 // indirect + github.com/xanzy/ssh-agent v0.2.1 // indirect + go.uber.org/atomic v1.5.0 // indirect + go.uber.org/multierr v1.3.0 // indirect + go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee // indirect + go.uber.org/zap v1.13.0 // indirect + golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect + golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect + golang.org/x/mod v0.3.0 // indirect + golang.org/x/net v0.0.0-20201224014010-6772e930b67b // indirect + golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e // indirect + golang.org/x/text v0.3.5 // indirect + golang.org/x/tools v0.0.0-20210106214847-113979e3529a // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc // indirect gopkg.in/fsnotify.v1 v1.4.7 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/apimachinery v0.23.1 // indirect - k8s.io/klog/v2 v2.30.0 // indirect - k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect + gopkg.in/yaml.v2 v2.3.0 // indirect + honnef.co/go/tools v0.0.1-2019.2.3 // indirect + k8s.io/apimachinery v0.18.6 // indirect + k8s.io/klog v1.0.0 // indirect moul.io/http2curl v1.0.0 // indirect - sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect + sigs.k8s.io/structured-merge-diff/v3 v3.0.0 // indirect ) diff --git a/bcs-services/bcs-alert-manager/pkg/handler/eventhandler/handler.go b/bcs-services/bcs-alert-manager/pkg/handler/eventhandler/handler.go index 6701723bcd..0c0de60267 100644 --- a/bcs-services/bcs-alert-manager/pkg/handler/eventhandler/handler.go +++ b/bcs-services/bcs-alert-manager/pkg/handler/eventhandler/handler.go @@ -332,7 +332,7 @@ func validateResourceType(resourceType string) bool { // Consume subscribe Event queue & backgroundSync func (eh *SyncEventHandler) Consume(ctx context.Context, sub msgqueue.MessageQueue) error { - unSub, _ := sub.Subscribe(msgqueue.NewHandlerWrapper("event-handler", eh.HandleQueueEvent), eh.filters, + unSub, _ := sub.Subscribe(msgqueue.HandlerWrap("event-handler", eh.HandleQueueEvent), eh.filters, msgqueue.EventSubscribeType) eh.unSub = func() { diff --git a/bcs-services/bcs-alert-manager/pkg/remote/alert/alert_test.go b/bcs-services/bcs-alert-manager/pkg/remote/alert/alert_test.go index bc5fb0880b..6b7497607c 100644 --- a/bcs-services/bcs-alert-manager/pkg/remote/alert/alert_test.go +++ b/bcs-services/bcs-alert-manager/pkg/remote/alert/alert_test.go @@ -38,7 +38,7 @@ func TestNewAlertServer(t *testing.T) { GeneratorURL: "http://xxx", Annotations: map[string]string{ "uuid": "cee84faf-7ee3-11ea-xxx", - "message": "0.gseagent.gse.30012.1586932748085923931()status changed:Staging->Failed", + "message": "0.gseagent.gse.30012.1586932748085923931(9.4.146.229)status changed:Staging->Failed", }, Labels: map[string]string{ "alertname": "测试cee84faf", diff --git a/bcs-services/bcs-alert-manager/pkg/remote/alert/types.go b/bcs-services/bcs-alert-manager/pkg/remote/alert/types.go index 9b636f1de0..fe752df3cf 100644 --- a/bcs-services/bcs-alert-manager/pkg/remote/alert/types.go +++ b/bcs-services/bcs-alert-manager/pkg/remote/alert/types.go @@ -68,7 +68,7 @@ const ( // AlarmLabelsAlarmLevel labels level AlarmLabelsAlarmLevel AlarmLabelsKey = "alarm_level" - // AlarmLabelsAlarmProjectID xxx + // AlarmLabelsAlarmProjectID TODO AlarmLabelsAlarmProjectID AlarmLabelsKey = "project_id" ) diff --git a/bcs-services/bcs-api/auth/bkiam/auth.go b/bcs-services/bcs-api/auth/bkiam/auth.go index cd34955863..08f63462b7 100644 --- a/bcs-services/bcs-api/auth/bkiam/auth.go +++ b/bcs-services/bcs-api/auth/bkiam/auth.go @@ -29,14 +29,14 @@ import ( "github.com/Tencent/bk-bcs/bcs-services/bcs-api/config" "github.com/Tencent/bk-bcs/bcs-services/bcs-api/options" - "github.com/golang-jwt/jwt/v4" + "github.com/dgrijalva/jwt-go" ) const ( // ApiGwJWTKey xxx ApiGwJWTKey = "X-Bkapi-JWT" // BcsUserTokenKey xxx - BcsUserTokenKey = "X-Bcs-User-Token" // nolint + BcsUserTokenKey = "X-Bcs-User-Token" ) // NewAuth xxx diff --git a/bcs-services/bcs-api/auth/bkiam/client.go b/bcs-services/bcs-api/auth/bkiam/client.go index bce9d32b30..f207377b89 100644 --- a/bcs-services/bcs-api/auth/bkiam/client.go +++ b/bcs-services/bcs-api/auth/bkiam/client.go @@ -28,7 +28,7 @@ import ( const ( queryAuthURI = "%s/bkiam/api/v1/perm/systems/%s/resources-perms/verify" appCodeKey = "X-BK-APP-CODE" - appSecretKey = "X-BK-APP-SECRET" // nolint + appSecretKey = "X-BK-APP-SECRET" ) // NewClient xxx diff --git a/bcs-services/bcs-api/go.mod b/bcs-services/bcs-api/go.mod index 8a6614e124..5e32b3d557 100644 --- a/bcs-services/bcs-api/go.mod +++ b/bcs-services/bcs-api/go.mod @@ -14,27 +14,27 @@ replace ( ) require ( - github.com/Tencent/bk-bcs/bcs-common v0.0.0-20230607093333-1f5cd2719e19 + github.com/Tencent/bk-bcs/bcs-common v0.0.0-20210204084037-834463e85666 github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5 github.com/deckarep/golang-set v1.7.1 + github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/emicklei/go-restful v2.15.0+incompatible github.com/ghodss/yaml v1.0.0 - github.com/golang-jwt/jwt/v4 v4.5.0 - github.com/google/go-cmp v0.5.7 + github.com/google/go-cmp v0.5.4 github.com/gorilla/mux v1.8.0 github.com/gorilla/websocket v1.4.2 github.com/iancoleman/strcase v0.1.3 github.com/jinzhu/gorm v1.9.16 - github.com/json-iterator/go v1.1.12 + github.com/json-iterator/go v1.1.10 github.com/parnurzeal/gorequest v0.2.16 - github.com/prometheus/client_golang v1.11.0 + github.com/prometheus/client_golang v1.9.0 github.com/samuel/go-zookeeper v0.0.0-20201211165307-7117e9ea2414 - github.com/sirupsen/logrus v1.8.1 - golang.org/x/net v0.0.0-20220909164309-bea034e7d591 + github.com/sirupsen/logrus v1.7.0 + golang.org/x/net v0.0.0-20210119194325-5f4716e94777 gopkg.in/go-playground/validator.v9 v9.31.0 - k8s.io/api v0.23.1 - k8s.io/apimachinery v0.23.1 + k8s.io/api v0.20.2 + k8s.io/apimachinery v0.20.2 k8s.io/client-go v11.0.0+incompatible ) @@ -44,40 +44,36 @@ require ( github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/go-playground/locales v0.13.0 // indirect github.com/go-playground/universal-translator v0.17.0 // indirect - github.com/go-sql-driver/mysql v1.6.0 // indirect + github.com/go-sql-driver/mysql v1.5.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.0.0 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect + github.com/golang/protobuf v1.4.3 // indirect github.com/google/btree v1.0.0 // indirect - github.com/google/gofuzz v1.2.0 // indirect - github.com/googleapis/gnostic v0.5.5 // indirect + github.com/google/gofuzz v1.0.0 // indirect + github.com/googleapis/gnostic v0.0.0-00010101000000-000000000000 // indirect github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/leodido/go-urn v1.2.1 // indirect - github.com/lib/pq v1.10.2 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.26.0 // indirect - github.com/prometheus/procfs v0.6.0 // indirect - github.com/smartystreets/assertions v1.0.1 // indirect + github.com/prometheus/common v0.15.0 // indirect + github.com/prometheus/procfs v0.2.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/ugorji/go/codec v1.2.3 // indirect - golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect - golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect - golang.org/x/sys v0.0.0-20220909162455-aba9fc2a8ff2 // indirect - golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect - golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.28.1 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect + golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect + golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e // indirect + golang.org/x/text v0.3.3 // indirect + golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect + google.golang.org/appengine v1.6.1 // indirect + google.golang.org/protobuf v1.23.0 // indirect gopkg.in/go-playground/assert.v1 v1.2.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v2 v2.3.0 // indirect moul.io/http2curl v1.0.0 // indirect ) diff --git a/bcs-services/bcs-api/pkg/component/auth.go b/bcs-services/bcs-api/pkg/component/auth.go index 39d09b1954..28cfde7e33 100644 --- a/bcs-services/bcs-api/pkg/component/auth.go +++ b/bcs-services/bcs-api/pkg/component/auth.go @@ -21,7 +21,7 @@ import ( const ( appCodeKey = "X-BK-APP-CODE" - appSecretKey = "X-BK-APP-SECRET" // nolint + appSecretKey = "X-BK-APP-SECRET" ) // PaaSAuth auth configuration for bk-app diff --git a/bcs-services/bcs-api/pkg/rbac/utils/utils.go b/bcs-services/bcs-api/pkg/rbac/utils/utils.go index ccb0006738..69970f9d38 100755 --- a/bcs-services/bcs-api/pkg/rbac/utils/utils.go +++ b/bcs-services/bcs-api/pkg/rbac/utils/utils.go @@ -20,12 +20,11 @@ import ( "strings" "time" - "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - "github.com/Tencent/bk-bcs/bcs-common/common/blog" m "github.com/Tencent/bk-bcs/bcs-services/bcs-api/pkg/models" "github.com/Tencent/bk-bcs/bcs-services/bcs-api/pkg/storages/sqlstore" + "k8s.io/client-go/kubernetes" + restclient "k8s.io/client-go/rest" ) // TurnCredentialsIntoConfig xxx @@ -90,7 +89,7 @@ func makeKubeclient(clusterCredentials *m.ClusterCredentials) (*kubernetes.Clien func dialTls(host string) error { conf := &tls.Config{ - InsecureSkipVerify: true, // nolint + InsecureSkipVerify: true, } conn, err := tls.Dial("tcp", host, conf) if err != nil { diff --git a/bcs-services/bcs-api/pkg/server/proxier/utils.go b/bcs-services/bcs-api/pkg/server/proxier/utils.go index f3324df173..8af0b96913 100644 --- a/bcs-services/bcs-api/pkg/server/proxier/utils.go +++ b/bcs-services/bcs-api/pkg/server/proxier/utils.go @@ -15,13 +15,11 @@ package proxier import ( "crypto/tls" + restclient "k8s.io/client-go/rest" "net/url" "strings" - restclient "k8s.io/client-go/rest" - "fmt" - m "github.com/Tencent/bk-bcs/bcs-services/bcs-api/pkg/models" ) @@ -71,7 +69,7 @@ func CheckTcpConn(addr string) error { func dialTls(host string) error { conf := &tls.Config{ - InsecureSkipVerify: true, // nolint + InsecureSkipVerify: true, } conn, err := tls.Dial("tcp", host, conf) if err != nil { diff --git a/bcs-services/bcs-api/pkg/server/resthdrs/filters/filters.go b/bcs-services/bcs-api/pkg/server/resthdrs/filters/filters.go index 701aa7e16b..a43a918952 100644 --- a/bcs-services/bcs-api/pkg/server/resthdrs/filters/filters.go +++ b/bcs-services/bcs-api/pkg/server/resthdrs/filters/filters.go @@ -17,8 +17,6 @@ package filters import ( "fmt" - "github.com/emicklei/go-restful" - "github.com/Tencent/bk-bcs/bcs-common/common" "github.com/Tencent/bk-bcs/bcs-common/common/blog" "github.com/Tencent/bk-bcs/bcs-services/bcs-api/pkg/auth" @@ -26,6 +24,7 @@ import ( "github.com/Tencent/bk-bcs/bcs-services/bcs-api/pkg/server/resthdrs/utils" "github.com/Tencent/bk-bcs/bcs-services/bcs-api/pkg/server/types" "github.com/Tencent/bk-bcs/bcs-services/bcs-api/pkg/storages/sqlstore" + "github.com/emicklei/go-restful" ) const ( @@ -34,7 +33,7 @@ const ( // CurrentCluster xxx CurrentCluster = "bke_current_cluster" // CurrentUserTokenType xxx - CurrentUserTokenType = "bke_current_usertoken_type" // nolint + CurrentUserTokenType = "bke_current_usertoken_type" ) // ====================== // diff --git a/bcs-services/bcs-api/regdiscv/regdiscv.go b/bcs-services/bcs-api/regdiscv/regdiscv.go index 62222fd1d4..05687918c2 100644 --- a/bcs-services/bcs-api/regdiscv/regdiscv.go +++ b/bcs-services/bcs-api/regdiscv/regdiscv.go @@ -232,10 +232,10 @@ func (r *RDiscover) registerAPI() error { return err } - apiPath := types.BCS_SERV_BASEPATH + "/" + types.BCS_MODULE_APISERVER + "/" + r.conf.LocalIp + path := types.BCS_SERV_BASEPATH + "/" + types.BCS_MODULE_APISERVER + "/" + r.conf.LocalIp - blog.Infof("register key %s apiserver %s", apiPath, string(data)) - return r.rd.RegisterAndWatchService(apiPath, data) + blog.Infof("register key %s apiserver %s", path, string(data)) + return r.rd.RegisterAndWatchService(path, data) } func (r *RDiscover) discoverStorageServ(servInfos []string) error { diff --git a/bcs-services/bcs-bkcmdb-synchronizer/common/mesos.go b/bcs-services/bcs-bkcmdb-synchronizer/common/mesos.go index 253505ea0a..309c38e20a 100644 --- a/bcs-services/bcs-bkcmdb-synchronizer/common/mesos.go +++ b/bcs-services/bcs-bkcmdb-synchronizer/common/mesos.go @@ -67,7 +67,7 @@ func ConvertMesosPod(mesosPod *commtypes.BcsPodStatus) (*Pod, error) { newPod.PodLabels = "{}" } - // to fulfill annotations in future + // TODO: to fullfill annotations newPod.PodAnnotations = "{}" newPod.PodIP = mesosPod.PodIP diff --git a/bcs-services/bcs-bkcmdb-synchronizer/reconciler/reconciler.go b/bcs-services/bcs-bkcmdb-synchronizer/reconciler/reconciler.go index e6a3f75160..81dca80593 100644 --- a/bcs-services/bcs-bkcmdb-synchronizer/reconciler/reconciler.go +++ b/bcs-services/bcs-bkcmdb-synchronizer/reconciler/reconciler.go @@ -88,7 +88,7 @@ func NewReconciler(clusterInfo common.Cluster, storageClient storage.Interface, } // check cluster type from cluster id - // [warning] some cluster with special name won't work + // TODO: some cluster with special name won't work var clusterType string if strings.Contains(strings.ToLower(clusterID), common.ClusterTypeMesos) { clusterType = common.ClusterTypeMesos diff --git a/bcs-services/bcs-bkcmdb-synchronizer/taskmanager/manager.go b/bcs-services/bcs-bkcmdb-synchronizer/taskmanager/manager.go index 912ebeb5d2..826c29523e 100644 --- a/bcs-services/bcs-bkcmdb-synchronizer/taskmanager/manager.go +++ b/bcs-services/bcs-bkcmdb-synchronizer/taskmanager/manager.go @@ -32,7 +32,7 @@ import ( ) const ( - // DEFAULT_CHECK_INTERVAL default check interval + // DEFAULT_CHECK_INTERVAL TODO DEFAULT_CHECK_INTERVAL = 60 ) diff --git a/bcs-services/bcs-bscp/api/api-docs/api-server/api/bk_apigw_resources.yml b/bcs-services/bcs-bscp/api/api-docs/api-server/api/bk_apigw_resources.yml index 162995cbe6..fdf95caa96 100644 --- a/bcs-services/bcs-bscp/api/api-docs/api-server/api/bk_apigw_resources.yml +++ b/bcs-services/bcs-bscp/api/api-docs/api-server/api/bk_apigw_resources.yml @@ -725,7 +725,7 @@ paths: authConfig: userVerifiedRequired: true disabledStages: [] - /api/v1/config/biz/{biz_id}/hooks: + /api/v1/config/apps/{app_id}/hooks: post: operationId: create_hook description: 创建hook脚本 @@ -741,7 +741,7 @@ paths: backend: type: HTTP method: post - path: /api/v1/config/biz/{biz_id}/hooks + path: /api/v1/config/apps/{app_id}/hooks matchSubpath: false timeout: 0 upstreams: {} @@ -749,133 +749,10 @@ paths: authConfig: userVerifiedRequired: true disabledStages: [] - - get: - operationId: list_hook - description: hook脚本列表 - tags: - - hook脚本管理 - responses: - default: - description: '' - x-bk-apigateway-resource: - isPublic: true - allowApplyPermission: true - matchSubpath: false - backend: - type: HTTP - method: get - path: /api/v1/config/biz/{biz_id}/hooks - matchSubpath: false - timeout: 0 - upstreams: { } - transformHeaders: { } - authConfig: - userVerifiedRequired: true - disabledStages: [ ] - - /api/v1/config/biz/{biz_id}/hooks/{hook_id}: - get: - operationId: get_hook - description: 获取hook脚本 - tags: - - hook脚本管理 - responses: - default: - description: '' - x-bk-apigateway-resource: - isPublic: true - allowApplyPermission: true - matchSubpath: false - backend: - type: HTTP - method: get - path: /api/v1/config/biz/{biz_id}/hooks/{hook_id} - matchSubpath: false - timeout: 0 - upstreams: { } - transformHeaders: { } - authConfig: - userVerifiedRequired: true - disabledStages: [ ] - - delete: - operationId: delete_hook - description: 删除hook脚本 - tags: - - hook脚本管理 - responses: - default: - description: '' - x-bk-apigateway-resource: - isPublic: true - allowApplyPermission: true - matchSubpath: false - backend: - type: HTTP - method: delete - path: /api/v1/config/biz/{biz_id}/hooks/{hook_id} - matchSubpath: false - timeout: 0 - upstreams: { } - transformHeaders: { } - authConfig: - userVerifiedRequired: true - disabledStages: [ ] - - /api/v1/config/biz/{biz_id}/hook_tags: - get: - operationId: list_hook_tag - description: hook脚本标签列表 - tags: - - hook脚本管理 - responses: - default: - description: '' - x-bk-apigateway-resource: - isPublic: true - allowApplyPermission: true - matchSubpath: false - backend: - type: HTTP - method: get - path: /api/v1/config/biz/{biz_id}/hooks/hook_tags - matchSubpath: false - timeout: 0 - upstreams: { } - transformHeaders: { } - authConfig: - userVerifiedRequired: true - disabledStages: [ ] - - /api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id}: - get: - operationId: get_hook_release - description: 获取hook版本 - tags: - - hook脚本管理 - responses: - default: - description: '' - x-bk-apigateway-resource: - isPublic: true - allowApplyPermission: true - matchSubpath: false - backend: - type: HTTP - method: put - path: /api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id} - matchSubpath: false - timeout: 0 - upstreams: { } - transformHeaders: { } - authConfig: - userVerifiedRequired: true - disabledStages: [ ] - + /api/v1/config/apps/{app_id}/hooks/{hook_id}: put: - operationId: update_hook_release - description: 更新hook版本 + operationId: update_hook + description: 更新hook脚本 tags: - hook脚本管理 responses: @@ -888,18 +765,17 @@ paths: backend: type: HTTP method: put - path: /api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id} + path: /api/v1/config/apps/{app_id}/hooks/{hook_id} matchSubpath: false timeout: 0 - upstreams: { } - transformHeaders: { } + upstreams: {} + transformHeaders: {} authConfig: userVerifiedRequired: true - disabledStages: [ ] - + disabledStages: [] delete: - operationId: delete_hook_release - description: 删除hook版本 + operationId: delete_hook + description: 删除hook脚本 tags: - hook脚本管理 responses: @@ -912,19 +788,18 @@ paths: backend: type: HTTP method: delete - path: /api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id} + path: /api/v1/config/apps/{app_id}/hooks/{hook_id} matchSubpath: false timeout: 0 - upstreams: { } - transformHeaders: { } + upstreams: {} + transformHeaders: {} authConfig: userVerifiedRequired: true - disabledStages: [ ] - - /api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases: + disabledStages: [] + /api/v1/config/apps/{app_id}/hooks/list: post: - operationId: create_hook_release - description: 创建hook版本 + operationId: list_hooks + description: 获取hook脚本列表 tags: - hook脚本管理 responses: @@ -937,64 +812,14 @@ paths: backend: type: HTTP method: post - path: /api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases - matchSubpath: false - timeout: 0 - upstreams: { } - transformHeaders: { } - authConfig: - userVerifiedRequired: true - disabledStages: [ ] - - get: - operationId: list_hook_release - description: hook版本列表 - tags: - - hook脚本管理 - responses: - default: - description: '' - x-bk-apigateway-resource: - isPublic: true - allowApplyPermission: true - matchSubpath: false - backend: - type: HTTP - method: post - path: /api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases - matchSubpath: false - timeout: 0 - upstreams: { } - transformHeaders: { } - authConfig: - userVerifiedRequired: true - disabledStages: [ ] - - /api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id}/publish: - put: - operationId: delete_hook_release - description: 上线hook版本 - tags: - - hook脚本管理 - responses: - default: - description: '' - x-bk-apigateway-resource: - isPublic: true - allowApplyPermission: true - matchSubpath: false - backend: - type: HTTP - method: put - path: /api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id}/publish + path: /api/v1/config/apps/{app_id}/hooks/list matchSubpath: false timeout: 0 - upstreams: { } - transformHeaders: { } + upstreams: {} + transformHeaders: {} authConfig: userVerifiedRequired: true - disabledStages: [ ] - + disabledStages: [] /api/v1/config/biz/{biz_id}/template_spaces: post: operationId: create_template_space @@ -1420,53 +1245,4 @@ paths: transformHeaders: { } authConfig: userVerifiedRequired: true - disabledStages: [ ] - - /api/v1/config/biz/{biz_id}/apps/{app_id}/config_hooks: - put: - operationId: update_config_hook - description: 更新配置脚本 - tags: - - 配置脚本管理 - responses: - default: - description: '' - x-bk-apigateway-resource: - isPublic: true - allowApplyPermission: true - matchSubpath: false - backend: - type: HTTP - method: put - path: /api/v1/config/biz/{biz_id}/apps/{app_id}/config_hooks - matchSubpath: false - timeout: 0 - upstreams: { } - transformHeaders: { } - authConfig: - userVerifiedRequired: true - disabledStages: [ ] - - get: - operationId: get_config_hook - description: 更新配置脚本 - tags: - - 配置脚本管理 - responses: - default: - description: '' - x-bk-apigateway-resource: - isPublic: true - allowApplyPermission: true - matchSubpath: false - backend: - type: HTTP - method: put - path: /api/v1/config/biz/{biz_id}/apps/{app_id}/config_hooks - matchSubpath: false - timeout: 0 - upstreams: { } - transformHeaders: { } - authConfig: - userVerifiedRequired: true disabledStages: [ ] \ No newline at end of file diff --git a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/create_hook.md b/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/create_hook.md index 892573c1d1..e35e7e94ec 100644 --- a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/create_hook.md +++ b/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/create_hook.md @@ -8,24 +8,23 @@ | 参数名称 | 参数类型 | 必选 | 描述 | | ------------ | ------------ | ------ |-------------------------------------| -| biz_id | uint32 | 是 | 业务id | -| name | string | 是 | 脚本名称 | -| release_name | string | 是 | 版本号 | -| type | string | 是 | hook脚本类型,当前类型有shell、python | -| tag | string | 否 | 脚本标签 | -| memo | string | 否 | 脚本描述 | -| content | string | 是 | 脚本内容 | +| app_id | uint32 | 是 | 应用ID | +| release_id | uint32 | 否 | 版本ID,可选项,不传或传0时则为没有发布的脚本 | +| name | string | 是 | hook脚本名称 | +| pre_type | string | 否 | 前置hook脚本类型,当前类型有shell、python | +| pre_hook | string | 否 | 前置hook脚本内容,内容格式需和脚本类型相匹配,为内容字节流对应的字符串 | +| post_type | string | 否 | 后置hook脚本类型,当前类型有shell、python | +| post_hook | string | 否 | 后置hook脚本内容,内容格式需和脚本类型相匹配,为内容字节流对应的字符串 | #### 调用示例 ```json { - "name": "myhook003", - "release_name": "v1", - "type": "shell", - "tag": "自动化脚本2", - "content": "#!/bin/bash\n\nnow=$(date +'%Y-%m-%d %H:%M:%S')\necho \"hello, start at $now\"\n", - "memo": "from datetime import datetime\nprint(\"hello, end at\", datetime.now())\n" + "name": "myhook001", + "pre_type": "shell", + "pre_hook": "#!/bin/bash\n\nnow=$(date +'%Y-%m-%d %H:%M:%S')\necho \"hello, start at $now\"\n", + "post_type": "python", + "post_hook": "from datetime import datetime\nprint(\"hello, end at\", datetime.now())\n" } ``` @@ -33,9 +32,9 @@ ```json { - "data": { - "id": 24 - } + "data": { + "id": 1 + } } ``` diff --git a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/create_hook_release.md b/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/create_hook_release.md deleted file mode 100644 index eb92b8e070..0000000000 --- a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/create_hook_release.md +++ /dev/null @@ -1,40 +0,0 @@ -### 描述 - -该接口提供版本:v1.0.0+ - - -创建hook版本,新建的版本状态为“未上线”,hook下存在一个“未上线”版本时,不能创建新的版本 - -### 输入参数 - -| 参数名称 | 参数类型 | 必选 | 描述 | -| -------- | -------- | ---- | -------- | -| biz_id | uint32 | 是 | 业务ID | -| hook_id | uint32 | 是 | 脚本ID | -| name | string | 是 | 版本号 | -| memo | string | 是 | 版本日志 | -| content | string | 是 | 脚本内容 | - -### 调用示例 - -```json -{ - "name": "myhook001", - "content": "#!/bin/bash\n\nnow=$(date +'%Y-%m-%d %H:%M:%S')\necho \"hello, start at $now\"\n", - "memo": "from datetime import datetime" -} -``` - -### 响应示例 - -```json -{ - "data": { - "id": 24 - } -} -``` - -### 响应参数说明 - -#### data \ No newline at end of file diff --git a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/delete_hook.md b/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/delete_hook.md index 68db34d9e4..3ff08eda8a 100644 --- a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/delete_hook.md +++ b/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/delete_hook.md @@ -9,7 +9,7 @@ | 参数名称 | 参数类型 | 必选 | 描述 | | ------------ | ------------ | ------ | ---------------- | | app_id | uint32 | 是 | 应用ID | -| hook_id | uint32 | 是 | hook脚本ID | +| id | uint32 | 是 | hook脚本ID | #### 调用示例 diff --git a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/delete_hook_release.md b/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/delete_hook_release.md deleted file mode 100644 index 261730f839..0000000000 --- a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/delete_hook_release.md +++ /dev/null @@ -1,34 +0,0 @@ -#### 描述 - -该接口提供版本:v1.0.0+ - -删除hook 版本,版本如果被引用则不能被删除 - -#### 输入参数 - -| 参数名称 | 参数类型 | 必选 | 描述 | -| ---------- | -------- | ---- | ------ | -| biz_id | uint32 | 是 | 业务ID | -| hook_id | uint32 | 是 | hookID | -| release_id | uint32 | 是 | 版本ID | - -#### 调用示例 - -```json - -``` - -#### 响应示例 - -```json -{ - "data": {} -} -``` - -#### 响应参数说明 - -| 参数名称 | 参数类型 | 描述 | -| -------- | -------- | -------- | -| data | object | 响应数据 | - diff --git a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/get_config_hook.md b/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/get_config_hook.md deleted file mode 100644 index 282a9e9e3f..0000000000 --- a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/get_config_hook.md +++ /dev/null @@ -1,54 +0,0 @@ -### 描述 - -该接口提供版本:v1.0.0+ - -获取服务配置脚本 - -### 输入参数 - -| 参数名称 | 参数类型 | 必选 | 描述 | -| -------- | -------- | ---- | ------ | -| biz_id | uint32 | 是 | 业务ID | -| app_id | uint32 | 是 | 应用ID | - -### 调用示例 - -### 响应示例 - -```json -{ - "data": { - "config_hook": { - "id": 1, - "spec": { - "pre_hook_id": 1, - "pre_hook_release_id": 1, - "post_hook_id": 0, - "post_hook_release_id": 0 - }, - "attachment": { - "biz_id": 5, - "app_id": 34 - }, - "revision": { - "creator": "joelei", - "reviser": "joelei", - "create_at": "2023-06-09 16:37:43", - "update_at": "2023-06-09 16:55:27" - } - } - } -} -``` - -### 响应参数说明 - -data - -| 参数名称 | 参数类型 | 必选 | 描述 | -| -------------------- | -------- | ---- | -------------- | -| pre_hook_id | int | 否 | 前置脚本ID | -| pre_hook_release_id | int | 否 | 前置脚本版本ID | -| post_hook_id | int | 否 | 后置脚本ID | -| post_hook_release_id | int | 否 | 后置脚本版本ID | - diff --git a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/get_hook.md b/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/get_hook.md deleted file mode 100644 index a17575162d..0000000000 --- a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/get_hook.md +++ /dev/null @@ -1,56 +0,0 @@ -#### 描述 - -该接口提供版本:v1.0.0+ - -创建hook脚本 - -#### 输入参数 - -| 参数名称 | 参数类型 | 必选 | 描述 | -| -------- | -------- | ---- | -------- | -| biz_id | uint32 | 是 | 业务id | -| hook_id | uint32 | 是 | 脚本名称 | - -#### 调用示例 - -#### 响应示例 - -```json -{ - "data": { - "id": 66, - "spec": { - "name": "myhook002", - "type": "shell", - "tag": "自动化脚本", - "memo": "from datetime import datetime\nprint(\"hello, end at\", datetime.now())\n", - "publish_num": 21, - "releases": { - "not_release_id": 0 - } - }, - "attachment": { - "biz_id": 5 - }, - "revision": { - "creator": "joelei", - "reviser": "joelei", - "create_at": "2023-05-25 17:25:22", - "update_at": "2023-05-25 17:25:22" - } - } -} -``` - -#### 响应参数说明 - -#### data - -| 参数名称 | 参数类型 | 描述 | -| ----------- | -------- | ---------- | -| id | uint32 | hook脚本ID | -| name | string | 脚本名 | -| type | string | 脚本类型 | -| tag | string | 脚本标签 | -| memo | string | 描述 | -| publish_num | uint32 | 发布次数 | \ No newline at end of file diff --git a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/get_hook_release.md b/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/get_hook_release.md deleted file mode 100644 index ed67bb0589..0000000000 --- a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/get_hook_release.md +++ /dev/null @@ -1,51 +0,0 @@ -#### 描述 - -该接口提供版本:v1.0.0+ - -获取hook下的版本信息 - -#### 输入参数 - -| 参数名称 | 参数类型 | 必选 | 描述 | -| ---------- | -------- | ---- | ------ | -| biz_id | uint32 | 是 | 业务ID | -| hook_id | uint32 | 是 | hookID | -| release_id | uint32 | 是 | 版本ID | - -#### 调用示例 - -```json - -``` - -#### 响应示例 - -```json -{ - "data": { - "details": { - "id": 21, - "spec": { - "name": "v2", - "content": "#!/bin/bash\n\nnow=$(date +'%Y-%m-%d %H:%M:%S')\necho \"hello, start at $now\"\n", - "publish_num": 21, - "state" : "deployed", - "momo": "v2 memo", - }, - "attachment": { - "biz_id": 5, - "hook_id": 21 - }, - "revision": { - "creator": "joelei", - "reviser": "joelei", - "create_at": "2023-05-19 17:32:09", - "update_at": "2023-05-19 17:32:09" - } - } - } -} -``` - -#### 响应参数说明 - diff --git a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/get_hook_tag.md b/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/get_hook_tag.md deleted file mode 100644 index b3d6317ca9..0000000000 --- a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/get_hook_tag.md +++ /dev/null @@ -1,40 +0,0 @@ -#### 描述 - -该接口提供版本:v1.0.0+ - -获取hook标签 - -#### 输入参数 - -| 参数名称 | 参数类型 | 必选 | 描述 | -| -------- | -------- | ---- | ------ | -| app_id | uint32 | 是 | 应用ID | - -#### 调用示例 - -```json - -``` - -#### 响应示例 - -```json -{ - "data": { - "details": [ - { - "tag" : "自动化脚本", - "counts" : 21, - } - ] - } -} -``` - -#### 响应参数说明 - -| 参数名称 | 参数类型 | 描述 | -| -------- | -------- | -------- | -| tag | string | 标签名 | -| counts | uint32 | 使用次数 | - diff --git a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/list_hook.md b/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/list_hook.md deleted file mode 100644 index c293bcceee..0000000000 --- a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/list_hook.md +++ /dev/null @@ -1,61 +0,0 @@ -#### 描述 - -该接口提供版本:v1.0.0+ - -获取脚本列表 - -#### 输入参数 - -| 参数名称 | 参数类型 | 必选 | 描述 | -| -------- | -------- | ---- | ------------------------------ | -| biz_id | uint32 | 是 | 业务ID | -| name | string | 否 | 脚本名称,模糊搜索 | -| tag | string | 否 | 启用标签搜索,“”时代表拉取全部 | -| not_tag | bool | 否 | 未分类 | -| all | bool | 否 | 是否拉取全量数据 | -| start | uint32 | 否 | 分页起始值 | -| limit | uint32 | 否 | 分页大小 | - -#### 调用示例 - -```json - -``` - -#### 响应示例 - -```json -{ - "data": { - "count": 1, - "details": [ - { - "id": 21, - "spec": { - "name": "myhook001", - "type": "shell", - "tag": "自动化测试", - "publish_num": 21, - "momo": "from datetime import datetime\nprint(\"hello, end at\", datetime.now())\n", - }, - "attachment": { - "biz_id": 5 - }, - "revision": { - "creator": "joelei", - "reviser": "joelei", - "create_at": "2023-05-19 17:32:09", - "update_at": "2023-05-19 17:32:09" - } - } - ] - } -} -``` - -#### 响应参数说明 - -| 参数名称 | 参数类型 | 描述 | -| -------- | -------- | -------- | -| data | object | 响应数据 | - diff --git a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/list_hook_release.md b/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/list_hook_release.md deleted file mode 100644 index 596d207622..0000000000 --- a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/list_hook_release.md +++ /dev/null @@ -1,67 +0,0 @@ -#### 描述 - -该接口提供版本:v1.0.0+ - -获取脚本列表 - -#### 输入参数 - -| 参数名称 | 参数类型 | 必选 | 描述 | -| --------- | -------- | ---- | ------------------------ | -| biz_id | uint32 | 是 | 业务ID | -| hook_id | uint32 | 是 | hookID | -| searchKey | string | 否 | 版本号、版本说明、创建人 | -| start | uint32 | 否 | 分页起始值 | -| limit | uint32 | 否 | 分页大小 | -| all | bool | 否 | 是否拉取全量数据 | -| state | string | 否 | 版本状态查询 | - -#### 调用示例 - -```json - -``` - -#### 响应示例 - -```json -{ - "data": { - "count": 1, - "details": [ - { - "id": 21, - "spec": { - "name": "v2", - "content": "#!/bin/bash\n\nnow=$(date +'%Y-%m-%d %H:%M:%S')\necho \"hello, start at $now\"\n", - "publish_num": 21, - "pub_state" : "not_released", - "momo": "v2 memo", - }, - "attachment": { - "biz_id": 5, - "hook_id": 21 - }, - "revision": { - "creator": "joelei", - "reviser": "joelei", - "create_at": "2023-05-19 17:32:09", - "update_at": "2023-05-19 17:32:09" - } - } - ] - } -} -``` - -#### 响应参数说明 - -| 参数名称 | 参数类型 | 描述 | -| ----------- | -------- | ------------------------------------------------------------ | -| biz_id | uint32 | 业务ID | -| name | string | 版本号 | -| memo | string | 版本日志 | -| content | string | 脚本内容 | -| publish_num | uint32 | 被引用数,发布一次+1 | -| pub_state | string | 状态,(枚举值:not_released、partial_released、full_released) | - diff --git a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/list_hook_releases_ references.md b/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/list_hook_releases_ references.md deleted file mode 100644 index ce019cad46..0000000000 --- a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/list_hook_releases_ references.md +++ /dev/null @@ -1,43 +0,0 @@ -#### 描述 - -该接口提供版本:v1.0.0+ - -获取脚本引用列表 - -#### 输入参数 - -| 参数名称 | 参数类型 | 必选 | 描述 | -| ----------- | -------- | ---- | ---------- | -| biz_id | uint32 | 是 | 业务ID | -| hook_id | uint32 | 是 | hookID | -| releases_id | uint32 | 是 | 版本id | -| start | uint32 | 否 | 分页起始值 | -| limit | uint32 | 否 | 分页大小 | - -#### 调用示例 - -```json - -``` - -#### 响应示例 - -```json -{ - "data": { - "count": 1, - "details": [ - { - "hook_release_name": "v1", - "app_name": "demo-34", - "config_release_name": "v3", - "config_release_id": 1, - "state": "not_released" - } - ] - } -} -``` - -#### 响应参数说明 - diff --git a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/publish_hook_release.md b/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/publish_hook_release.md deleted file mode 100644 index b06a75fafc..0000000000 --- a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/publish_hook_release.md +++ /dev/null @@ -1,30 +0,0 @@ -### 描述 - -该接口提供版本:v1.0.0+ - -hook版本上线,每个hook只有一个上线的版本,会把之前上线的版本状态设为已下线 - -### 输入参数 - -| 参数名称 | 参数类型 | 必选 | 描述 | -| ---------- | -------- | ---- | ------ | -| biz_id | uint32 | 是 | 业务ID | -| hook_id | uint32 | 是 | hookID | -| release_id | uint32 | 是 | 版本ID | - - -### 调用示例 - -```json - -``` - -### 响应示例 - -```json -{ - "data": {} -} -``` - -### 响应参数说明 \ No newline at end of file diff --git a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/update_config_hook.md b/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/update_config_hook.md deleted file mode 100644 index 05798b6e5e..0000000000 --- a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/update_config_hook.md +++ /dev/null @@ -1,33 +0,0 @@ -### 描述 - -该接口提供版本:v1.0.0+ - -更新服务配置脚本 - -### 输入参数 - -| 参数名称 | 参数类型 | 必选 | 描述 | -| ------------ | -------- | ---- | ---------- | -| biz_id | uint32 | 是 | 业务ID | -| app_id | uint32 | 是 | 应用ID | -| pre_hook_id | uint32 | 否 | 前置脚本id | -| post_hook_id | uint32 | 否 | 后置脚本id | - -### 调用示例 - -```json -{ - "pre_hook_id": 79, - "post_hook_id": 79, -} -``` - -### 响应示例 - -```json -{ - "data": {} -} -``` - -### 响应参数说明 diff --git a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/update_hook_releases.md b/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/update_hook_releases.md deleted file mode 100644 index 909fd148a2..0000000000 --- a/bcs-services/bcs-bscp/api/api-docs/api-server/docs/zh/update_hook_releases.md +++ /dev/null @@ -1,38 +0,0 @@ -### 描述 - -该接口提供版本:v1.0.0+ - - -更新hook版本,新建的版本状态为“未上线”,hook下存在一个“未上线”版本时,不能创建新的版本 - -### 输入参数 - -| 参数名称 | 参数类型 | 必选 | 描述 | -| -------- | -------- | ---- | -------- | -| biz_id | uint32 | 是 | 业务ID | -| hook_id | uint32 | 是 | 脚本ID | -| name | string | 是 | 版本号 | -| memo | string | 是 | 版本日志 | -| content | string | 是 | 脚本内容 | - -### 调用示例 - -```json -{ - "name": "myhook001", - "content": "#!/bin/bash\n\nnow=$(date +'%Y-%m-%d %H:%M:%S')\necho \"hello, start at $now\"\n", - "memo": "from datetime import datetime" -} -``` - -### 响应示例 - -```json -{ - "data": {} -} -``` - -### 响应参数说明 - -#### data \ No newline at end of file diff --git a/bcs-services/bcs-bscp/cmd/api-server/service/proxy.go b/bcs-services/bcs-bscp/cmd/api-server/service/proxy.go index 54f53c4997..d667324b52 100644 --- a/bcs-services/bcs-bscp/cmd/api-server/service/proxy.go +++ b/bcs-services/bcs-bscp/cmd/api-server/service/proxy.go @@ -24,6 +24,7 @@ import ( "google.golang.org/grpc/credentials/insecure" "bscp.io/pkg/cc" + "bscp.io/pkg/dal/repository" "bscp.io/pkg/iam/auth" "bscp.io/pkg/logs" pbas "bscp.io/pkg/protocol/auth-server" @@ -35,11 +36,11 @@ import ( // proxy all server's mux proxy. type proxy struct { - cfgSvrMux *runtime.ServeMux - authSvrMux http.Handler - repo *repoService - state serviced.State - authorizer auth.Authorizer + cfgSvrMux *runtime.ServeMux + authSvrMux http.Handler + repoRevProxy repository.FileApiType + state serviced.State + authorizer auth.Authorizer } // newProxy create new mux proxy. @@ -64,17 +65,17 @@ func newProxy(dis serviced.Discover) (*proxy, error) { return nil, fmt.Errorf("new authorizer failed, err: %v", err) } - repo, err := newRepoService(cc.ApiServer().Repo, authorizer) + repoProxy, err := newRepoProxy(authorizer) if err != nil { return nil, err } p := &proxy{ - cfgSvrMux: cfgSvrMux, - repo: repo, - state: state, - authorizer: authorizer, - authSvrMux: authSvrMux, + cfgSvrMux: cfgSvrMux, + repoRevProxy: repoProxy, + state: state, + authorizer: authorizer, + authSvrMux: authSvrMux, } return p, nil diff --git a/bcs-services/bcs-bscp/cmd/api-server/service/repo.go b/bcs-services/bcs-bscp/cmd/api-server/service/repo.go deleted file mode 100644 index 3ce45ed770..0000000000 --- a/bcs-services/bcs-bscp/cmd/api-server/service/repo.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 service - -import ( - "io" - "net/http" - "strconv" - - "github.com/go-chi/render" - "k8s.io/klog/v2" - - "bscp.io/pkg/cc" - "bscp.io/pkg/dal/repository" - "bscp.io/pkg/iam/auth" - "bscp.io/pkg/kit" - "bscp.io/pkg/rest" -) - -// repoService is http handler for repo services. -type repoService struct { - // authorizer auth related operations. - authorizer auth.Authorizer - provider repository.Provider -} - -// UploadFile upload to repo provider -func (s *repoService) UploadFile(w http.ResponseWriter, r *http.Request) { - kt := kit.MustGetKit(r.Context()) - - fileContentID, err := repository.GetFileContentID(r) - if err != nil { - render.Render(w, r, rest.BadRequest(err)) - return - } - - metadata, err := s.provider.Upload(kt, fileContentID, r.Body, r.ContentLength) - if err != nil { - render.Render(w, r, rest.BadRequest(err)) - return - } - - render.Render(w, r, rest.OKRender(metadata)) -} - -// DownloadFile download file from provider repo -func (s *repoService) DownloadFile(w http.ResponseWriter, r *http.Request) { - kt := kit.MustGetKit(r.Context()) - - fileContentID, err := repository.GetFileContentID(r) - if err != nil { - render.Render(w, r, rest.BadRequest(err)) - return - } - - body, contentLength, err := s.provider.Download(kt, fileContentID) - if err != nil { - render.Render(w, r, rest.BadRequest(err)) - return - } - defer body.Close() - - w.Header().Set("Content-Length", strconv.FormatInt(contentLength, 10)) - w.Header().Set("Content-Type", "application/octet-stream") - _, err = io.Copy(w, body) - if err != nil { - klog.ErrorS(err, "download file", "fileContentID", fileContentID) - } -} - -// FileMetadata get repo head data -func (s *repoService) FileMetadata(w http.ResponseWriter, r *http.Request) { - kt := kit.MustGetKit(r.Context()) - - fileContentID, err := repository.GetFileContentID(r) - if err != nil { - render.Render(w, r, rest.BadRequest(err)) - return - } - - metadata, err := s.provider.Metadata(kt, fileContentID) - if err != nil { - render.Render(w, r, rest.BadRequest(err)) - return - } - - render.Render(w, r, rest.OKRender(metadata)) -} - -func newRepoService(settings cc.Repository, authorizer auth.Authorizer) (*repoService, error) { - provider, err := repository.NewProvider(settings) - if err != nil { - return nil, err - } - - repo := &repoService{ - authorizer: authorizer, - provider: provider, - } - - return repo, nil -} diff --git a/bcs-services/bcs-bscp/cmd/api-server/service/repo_proxy.go b/bcs-services/bcs-bscp/cmd/api-server/service/repo_proxy.go new file mode 100644 index 0000000000..a218f1693b --- /dev/null +++ b/bcs-services/bcs-bscp/cmd/api-server/service/repo_proxy.go @@ -0,0 +1,475 @@ +/* +Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. +Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except +in compliance with the License. You may obtain a copy of the License at +http://opensource.org/licenses/MIT +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 service + +import ( + "bytes" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "net" + "net/http" + "net/http/httputil" + "strconv" + "strings" + "time" + + "github.com/bluele/gcache" + "github.com/go-chi/chi/v5" + "github.com/tidwall/gjson" + + "bscp.io/pkg/cc" + "bscp.io/pkg/criteria/constant" + "bscp.io/pkg/criteria/errf" + "bscp.io/pkg/dal/repository" + "bscp.io/pkg/iam/auth" + "bscp.io/pkg/iam/meta" + "bscp.io/pkg/kit" + "bscp.io/pkg/logs" + "bscp.io/pkg/metrics" + "bscp.io/pkg/rest" + "bscp.io/pkg/thirdparty/repo" +) + +const ( + // defaultWriteBufferSize is default write buffer size, 4KB. + defaultWriteBufferSize = 4 << 10 + + // defaultReadBufferSize is default read buffer size, 4KB. + defaultReadBufferSize = 4 << 10 +) + +// repoProxy is http reverse proxy for bkrepo. +type repoProxy struct { + // proxy repo http reverse proxy. + proxy *httputil.ReverseProxy + // repoCli repo client. + repoCli *repo.Client + // repoCreatedRecords memory LRU cache used for re-create repo repository. + repoCreatedRecords gcache.Cache + // authorizer auth related operations. + authorizer auth.Authorizer +} + +// FileMetadata get repo head data +func (p repoProxy) FileMetadata(w http.ResponseWriter, r *http.Request) { + kt := kit.MustGetKit(r.Context()) + + authRes, needReturn := p.authorize(kt, r) + if needReturn { + fmt.Fprintf(w, authRes) + return + } + config := cc.ApiServer().Repo + + bizID, _, err := repository.GetBizIDAndAppID(nil, r) + if err != nil { + logs.Errorf("get biz_id and app_id from request failed, err: %v, rid: %s", err, kt.Rid) + return + } + + sha256 := strings.ToLower(r.Header.Get(constant.ContentIDHeaderKey)) + opt := &repo.NodeOption{ + Project: config.BkRepo.Project, + BizID: bizID, + Sign: sha256, + } + path, _ := repo.GenNodePath(opt) + fileMetadata, err := p.repoCli.FileMetadataHead(kt.Ctx, path) + if err != nil { + logs.Errorf("get file metadata information failed, err: %v, rid: %s", err, kt.Rid) + return + } + msg, _ := json.Marshal(fileMetadata) + w.Write(msg) +} + +func (p repoProxy) DownloadFile(w http.ResponseWriter, r *http.Request) { + kt := kit.MustGetKit(r.Context()) + + authRes, needReturn := p.authorize(kt, r) + if needReturn { + fmt.Fprintf(w, authRes) + return + } + p.proxy.ServeHTTP(w, r) +} + +func (p repoProxy) UploadFile(w http.ResponseWriter, r *http.Request) { + kt := kit.MustGetKit(r.Context()) + + authRes, needReturn := p.authorize(kt, r) + if needReturn { + fmt.Fprintf(w, authRes) + return + } + + // parse biz_id. + bizIDStr := chi.URLParam(r, "biz_id") + bizID, err := strconv.ParseUint(bizIDStr, 10, 64) + if err != nil { + logs.Errorf("biz_id parse uint failed, err: %v, rid: %s", err, kt.Rid) + fmt.Fprintf(w, errf.New(errf.InvalidParameter, err.Error()).Error()) + return + } + + if bizID == 0 { + fmt.Fprintf(w, errf.New(errf.InvalidParameter, "biz_id should > 0").Error()) + return + } + + if record, err := p.repoCreatedRecords.Get(bizID); err != nil || record == nil { + repoName, err := repo.GenRepoName(uint32(bizID)) + if err != nil { + logs.Errorf("generate repository name failed, err: %v, rid: %s", err, kt.Rid) + fmt.Fprintf(w, errf.Error(err).Error()) + return + } + + req := &repo.CreateRepoReq{ + ProjectID: cc.ApiServer().Repo.BkRepo.Project, + Name: repoName, + Type: repo.RepositoryType, + Category: repo.CategoryType, + Configuration: repo.Configuration{Type: repo.RepositoryCfgType}, + Description: fmt.Sprintf("bscp %d business repository", bizID), + } + if err = p.repoCli.CreateRepo(r.Context(), req); err != nil { + logs.Errorf("create repository failed, err: %v, rid: %s", err, kt.Rid) + fmt.Fprintf(w, errf.Error(err).Error()) + return + } + + // set cache, to flag this biz repository already created. + p.repoCreatedRecords.SetWithExpire(bizID, true, repository.RepoRecordCacheExpiration) + } + + p.proxy.ServeHTTP(w, r) +} + +// authorize the request, returns error response and if the response needs return. +func (p repoProxy) authorize(kt *kit.Kit, r *http.Request) (string, bool) { + bizID, appID, err := repository.GetBizIDAndAppID(kt, r) + if err != nil { + logs.Errorf("get biz_id and app_id from request failed, err: %v, rid: %s", err, kt.Rid) + return errf.New(errf.InvalidParameter, err.Error()).Error(), true + } + + var authRes *meta.ResourceAttribute + switch r.Method { + case http.MethodPut: + authRes = &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.Content, Action: meta.Upload, + ResourceID: appID}, BizID: bizID} + case http.MethodGet: + authRes = &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.Content, Action: meta.Download, + ResourceID: appID}, BizID: bizID} + } + + resp := new(repository.AuthResp) + err = p.authorizer.AuthorizeWithResp(kt, resp, authRes) + if err != nil { + respJson, _ := json.Marshal(resp) + return string(respJson), true + } + + return "", false +} + +// newRepoProxy creates a new ReverseProxy for repo. +func newRepoProxy(authorizer auth.Authorizer) (repository.FileApiType, error) { + settings := cc.ApiServer().Repo + switch strings.ToUpper(string(settings.StorageType)) { + case string(cc.S3): + return repository.NewS3Service(settings, authorizer) + case string(cc.BkRepo): + return NewRepoService(settings, authorizer) + } + return nil, fmt.Errorf("store with type %s is not supported", settings.StorageType) +} + +// modifyResponse modify the response returned by the product library and convert it to the bscp response body. +func modifyResponse(res *http.Response) error { + switch res.Request.Method { + case http.MethodPut: + return modifyUploadResp(res) + + case http.MethodGet: + return modifyDownloadResp(res) + + default: + return fmt.Errorf("unknown request method %s", res.Request.Method) + } +} + +// modifyDownloadResp modify download file api response to convert bscp response body. +func modifyDownloadResp(res *http.Response) error { + rid := res.Request.Header.Get(constant.RidKey) + + switch res.StatusCode { + case http.StatusOK: + return nil + + case http.StatusNotFound: + body, err := ioutil.ReadAll(res.Body) + if err != nil { + return err + } + + code := gjson.GetBytes(body, "code").Int() + msg := gjson.GetBytes(body, "message").String() + + if code == repo.ErrCodeNodeNotExist { + res.Body = ioutil.NopCloser(bytes.NewBuffer([]byte(errf.New(errf.RecordNotFound, ""+ + "file content not found").Error()))) + + return nil + } + + logs.Errorf("repo proxy download file failed, code: %d, msg: %s, rid: %s", code, msg, rid) + res.Body = ioutil.NopCloser(bytes.NewBuffer([]byte(errf.New(errf.Unknown, "repo proxy "+ + "download file failed, state code: 404").Error()))) + + return nil + + default: + logs.Errorf("repo proxy download file failed, code: %d, msg: %s, rid: %s", res.StatusCode, res.Status, rid) + res.Body = ioutil.NopCloser(bytes.NewBuffer([]byte(errf.New(errf.Unknown, fmt.Sprintf( + "repo proxy download file failed, state code: %d", res.StatusCode)).Error()))) + } + + return nil +} + +// modifyUploadResp bscp needs to log the repo upload interface response of the agent and +// convert it to the response body of bscp to avoid disclosure of internal repo configuration information. +func modifyUploadResp(res *http.Response) error { + rid := res.Request.Header.Get(constant.RidKey) + + switch res.StatusCode { + case http.StatusOK: + if err := successResp(res, rid); err != nil { + return err + } + return nil + + case http.StatusBadRequest: + body, err := ioutil.ReadAll(res.Body) + if err != nil { + return err + } + + code := gjson.GetBytes(body, "code").Int() + msg := gjson.GetBytes(body, "message").String() + + // repeatedly create node(uploading files) is a successful response to bscp. + if code != repo.ErrCodeNodeAlreadyExist { + res.Body = ioutil.NopCloser(bytes.NewBuffer([]byte(errf.New(errf.Unknown, fmt.Sprintf("repo proxy "+ + "upload file failed, code: %d, msg: %s", code, msg)).Error()))) + + } else { + res.StatusCode = http.StatusOK + res.Status = "OK" + + if err := successResp(res, rid); err != nil { + return err + } + } + return nil + + default: + logs.Errorf("repo proxy upload file failed, code: %d, msg: %s, rid: %s", + res.StatusCode, res.Status, rid) + res.Body = ioutil.NopCloser(bytes.NewBuffer([]byte(errf.New(errf.Unknown, fmt.Sprintf( + "repo proxy upload file failed, state code: %d", res.StatusCode)).Error()))) + } + + return nil +} + +func successResp(res *http.Response, rid string) error { + logs.Infof("repo proxy upload file success, rid: %s", rid) + resp := &rest.BaseResp{ + Code: errf.OK, + } + + b, err := json.Marshal(resp) + if err != nil { + return err + } + + res.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + res.Header.Set("Content-Length", strconv.Itoa(len(b))) + return nil +} + +// newRepoDirector returns a director for repo. +func newRepoDirector(cli *repo.Client) func(req *http.Request) { + return func(req *http.Request) { + config := cc.ApiServer().Repo + kt := kit.MustGetKit(req.Context()) + + addr, err := config.OneEndpoint() + if err != nil { + logs.Errorf("get repo address failed, err: %v, rid: %s", err, kt.Rid) + return + } + + // set scheme(http) and addr. + elmHost := strings.Split(addr, "://") + if len(elmHost) != 2 { + logs.Errorf("repo address format does not conform to the regulations, addr: %s, rid: %s", addr, kt.Rid) + return + } + req.URL.Scheme = elmHost[0] + req.Host = elmHost[1] + req.URL.Host = elmHost[1] + + bizID, appID, err := repository.GetBizIDAndAppID(kt, req) + if err != nil { + logs.Errorf("get biz_id and app_id from request failed, err: %v, rid: %s", err, kt.Rid) + return + } + + sha256 := strings.ToLower(req.Header.Get(constant.ContentIDHeaderKey)) + opt := &repo.NodeOption{ + Project: config.BkRepo.Project, + BizID: bizID, + Sign: sha256, + } + req.URL.Path, err = repo.GenNodePath(opt) + if err != nil { + logs.Errorf("generate node path failed, err: %v, rid: %s", err, kt.Rid) + return + } + + authStr := base64.RawStdEncoding.EncodeToString( + []byte(config.BkRepo.Username + ":" + config.BkRepo.Password)) + + // set rid, this is the rid for internal positioning requests. + // this field is not supported by repo and will not be used. + req.Header.Set(constant.RidKey, kt.Rid) + + // set repo header. + req.Header.Set("Authorization", fmt.Sprintf("Basic %s", authStr)) + req.Header.Set(repo.HeaderKeySHA256, sha256) + + // if it is an upload request, you need to set the upload node metadata. + if req.Method == http.MethodPut { + metadata, err := getNodeMetadata(kt, cli, opt, appID) + if err != nil { + logs.Errorf("get node metadata failed, err: %v, rid: %s", err, kt.Rid) + return + } + + req.Header.Set(repo.HeaderKeyMETA, metadata) + // the contents of the files under the same business may be duplicated, + // and the metadata information needs to be written by overwriting. + req.Header.Set(repo.HeaderKeyOverwrite, "true") + } + } +} + +// getNodeMetadata If the node already exists, this appID will be added to the metadata of the current node. +// If not exist, will create new metadata with this bizID and appID. +func getNodeMetadata(kt *kit.Kit, cli *repo.Client, opt *repo.NodeOption, appID uint32) (string, error) { + metadata, err := cli.QueryMetadata(kt.Ctx, opt) + if err != nil { + return "", err + } + + if len(metadata) == 0 { + meta := repo.NodeMeta{ + BizID: opt.BizID, + AppID: []uint32{appID}, + } + + return meta.String() + } + + // validate already node metadata. + bizID, exist := metadata["biz_id"] + if !exist { + return "", errors.New("node metadata not has biz id") + } + + if bizID != strconv.Itoa(int(opt.BizID)) { + return "", fmt.Errorf("node metadata %s biz id is different from the request %d biz id", bizID, opt.BizID) + } + + appIDStr, exist := metadata["app_id"] + if !exist { + return "", errors.New("node metadata not has app id") + } + + appIDs := make([]uint32, 0) + if err = json.Unmarshal([]byte(appIDStr), &appIDs); err != nil { + return "", fmt.Errorf("unmarshal node metadata appID failed, err: %v", err) + } + + // judge current app if already upload this node. + var idExist bool + for index := range appIDs { + if appIDs[index] == appID { + idExist = true + break + } + } + + if !idExist { + appIDs = append(appIDs, appID) + } + + meta := &repo.NodeMeta{ + BizID: opt.BizID, + AppID: appIDs, + } + return meta.String() +} + +func NewRepoService(settings cc.Repository, authorizer auth.Authorizer) (repository.FileApiType, error) { + repoCli, err := repo.NewClient(settings, metrics.Register()) + if err != nil { + return nil, err + } + + p := &repoProxy{ + proxy: &httputil.ReverseProxy{ + // Director must be a function which modifies the request into a new Request + // to be sent using Transport. Its response is then copied back to the original + // client unmodified. Director must not access the provided Request after returning. + Director: newRepoDirector(repoCli), + + // The transport used to perform proxy requests. If nil, + // http.DefaultTransport is used. + Transport: &http.Transport{ + Proxy: http.ProxyFromEnvironment, + Dial: (&net.Dialer{Timeout: 10 * time.Second}).Dial, + MaxConnsPerHost: 200, + MaxIdleConnsPerHost: 10, + IdleConnTimeout: time.Minute, + WriteBufferSize: defaultWriteBufferSize, + ReadBufferSize: defaultReadBufferSize, + }, + + // Modify the response returned by the product library and convert it to the bscp response body + ModifyResponse: modifyResponse, + }, + repoCli: repoCli, + repoCreatedRecords: gcache.New(1000).EvictType(gcache.TYPE_LRU).Build(), // total size < 8k + authorizer: authorizer, + } + + return p, nil +} diff --git a/bcs-services/bcs-bscp/cmd/api-server/service/routers.go b/bcs-services/bcs-bscp/cmd/api-server/service/routers.go index 18ed1d5616..7224c4dbf8 100644 --- a/bcs-services/bcs-bscp/cmd/api-server/service/routers.go +++ b/bcs-services/bcs-bscp/cmd/api-server/service/routers.go @@ -82,19 +82,19 @@ func (p *proxy) routers() http.Handler { // repo 上传 API r.Route("/api/v1/api/create/content/upload", func(r chi.Router) { r.Use(p.authorizer.UnifiedAuthentication) - r.With(p.authorizer.BizVerified, p.authorizer.AppVerified).Put("/biz_id/{biz_id}/app_id/{app_id}", p.repo.UploadFile) + r.With(p.authorizer.BizVerified, p.authorizer.AppVerified).Put("/biz_id/{biz_id}/app_id/{app_id}", p.repoRevProxy.UploadFile) }) // repo 下载 API r.Route("/api/v1/api/get/content/download", func(r chi.Router) { r.Use(p.authorizer.UnifiedAuthentication) - r.With(p.authorizer.BizVerified, p.authorizer.AppVerified).Get("/biz_id/{biz_id}/app_id/{app_id}", p.repo.DownloadFile) + r.With(p.authorizer.BizVerified, p.authorizer.AppVerified).Get("/biz_id/{biz_id}/app_id/{app_id}", p.repoRevProxy.DownloadFile) }) // repo 获取二进制元数据 API r.Route("/api/v1/api/get/content/metadata", func(r chi.Router) { r.Use(p.authorizer.UnifiedAuthentication) - r.With(p.authorizer.BizVerified, p.authorizer.AppVerified).Get("/biz_id/{biz_id}/app_id/{app_id}", p.repo.FileMetadata) + r.With(p.authorizer.BizVerified, p.authorizer.AppVerified).Get("/biz_id/{biz_id}/app_id/{app_id}", p.repoRevProxy.FileMetadata) }) return r diff --git a/bcs-services/bcs-bscp/cmd/auth-server/service/auth/auth.go b/bcs-services/bcs-bscp/cmd/auth-server/service/auth/auth.go index 9b279b4560..c1f09a3221 100644 --- a/bcs-services/bcs-bscp/cmd/auth-server/service/auth/auth.go +++ b/bcs-services/bcs-bscp/cmd/auth-server/service/auth/auth.go @@ -437,13 +437,13 @@ func (a *Auth) parseIamPathToAncestors(iamPath []string) ([]*meta.IamResourceIns } // getInstIDNameMap NOTES -// Note how to get ancestor names? right now it means cc biz name, which is not in bscp +// TODO how to get ancestor names? right now it means cc biz name, which is not in bscp // note that app id is generated in the form of {biz_id}-{app_id} // and right now pbds.ListInstancesReq requires biz id to be set, how to confirm this? // and return should be grouped by type to avoid duplicates // getInstIDNameMap get resource id to name map by resource ids, groups by resource type func (a *Auth) getInstIDNameMap(kt *kit.Kit, resTypeIDsMap map[client.TypeID][]string) (map[string]string, error) { - // Note implement this + // TODO implement this return make(map[string]string), nil } diff --git a/bcs-services/bcs-bscp/cmd/auth-server/service/filter.go b/bcs-services/bcs-bscp/cmd/auth-server/service/filter.go index fe74404b1c..805224d78d 100644 --- a/bcs-services/bcs-bscp/cmd/auth-server/service/filter.go +++ b/bcs-services/bcs-bscp/cmd/auth-server/service/filter.go @@ -158,7 +158,7 @@ func getRid(h http.Header) string { // authRequestFilter set auth request filter. func authRequestFilter(w http.ResponseWriter, req *http.Request) error { - // Note: set auth request filter. + // TODO: set auth request filter. return nil } diff --git a/bcs-services/bcs-bscp/cmd/auth-server/service/iam/fetch_instance_info.go b/bcs-services/bcs-bscp/cmd/auth-server/service/iam/fetch_instance_info.go index 3baf27103c..dfe2cedbfe 100644 --- a/bcs-services/bcs-bscp/cmd/auth-server/service/iam/fetch_instance_info.go +++ b/bcs-services/bcs-bscp/cmd/auth-server/service/iam/fetch_instance_info.go @@ -27,7 +27,7 @@ import ( func (i *IAM) FetchInstanceInfo(kt *kit.Kit, resType client.TypeID, ft *types.FetchInstanceInfoFilter) ( []map[string]interface{}, error) { - // Note: f.Attrs need to deal with, if add attribute authentication. + // TODO: f.Attrs need to deal with, if add attribute authentication. groups := make(map[uint32][]uint32, 0) for _, id := range ft.IDs { diff --git a/bcs-services/bcs-bscp/cmd/auth-server/service/iam/list_instance.go b/bcs-services/bcs-bscp/cmd/auth-server/service/iam/list_instance.go index c8287a1c12..c918034cfc 100644 --- a/bcs-services/bcs-bscp/cmd/auth-server/service/iam/list_instance.go +++ b/bcs-services/bcs-bscp/cmd/auth-server/service/iam/list_instance.go @@ -75,6 +75,6 @@ func (i *IAM) ListInstances(kt *kit.Kit, resType client.TypeID, filter *types.Li func (i *IAM) ListInstancesWithAttributes(ctx context.Context, opts *client.ListWithAttributes) (idList []string, err error) { - // Note implement this when attribute auth is enabled + // TODO implement this when attribute auth is enabled return make([]string, 0), nil } diff --git a/bcs-services/bcs-bscp/cmd/cache-service/service/cache/client/credential.go b/bcs-services/bcs-bscp/cmd/cache-service/service/cache/client/credential.go index d13bb368c1..e09f58b102 100644 --- a/bcs-services/bcs-bscp/cmd/cache-service/service/cache/client/credential.go +++ b/bcs-services/bcs-bscp/cmd/cache-service/service/cache/client/credential.go @@ -135,20 +135,27 @@ func (c *client) queryMatchedCIFromCache(kt *kit.Kit, bizID uint32, credential s } // list credential scopes - scopes, _, err := c.op.CredentialScope().Get(kt, cred.ID, bizID) + scopes, err := c.op.CredentialScope().Get(kt, cred.ID, bizID) if err != nil { return "", 0, err } // list all apps which can be matched by credential. - apps, _, err := c.op.App().List(kt, []uint32{bizID}, "", "", &types.BasePage{}) + appDetails, err := c.op.App().List(kt, &types.ListAppsOption{ + BizID: bizID, + Filter: &filter.Expression{ + Op: filter.And, + Rules: []filter.RuleFactory{}, + }, + Page: &types.BasePage{}, + }) if err != nil { return "", 0, err } - appIDs := make([]uint32, 0, len(apps)) - for _, app := range apps { - for _, scope := range scopes { + appIDs := make([]uint32, 0, len(appDetails.Details)) + for _, app := range appDetails.Details { + for _, scope := range scopes.Details { match, e := scope.Spec.CredentialScope.MatchApp(app.Spec.Name) if e != nil { return "", 0, e @@ -183,7 +190,7 @@ func (c *client) queryMatchedCIFromCache(kt *kit.Kit, bizID uint32, credential s return "", 0, err } for _, ci := range CIDetails.Details { - for _, scope := range scopes { + for _, scope := range scopes.Details { match, e := scope.Spec.CredentialScope.MatchConfigItem(ci.ConfigItemSpec.Path, ci.ConfigItemSpec.Name) if e != nil { return "", 0, e @@ -274,12 +281,12 @@ func (c *client) queryCredentialFromCahce(kt *kit.Kit, bizID uint32, credential if errors.Is(err, errf.ErrCredentialInvalid) { return "", 0, errf.Newf(errf.InvalidParameter, "invalid credential: %s", credential) } - details, _, err := c.op.CredentialScope().Get(kt, cred.ID, bizID) + details, err := c.op.CredentialScope().Get(kt, cred.ID, bizID) if err != nil { return "", 0, err } - scope := make([]string, 0, len(details)) - for _, detail := range details { + scope := make([]string, 0, len(details.Details)) + for _, detail := range details.Details { scope = append(scope, string(detail.Spec.CredentialScope)) } credentialCache := &types.CredentialCache{ diff --git a/bcs-services/bcs-bscp/cmd/cache-service/service/cache/event/consumer.go b/bcs-services/bcs-bscp/cmd/cache-service/service/cache/event/consumer.go index a5e0948f8e..b7c2c1df64 100644 --- a/bcs-services/bcs-bscp/cmd/cache-service/service/cache/event/consumer.go +++ b/bcs-services/bcs-bscp/cmd/cache-service/service/cache/event/consumer.go @@ -340,14 +340,13 @@ func (c *consumer) cacheOneReleasedGroup(kt *kit.Kit, bizID, appID uint32) (map[ releaseBizID[one.ReleaseID] = bizID } - var b []byte - b, err = jsoni.Marshal(groups) + b, err := jsoni.Marshal(groups) if err != nil { logs.Errorf("marshal app: %d, released group list failed, err: %v", appID, err) return nil, err } - if err = c.bds.Set(kt.Ctx, keys.Key.ReleasedGroup(bizID, appID), string(b), keys.Key.ReleasedGroupTtlSec(false)); err != nil { + if err := c.bds.Set(kt.Ctx, keys.Key.ReleasedGroup(bizID, appID), string(b), keys.Key.ReleasedGroupTtlSec(false)); err != nil { logs.Errorf("set biz: %d, app: %d, strategies cache failed, err: %v, rid: %s", bizID, appID, err, kt.Rid) return nil, err } diff --git a/bcs-services/bcs-bscp/cmd/cache-service/service/cache/event/loop_watch.go b/bcs-services/bcs-bscp/cmd/cache-service/service/cache/event/loop_watch.go index c6cb09492e..5c23c1d058 100644 --- a/bcs-services/bcs-bscp/cmd/cache-service/service/cache/event/loop_watch.go +++ b/bcs-services/bcs-bscp/cmd/cache-service/service/cache/event/loop_watch.go @@ -23,6 +23,7 @@ import ( "bscp.io/pkg/dal/table" "bscp.io/pkg/kit" "bscp.io/pkg/logs" + "bscp.io/pkg/runtime/filter" "bscp.io/pkg/runtime/shutdown" "bscp.io/pkg/serviced" "bscp.io/pkg/tools" @@ -179,20 +180,23 @@ func (lw *loopWatch) loopOneStep(kt *kit.Kit, currentCursor uint32) (lastCursor // events which are satisfied with the lag seconds continuously(one by one) until the not satisfied one occurred. func (lw *loopWatch) doOneStep(kt *kit.Kit, start uint32, limit uint, lagSeconds int) (lastCursor uint32, atEnd, retry bool) { - // order these events with event id. - opt := &types.BasePage{Start: 0, Limit: limit, Sort: "id", Order: types.Ascending} - if err := opt.Validate(types.DefaultPageOption); err != nil { - logs.Errorf("validate page option failed, err: %v, rid: %s", err, kt.Rid) - return start, false, true + + opts := &types.ListEventsOption{ + Filter: &filter.Expression{ + Op: filter.And, + Rules: []filter.RuleFactory{&filter.AtomRule{Field: "id", Op: filter.GreaterThan.Factory(), Value: start}}, + }, + // order these events with event id. + Page: &types.BasePage{Count: false, Start: 0, Limit: limit, Sort: "id", Order: types.Ascending}, } - details, _, err := lw.ds.event.List(kt, start, opt) + result, err := lw.ds.event.List(kt, opts) if err != nil { logs.Errorf("list event failed, err: %v, rid: %s", err, kt.Rid) return start, false, true } - if len(details) == 0 { + if len(result.Details) == 0 { logs.V(1).Infof("watch events with cursor: %d, limit: %d, but no events found, rid: %s", start, limit, kt.Rid) return start, true, false } @@ -200,7 +204,7 @@ func (lw *loopWatch) doOneStep(kt *kit.Kit, start uint32, limit uint, lagSeconds // filter out events which is satisfied with the lag seconds. lag := time.Now().Unix() - int64(lagSeconds) filterOut := make([]*table.Event, 0) - for _, one := range details { + for _, one := range result.Details { if one.State.FinalStatus != table.UnknownFS { // if the event do have a final status, it means the event related // resource's db transaction has already finished with success or failed. diff --git a/bcs-services/bcs-bscp/cmd/cache-service/service/cache/keys/cache.go b/bcs-services/bcs-bscp/cmd/cache-service/service/cache/keys/cache.go index dbe96076cd..1735a7c862 100644 --- a/bcs-services/bcs-bscp/cmd/cache-service/service/cache/keys/cache.go +++ b/bcs-services/bcs-bscp/cmd/cache-service/service/cache/keys/cache.go @@ -195,8 +195,8 @@ func (ele element) String() string { } const ( - // FalseVal .. + // FalseVal TODO FalseVal = "0" - // TrueVal .. + // TrueVal TODO TrueVal = "1" ) diff --git a/bcs-services/bcs-bscp/cmd/cache-service/service/feed.go b/bcs-services/bcs-bscp/cmd/cache-service/service/feed.go index cd39635fae..f4cd063fec 100644 --- a/bcs-services/bcs-bscp/cmd/cache-service/service/feed.go +++ b/bcs-services/bcs-bscp/cmd/cache-service/service/feed.go @@ -18,6 +18,7 @@ import ( "bscp.io/pkg/criteria/errf" "bscp.io/pkg/kit" + "bscp.io/pkg/logs" pbcs "bscp.io/pkg/protocol/cache-service" pbbase "bscp.io/pkg/protocol/core/base" "bscp.io/pkg/types" @@ -146,27 +147,40 @@ func (s *Service) GetCurrentCursorReminder(ctx context.Context, _ *pbbase.EmptyR // ListEventsMeta list event metas with filter func (s *Service) ListEventsMeta(ctx context.Context, req *pbcs.ListEventsReq) (*pbcs.ListEventsResp, error) { + + if req.Page.Count { + return nil, errors.New("invalid request, do now allows to count events") + } + kt := kit.FromGrpcContext(ctx) + + // parse pb struct filter to filter.Expression. + filter, err := pbbase.UnmarshalFromPbStructToExpr(req.Filter) + if err != nil { + logs.Errorf("unmarshal pb struct to expression failed, err: %v, rid: %s", err, kt.Rid) + return nil, err + } + if req.Page == nil { - return nil, errors.New("page is null") + return nil, errf.New(errf.InvalidParameter, "page is null") } - opt := req.Page.BasePage() - if err := opt.Validate(types.DefaultPageOption); err != nil { - return nil, err + opt := &types.ListEventsOption{ + Filter: filter, + Page: req.Page.BasePage(), } - details, _, err := s.dao.Event().ListConsumedEvents(kt, req.StartCursor, opt) + result, err := s.dao.Event().ListConsumedEvents(kt, opt) if err != nil { return nil, err } - metas := make([]*types.EventMeta, len(details)) - for idx := range details { + metas := make([]*types.EventMeta, len(result.Details)) + for idx := range result.Details { metas[idx] = &types.EventMeta{ - ID: details[idx].ID, - Spec: details[idx].Spec, - Attachment: details[idx].Attachment, + ID: result.Details[idx].ID, + Spec: result.Details[idx].Spec, + Attachment: result.Details[idx].Attachment, } } diff --git a/bcs-services/bcs-bscp/cmd/config-server/service/app.go b/bcs-services/bcs-bscp/cmd/config-server/service/app.go index e46a11a6f7..400017ce9c 100644 --- a/bcs-services/bcs-bscp/cmd/config-server/service/app.go +++ b/bcs-services/bcs-bscp/cmd/config-server/service/app.go @@ -19,6 +19,7 @@ import ( "github.com/pkg/errors" + "bscp.io/pkg/criteria/errf" "bscp.io/pkg/iam/meta" "bscp.io/pkg/kit" "bscp.io/pkg/logs" @@ -27,6 +28,7 @@ import ( pbapp "bscp.io/pkg/protocol/core/app" pbds "bscp.io/pkg/protocol/data-service" "bscp.io/pkg/space" + "bscp.io/pkg/types" ) // CreateApp create app with options @@ -129,6 +131,43 @@ func (s *Service) DeleteApp(ctx context.Context, req *pbcs.DeleteAppReq) (*pbcs. return resp, nil } +// ListApps list apps with filter. +func (s *Service) ListApps(ctx context.Context, req *pbcs.ListAppsReq) (*pbcs.ListAppsResp, error) { + kt := kit.FromGrpcContext(ctx) + resp := new(pbcs.ListAppsResp) + + authRes := &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.App, Action: meta.Find}, BizID: req.BizId} + err := s.authorizer.AuthorizeWithResp(kt, resp, authRes) + if err != nil { + return nil, err + } + + if req.Page == nil { + return nil, errf.New(errf.InvalidParameter, "page is null") + } + + if err = req.Page.BasePage().Validate(types.DefaultPageOption); err != nil { + return nil, err + } + + r := &pbds.ListAppsReq{ + BizId: req.BizId, + Filter: req.Filter, + Page: req.Page, + } + rp, err := s.client.DS.ListApps(kt.RpcCtx(), r) + if err != nil { + logs.Errorf("list apps failed, err: %v, rid: %s", err, kt.Rid) + return nil, err + } + + resp = &pbcs.ListAppsResp{ + Count: rp.Count, + Details: rp.Details, + } + return resp, nil +} + // GetApp get app with app id func (s *Service) GetApp(ctx context.Context, req *pbcs.GetAppReq) (*pbapp.App, error) { kt := kit.FromGrpcContext(ctx) @@ -180,6 +219,7 @@ func (s *Service) GetAppByName(ctx context.Context, req *pbcs.GetAppByNameReq) ( // ListAppsRest list apps with rest filter func (s *Service) ListAppsRest(ctx context.Context, req *pbcs.ListAppsRestReq) (*pbcs.ListAppsResp, error) { kt := kit.FromGrpcContext(ctx) + resp := new(pbcs.ListAppsResp) userSpaceResp, err := s.client.AS.ListUserSpace(kt.RpcCtx(), &pbas.ListUserSpaceReq{}) if err != nil { @@ -227,7 +267,7 @@ func (s *Service) ListAppsRest(ctx context.Context, req *pbcs.ListAppsRestReq) ( } } - resp := &pbcs.ListAppsResp{ + resp = &pbcs.ListAppsResp{ Count: rp.Count, Details: rp.Details, } diff --git a/bcs-services/bcs-bscp/cmd/config-server/service/config_hook.go b/bcs-services/bcs-bscp/cmd/config-server/service/config_hook.go deleted file mode 100644 index f03da1aa77..0000000000 --- a/bcs-services/bcs-bscp/cmd/config-server/service/config_hook.go +++ /dev/null @@ -1,109 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 service - -import ( - "context" - - "bscp.io/pkg/iam/meta" - "bscp.io/pkg/kit" - "bscp.io/pkg/logs" - pbcs "bscp.io/pkg/protocol/config-server" - pbch "bscp.io/pkg/protocol/core/config-hook" - pbds "bscp.io/pkg/protocol/data-service" -) - -// UpdateConfigHook update a ConfigHook -func (s *Service) UpdateConfigHook(ctx context.Context, req *pbcs.UpdateConfigHookReq) (*pbcs.UpdateConfigHookResp, error) { - - grpcKit := kit.FromGrpcContext(ctx) - resp := new(pbcs.UpdateConfigHookResp) - - res := &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.TemplateSpace, Action: meta.Update}, BizID: grpcKit.BizID} - if err := s.authorizer.AuthorizeWithResp(grpcKit, resp, res); err != nil { - return nil, err - } - - r := &pbds.GetConfigHookReq{ - BizId: req.BizId, - AppId: req.AppId, - } - ch, err := s.client.DS.GetConfigHook(grpcKit.RpcCtx(), r) - if err != nil { - logs.Errorf("update ConfigHook failed, err: %v, rid: %s", err, grpcKit.Rid) - return nil, err - } - - if ch.Id == 0 { - createR := &pbds.CreateConfigHookReq{ - Attachment: &pbch.ConfigHookAttachment{ - BizId: req.BizId, - AppId: req.AppId, - }, - Spec: &pbch.ConfigHookSpec{ - PreHookId: req.PreHookId, - PostHookId: req.PostHookId, - }, - } - - _, err = s.client.DS.CreateConfigHook(grpcKit.RpcCtx(), createR) - if err != nil { - logs.Errorf("create ConfigHook failed, err: %v, rid: %s", err, grpcKit.Rid) - return nil, err - } - return resp, nil - } - - updateR := &pbds.UpdateConfigHookReq{ - Attachment: &pbch.ConfigHookAttachment{ - BizId: req.BizId, - AppId: req.AppId, - }, - Spec: &pbch.ConfigHookSpec{ - PreHookId: req.PreHookId, - PostHookId: req.PostHookId, - }, - } - if _, e := s.client.DS.UpdateConfigHook(grpcKit.RpcCtx(), updateR); e != nil { - logs.Errorf("update ConfigHook failed, err: %v, rid: %s", e, grpcKit.Rid) - return nil, e - } - - return resp, nil -} - -// GetConfigHook get a ConfigHook -func (s *Service) GetConfigHook(ctx context.Context, req *pbcs.GetConfigHookReq) (*pbcs.GetConfigHookResp, error) { - - grpcKit := kit.FromGrpcContext(ctx) - resp := new(pbcs.GetConfigHookResp) - - res := &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.TemplateSpace, Action: meta.Update}, BizID: grpcKit.BizID} - if err := s.authorizer.AuthorizeWithResp(grpcKit, resp, res); err != nil { - return nil, err - } - - r := &pbds.GetConfigHookReq{ - BizId: req.BizId, - AppId: req.AppId, - } - - hook, err := s.client.DS.GetConfigHook(grpcKit.RpcCtx(), r) - if err != nil { - logs.Errorf("get ConfigHook failed, err: %v, rid: %s", err, grpcKit.Rid) - return nil, err - } - - return &pbcs.GetConfigHookResp{ConfigHook: hook}, nil - -} diff --git a/bcs-services/bcs-bscp/cmd/config-server/service/config_item.go b/bcs-services/bcs-bscp/cmd/config-server/service/config_item.go index 53c1684616..e4caba75cd 100644 --- a/bcs-services/bcs-bscp/cmd/config-server/service/config_item.go +++ b/bcs-services/bcs-bscp/cmd/config-server/service/config_item.go @@ -354,7 +354,7 @@ func (s *Service) ListConfigItems(ctx context.Context, req *pbcs.ListConfigItems return nil, err } - // Note: list latest release and compare each config item exists and latest commit id to get changing status + // TODO: list latest release and compare each config item exists and latest commit id to get changing status r := &pbds.ListConfigItemsReq{ BizId: grpcKit.BizID, AppId: req.AppId, diff --git a/bcs-services/bcs-bscp/cmd/config-server/service/credential.go b/bcs-services/bcs-bscp/cmd/config-server/service/credential.go index b13089fe2e..edf6825a11 100644 --- a/bcs-services/bcs-bscp/cmd/config-server/service/credential.go +++ b/bcs-services/bcs-bscp/cmd/config-server/service/credential.go @@ -1,15 +1,3 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 service import ( @@ -21,8 +9,10 @@ import ( "bscp.io/pkg/kit" "bscp.io/pkg/logs" pbcs "bscp.io/pkg/protocol/config-server" + pbbase "bscp.io/pkg/protocol/core/base" pbcredential "bscp.io/pkg/protocol/core/credential" pbds "bscp.io/pkg/protocol/data-service" + "bscp.io/pkg/runtime/filter" "bscp.io/pkg/tools" ) @@ -85,11 +75,36 @@ func (s *Service) ListCredentials(ctx context.Context, req *pbcs.ListCredentials return nil, err } + page := &pbbase.BasePage{ + Start: req.Start, + Limit: req.Limit, + } + + ft := &filter.Expression{ + Op: filter.Or, + Rules: []filter.RuleFactory{}, + } + + if req.SearchKey != "" { + ft.Rules = append(ft.Rules, &filter.AtomRule{ + Field: "memo", + Op: filter.ContainsInsensitive.Factory(), + Value: req.SearchKey, + }, &filter.AtomRule{ + Field: "reviser", + Op: filter.ContainsInsensitive.Factory(), + Value: req.SearchKey, + }) + } + + ftpb, err := ft.MarshalPB() + if err != nil { + return nil, err + } r := &pbds.ListCredentialReq{ - BizId: bizID, - SearchKey: req.SearchKey, - Start: req.Start, - Limit: req.Limit, + BizId: bizID, + Page: page, + Filter: ftpb, } rp, err := s.client.DS.ListCredentials(grpcKit.RpcCtx(), r) diff --git a/bcs-services/bcs-bscp/cmd/config-server/service/credential_scope.go b/bcs-services/bcs-bscp/cmd/config-server/service/credential_scope.go index 5fc23b2d4f..98ae8f1e72 100644 --- a/bcs-services/bcs-bscp/cmd/config-server/service/credential_scope.go +++ b/bcs-services/bcs-bscp/cmd/config-server/service/credential_scope.go @@ -1,15 +1,3 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 service import ( @@ -65,7 +53,7 @@ func (s *Service) UpdateCredentialScope(ctx context.Context, req *pbcs.UpdateCre } r := &pbds.UpdateCredentialScopesReq{ - BizId: req.BizId, + BizId: req.BizId, CredentialId: req.CredentialId, } diff --git a/bcs-services/bcs-bscp/cmd/config-server/service/group.go b/bcs-services/bcs-bscp/cmd/config-server/service/group.go index ebbc9fa163..0a6c52f7a4 100644 --- a/bcs-services/bcs-bscp/cmd/config-server/service/group.go +++ b/bcs-services/bcs-bscp/cmd/config-server/service/group.go @@ -174,10 +174,24 @@ func (s *Service) ListAllGroups(ctx context.Context, req *pbcs.ListAllGroupsReq) } if len(appIDs) != 0 { - laReq := &pbds.ListAppsByIDsReq{ - Ids: appIDs, + laft := &filter.Expression{ + Op: filter.And, + Rules: []filter.RuleFactory{&filter.AtomRule{ + Field: "id", + Op: filter.In.Factory(), + Value: appIDs, + }}, } - laResp, e := s.client.DS.ListAppsByIDs(grpcKit.RpcCtx(), laReq) + laftpb, e := laft.MarshalPB() + if e != nil { + return nil, e + } + laReq := &pbds.ListAppsReq{ + BizId: req.BizId, + Filter: laftpb, + Page: &pbbase.BasePage{}, + } + laResp, e := s.client.DS.ListApps(grpcKit.RpcCtx(), laReq) if e != nil { logs.Errorf("list apps failed, err: %v, rid: %s", e, grpcKit.Rid) return nil, e diff --git a/bcs-services/bcs-bscp/cmd/config-server/service/hook.go b/bcs-services/bcs-bscp/cmd/config-server/service/hook.go index bf2622821b..909675c178 100644 --- a/bcs-services/bcs-bscp/cmd/config-server/service/hook.go +++ b/bcs-services/bcs-bscp/cmd/config-server/service/hook.go @@ -14,42 +14,40 @@ package service import ( "context" - "encoding/base64" - "errors" + "bscp.io/pkg/criteria/errf" "bscp.io/pkg/iam/meta" "bscp.io/pkg/kit" "bscp.io/pkg/logs" pbcs "bscp.io/pkg/protocol/config-server" - pbbase "bscp.io/pkg/protocol/core/base" pbhook "bscp.io/pkg/protocol/core/hook" pbds "bscp.io/pkg/protocol/data-service" + "bscp.io/pkg/types" ) // CreateHook create a hook func (s *Service) CreateHook(ctx context.Context, req *pbcs.CreateHookReq) (*pbcs.CreateHookResp, error) { - grpcKit := kit.FromGrpcContext(ctx) resp := new(pbcs.CreateHookResp) res := &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.Hook, Action: meta.Create, - ResourceID: req.BizId}, BizID: grpcKit.BizID} + ResourceID: req.AppId}, BizID: grpcKit.BizID} if err := s.authorizer.AuthorizeWithResp(grpcKit, resp, res); err != nil { return nil, err } - contentBase64 := base64.StdEncoding.EncodeToString([]byte(req.Content)) r := &pbds.CreateHookReq{ Attachment: &pbhook.HookAttachment{ - BizId: grpcKit.BizID, + BizId: grpcKit.BizID, + AppId: req.AppId, + ReleaseId: req.ReleaseId, }, Spec: &pbhook.HookSpec{ - Name: req.Name, - ReleaseName: req.ReleaseName, - Type: req.Type, - Tag: req.Tag, - Memo: req.Memo, - Content: contentBase64, + Name: req.Name, + PreType: req.PreType, + PreHook: req.PreHook, + PostType: req.PostType, + PostHook: req.PostHook, }, } rp, err := s.client.DS.CreateHook(grpcKit.RpcCtx(), r) @@ -79,6 +77,7 @@ func (s *Service) DeleteHook(ctx context.Context, req *pbcs.DeleteHookReq) (*pbc Id: req.HookId, Attachment: &pbhook.HookAttachment{ BizId: grpcKit.BizID, + AppId: req.AppId, }, } if _, err := s.client.DS.DeleteHook(grpcKit.RpcCtx(), r); err != nil { @@ -89,117 +88,74 @@ func (s *Service) DeleteHook(ctx context.Context, req *pbcs.DeleteHookReq) (*pbc return resp, nil } -// ListHooks list hooks with filter -func (s *Service) ListHooks(ctx context.Context, req *pbcs.ListHooksReq) (*pbcs.ListHooksResp, error) { - +// UpdateHook update a hook +func (s *Service) UpdateHook(ctx context.Context, req *pbcs.UpdateHookReq) (*pbcs.UpdateHookResp, error) { grpcKit := kit.FromGrpcContext(ctx) - resp := new(pbcs.ListHooksResp) + resp := new(pbcs.UpdateHookResp) - res := &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.TemplateSpace, Action: meta.Find}, BizID: grpcKit.BizID} + res := &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.Hook, Action: meta.Update, + ResourceID: req.HookId}, BizID: grpcKit.BizID} if err := s.authorizer.AuthorizeWithResp(grpcKit, resp, res); err != nil { return nil, err } - r := &pbds.ListHooksReq{ - BizId: grpcKit.BizID, - Name: req.Name, - Tag: req.Tag, - All: req.All, - NotTag: req.NotTag, - } - - if !req.All { - if req.Start < 0 { - return nil, errors.New("start has to be greater than 0") - } - - if req.Limit < 0 { - return nil, errors.New("limit has to be greater than 0") - } - - r.Start = req.Start - r.Limit = req.Limit + r := &pbds.UpdateHookReq{ + Id: req.HookId, + Attachment: &pbhook.HookAttachment{ + BizId: grpcKit.BizID, + AppId: req.AppId, + ReleaseId: req.ReleaseId, + }, + Spec: &pbhook.HookSpec{ + Name: req.Name, + PreType: req.PreType, + PreHook: req.PreHook, + PostType: req.PostType, + PostHook: req.PostHook, + }, } - - rp, err := s.client.DS.ListHooks(grpcKit.RpcCtx(), r) - if err != nil { - logs.Errorf("list hook failed, err: %v, rid: %s", err, grpcKit.Rid) + if _, err := s.client.DS.UpdateHook(grpcKit.RpcCtx(), r); err != nil { + logs.Errorf("update hook failed, err: %v, rid: %s", err, grpcKit.Rid) return nil, err } - resp = &pbcs.ListHooksResp{ - Count: rp.Count, - Details: rp.Details, - } - return resp, nil } -// ListHookTags list tag -func (s *Service) ListHookTags(ctx context.Context, req *pbcs.ListHookTagsReq) (*pbcs.ListHookTagsResp, error) { - +// ListHooks list hooks with filter +func (s *Service) ListHooks(ctx context.Context, req *pbcs.ListHooksReq) (*pbcs.ListHooksResp, error) { grpcKit := kit.FromGrpcContext(ctx) - resp := new(pbcs.ListHookTagsResp) + resp := new(pbcs.ListHooksResp) res := &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.Hook, Action: meta.Find}, BizID: grpcKit.BizID} if err := s.authorizer.AuthorizeWithResp(grpcKit, resp, res); err != nil { return nil, err } - r := &pbds.ListHookTagReq{BizId: req.BizId} - - ht, err := s.client.DS.ListHookTags(grpcKit.RpcCtx(), r) - if err != nil { - return nil, err + if req.Page == nil { + return nil, errf.New(errf.InvalidParameter, "page is null") } - resp = &pbcs.ListHookTagsResp{ - Details: ht.Details, - } - - return resp, nil -} - -// GetHook get a hook -func (s *Service) GetHook(ctx context.Context, req *pbcs.GetHookReq) (*pbcs.GetHookResp, error) { - - grpcKit := kit.FromGrpcContext(ctx) - resp := new(pbcs.GetHookResp) - - res := &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.TemplateSpace, Action: meta.Find}, BizID: grpcKit.BizID} - if err := s.authorizer.AuthorizeWithResp(grpcKit, resp, res); err != nil { + if err := req.Page.BasePage().Validate(types.DefaultPageOption); err != nil { return nil, err } - r := &pbds.GetHookReq{ - BizId: req.BizId, - HookId: req.HookId, + r := &pbds.ListHooksReq{ + BizId: grpcKit.BizID, + AppId: req.AppId, + Filter: req.Filter, + Page: req.Page, } - hook, err := s.client.DS.GetHook(grpcKit.RpcCtx(), r) + rp, err := s.client.DS.ListHooks(grpcKit.RpcCtx(), r) if err != nil { - logs.Errorf("get hook failed, err: %v, rid: %s", err, grpcKit.Rid) + logs.Errorf("list hooks failed, err: %v, rid: %s", err, grpcKit.Rid) return nil, err } - resp = &pbcs.GetHookResp{ - Id: hook.Id, - Spec: &pbcs.GetHookInfoSpec{ - Name: hook.Spec.Name, - Type: hook.Spec.Type, - Tag: hook.Spec.Tag, - Memo: hook.Spec.Memo, - PublishNum: hook.Spec.PublishNum, - Releases: &pbcs.GetHookInfoSpec_Releases{NotReleaseId: hook.Spec.Releases.NotReleaseId}, - }, - Attachment: &pbhook.HookAttachment{BizId: hook.Attachment.BizId}, - Revision: &pbbase.Revision{ - Creator: hook.Revision.CreateAt, - Reviser: hook.Revision.Reviser, - CreateAt: hook.Revision.Creator, - UpdateAt: hook.Revision.UpdateAt, - }, + resp = &pbcs.ListHooksResp{ + Count: rp.Count, + Details: rp.Details, } - return resp, nil } diff --git a/bcs-services/bcs-bscp/cmd/config-server/service/hook_release.go b/bcs-services/bcs-bscp/cmd/config-server/service/hook_release.go deleted file mode 100644 index f68e4ab6f9..0000000000 --- a/bcs-services/bcs-bscp/cmd/config-server/service/hook_release.go +++ /dev/null @@ -1,274 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 service - -import ( - "context" - "encoding/base64" - "errors" - - "bscp.io/pkg/iam/meta" - "bscp.io/pkg/kit" - "bscp.io/pkg/logs" - pbcs "bscp.io/pkg/protocol/config-server" - pbhr "bscp.io/pkg/protocol/core/hook-release" - pbds "bscp.io/pkg/protocol/data-service" -) - -// CreateHookRelease create hook release with option -func (s *Service) CreateHookRelease(ctx context.Context, - req *pbcs.CreateHookReleaseReq) (*pbcs.CreateHookReleaseResp, error) { - - grpcKit := kit.FromGrpcContext(ctx) - resp := new(pbcs.CreateHookReleaseResp) - - res := &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.TemplateSpace, Action: meta.Create, - ResourceID: req.BizId}, BizID: grpcKit.BizID} - if err := s.authorizer.AuthorizeWithResp(grpcKit, resp, res); err != nil { - return nil, err - } - - contentBase64 := base64.StdEncoding.EncodeToString([]byte(req.Content)) - r := &pbds.CreateHookReleaseReq{ - Attachment: &pbhr.HookReleaseAttachment{ - BizId: grpcKit.BizID, - HookId: req.HookId, - }, - Spec: &pbhr.HookReleaseSpec{ - Name: req.Name, - Content: contentBase64, - Memo: req.Memo, - }, - } - - rp, err := s.client.DS.CreateHookRelease(grpcKit.RpcCtx(), r) - if err != nil { - logs.Errorf("create HookRelease failed, err: %v, rid: %s", err, grpcKit.Rid) - return nil, err - } - - resp = &pbcs.CreateHookReleaseResp{ - Id: rp.Id, - } - return resp, nil -} - -// ListHookRelease list HookRelease with filter -func (s *Service) ListHookRelease(ctx context.Context, req *pbcs.ListHookReleaseReq) (*pbcs.ListHookReleaseResp, error) { - - grpcKit := kit.FromGrpcContext(ctx) - resp := new(pbcs.ListHookReleaseResp) - - res := &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.TemplateSpace, Action: meta.Find}, BizID: grpcKit.BizID} - if err := s.authorizer.AuthorizeWithResp(grpcKit, resp, res); err != nil { - return nil, err - } - - r := &pbds.ListHookReleasesReq{ - HookId: req.HookId, - SearchKey: req.SearchKey, - BizId: grpcKit.BizID, - All: req.All, - State: req.State, - } - - if !req.All { - if req.Start < 0 { - return nil, errors.New("start has to be greater than 0") - } - - if req.Limit < 0 { - return nil, errors.New("limit has to be greater than 0") - } - - r.Start = req.Start - r.Limit = req.Limit - } - - rp, err := s.client.DS.ListHookReleases(grpcKit.RpcCtx(), r) - if err != nil { - logs.Errorf("list HookReleases failed, err: %v, rid: %s", err, grpcKit.Rid) - return nil, err - } - - for _, detail := range rp.Details { - content, e := base64.StdEncoding.DecodeString(detail.Spec.Content) - if e != nil { - logs.Errorf("base64 decode release content failed, err: %v, rid: %s", e, grpcKit.Rid) - return nil, e - } - detail.Spec.Content = string(content) - } - - resp = &pbcs.ListHookReleaseResp{ - Count: rp.Count, - Details: rp.Details, - } - - return resp, nil -} - -// DeleteHookRelease delete a HookRelease -func (s *Service) DeleteHookRelease(ctx context.Context, - req *pbcs.DeleteHookReleaseReq) (*pbcs.DeleteHookReleaseResp, error) { - - grpcKit := kit.FromGrpcContext(ctx) - resp := new(pbcs.DeleteHookReleaseResp) - - res := &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.TemplateSpace, Action: meta.Delete, - ResourceID: req.ReleaseId}, BizID: grpcKit.BizID} - if err := s.authorizer.AuthorizeWithResp(grpcKit, resp, res); err != nil { - return nil, err - } - - r := &pbds.DeleteHookReleaseReq{ - BizId: req.BizId, - HookId: req.HookId, - Id: req.ReleaseId, - } - - if _, err := s.client.DS.DeleteHookRelease(grpcKit.RpcCtx(), r); err != nil { - logs.Errorf("delete HookRelease failed, err: %v, rid: %s", err, grpcKit.Rid) - return nil, err - } - - return resp, nil -} - -// PublishHookRelease publish a release -func (s *Service) PublishHookRelease(ctx context.Context, req *pbcs.PublishHookReleaseReq) (*pbcs.PublishHookReleaseResp, error) { - - grpcKit := kit.FromGrpcContext(ctx) - resp := new(pbcs.PublishHookReleaseResp) - - res := &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.TemplateSpace, Action: meta.Update}, - BizID: grpcKit.BizID} - if err := s.authorizer.AuthorizeWithResp(grpcKit, resp, res); err != nil { - return nil, err - } - - r := &pbds.PublishHookReleaseReq{ - BizId: req.BizId, - HookId: req.HookId, - Id: req.ReleaseId, - } - - if _, err := s.client.DS.PublishHookRelease(grpcKit.RpcCtx(), r); err != nil { - logs.Errorf("publish HookRelease failed, err: %v, rid: %s", err, grpcKit.Rid) - return nil, err - } - - return resp, nil -} - -// GetHookRelease get a hookRelease -func (s *Service) GetHookRelease(ctx context.Context, req *pbcs.GetHookReleaseReq) (*pbhr.HookRelease, error) { - - grpcKit := kit.FromGrpcContext(ctx) - resp := new(pbhr.HookRelease) - - res := &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.TemplateSpace, Action: meta.Update}, - BizID: grpcKit.BizID} - if err := s.authorizer.AuthorizeWithResp(grpcKit, resp, res); err != nil { - return nil, err - } - - r := &pbds.GetHookReleaseByIdReq{ - BizId: req.BizId, - HookId: req.HookId, - Id: req.ReleaseId, - } - - release, err := s.client.DS.GetHookReleaseByID(grpcKit.RpcCtx(), r) - if err != nil { - logs.Errorf("get HookRelease failed, err: %v, rid: %s", err, grpcKit.Rid) - return nil, err - } - - content, err := base64.StdEncoding.DecodeString(release.Spec.Content) - if err != nil { - logs.Errorf("base64 decode release content failed, err: %v, rid: %s", err, grpcKit.Rid) - return nil, err - } - release.Spec.Content = string(content) - - return release, nil -} - -// UpdateHookRelease update a HookRelease -func (s *Service) UpdateHookRelease(ctx context.Context, req *pbcs.UpdateHookReleaseReq) (*pbcs.UpdateHookReleaseResp, error) { - grpcKit := kit.FromGrpcContext(ctx) - resp := new(pbcs.UpdateHookReleaseResp) - - res := &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.TemplateSpace, Action: meta.Update, - ResourceID: req.ReleaseId}, BizID: grpcKit.BizID} - if err := s.authorizer.AuthorizeWithResp(grpcKit, resp, res); err != nil { - return nil, err - } - - contentBase64 := base64.StdEncoding.EncodeToString([]byte(req.Content)) - r := &pbds.UpdateHookReleaseReq{ - Id: req.ReleaseId, - Attachment: &pbhr.HookReleaseAttachment{ - BizId: req.BizId, - HookId: req.HookId, - }, - Spec: &pbhr.HookReleaseSpec{ - Name: req.Name, - Content: contentBase64, - Memo: req.Memo, - }, - } - if _, err := s.client.DS.UpdateHookRelease(grpcKit.RpcCtx(), r); err != nil { - logs.Errorf("update HookRelease failed, err: %v, rid: %s", err, grpcKit.Rid) - return nil, err - } - - return resp, nil - -} - -// ListHookReleasesReferences 查询hook版本被引用列表 -func (s *Service) ListHookReleasesReferences(ctx context.Context, - req *pbcs.ListHookReleasesReferencesReq) (*pbcs.ListHookReleasesReferencesResp, error) { - - grpcKit := kit.FromGrpcContext(ctx) - resp := new(pbcs.ListHookReleasesReferencesResp) - - res := &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.TemplateSpace, Action: meta.Find}, BizID: grpcKit.BizID} - if err := s.authorizer.AuthorizeWithResp(grpcKit, resp, res); err != nil { - return nil, err - } - - r := &pbds.ListHookReleasesReferencesReq{ - BizId: req.BizId, - HookId: req.HookId, - ReleasesId: req.ReleaseId, - Limit: req.Limit, - Start: req.Start, - } - - rp, err := s.client.DS.ListHookReleasesReferences(grpcKit.RpcCtx(), r) - if err != nil { - logs.Errorf("list TemplateSpaces failed, err: %v, rid: %s", err, grpcKit.Rid) - return nil, err - } - - resp = &pbcs.ListHookReleasesReferencesResp{ - Count: rp.Count, - Details: rp.Details, - } - - return resp, nil - -} diff --git a/bcs-services/bcs-bscp/cmd/data-service/cmd/migrate.go b/bcs-services/bcs-bscp/cmd/data-service/cmd/migrate.go index c783daba76..476f443cd4 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/cmd/migrate.go +++ b/bcs-services/bcs-bscp/cmd/data-service/cmd/migrate.go @@ -16,7 +16,6 @@ import ( "fmt" "github.com/spf13/cobra" - "gorm.io/gorm" "bscp.io/cmd/data-service/db-migration/migrator" "bscp.io/pkg/cc" @@ -24,7 +23,6 @@ import ( _ "bscp.io/cmd/data-service/db-migration/migrations" ) -// cmd for migration var migrateCmd = &cobra.Command{ Use: "migrate", Short: "database migrations tool", @@ -33,7 +31,6 @@ var migrateCmd = &cobra.Command{ }, } -// sub migrate cmd to create migration var migrateCreateCmd = &cobra.Command{ Use: "create", Short: "create a new empty migrations file", @@ -44,39 +41,30 @@ var migrateCreateCmd = &cobra.Command{ return } - var mode string - mode, err = cmd.Flags().GetString("mode") + mode, err := cmd.Flags().GetString("mode") if err != nil { fmt.Println("Unable to read flag `mode`, err:", err) return } - if err = migrator.Create(name, mode); err != nil { + if err := migrator.Create(name, mode); err != nil { fmt.Println("Unable to create migration, err:", err) return } }, } -// sub migrate cmd to execute up migration var migrateUpCmd = &cobra.Command{ Use: "up", Short: "run up migrations", Run: func(cmd *cobra.Command, args []string) { - var ( - err error - step int - debug bool - db *gorm.DB - mig *migrator.Migrator - ) - - step, err = cmd.Flags().GetInt("step") + + step, err := cmd.Flags().GetInt("step") if err != nil { fmt.Println("Unable to read flag `step`, err:", err) return } - debug, err = cmd.Flags().GetBool("debug") + debug, err := cmd.Flags().GetBool("debug") if err != nil { fmt.Println("Unable to read flag `debug`, err:", err) return @@ -87,19 +75,19 @@ var migrateUpCmd = &cobra.Command{ return } - db, err = migrator.NewDB(debug) + db, err := migrator.NewDB(debug) if err != nil { fmt.Println("Unable to new db migrator, err:", err) return } - mig, err = migrator.Init(db) + migrator, err := migrator.Init(db) if err != nil { fmt.Println("Unable to fetch migrator, err:", err) return } - err = mig.Up(step) + err = migrator.Up(step) if err != nil { fmt.Println("Unable to run `up` migrations, err:", err) return @@ -108,48 +96,40 @@ var migrateUpCmd = &cobra.Command{ }, } -// sub migrate cmd to execute down migration var migrateDownCmd = &cobra.Command{ Use: "down", Short: "run down migrations", Run: func(cmd *cobra.Command, args []string) { - var ( - err error - step int - debug bool - db *gorm.DB - mig *migrator.Migrator - ) - - step, err = cmd.Flags().GetInt("step") + + step, err := cmd.Flags().GetInt("step") if err != nil { fmt.Println("Unable to read flag `step`, err:", err) return } - debug, err = cmd.Flags().GetBool("debug") + debug, err := cmd.Flags().GetBool("debug") if err != nil { fmt.Println("Unable to read flag `debug`, err:", err) return } - if err = cc.LoadSettings(SysOpt); err != nil { + if err := cc.LoadSettings(SysOpt); err != nil { fmt.Println("load settings from config files failed, err:", err) return } - db, err = migrator.NewDB(debug) + db, err := migrator.NewDB(debug) if err != nil { fmt.Println("Unable to new db migrator, err:", err) return } - mig, err = migrator.Init(db) + migrator, err := migrator.Init(db) if err != nil { fmt.Println("Unable to fetch migrator, err:", err) return } - err = mig.Down(step) + err = migrator.Down(step) if err != nil { fmt.Println("Unable to run `down` migrations, err:", err) return @@ -157,42 +137,34 @@ var migrateDownCmd = &cobra.Command{ }, } -// sub migrate cmd to get migration status var migrateStatusCmd = &cobra.Command{ Use: "status", Short: "display status of each migrations", Run: func(cmd *cobra.Command, args []string) { - var ( - err error - debug bool - db *gorm.DB - mig *migrator.Migrator - ) - - debug, err = cmd.Flags().GetBool("debug") + debug, err := cmd.Flags().GetBool("debug") if err != nil { fmt.Println("Unable to read flag `debug`, err:", err) return } - if err = cc.LoadSettings(SysOpt); err != nil { + if err := cc.LoadSettings(SysOpt); err != nil { fmt.Println("load settings from config files failed, err:", err) return } - db, err = migrator.NewDB(debug) + db, err := migrator.NewDB(debug) if err != nil { fmt.Println("Unable to new db migrator, err:", err) return } - mig, err = migrator.Init(db) + migrator, err := migrator.Init(db) if err != nil { fmt.Println("Unable to fetch migrator, err:", err) return } - if err = mig.MigrationStatus(); err != nil { + if err := migrator.MigrationStatus(); err != nil { fmt.Println("Unable to fetch migration status, err:", err) return } diff --git a/bcs-services/bcs-bscp/cmd/data-service/db-migration/embed_sql.go b/bcs-services/bcs-bscp/cmd/data-service/db-migration/embed_sql.go index f9e03470fc..e980ff4381 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/db-migration/embed_sql.go +++ b/bcs-services/bcs-bscp/cmd/data-service/db-migration/embed_sql.go @@ -10,7 +10,7 @@ either express or implied. See the License for the specific language governing p limitations under the License. */ -package dbmigration +package db_migration import "embed" diff --git a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/20230207215606_init_schema.go b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/20230207215606_init_schema.go index cdf9daae36..c0ca2dfba5 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/20230207215606_init_schema.go +++ b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/20230207215606_init_schema.go @@ -23,7 +23,6 @@ import ( const mig20230207215606 = "20230207215606_init_schema" func init() { - // add current migration to migrator migrator.GetMigrator().AddMigration(&migrator.Migration{ Version: "20230207215606", Name: "20230207215606_init_schema", @@ -33,7 +32,6 @@ func init() { }) } -// mig20230511114513GormTestUp for up migration func mig20230207215606InitSchemaUp(tx *gorm.DB) error { sqlArr := strings.Split(migrator.GetMigrator().MigrationSQLs[migrator.GetUpSQLKey(mig20230207215606)], ";") for _, sql := range sqlArr { @@ -49,7 +47,6 @@ func mig20230207215606InitSchemaUp(tx *gorm.DB) error { } -// mig20230207215606InitSchemaDown for down migration func mig20230207215606InitSchemaDown(tx *gorm.DB) error { sqlArr := strings.Split(migrator.GetMigrator().MigrationSQLs[migrator.GetDownSQLKey(mig20230207215606)], ";") for _, sql := range sqlArr { diff --git a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/20230418102723_add_credential.go b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/20230418102723_add_credential.go index d4ca001599..09173357e3 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/20230418102723_add_credential.go +++ b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/20230418102723_add_credential.go @@ -23,7 +23,6 @@ import ( const mig20230418102723 = "20230418102723_add_credential" func init() { - // add current migration to migrator migrator.GetMigrator().AddMigration(&migrator.Migration{ Version: "20230418102723", Name: "20230418102723_add_credential", @@ -33,7 +32,6 @@ func init() { }) } -// mig20230418102723AddCredentialUp for up migration func mig20230418102723AddCredentialUp(tx *gorm.DB) error { sqlArr := strings.Split(migrator.GetMigrator().MigrationSQLs[migrator.GetUpSQLKey(mig20230418102723)], ";") for _, sql := range sqlArr { @@ -50,7 +48,6 @@ func mig20230418102723AddCredentialUp(tx *gorm.DB) error { } -// mig20230418102723AddCredentialDown for down migration func mig20230418102723AddCredentialDown(tx *gorm.DB) error { sqlArr := strings.Split(migrator.GetMigrator().MigrationSQLs[migrator.GetDownSQLKey(mig20230418102723)], ";") for _, sql := range sqlArr { diff --git a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/20230511114513_add_template.go b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/20230511114513_add_template.go index a5f5b9412c..9d9c218048 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/20230511114513_add_template.go +++ b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/20230511114513_add_template.go @@ -21,7 +21,6 @@ import ( ) func init() { - // add current migration to migrator migrator.GetMigrator().AddMigration(&migrator.Migration{ Version: "20230511114513", Name: "20230511114513_add_template", @@ -31,7 +30,6 @@ func init() { }) } -// mig20230511114513GormTestUp for up migration func mig20230511114513GormTestUp(tx *gorm.DB) error { // TemplateSpaces :模版空间 type TemplateSpaces struct { @@ -145,7 +143,6 @@ func mig20230511114513GormTestUp(tx *gorm.DB) error { } -// mig20230511114513GormDown for down migration func mig20230511114513GormDown(tx *gorm.DB) error { // IDGenerators : ID生成器 type IDGenerators struct { diff --git a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/20230526152150_add_hook.go b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/20230526152150_add_hook.go deleted file mode 100644 index afe31ac9fa..0000000000 --- a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/20230526152150_add_hook.go +++ /dev/null @@ -1,246 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 migrations - -import ( - "time" - - "gorm.io/gorm" - - "bscp.io/cmd/data-service/db-migration/migrator" -) - -func init() { - migrator.GetMigrator().AddMigration(&migrator.Migration{ - Version: "mig20230526152150", - Name: "20230526152150_add_hook", - Mode: migrator.GormMode, - Up: mig20230526152150GormTestUp, - Down: mig20230526152150GormDown, - }) -} - -func mig20230526152150GormTestUp(tx *gorm.DB) error { - - // Hook 脚本 - type Hook struct { - ID uint `gorm:"type:bigint(1) unsigned not null;primaryKey;autoIncrement:false"` - - // Spec is specifics of the resource defined with user - Name string `gorm:"type:varchar(255) not null;uniqueIndex:idx_bizID_name,priority:2"` - Memo string `gorm:"type:varchar(256) default ''"` - PublishNum uint `gorm:"type:bigint(1) unsigned not null"` - Type string `gorm:"type:varchar(64) not null"` - Tag string `gorm:"type:varchar(64) not null"` - - // Attachment is attachment info of the resource - BizID uint `gorm:"type:bigint(1) unsigned not null;uniqueIndex:idx_bizID_name,priority:1"` - - // Revision is revision info of the resource - Creator string `gorm:"type:varchar(64) not null"` - Reviser string `gorm:"type:varchar(64) not null"` - CreatedAt time.Time `gorm:"type:datetime(6) not null"` - UpdatedAt time.Time `gorm:"type:datetime(6) not null"` - } - - // HookRelease 脚本版本 - type HookRelease struct { - ID uint `gorm:"type:bigint(1) unsigned not null;primaryKey;autoIncrement:false"` - - // Spec is specifics of the resource defined with user - Name string `gorm:"type:varchar(255) not null;;uniqueIndex:idx_bizID_releaseName,priority:2"` - Memo string `gorm:"type:varchar(256) default ''"` - PublishNum uint `gorm:"type:bigint(1) unsigned not null"` - State string `gorm:"type:varchar(64) not null"` - Content string `gorm:"type:longtext"` - - // Attachment is attachment info of the resource - BizID uint `gorm:"type:bigint(1) unsigned not null"` - HookID uint `gorm:"type:bigint(1) unsigned not null;uniqueIndex:idx_bizID_releaseName,priority:1"` - - // Revision is revision info of the resource - Creator string `gorm:"type:varchar(64) not null"` - Reviser string `gorm:"type:varchar(64) not null"` - CreatedAt time.Time `gorm:"type:datetime(6) not null"` - UpdatedAt time.Time `gorm:"type:datetime(6) not null"` - } - - // ConfigHook : 配置脚本 - type ConfigHook struct { - ID uint `gorm:"type:bigint(1) unsigned not null;primaryKey;autoIncrement:false"` - - // Spec is specifics of the resource defined with user - PreHookID uint `gorm:"type:bigint(1) unsigned not null"` - PreHookReleaseID uint `gorm:"type:bigint(1) unsigned not null"` - PostHookID uint `gorm:"type:bigint(1) unsigned not null"` - PostHookReleaseID uint `gorm:"type:bigint(1) unsigned not null"` - - // Attachment is attachment info of the resource - BizID uint `gorm:"type:bigint(1) unsigned not null"` - APPID uint `gorm:"type:bigint(1) unsigned not null;uniqueIndex:idx_AppID:1"` - - // Revision is revision info of the resource - Creator string `gorm:"type:varchar(64) not null"` - Reviser string `gorm:"type:varchar(64) not null"` - CreatedAt time.Time `gorm:"type:datetime(6) not null"` - UpdatedAt time.Time `gorm:"type:datetime(6) not null"` - } - - // Release mapped from table - type Release struct { - PreHookID uint `gorm:"type:bigint(1) unsigned not null"` - PreHookReleaseID uint `gorm:"type:bigint(1) unsigned not null"` - PostHookID uint `gorm:"type:bigint(1) unsigned not null"` - PostHookReleaseID uint `gorm:"type:bigint(1) unsigned not null"` - } - - // IDGenerators : ID生成器 - type IDGenerators struct { - ID uint `gorm:"type:bigint(1) unsigned not null;primaryKey"` - Resource string `gorm:"type:varchar(50) not null;uniqueIndex:idx_resource"` - MaxID uint `gorm:"type:bigint(1) unsigned not null"` - UpdatedAt time.Time `gorm:"type:datetime(6) not null"` - } - - if err := tx.Set("gorm:table_options", "ENGINE=InnoDB CHARSET=utf8mb4"). - AutoMigrate(&Hook{}, &HookRelease{}, &ConfigHook{}, &Release{}); err != nil { - return err - } - - now := time.Now() - if result := tx.Create([]IDGenerators{ - {Resource: "hooks", MaxID: 0, UpdatedAt: now}, - {Resource: "hook_releases", MaxID: 0, UpdatedAt: now}, - {Resource: "config_hooks", MaxID: 0, UpdatedAt: now}, - }); result.Error != nil { - return result.Error - } - - return nil -} - -func mig20230526152150GormDown(tx *gorm.DB) error { - - // Hook 脚本 - type Hook struct { - ID uint `gorm:"type:bigint(1) unsigned not null;primaryKey;autoIncrement:false"` - - // Spec is specifics of the resource defined with user - Name string `gorm:"type:varchar(64) not null;uniqueIndex:idx_bizID_name,priority:2"` - Meme string `gorm:"type:varchar(64) not null"` - PublishNum uint `gorm:"type:bigint(1) unsigned not null"` - Type string `gorm:"type:varchar(64) not null"` - Tag string `gorm:"type:varchar(64) not null"` - - // Attachment is attachment info of the resource - BizID uint `gorm:"type:bigint(1) unsigned not null;uniqueIndex:idx_bizID_name,priority:1"` - - // Revision is revision info of the resource - Creator string `gorm:"type:varchar(64) not null"` - Reviser string `gorm:"type:varchar(64) not null"` - CreatedAt time.Time `gorm:"type:datetime(6) not null"` - UpdatedAt time.Time `gorm:"type:datetime(6) not null"` - } - - // HookRelease 脚本版本 - type HookRelease struct { - ID uint `gorm:"type:bigint(1) unsigned not null;primaryKey;autoIncrement:false"` - - // Spec is specifics of the resource defined with user - Name string `gorm:"type:varchar(64) not null;uniqueIndex:idx_bizID_releaseName,priority:2"` - Meme string `gorm:"type:varchar(64) not null"` - PublishNum uint `gorm:"type:bigint(1) unsigned not null"` - State string `gorm:"type:varchar(64) not null"` - Content string `gorm:"type:longtext"` - - // Attachment is attachment info of the resource - BizID uint `gorm:"type:bigint(1) unsigned not null"` - HookID uint `gorm:"type:bigint(1) unsigned not null;uniqueIndex:idx_bizID_releaseName,priority:1"` - - // Revision is revision info of the resource - Creator string `gorm:"type:varchar(64) not null"` - Reviser string `gorm:"type:varchar(64) not null"` - CreatedAt time.Time `gorm:"type:datetime(6) not null"` - UpdatedAt time.Time `gorm:"type:datetime(6) not null"` - } - - // ConfigHook : 配置脚本 - type ConfigHook struct { - ID uint `gorm:"type:bigint(1) unsigned not null;primaryKey;autoIncrement:false"` - - // Spec is specifics of the resource defined with user - PreHookID uint `gorm:"type:bigint(1) unsigned not null"` - PreHookReleaseID uint `gorm:"type:bigint(1) unsigned not null"` - PostHookID uint `gorm:"type:bigint(1) unsigned not null"` - PostHookReleaseID uint `gorm:"type:bigint(1) unsigned not null"` - - // Attachment is attachment info of the resource - BizID uint `gorm:"type:bigint(1) unsigned not null"` - APPID uint `gorm:"type:bigint(1) unsigned not null;uniqueIndex:idx_AppID:1"` - - // Revision is revision info of the resource - Creator string `gorm:"type:varchar(64) not null"` - Reviser string `gorm:"type:varchar(64) not null"` - CreatedAt time.Time `gorm:"type:datetime(6) not null"` - UpdatedAt time.Time `gorm:"type:datetime(6) not null"` - } - - // Release mapped from table - type Release struct { - PreHookID uint `gorm:"type:bigint(1) unsigned not null"` - PreHookReleaseID uint `gorm:"type:bigint(1) unsigned not null"` - PostHookID uint `gorm:"type:bigint(1) unsigned not null"` - PostHookReleaseID uint `gorm:"type:bigint(1) unsigned not null"` - } - - // IDGenerators : ID生成器 - type IDGenerators struct { - ID uint `gorm:"type:bigint(1) unsigned not null;primaryKey"` - Resource string `gorm:"type:varchar(50) not null;uniqueIndex:idx_resource"` - MaxID uint `gorm:"type:bigint(1) unsigned not null"` - UpdatedAt time.Time `gorm:"type:datetime(6) not null"` - } - - if err := tx.Migrator().DropTable(ConfigHook{}); err != nil { - return err - } - - if err := tx.Migrator().DropColumn(Release{}, "pre_hook_id"); err != nil { - return err - } - if err := tx.Migrator().DropColumn(Release{}, "pre_hook_release_id"); err != nil { - return err - } - if err := tx.Migrator().DropColumn(Release{}, "post_hook_id"); err != nil { - return err - } - if err := tx.Migrator().DropColumn(Release{}, "post_hook_release_id"); err != nil { - return err - } - - if err := tx.Migrator(). - DropTable("hooks", "hook_releases", "config_hooks"); err != nil { - return err - } - - var resources = []string{ - "hooks", - "hook_releases", - "config_hooks", - } - if result := tx.Where("resource IN ?", resources).Delete(&IDGenerators{}); result.Error != nil { - return result.Error - } - - return nil -} diff --git a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/sql/20230207215606_init_schema_down.sql b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/sql/20230207215606_init_schema_down.sql index 84da78d883..cffa8ec939 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/sql/20230207215606_init_schema_down.sql +++ b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/sql/20230207215606_init_schema_down.sql @@ -10,6 +10,7 @@ drop table if exists `current_published_strategies`; drop table if exists `groups`; drop table if exists `group_app_binds`; drop table if exists `released_groups`; +drop table if exists `hooks`; drop table if exists `released_config_items`; drop table if exists `releases`; drop table if exists `current_released_instances`; diff --git a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/sql/20230207215606_init_schema_up.sql b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/sql/20230207215606_init_schema_up.sql index 7ea65b284f..bcaa43c5a1 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/sql/20230207215606_init_schema_up.sql +++ b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrations/sql/20230207215606_init_schema_up.sql @@ -116,6 +116,8 @@ insert into id_generators(resource, max_id, updated_at) values ('group_app_binds', 0, now()); insert into id_generators(resource, max_id, updated_at) values ('released_groups', 0, now()); +insert into id_generators(resource, max_id, updated_at) +values ('hooks', 0, now()); create table if not exists `archived_apps` ( @@ -402,6 +404,34 @@ create table if not exists `strategies` ) engine = innodb default charset = utf8mb4; +create table if not exists `hooks` +( + `id` bigint(1) unsigned not null, + + # spec is specifics of resource defined with user + `name` varchar(255) not null, + `pre_type` varchar(20) not null, + `pre_hook` longtext not null, + `post_type` varchar(20) not null, + `post_hook` longtext not null, + + # Attachment is attachment info of the resource + `biz_id` bigint(1) unsigned not null, + `app_id` bigint(1) unsigned not null, + `release_id` bigint(1) unsigned not null, + + # Revision record revision info of the resource + `creator` varchar(64) not null, + `reviser` varchar(64) not null, + `created_at` datetime(6) not null, + `updated_at` datetime(6) not null, + + primary key (`id`), + unique key `idx_appid_releaseid` (`app_id`, `release_id`), + index `idx_bizid_appid` (`biz_id`, `app_id`) +) engine = innodb + default charset = utf8mb4; + create table if not exists `groups` ( `id` bigint(1) unsigned not null, diff --git a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrator/db.go b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrator/db.go index aff14a4a68..e8c4c9db67 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrator/db.go +++ b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrator/db.go @@ -30,7 +30,6 @@ func NewDB(debug bool) (*gorm.DB, error) { dbConf := cc.DataService().Sharding.AdminDatabase dsn := sharding.URI(dbConf) if debug { - // return the gorm db instance which prints debug log return gorm.Open(mysql.Open(dsn), &gorm.Config{Logger: logger.Default.LogMode(logger.Info)}) } return gorm.Open(mysql.Open(dsn), &gorm.Config{}) diff --git a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrator/gorm_schema.tmpl b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrator/gorm_schema.tmpl index 5aae346711..f32cfd9a19 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrator/gorm_schema.tmpl +++ b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrator/gorm_schema.tmpl @@ -21,7 +21,6 @@ import ( ) func init() { - // add current migration to migrator migrator.GetMigrator().AddMigration(&migrator.Migration{ Version: "{{.Version}}", Name: "{{.Version}}_gorm_{{.FileName}}", @@ -31,7 +30,6 @@ func init() { }) } -// mig{{.Version}}Gorm{{.FuncName}}Up for up migration func mig{{.Version}}Gorm{{.FuncName}}Up(tx *gorm.DB) error { // ModelExample : 模型示例,实际迁移DB时,需按实际情况进行修改(包括修改该注释) type ModelExample struct { @@ -58,7 +56,6 @@ func mig{{.Version}}Gorm{{.FuncName}}Up(tx *gorm.DB) error { } -// mig{{.Version}}Gorm{{.FuncName}}Down for down migration func mig{{.Version}}Gorm{{.FuncName}}Down(tx *gorm.DB) error { if err := tx.Migrator().DropTable("model_example"); err != nil { return err diff --git a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrator/migrator.go b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrator/migrator.go index 31eaffcaa8..878e2387ef 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrator/migrator.go +++ b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrator/migrator.go @@ -105,7 +105,7 @@ func Init(db *gorm.DB) (*Migrator, error) { // Mark the migrations as Done if it is already executed for rows.Next() { var version string - err = rows.Scan(&version) + err := rows.Scan(&version) if err != nil { return migrator, err } @@ -291,7 +291,7 @@ func genSqlMigrationFile(version, fileName string, in interface{}) error { } defer migrationFile.Close() - if _, err = migrationFile.WriteString(out.String()); err != nil { + if _, err := migrationFile.WriteString(out.String()); err != nil { return errors.New("Unable to write to migration file:" + err.Error()) } @@ -302,8 +302,7 @@ func genSqlMigrationFile(version, fileName string, in interface{}) error { } defer upSQLFile.Close() - var downSQLFile *os.File - downSQLFile, err = os.Create(fmt.Sprintf("./cmd/data-service/db-migration/migrations/sql/%s_%s_down.sql", + downSQLFile, err := os.Create(fmt.Sprintf("./cmd/data-service/db-migration/migrations/sql/%s_%s_down.sql", version, fileName)) if err != nil { return errors.New("Unable to create down sql file:" + err.Error()) @@ -343,7 +342,7 @@ func getMigrationSQLs() (map[string]string, error) { dir := "migrations/sql" getAllSQLFiles(dir) for _, file := range allSQLFiles { - content, err := dbmigration.SQLFiles.ReadFile(file) + content, err := db_migration.SQLFiles.ReadFile(file) if err != nil { fmt.Printf("read file %s err: %s", file, err) return nil, fmt.Errorf("read file %s err: %s", file, err) @@ -356,7 +355,7 @@ func getMigrationSQLs() (map[string]string, error) { } func getAllSQLFiles(dir string) error { - entries, err := dbmigration.SQLFiles.ReadDir(dir) + entries, err := db_migration.SQLFiles.ReadDir(dir) if err != nil { return err } diff --git a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrator/sql_schema.tmpl b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrator/sql_schema.tmpl index f6f316f415..c070d2ee27 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrator/sql_schema.tmpl +++ b/bcs-services/bcs-bscp/cmd/data-service/db-migration/migrator/sql_schema.tmpl @@ -23,7 +23,6 @@ import ( const mig{{.Version}} = "{{.Version}}_{{.FileName}}" func init() { - // add current migration to migrator migrator.GetMigrator().AddMigration(&migrator.Migration{ Version: "{{.Version}}", Name: "{{.Version}}_{{.FileName}}", @@ -33,7 +32,6 @@ func init() { }) } -// mig{{.Version}}{{.FuncName}}Up for up migration func mig{{.Version}}{{.FuncName}}Up(tx *gorm.DB) error { sqlArr := strings.Split(migrator.GetMigrator().MigrationSQLs[migrator.GetUpSQLKey(mig{{.Version}})], ";") for _, sql := range sqlArr { @@ -49,7 +47,6 @@ func mig{{.Version}}{{.FuncName}}Up(tx *gorm.DB) error { } -// mig{{.Version}}{{.FuncName}}Down for down migration func mig{{.Version}}{{.FuncName}}Down(tx *gorm.DB) error { sqlArr := strings.Split(migrator.GetMigrator().MigrationSQLs[migrator.GetDownSQLKey(mig{{.Version}})], ";") for _, sql := range sqlArr { diff --git a/bcs-services/bcs-bscp/cmd/data-service/service/app.go b/bcs-services/bcs-bscp/cmd/data-service/service/app.go index 87c46198c9..95708f2e74 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/service/app.go +++ b/bcs-services/bcs-bscp/cmd/data-service/service/app.go @@ -16,6 +16,7 @@ import ( "context" "fmt" "strings" + "time" "bscp.io/pkg/criteria/constant" "bscp.io/pkg/criteria/errf" @@ -25,6 +26,7 @@ import ( pbapp "bscp.io/pkg/protocol/core/app" pbbase "bscp.io/pkg/protocol/core/base" pbds "bscp.io/pkg/protocol/data-service" + "bscp.io/pkg/runtime/filter" "bscp.io/pkg/thirdparty/esb/cmdb" "bscp.io/pkg/tools" "bscp.io/pkg/types" @@ -48,12 +50,15 @@ func (s *Service) CreateApp(ctx context.Context, req *pbds.CreateAppReq) (*pbds. return nil, fmt.Errorf("app name %s already exists", req.Spec.Name) } + now := time.Now() app := &table.App{ BizID: req.BizId, Spec: req.Spec.AppSpec(), Revision: &table.Revision{ - Creator: kt.User, - Reviser: kt.User, + Creator: kt.User, + Reviser: kt.User, + CreatedAt: now, + UpdatedAt: now, }, } @@ -76,7 +81,8 @@ func (s *Service) UpdateApp(ctx context.Context, req *pbds.UpdateAppReq) (*pbbas BizID: req.BizId, Spec: req.Spec.AppSpec(), Revision: &table.Revision{ - Reviser: grpcKit.User, + Reviser: grpcKit.User, + UpdatedAt: time.Now(), }, } if err := s.dao.App().Update(grpcKit, app); err != nil { @@ -142,6 +148,36 @@ func (s *Service) GetAppByName(ctx context.Context, req *pbds.GetAppByNameReq) ( return pbapp.PbApp(app), nil } +// ListApps list apps by query condition. +func (s *Service) ListApps(ctx context.Context, req *pbds.ListAppsReq) (*pbds.ListAppsResp, error) { + grpcKit := kit.FromGrpcContext(ctx) + + // parse pb struct filter to filter.Expression. + filter, err := pbbase.UnmarshalFromPbStructToExpr(req.Filter) + if err != nil { + logs.Errorf("unmarshal pb struct to expression failed, err: %v, rid: %s", err, grpcKit.Rid) + return nil, err + } + + query := &types.ListAppsOption{ + BizID: req.BizId, + Filter: filter, + Page: req.Page.BasePage(), + } + + details, err := s.dao.App().List(grpcKit, query) + if err != nil { + logs.Errorf("list apps failed, err: %v, rid: %s", err, grpcKit.Rid) + return nil, err + } + + resp := &pbds.ListAppsResp{ + Count: details.Count, + Details: pbapp.PbApps(details.Details), + } + return resp, nil +} + // ListAppsRest list apps by query condition. func (s *Service) ListAppsRest(ctx context.Context, req *pbds.ListAppsRestReq) (*pbds.ListAppsResp, error) { kt := kit.FromGrpcContext(ctx) @@ -152,51 +188,60 @@ func (s *Service) ListAppsRest(ctx context.Context, req *pbds.ListAppsRestReq) ( limit = 50 } - opt := &types.BasePage{ + page := &types.BasePage{ Start: req.Start, Limit: limit, } - if err := opt.Validate(types.DefaultPageOption); err != nil { - return nil, err - } - bizList, err := tools.GetUint32List(req.BizId) - if err != nil { - return nil, err + rules := []filter.RuleFactory{} + if req.Operator != "" { + rules = append(rules, filter.AtomRule{ + Field: "creator", + Op: filter.OpFactory(filter.Equal), + Value: req.Operator, + }) } - if len(bizList) == 0 { - return nil, fmt.Errorf("bizList is empty") + + // 按名称模糊搜索 + if req.Name != "" { + rules = append(rules, filter.AtomRule{ + Field: "name", + Op: filter.OpFactory(filter.ContainsInsensitive), + Value: req.Name, + }) } - details, count, err := s.dao.App().List(kt, bizList, req.Name, req.Operator, opt) + bizList, err := tools.GetIntList(req.BizId) if err != nil { - logs.Errorf("list apps failed, err: %v, rid: %s", err, kt.Rid) return nil, err } - resp := &pbds.ListAppsResp{ - Count: uint32(count), - Details: pbapp.PbApps(details), + if len(bizList) == 0 { + return nil, fmt.Errorf("bizList is empty") } - return resp, nil -} -// ListAppsByIDs list apps by query condition. -func (s *Service) ListAppsByIDs(ctx context.Context, req *pbds.ListAppsByIDsReq) (*pbds.ListAppsByIDsResp, error) { - kt := kit.FromGrpcContext(ctx) + filter := &filter.Expression{ + Op: filter.And, + Rules: rules, + } - if len(req.Ids) == 0 { - return nil, fmt.Errorf("app ids is empty") + // 导航查询的场景 + query := &types.ListAppsOption{ + BizList: bizList, + BizID: uint32(bizList[0]), + Filter: filter, + Page: page, } - details, err := s.dao.App().ListAppsByIDs(kt, req.Ids) + details, err := s.dao.App().List(kt, query) if err != nil { logs.Errorf("list apps failed, err: %v, rid: %s", err, kt.Rid) return nil, err } - resp := &pbds.ListAppsByIDsResp{ - Details: pbapp.PbApps(details), + resp := &pbds.ListAppsResp{ + Count: details.Count, + Details: pbapp.PbApps(details.Details), } return resp, nil } diff --git a/bcs-services/bcs-bscp/cmd/data-service/service/config_hook.go b/bcs-services/bcs-bscp/cmd/data-service/service/config_hook.go deleted file mode 100644 index 9e1b7884e7..0000000000 --- a/bcs-services/bcs-bscp/cmd/data-service/service/config_hook.go +++ /dev/null @@ -1,175 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 service - -import ( - "context" - "errors" - "fmt" - - "gorm.io/gorm" - - "bscp.io/pkg/dal/table" - "bscp.io/pkg/kit" - "bscp.io/pkg/logs" - pbbase "bscp.io/pkg/protocol/core/base" - pbch "bscp.io/pkg/protocol/core/config-hook" - pbds "bscp.io/pkg/protocol/data-service" - "bscp.io/pkg/types" -) - -// CreateConfigHook create configHook. -func (s *Service) CreateConfigHook(ctx context.Context, req *pbds.CreateConfigHookReq) (*pbds.CreateResp, error) { - kt := kit.FromGrpcContext(ctx) - - if _, err := s.dao.ConfigHook().GetByAppID(kt, req.Attachment.BizId, req.Attachment.AppId); err == nil { - return nil, fmt.Errorf("configHook app_id %d already exists", req.Attachment.AppId) - } - - if req.Spec.PreHookId > 0 { - opt := &types.GetByPubStateOption{ - BizID: req.Attachment.BizId, - HookID: req.Spec.PreHookId, - State: table.DeployedHookReleased, - } - hr, err := s.dao.HookRelease().GetByPubState(kt, opt) - if err != nil { - logs.Errorf("no released releases of the pre-hook, err: %v, rid: %s", err, kt.Rid) - return nil, errors.New("no released releases of the pre-hook") - } - req.Spec.PreHookReleaseId = hr.ID - } - - if req.Spec.PostHookId > 0 { - opt := &types.GetByPubStateOption{ - BizID: req.Attachment.BizId, - HookID: req.Spec.PostHookId, - State: table.DeployedHookReleased, - } - hr, err := s.dao.HookRelease().GetByPubState(kt, opt) - if err != nil { - logs.Errorf("no released releases of the post-hook, err: %v, rid: %s", err, kt.Rid) - return nil, errors.New("no released releases of the post-hook") - } - req.Spec.PostHookReleaseId = hr.ID - } - - spec, err := req.Spec.ConfigHookSpec() - if err != nil { - logs.Errorf("get configHook spec from pb failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - hook := &table.ConfigHook{ - Spec: spec, - Attachment: req.Attachment.ConfigHookAttachment(), - Revision: &table.Revision{ - Creator: kt.User, - Reviser: kt.User, - }, - } - id, err := s.dao.ConfigHook().Create(kt, hook) - if err != nil { - logs.Errorf("create configHook failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - - resp := &pbds.CreateResp{Id: id} - return resp, nil - -} - -// UpdateConfigHook update ConfigHook. -func (s *Service) UpdateConfigHook(ctx context.Context, req *pbds.UpdateConfigHookReq) (*pbbase.EmptyResp, error) { - - kt := kit.FromGrpcContext(ctx) - - if req.Spec.PreHookId > 0 { - opt := &types.GetByPubStateOption{ - BizID: req.Attachment.BizId, - HookID: req.Spec.PreHookId, - State: table.DeployedHookReleased, - } - hr, err := s.dao.HookRelease().GetByPubState(kt, opt) - if err != nil { - logs.Errorf("no released releases of the pre-hook, err: %v, rid: %s", err, kt.Rid) - return nil, errors.New("no released releases of the pre-hook") - } - req.Spec.PreHookReleaseId = hr.ID - } else { - req.Spec.PreHookId = 0 - req.Spec.PreHookReleaseId = 0 - } - - if req.Spec.PostHookId > 0 { - opt := &types.GetByPubStateOption{ - BizID: req.Attachment.BizId, - HookID: req.Spec.PostHookId, - State: table.DeployedHookReleased, - } - hr, err := s.dao.HookRelease().GetByPubState(kt, opt) - if err != nil { - logs.Errorf("no released releases of the post-hook, err: %v, rid: %s", err, kt.Rid) - return nil, errors.New("no released releases of the post-hook") - } - req.Spec.PostHookReleaseId = hr.ID - } else { - req.Spec.PostHookId = 0 - req.Spec.PostHookReleaseId = 0 - } - - spec, e := req.Spec.ConfigHookSpec() - if e != nil { - logs.Errorf("get ConfigHookSpec spec from pb failed, err: %v, rid: %s", e, kt.Rid) - return nil, e - } - hook := &table.ConfigHook{ - ID: req.Id, - Spec: spec, - Attachment: req.Attachment.ConfigHookAttachment(), - Revision: &table.Revision{ - Reviser: kt.User, - }, - } - if err := s.dao.ConfigHook().Update(kt, hook); err != nil { - logs.Errorf("update ConfigHook failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - - return new(pbbase.EmptyResp), nil -} - -// GetConfigHook get a configHook -func (s *Service) GetConfigHook(ctx context.Context, req *pbds.GetConfigHookReq) (*pbch.ConfigHook, error) { - - kt := kit.FromGrpcContext(ctx) - - hook, err := s.dao.ConfigHook().GetByAppID(kt, req.BizId, req.AppId) - if errors.Is(err, gorm.ErrRecordNotFound) { - return pbch.PbConfigHook(genNilConfigHook()), nil - } - if err != nil { - logs.Errorf("get ConfigHook failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - - return pbch.PbConfigHook(hook), err - -} - -func genNilConfigHook() *table.ConfigHook { - return &table.ConfigHook{ - Spec: &table.ConfigHookSpec{}, - Attachment: &table.ConfigHookAttachment{}, - Revision: &table.Revision{}, - } -} diff --git a/bcs-services/bcs-bscp/cmd/data-service/service/credential.go b/bcs-services/bcs-bscp/cmd/data-service/service/credential.go index d88362c0e7..38e0ae8064 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/service/credential.go +++ b/bcs-services/bcs-bscp/cmd/data-service/service/credential.go @@ -1,22 +1,10 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 service import ( "context" - "errors" "time" + "bscp.io/pkg/criteria/errf" "bscp.io/pkg/dal/table" "bscp.io/pkg/kit" "bscp.io/pkg/logs" @@ -30,15 +18,23 @@ import ( func (s *Service) CreateCredential(ctx context.Context, req *pbds.CreateCredentialReq) (*pbds.CreateResp, error) { kt := kit.FromGrpcContext(ctx) + spec, err := req.Spec.CredentialSpec() + if err != nil { + logs.Errorf("get credential spec from pb failed, err: %v, rid: %s", err, kt.Rid) + return nil, err + } + now := time.Now() credential := &table.Credential{ - Spec: req.Spec.CredentialSpec(), + Spec: spec, Attachment: req.Attachment.CredentialAttachment(), Revision: &table.Revision{ - Creator: kt.User, - Reviser: kt.User, + Creator: kt.User, + Reviser: kt.User, + CreatedAt: now, + UpdatedAt: now, }, } - credential.Spec.ExpiredAt = time.Now() + credential.Spec.ExpiredAt = now id, err := s.dao.Credential().Create(kt, credential) if err != nil { logs.Errorf("create credential failed, err: %v, rid: %s", err, kt.Rid) @@ -54,21 +50,32 @@ func (s *Service) CreateCredential(ctx context.Context, req *pbds.CreateCredenti func (s *Service) ListCredentials(ctx context.Context, req *pbds.ListCredentialReq) (*pbds.ListCredentialResp, error) { kt := kit.FromGrpcContext(ctx) - opt := &types.BasePage{Start: req.Start, Limit: uint(req.Limit)} - if err := opt.Validate(types.DefaultPageOption); err != nil { + // parse pb struct filter to filter.Expression. + filter, err := pbbase.UnmarshalFromPbStructToExpr(req.Filter) + if err != nil { + logs.Errorf("unmarshal pb struct to expression failed, err: %v, rid: %s", err, kt.Rid) return nil, err } - details, count, err := s.dao.Credential().List(kt, req.BizId, req.SearchKey, opt) - + query := &types.ListCredentialsOption{ + BizID: req.BizId, + Page: req.Page.BasePage(), + Filter: filter, + } + details, err := s.dao.Credential().List(kt, query) if err != nil { logs.Errorf("list credential failed, err: %v, rid: %s", err, kt.Rid) return nil, err } + credentials, err := pbcredential.PbCredentials(details.Details) + if err != nil { + logs.Errorf("get pb credential failed, err: %v, rid: %s", err, kt.Rid) + return nil, err + } resp := &pbds.ListCredentialResp{ - Count: uint32(count), - Details: pbcredential.PbCredentials(details), + Count: details.Count, + Details: credentials, } return resp, nil } @@ -83,14 +90,14 @@ func (s *Service) DeleteCredential(ctx context.Context, req *pbds.DeleteCredenti } // 查看credential_scopes表中的数据 - _, count, err := s.dao.CredentialScope().Get(kt, req.Id, req.Attachment.BizId) + credentialScopes, err := s.dao.CredentialScope().Get(kt, req.Id, req.Attachment.BizId) if err != nil { logs.Errorf("get credential scope failed, err: %v, rid: %s", err, kt.Rid) return nil, err } - if count != 0 { - return nil, errors.New("delete Credential failed, credential scope have data") + if credentialScopes.Count != 0 { + return nil, errf.New(errf.InvalidParameter, "delete Credential failed, credential scope have data") } if err := s.dao.Credential().Delete(kt, credential); err != nil { @@ -105,12 +112,20 @@ func (s *Service) DeleteCredential(ctx context.Context, req *pbds.DeleteCredenti func (s *Service) UpdateCredential(ctx context.Context, req *pbds.UpdateCredentialReq) (*pbbase.EmptyResp, error) { kt := kit.FromGrpcContext(ctx) + spec, err := req.Spec.CredentialSpec() + if err != nil { + logs.Errorf("get credential spec from pb failed, err: %v, rid: %s", err, kt.Rid) + return nil, err + } + + now := time.Now() credential := &table.Credential{ ID: req.Id, - Spec: req.Spec.CredentialSpec(), + Spec: spec, Attachment: req.Attachment.CredentialAttachment(), Revision: &table.Revision{ - Reviser: kt.User, + Reviser: kt.User, + UpdatedAt: now, }, } if err := s.dao.Credential().Update(kt, credential); err != nil { diff --git a/bcs-services/bcs-bscp/cmd/data-service/service/credential_scope.go b/bcs-services/bcs-bscp/cmd/data-service/service/credential_scope.go index c3ec325622..82ff453c19 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/service/credential_scope.go +++ b/bcs-services/bcs-bscp/cmd/data-service/service/credential_scope.go @@ -1,15 +1,3 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 service import ( @@ -28,19 +16,19 @@ import ( func (s *Service) ListCredentialScopes(ctx context.Context, req *pbds.ListCredentialScopesReq) (*pbds.ListCredentialScopesResp, error) { kt := kit.FromGrpcContext(ctx) - details, count, err := s.dao.CredentialScope().Get(kt, req.CredentialId, req.BizId) + details, err := s.dao.CredentialScope().Get(kt, req.CredentialId, req.BizId) if err != nil { logs.Errorf("list credential scope failed, err: %v, rid: %s", err, kt.Rid) return nil, err } - credentialScopes, err := pbcrs.PbCredentialScopes(details) + credentialScopes, err := pbcrs.PbCredentialScopes(details.Details) if err != nil { logs.Errorf("get pb credential scope failed, err: %v, rid: %s", err, kt.Rid) return nil, err } resp := &pbds.ListCredentialScopesResp{ - Count: uint32(count), + Count: details.Count, Details: credentialScopes, } return resp, nil @@ -50,8 +38,13 @@ func (s *Service) ListCredentialScopes(ctx context.Context, req *pbds.ListCreden func (s *Service) UpdateCredentialScopes(ctx context.Context, req *pbds.UpdateCredentialScopesReq) (*pbds.UpdateCredentialScopesResp, error) { kt := kit.FromGrpcContext(ctx) - tx := s.dao.GenQuery().Begin() + tx, err := s.dao.BeginTx(kt, req.BizId) + if err != nil { + logs.Errorf("begin transaction failed, err: %v, rid: %s", err, kt.Rid) + return nil, err + } + now := time.Now() for _, updated := range req.Updated { credentialScope := &table.CredentialScope{ ID: updated.Id, @@ -64,19 +57,20 @@ func (s *Service) UpdateCredentialScopes(ctx context.Context, req *pbds.UpdateCr CredentialId: updated.Id, }, Revision: &table.Revision{ - Reviser: kt.User, + Reviser: kt.User, + UpdatedAt: now, }, } - if err := s.dao.CredentialScope().UpdateWithTx(kt, tx, credentialScope); err != nil { + if err = s.dao.CredentialScope().UpdateWithTx(kt, tx, credentialScope); err != nil { logs.Errorf("update credential scope failed, err: %v, rid: %s", err, kt.Rid) - tx.Rollback() + tx.Rollback(kt) return nil, err } } for _, deleted := range req.Deleted { - if err := s.dao.CredentialScope().DeleteWithTx(kt, tx, req.BizId, deleted); err != nil { + if err = s.dao.CredentialScope().DeleteWithTx(kt, tx, req.BizId, deleted); err != nil { logs.Errorf("delete credential scope failed, err: %v, rid: %s", err, kt.Rid) - tx.Rollback() + tx.Rollback(kt) return nil, err } } @@ -92,23 +86,25 @@ func (s *Service) UpdateCredentialScopes(ctx context.Context, req *pbds.UpdateCr CredentialId: req.CredentialId, }, Revision: &table.Revision{ - Creator: kt.User, - Reviser: kt.User, + Creator: kt.User, + Reviser: kt.User, + CreatedAt: now, + UpdatedAt: now, }, } - if _, err := s.dao.CredentialScope().CreateWithTx(kt, tx, credentialScope); err != nil { + if _, err = s.dao.CredentialScope().CreateWithTx(kt, tx, credentialScope); err != nil { logs.Errorf("create credential scope failed, err: %v, rid: %s", err, kt.Rid) - tx.Rollback() + tx.Rollback(kt) return nil, err } } if err := s.dao.Credential().UpdateRevisionWithTx(kt, tx, req.BizId, req.CredentialId); err != nil { logs.Errorf("update credential revision failed, err: %v, rid: %s", err, kt.Rid) - tx.Rollback() + tx.Rollback(kt) return nil, err } - tx.Commit() + tx.Commit(kt) resp := &pbds.UpdateCredentialScopesResp{} return resp, nil } diff --git a/bcs-services/bcs-bscp/cmd/data-service/service/hook.go b/bcs-services/bcs-bscp/cmd/data-service/service/hook.go index 44da19975f..b4f2b21d56 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/service/hook.go +++ b/bcs-services/bcs-bscp/cmd/data-service/service/hook.go @@ -14,9 +14,7 @@ package service import ( "context" - "errors" - "fmt" - "gorm.io/gorm" + "time" "bscp.io/pkg/dal/table" "bscp.io/pkg/kit" @@ -31,206 +29,108 @@ import ( func (s *Service) CreateHook(ctx context.Context, req *pbds.CreateHookReq) (*pbds.CreateResp, error) { kt := kit.FromGrpcContext(ctx) - if _, err := s.dao.Hook().GetByName(kt, req.Attachment.BizId, req.Spec.Name); err == nil { - return nil, fmt.Errorf("hook name %s already exists", req.Spec.Name) - } - spec, err := req.Spec.HookSpec() if err != nil { logs.Errorf("get hook spec from pb failed, err: %v, rid: %s", err, kt.Rid) return nil, err } - res := &table.Revision{ - Creator: kt.User, - Reviser: kt.User, - } - - tx := s.dao.GenQuery().Begin() - - // 1. create hook + now := time.Now() hook := &table.Hook{ Spec: spec, Attachment: req.Attachment.HookAttachment(), - Revision: res, - } - - id, err := s.dao.Hook().CreateWithTx(kt, tx, hook) - if err != nil { - logs.Errorf("create hook failed, err: %v, rid: %s", err, kt.Rid) - tx.Rollback() - return nil, err - } - - // 2. create hook release - release := &table.HookRelease{ - Spec: &table.HookReleaseSpec{ - Name: req.Spec.ReleaseName, - Content: req.Spec.Content, - State: table.NotDeployedHookReleased, + Revision: &table.Revision{ + Creator: kt.User, + Reviser: kt.User, + CreatedAt: now, + UpdatedAt: now, }, - Attachment: &table.HookReleaseAttachment{ - BizID: req.Attachment.BizId, - HookID: id, - }, - Revision: res, } - _, err = s.dao.HookRelease().CreateWithTx(kt, tx, release) + id, err := s.dao.Hook().Create(kt, hook) if err != nil { - logs.Errorf("create hook release failed, err: %v, rid: %s", err, kt.Rid) - tx.Rollback() + logs.Errorf("create hook failed, err: %v, rid: %s", err, kt.Rid) return nil, err } - tx.Commit() - resp := &pbds.CreateResp{Id: id} return resp, nil } // ListHooks list hooks. func (s *Service) ListHooks(ctx context.Context, req *pbds.ListHooksReq) (*pbds.ListHooksResp, error) { - kt := kit.FromGrpcContext(ctx) - page := &types.BasePage{Start: req.Start, Limit: uint(req.Limit)} - opt := &types.ListHooksOption{ - BizID: req.BizId, - Name: req.Name, - Tag: req.Tag, - All: req.All, - NotTag: req.NotTag, - Page: page, - } - - po := &types.PageOption{ - EnableUnlimitedLimit: true, - } - if err := opt.Validate(po); err != nil { + // parse pb struct filter to filter.Expression. + filter, err := pbbase.UnmarshalFromPbStructToExpr(req.Filter) + if err != nil { + logs.Errorf("unmarshal pb struct to expression failed, err: %v, rid: %s", err, kt.Rid) return nil, err } - details, count, err := s.dao.Hook().List(kt, opt) - if err != nil { - logs.Errorf("list hook failed, err: %v, rid: %s", err, kt.Rid) - return nil, err + query := &types.ListHooksOption{ + BizID: req.BizId, + AppID: req.AppId, + Filter: filter, + Page: req.Page.BasePage(), } + details, err := s.dao.Hook().List(kt, query) if err != nil { logs.Errorf("list hook failed, err: %v, rid: %s", err, kt.Rid) return nil, err } - hooks, err := pbhook.PbHooks(details) + hooks, err := pbhook.PbHooks(details.Details) if err != nil { logs.Errorf("get pb hook failed, err: %v, rid: %s", err, kt.Rid) return nil, err } resp := &pbds.ListHooksResp{ - Count: uint32(count), + Count: details.Count, Details: hooks, } return resp, nil } -// DeleteHook delete hook. -func (s *Service) DeleteHook(ctx context.Context, req *pbds.DeleteHookReq) (*pbbase.EmptyResp, error) { +// UpdateHook update hook. +func (s *Service) UpdateHook(ctx context.Context, req *pbds.UpdateHookReq) (*pbbase.EmptyResp, error) { kt := kit.FromGrpcContext(ctx) - tx := s.dao.GenQuery().Begin() - - // 1. delete hook + spec, err := req.Spec.HookSpec() + if err != nil { + logs.Errorf("get hook spec from pb failed, err: %v, rid: %s", err, kt.Rid) + return nil, err + } + now := time.Now() hook := &table.Hook{ ID: req.Id, + Spec: spec, Attachment: req.Attachment.HookAttachment(), - } - if err := s.dao.Hook().DeleteWithTx(kt, tx, hook); err != nil { - logs.Errorf("delete hook failed, err: %v, rid: %s", err, kt.Rid) - tx.Rollback() - return nil, err - } - - // 2. delete hook release - release := &table.HookRelease{ - Attachment: &table.HookReleaseAttachment{ - BizID: req.Attachment.BizId, - HookID: req.Id, + Revision: &table.Revision{ + Reviser: kt.User, + UpdatedAt: now, }, } - if err := s.dao.HookRelease().DeleteByHookIDWithTx(kt, tx, release); err != nil { - logs.Errorf("delete hook release failed, err: %v, rid: %s", err, kt.Rid) - tx.Rollback() + if err := s.dao.Hook().Update(kt, hook); err != nil { + logs.Errorf("update hook failed, err: %v, rid: %s", err, kt.Rid) return nil, err } - tx.Commit() return new(pbbase.EmptyResp), nil } -// ListHookTags list tag -func (s *Service) ListHookTags(ctx context.Context, req *pbds.ListHookTagReq) (*pbds.ListHookTagResp, error) { - - kt := kit.FromGrpcContext(ctx) - - ht, err := s.dao.Hook().CountHookTag(kt, req.BizId) - if err != nil { - logs.Errorf("list hook failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - - resp := &pbds.ListHookTagResp{} - - for _, count := range ht { - resp.Details = append(resp.Details, &pbhook.CountHookTags{ - Tag: count.Tag, - Counts: count.Counts, - }) - } - - return resp, nil -} - -// GetHook get a hook -func (s *Service) GetHook(ctx context.Context, req *pbds.GetHookReq) (*pbds.GetHookResp, error) { - +// DeleteHook delete hook. +func (s *Service) DeleteHook(ctx context.Context, req *pbds.DeleteHookReq) (*pbbase.EmptyResp, error) { kt := kit.FromGrpcContext(ctx) - h, err := s.dao.Hook().GetByID(kt, req.BizId, req.HookId) - if err != nil { - logs.Errorf("list hook failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - - opt := &types.GetByPubStateOption{ - BizID: req.BizId, - HookID: req.HookId, - State: table.NotDeployedHookReleased, + hook := &table.Hook{ + ID: req.Id, + Attachment: req.Attachment.HookAttachment(), } - var releaseID uint32 - release, err := s.dao.HookRelease().GetByPubState(kt, opt) - if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) { - logs.Errorf("get hook failed, err: %v, rid: %s", err, kt.Rid) + if err := s.dao.Hook().Delete(kt, hook); err != nil { + logs.Errorf("delete hook failed, err: %v, rid: %s", err, kt.Rid) return nil, err } - if errors.Is(err, gorm.ErrRecordNotFound) { - releaseID = 0 - } else { - releaseID = release.ID - } - resp := &pbds.GetHookResp{ - Id: h.ID, - Spec: &pbds.GetHookInfoSpec{ - Name: h.Spec.Name, - Type: string(h.Spec.Type), - Tag: h.Spec.Tag, - Memo: h.Spec.Memo, - PublishNum: h.Spec.PublishNum, - Releases: &pbds.GetHookInfoSpec_Releases{NotReleaseId: releaseID}, - }, - Attachment: pbhook.PbHookAttachment(h.Attachment), - Revision: pbbase.PbRevision(h.Revision), - } - - return resp, nil + return new(pbbase.EmptyResp), nil } diff --git a/bcs-services/bcs-bscp/cmd/data-service/service/hook_release.go b/bcs-services/bcs-bscp/cmd/data-service/service/hook_release.go deleted file mode 100644 index 0cb23c869d..0000000000 --- a/bcs-services/bcs-bscp/cmd/data-service/service/hook_release.go +++ /dev/null @@ -1,314 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 service - -import ( - "bscp.io/pkg/runtime/filter" - "context" - "errors" - "fmt" - "time" - - "bscp.io/pkg/dal/table" - "bscp.io/pkg/kit" - "bscp.io/pkg/logs" - pbbase "bscp.io/pkg/protocol/core/base" - hr "bscp.io/pkg/protocol/core/hook-release" - pbhr "bscp.io/pkg/protocol/core/hook-release" - pbds "bscp.io/pkg/protocol/data-service" - "bscp.io/pkg/types" -) - -// CreateHookRelease create hook release with option -func (s *Service) CreateHookRelease(ctx context.Context, - req *pbds.CreateHookReleaseReq) (*pbds.CreateResp, error) { - - kt := kit.FromGrpcContext(ctx) - - if _, err := s.dao.Hook().GetByID(kt, req.Attachment.BizId, req.Attachment.HookId); err != nil { - logs.Errorf("get hook (%d) failed, err: %v, rid: %s", req.Attachment.HookId, err, kt.Rid) - return nil, err - } - - if _, err := s.dao.HookRelease().GetByName(kt, req.Attachment.BizId, req.Attachment.HookId, req.Spec.Name); err == nil { - return nil, fmt.Errorf("hook name %s already exists", req.Spec.Name) - } - - spec, err := req.Spec.HookReleaseSpec() - spec.State = table.NotDeployedHookReleased - if err != nil { - logs.Errorf("get HookReleaseSpec spec from pb failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - hookRelease := &table.HookRelease{ - Spec: spec, - Attachment: req.Attachment.HookReleaseAttachment(), - Revision: &table.Revision{ - Creator: kt.User, - Reviser: kt.User, - }, - } - - id, err := s.dao.HookRelease().Create(kt, hookRelease) - if err != nil { - logs.Errorf("create HookRelease failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - - resp := &pbds.CreateResp{Id: id} - return resp, nil -} - -// ListHookReleases list HookRelease with filter -func (s *Service) ListHookReleases(ctx context.Context, - req *pbds.ListHookReleasesReq) (*pbds.ListHookReleasesResp, error) { - - kt := kit.FromGrpcContext(ctx) - - page := &types.BasePage{Start: req.Start, Limit: uint(req.Limit)} - opt := &types.ListHookReleasesOption{ - BizID: req.BizId, - HookID: req.HookId, - SearchKey: req.SearchKey, - Page: page, - State: table.HookReleaseStatus(req.State), - } - po := &types.PageOption{ - EnableUnlimitedLimit: true, - } - if err := opt.Validate(po); err != nil { - return nil, err - } - - details, count, err := s.dao.HookRelease().List(kt, opt) - if err != nil { - logs.Errorf("list HookRelease failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - - hookRelease, err := pbhr.PbHookReleaseSpaces(details) - if err != nil { - logs.Errorf("get pb hookRelease failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - - resp := &pbds.ListHookReleasesResp{ - Count: uint32(count), - Details: hookRelease, - } - return resp, nil -} - -// GetHookReleaseByID get a release -func (s *Service) GetHookReleaseByID(ctx context.Context, - req *pbds.GetHookReleaseByIdReq) (*hr.HookRelease, error) { - - kt := kit.FromGrpcContext(ctx) - - hookRelease, err := s.dao.HookRelease().Get(kt, req.BizId, req.HookId, req.Id) - if err != nil { - logs.Errorf("get app by id failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - - resp, _ := hr.PbHookRelease(hookRelease) - return resp, nil -} - -// DeleteHookRelease delete a HookRelease -func (s *Service) DeleteHookRelease(ctx context.Context, - req *pbds.DeleteHookReleaseReq) (*pbbase.EmptyResp, error) { - - kt := kit.FromGrpcContext(ctx) - - HookRelease := &table.HookRelease{ - ID: req.Id, - Attachment: &table.HookReleaseAttachment{ - BizID: req.BizId, - HookID: req.HookId, - }, - } - - if err := s.dao.HookRelease().Delete(kt, HookRelease); err != nil { - logs.Errorf("delete HookRelease failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - - return new(pbbase.EmptyResp), nil -} - -// PublishHookRelease publish a release -func (s *Service) PublishHookRelease(ctx context.Context, req *pbds.PublishHookReleaseReq) (*pbbase.EmptyResp, error) { - - kt := kit.FromGrpcContext(ctx) - - r := &table.HookRelease{ - Attachment: &table.HookReleaseAttachment{ - BizID: req.BizId, - HookID: req.HookId, - }, - Spec: &table.HookReleaseSpec{ - State: table.NotDeployedHookReleased, - }, - Revision: &table.Revision{ - Reviser: kt.User, - }, - } - - tx := s.dao.GenQuery().Begin() - - // 1. 上线的版本下线 - opt := &types.GetByPubStateOption{ - BizID: req.BizId, - HookID: req.HookId, - State: table.DeployedHookReleased, - } - old, err := s.dao.HookRelease().GetByPubState(kt, opt) - if err == nil { - r.ID = old.ID - r.Spec.State = table.ShutdownHookReleased - if e := s.dao.HookRelease().UpdatePubStateWithTx(kt, tx, r); e != nil { - logs.Errorf("update HookRelease State failed, err: %v, rid: %s", err, kt.Rid) - tx.Rollback() - return nil, e - } - } - - // 2. 未上线的版本上线 - r.ID = req.Id - r.Spec.State = table.DeployedHookReleased - if e := s.dao.HookRelease().UpdatePubStateWithTx(kt, tx, r); e != nil { - logs.Errorf("update HookRelease State failed, err: %v, rid: %s", e, kt.Rid) - tx.Rollback() - return nil, err - } - - tx.Commit() - - return new(pbbase.EmptyResp), nil - -} - -// GetHookReleaseByPubState get a HookRelease by State -func (s *Service) GetHookReleaseByPubState(ctx context.Context, - req *pbds.GetByPubStateReq) (*hr.HookRelease, error) { - - kt := kit.FromGrpcContext(ctx) - - opt := &types.GetByPubStateOption{ - BizID: req.BizId, - HookID: req.HookId, - State: table.HookReleaseStatus(req.State), - } - - release, err := s.dao.HookRelease().GetByPubState(kt, opt) - if err != nil { - logs.Errorf("get HookRelease failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - - resp, _ := hr.PbHookRelease(release) - - return resp, nil -} - -func (s *Service) UpdateHookRelease(ctx context.Context, req *pbds.UpdateHookReleaseReq) (*pbbase.EmptyResp, error) { - - kt := kit.FromGrpcContext(ctx) - - hookRelease, err := s.dao.HookRelease().Get(kt, req.Attachment.BizId, req.Attachment.HookId, req.Id) - if err != nil { - logs.Errorf("update HookRelease spec from pb failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - - if hookRelease.Spec.State != table.NotDeployedHookReleased { - logs.Errorf("update HookRelease spec from pb failed, err: HookRelease state is not not_released, rid: %s", kt.Rid) - return nil, errors.New("the HookRelease pubState is not not_released, and cannot be updated") - } - - spec, err := req.Spec.HookReleaseSpec() - if err != nil { - logs.Errorf("update HookRelease spec from pb failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - now := time.Now() - hookRelease = &table.HookRelease{ - ID: req.Id, - Spec: spec, - Attachment: req.Attachment.HookReleaseAttachment(), - Revision: &table.Revision{ - Reviser: kt.User, - UpdatedAt: now, - }, - } - if e := s.dao.HookRelease().Update(kt, hookRelease); e != nil { - logs.Errorf("update hookRelease failed, err: %v, rid: %s", e, kt.Rid) - return nil, e - } - - return new(pbbase.EmptyResp), nil -} - -func (s *Service) ListHookReleasesReferences(ctx context.Context, - req *pbds.ListHookReleasesReferencesReq) (*pbds.ListHookReleasesReferencesResp, error) { - - kt := kit.FromGrpcContext(ctx) - - page := &types.BasePage{Start: req.Start, Limit: uint(req.Limit)} - opt := &types.ListHookReleasesReferencesOption{ - BizID: req.BizId, - HookID: req.HookId, - HookReleasesID: req.ReleasesId, - Page: page, - } - if err := opt.Validate(types.DefaultPageOption); err != nil { - return nil, err - } - - results, count, err := s.dao.HookRelease().ListHookReleasesReferences(kt, opt) - if err != nil { - logs.Errorf("list hook references failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - - gcrs, err := s.dao.ReleasedGroup().List(kt, &types.ListReleasedGroupsOption{ - BizID: req.BizId, - Filter: &filter.Expression{ - Op: filter.And, - Rules: []filter.RuleFactory{}, - }, - }) - if err != nil { - logs.Errorf("list group current releases failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - - for _, result := range results { - status, _ := s.queryPublishStatus(gcrs, result.ConfigReleaseID) - result.PubSate = status - } - - if err != nil { - logs.Errorf("list group current releases failed, err: %v, rid: %s", err, kt.Rid) - return nil, err - } - - resp := &pbds.ListHookReleasesReferencesResp{ - Count: uint32(count), - Details: pbhr.PbListHookReleasesReferencesDetails(results), - } - - return resp, nil - -} diff --git a/bcs-services/bcs-bscp/cmd/data-service/service/publish.go b/bcs-services/bcs-bscp/cmd/data-service/service/publish.go index 29350fbbad..7f21a5ef58 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/service/publish.go +++ b/bcs-services/bcs-bscp/cmd/data-service/service/publish.go @@ -16,6 +16,7 @@ import ( "context" "errors" "fmt" + "time" "bscp.io/pkg/dal/orm" "bscp.io/pkg/dal/table" @@ -39,7 +40,8 @@ func (s *Service) Publish(ctx context.Context, req *pbds.PublishReq) (*pbds.Publ Memo: req.Memo, Groups: req.Groups, Revision: &table.CreatedRevision{ - Creator: kt.User, + Creator: kt.User, + CreatedAt: time.Now(), }, } @@ -79,7 +81,7 @@ func (s *Service) GenerateReleaseAndPublish(ctx context.Context, req *pbds.Gener } releasedCIs := make([]*table.ReleasedConfigItem, 0) - // Note: need to change batch operator to query config item and it's commit. + // TODO: need to change batch operator to query config item and it's commit. // step2: query app's all config items. cfgItems, err := s.queryAppConfigItemList(grpcKit, req.BizId, req.AppId) if err != nil { @@ -93,6 +95,7 @@ func (s *Service) GenerateReleaseAndPublish(ctx context.Context, req *pbds.Gener } // step3: query config item newest commit + now := time.Now() for _, item := range cfgItems { commit, e := s.queryCILatestCommit(grpcKit, req.BizId, req.AppId, item.ID) if e != nil { @@ -115,8 +118,7 @@ func (s *Service) GenerateReleaseAndPublish(ctx context.Context, req *pbds.Gener } // step4: begin transaction to create release and released config item. - //tx, err := s.dao.BeginTx(grpcKit, req.BizId) - tx := s.dao.GenQuery().Begin() + tx, err := s.dao.BeginTx(grpcKit, req.BizId) if err != nil { return nil, err } @@ -132,13 +134,14 @@ func (s *Service) GenerateReleaseAndPublish(ctx context.Context, req *pbds.Gener AppID: req.AppId, }, Revision: &table.CreatedRevision{ - Creator: grpcKit.User, + Creator: grpcKit.User, + CreatedAt: now, }, } - releaseID, err := s.dao.Release().CreateWithTxV2(grpcKit, tx, release) + releaseID, err := s.dao.Release().CreateWithTx(grpcKit, tx, release) if err != nil { logs.Errorf("create release failed, err: %v, rid: %s", err, grpcKit.Rid) - tx.Rollback() + tx.Rollback(grpcKit) return nil, err } @@ -147,9 +150,9 @@ func (s *Service) GenerateReleaseAndPublish(ctx context.Context, req *pbds.Gener rci.ReleaseID = releaseID } - if err = s.dao.ReleasedCI().BulkCreateWithTxV2(grpcKit, tx, releasedCIs); err != nil { + if err = s.dao.ReleasedCI().BulkCreateWithTx(grpcKit, tx, releasedCIs); err != nil { logs.Errorf("bulk create released config item failed, err: %v, rid: %s", err, grpcKit.Rid) - tx.Rollback() + tx.Rollback(grpcKit) return nil, err } @@ -165,7 +168,8 @@ func (s *Service) GenerateReleaseAndPublish(ctx context.Context, req *pbds.Gener Memo: req.ReleaseMemo, Groups: groupIDs, Revision: &table.CreatedRevision{ - Creator: kt.User, + Creator: kt.User, + CreatedAt: time.Now(), }, } if e := s.validatePublishGroups(kt, opt); e != nil { @@ -174,12 +178,12 @@ func (s *Service) GenerateReleaseAndPublish(ctx context.Context, req *pbds.Gener pshID, err := s.dao.Publish().PublishWithTx(kt, tx, opt) if err != nil { logs.Errorf("publish strategy failed, err: %v, rid: %s", err, kt.Rid) - tx.Rollback() + tx.Rollback(kt) return nil, err } // step8: commit transaction. - if err = tx.Commit(); err != nil { + if err = tx.Commit(kt); err != nil { logs.Errorf("commit transaction failed, err: %v, rid: %s", err, kt.Rid) return nil, err } diff --git a/bcs-services/bcs-bscp/cmd/data-service/service/release.go b/bcs-services/bcs-bscp/cmd/data-service/service/release.go index b13d824dad..226ef799c2 100644 --- a/bcs-services/bcs-bscp/cmd/data-service/service/release.go +++ b/bcs-services/bcs-bscp/cmd/data-service/service/release.go @@ -19,7 +19,6 @@ import ( "time" pbstruct "github.com/golang/protobuf/ptypes/struct" - "gorm.io/gorm" "bscp.io/pkg/dal/table" "bscp.io/pkg/kit" @@ -36,7 +35,7 @@ func (s *Service) CreateRelease(ctx context.Context, req *pbds.CreateReleaseReq) grpcKit := kit.FromGrpcContext(ctx) releasedCIs := make([]*table.ReleasedConfigItem, 0) - // Note: need to change batch operator to query config item and it's commit. + // TODO: need to change batch operator to query config item and it's commit. // step1: query app's all config items. cfgItems, err := s.queryAppConfigItemList(grpcKit, req.Attachment.BizId, req.Attachment.AppId) if err != nil { @@ -51,10 +50,10 @@ func (s *Service) CreateRelease(ctx context.Context, req *pbds.CreateReleaseReq) // step2: query config item newest commit now := time.Now() for _, item := range cfgItems { - commit, e := s.queryCILatestCommit(grpcKit, req.Attachment.BizId, req.Attachment.AppId, item.ID) - if e != nil { - logs.Errorf("query config item latest commit failed, err: %v, rid: %s", e, grpcKit.Rid) - return nil, e + commit, err := s.queryCILatestCommit(grpcKit, req.Attachment.BizId, req.Attachment.AppId, item.ID) + if err != nil { + logs.Errorf("query config item latest commit failed, err: %v, rid: %s", err, grpcKit.Rid) + return nil, err } releasedCIs = append(releasedCIs, &table.ReleasedConfigItem{ @@ -77,21 +76,6 @@ func (s *Service) CreateRelease(ctx context.Context, req *pbds.CreateReleaseReq) return nil, err } // step4: create release, and create release and released config item need to begin tx. - hook, err := s.dao.ConfigHook().GetByAppID(grpcKit, req.Attachment.BizId, req.Attachment.AppId) - if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) { - logs.Errorf("get configHook failed, err: %v, rid: %s", err, grpcKit.Rid) - return nil, err - } - if !errors.Is(err, gorm.ErrRecordNotFound) { - - req.Spec.Hook = &pbrelease.Hook{ - PreHookId: hook.Spec.PreHookID, - PreHookReleaseId: hook.Spec.PreHookReleaseID, - PostHookId: hook.Spec.PostHookID, - PostHookReleaseId: hook.Spec.PostHookReleaseID, - } - } - release := &table.Release{ Spec: req.Spec.ReleaseSpec(), Attachment: req.Attachment.ReleaseAttachment(), diff --git a/bcs-services/bcs-bscp/cmd/feed-server/bll/eventc/app_event.go b/bcs-services/bcs-bscp/cmd/feed-server/bll/eventc/app_event.go index ed04eb62a7..5d87239d30 100644 --- a/bcs-services/bcs-bscp/cmd/feed-server/bll/eventc/app_event.go +++ b/bcs-services/bcs-bscp/cmd/feed-server/bll/eventc/app_event.go @@ -37,7 +37,7 @@ func newAppEvent(bizID, appID uint32, sch *Scheduler) *appEvent { mc: sch.mc, } - // Note: remove this go-routine, mounts of app may cost unacceptable size of memory. + // TODO: remove this go-routine, mounts of app may cost unacceptable size of memory. go ae.watchEvents(ctx) return ae } diff --git a/bcs-services/bcs-bscp/cmd/feed-server/bll/eventc/consumer.go b/bcs-services/bcs-bscp/cmd/feed-server/bll/eventc/consumer.go index fe84c843bf..fb3e1797b1 100644 --- a/bcs-services/bcs-bscp/cmd/feed-server/bll/eventc/consumer.go +++ b/bcs-services/bcs-bscp/cmd/feed-server/bll/eventc/consumer.go @@ -79,7 +79,7 @@ func (in *consumer) Members() []*member { idx := 0 for _, mem := range in.list { members[idx] = mem - idx++ + idx += 1 } return members diff --git a/bcs-services/bcs-bscp/cmd/feed-server/bll/eventc/pool.go b/bcs-services/bcs-bscp/cmd/feed-server/bll/eventc/pool.go index 6464517691..a11ae3f3fc 100644 --- a/bcs-services/bcs-bscp/cmd/feed-server/bll/eventc/pool.go +++ b/bcs-services/bcs-bscp/cmd/feed-server/bll/eventc/pool.go @@ -77,7 +77,7 @@ func (ap *appPool) PushEvent(appID uint32, es []*types.EventMeta) { } // gc NOTES -// Note: GC +// TODO: GC func (ap *appPool) gc() { panic("implement this") } diff --git a/bcs-services/bcs-bscp/cmd/feed-server/bll/eventc/scheduler.go b/bcs-services/bcs-bscp/cmd/feed-server/bll/eventc/scheduler.go index c12ae90b14..9cbdb93ae4 100644 --- a/bcs-services/bcs-bscp/cmd/feed-server/bll/eventc/scheduler.go +++ b/bcs-services/bcs-bscp/cmd/feed-server/bll/eventc/scheduler.go @@ -228,7 +228,7 @@ func (sch *Scheduler) notifyEvent(kt *kit.Kit, cursorID uint32, members []*membe cnt := 0 wg := sync.WaitGroup{} for idx := range members { - cnt++ + cnt += 1 if err := sch.notifyLimiter.Acquire(kt.Ctx, 1); err != nil { sch.retry.Add(cursorID, members[idx]) @@ -251,7 +251,7 @@ func (sch *Scheduler) notifyEvent(kt *kit.Kit, cursorID uint32, members []*membe } func (sch *Scheduler) notifyOne(kt *kit.Kit, cursorID uint32, one *member) { - // Note: optimize this when a mount of instances have the same labels with same release id. + // TODO: optimize this when a mount of instances have the same labels with same release id. inst := one.InstSpec meta := &btyp.AppInstanceMeta{ BizID: inst.BizID, diff --git a/bcs-services/bcs-bscp/cmd/feed-server/bll/lcache/auth.go b/bcs-services/bcs-bscp/cmd/feed-server/bll/lcache/auth.go index ca1645f3ae..663255a620 100644 --- a/bcs-services/bcs-bscp/cmd/feed-server/bll/lcache/auth.go +++ b/bcs-services/bcs-bscp/cmd/feed-server/bll/lcache/auth.go @@ -71,7 +71,7 @@ func (au *Auth) Authorize(kt *kit.Kit, res *meta.ResourceAttribute) (bool, error if err != gcache.KeyNotFoundError { // this is not a not found error, log it. - logs.Errorf("get biz: %d, auth key: %s authorized from local cache failed, err: %v, rid: %s", res.BizID, key, + logs.Errorf("get biz: %d, auth key: %d authorized from local cache failed, err: %v, rid: %s", res.BizID, key, err, kt.Rid) // do not return here, try to refresh cache for now. } diff --git a/bcs-services/bcs-bscp/cmd/feed-server/bll/observer/observer.go b/bcs-services/bcs-bscp/cmd/feed-server/bll/observer/observer.go index ca6482ec79..98d196f0a7 100644 --- a/bcs-services/bcs-bscp/cmd/feed-server/bll/observer/observer.go +++ b/bcs-services/bcs-bscp/cmd/feed-server/bll/observer/observer.go @@ -23,6 +23,7 @@ import ( "bscp.io/pkg/logs" pbcs "bscp.io/pkg/protocol/cache-service" pbbase "bscp.io/pkg/protocol/core/base" + "bscp.io/pkg/runtime/filter" "bscp.io/pkg/runtime/shutdown" "bscp.io/pkg/types" @@ -182,8 +183,22 @@ func (ob *observer) doLoop(startCursor uint32) { const step = 200 func (ob *observer) listEvents(kt *kit.Kit, startCursor uint32) (uint32, []*types.EventMeta, error) { + ft := &filter.Expression{ + Op: filter.And, + Rules: []filter.RuleFactory{&filter.AtomRule{ + Field: "id", + Op: filter.GreaterThan.Factory(), + Value: startCursor, + }}, + } + + pb, err := ft.MarshalPB() + if err != nil { + return 0, nil, fmt.Errorf("marshal pb expression failed, err: %v", err) + } + opt := &pbcs.ListEventsReq{ - StartCursor: startCursor, + Filter: pb, Page: &pbbase.BasePage{ Start: 0, Limit: step, diff --git a/bcs-services/bcs-bscp/cmd/feed-server/bll/release/watch.go b/bcs-services/bcs-bscp/cmd/feed-server/bll/release/watch.go index d97b592827..1d1ec10efb 100644 --- a/bcs-services/bcs-bscp/cmd/feed-server/bll/release/watch.go +++ b/bcs-services/bcs-bscp/cmd/feed-server/bll/release/watch.go @@ -129,7 +129,7 @@ func (wh *watchHandler) eventReceiver(event *eventc.Event, sn uint64) bool { logs.Errorf("send release message to sidecar failed, fingerprint: %s, sn: %d, err: %v, rid: %s", wh.im.Meta.Fingerprint, sn, err, rid) - // Note: 新增判断机制,判断是否还需要重试,避免大量、高频无效重试。 + // TODO: 新增判断机制,判断是否还需要重试,避免大量、高频无效重试。 // 可考虑增加server端主动关链的操作,强制sidecar进行重链,修复链路。 // if status.Convert(err).Code() == codes.Unavailable { // logs.Errorf("downstream sidecar is unavailable, stop send event, rid: %s", rid) diff --git a/bcs-services/bcs-bscp/cmd/feed-server/service/rpc_sidecar.go b/bcs-services/bcs-bscp/cmd/feed-server/service/rpc_sidecar.go index 1230f5dab5..2c29c8776d 100644 --- a/bcs-services/bcs-bscp/cmd/feed-server/service/rpc_sidecar.go +++ b/bcs-services/bcs-bscp/cmd/feed-server/service/rpc_sidecar.go @@ -70,7 +70,7 @@ func (s *Service) Handshake(ctx context.Context, hm *pbfs.HandshakeMessage) (*pb return nil, status.Errorf(codes.PermissionDenied, "no permission to access bscp server") } - // Note: + // TODO: // 1. get the basic configurations for sidecar if necessary, and send it back to sidecar later. // 2. collect the basic info for the app with biz dimension. @@ -84,7 +84,7 @@ func (s *Service) Handshake(ctx context.Context, hm *pbfs.HandshakeMessage) (*pb Repository: &sfs.RepositoryV1{ RepositoryType: decorator.GetRepositoryType(), Root: decorator.Root(), - // Note: TLS + // TODO: TLS AccessKeyID: decorator.AccessKeyID(), SecretAccessKey: decorator.SecretAccessKey(), Url: decorator.Url(), diff --git a/bcs-services/bcs-bscp/cmd/sidecar/scheduler/app_factory_test.go b/bcs-services/bcs-bscp/cmd/sidecar/scheduler/app_factory_test.go index 486cf35ca6..c9b53b2244 100644 --- a/bcs-services/bcs-bscp/cmd/sidecar/scheduler/app_factory_test.go +++ b/bcs-services/bcs-bscp/cmd/sidecar/scheduler/app_factory_test.go @@ -151,7 +151,7 @@ func TestAppFactory(t *testing.T) { } release, cursorID, exist = factory.CurrentRelease(setting.AppSpec.Applications[0].AppID) - // Note: cursorID has not been used yet. + // TODO: cursorID has not been used yet. if !exist || release != jobCtx.Descriptor.ReleaseID || cursorID != 0 { retry++ sleepTime = sleepTime * 2 diff --git a/bcs-services/bcs-bscp/cmd/sidecar/scheduler/app_runtime.go b/bcs-services/bcs-bscp/cmd/sidecar/scheduler/app_runtime.go index 4309cc9c01..c5d95a06d5 100644 --- a/bcs-services/bcs-bscp/cmd/sidecar/scheduler/app_runtime.go +++ b/bcs-services/bcs-bscp/cmd/sidecar/scheduler/app_runtime.go @@ -140,8 +140,8 @@ func (ar *AppRuntime) loopAppPublishReleaseJob(job *JobContext) { } if err := ar.workspace.PrepareReleaseDirectory(job.Descriptor.ReleaseID); err != nil { - logs.Errorf("prepare app: %d, job's release: %d directory failed, err: %s, rid: %s", ar.appID, - job.Descriptor.ReleaseID, err, job.Vas.Rid) + logs.Errorf("prepare app: %d, job's release: %d directory failed, err: %v, rid: %s", ar.appID, + job.Descriptor.ReleaseID, job.Vas.Rid) job.RetryPolicy.Sleep() continue } @@ -195,7 +195,7 @@ func (ar *AppRuntime) loopAppReleaseForOnce(vas *kit.Vas, desc *sfs.ReleaseEvent return true } - // Note: check if the CI has already been downloaded before in the other release, + // TODO: check if the CI has already been downloaded before in the other release, // if yes, copy it to this release without download it from repository. start := time.Now() diff --git a/bcs-services/bcs-bscp/cmd/sidecar/scheduler/downloader.go b/bcs-services/bcs-bscp/cmd/sidecar/scheduler/downloader.go index c827d5d47f..10d6c83038 100644 --- a/bcs-services/bcs-bscp/cmd/sidecar/scheduler/downloader.go +++ b/bcs-services/bcs-bscp/cmd/sidecar/scheduler/downloader.go @@ -38,7 +38,7 @@ import ( ) const ( - // Note: consider config these options. + // TODO: consider config these options. defaultSwapBufferSize = 2 * 1024 * 1024 defaultRangeDownloadByteSize = 5 * defaultSwapBufferSize requestAwaitResponseTimeoutSeconds = 10 @@ -174,7 +174,7 @@ func (dl *downloader) Download(vas *kit.Vas, downloadUri string, fileSize uint64 } func (dl *downloader) initClient() *http.Client { - // Note: find a way to manage these configuration options. + // TODO: find a way to manage these configuration options. transport := &http.Transport{ Proxy: http.ProxyFromEnvironment, TLSHandshakeTimeout: 5 * time.Second, @@ -184,7 +184,7 @@ func (dl *downloader) initClient() *http.Client { KeepAlive: 30 * time.Second, }).Dial, MaxIdleConnsPerHost: 10, - // Note: confirm this + // TODO: confirm this ResponseHeaderTimeout: 15 * time.Minute, } @@ -333,7 +333,7 @@ func (exec *execDownload) downloadWithRange() error { // calculate the total parts to be downloaded totalParts := int(exec.fileSize / batchSize) if (exec.fileSize % batchSize) > 0 { - totalParts++ + totalParts += 1 } var hitError error @@ -352,7 +352,7 @@ func (exec *execDownload) downloadWithRange() error { end = start + batchSize } - end-- + end -= 1 wg.Add(1) diff --git a/bcs-services/bcs-bscp/cmd/sidecar/scheduler/file_windows.go b/bcs-services/bcs-bscp/cmd/sidecar/scheduler/file_windows.go index ad23e85f88..a2a216e57a 100644 --- a/bcs-services/bcs-bscp/cmd/sidecar/scheduler/file_windows.go +++ b/bcs-services/bcs-bscp/cmd/sidecar/scheduler/file_windows.go @@ -15,6 +15,6 @@ package scheduler import "errors" func prepareReloadDirectory(filePath string) error { - // Note: add windows reload file handle logic. + // TODO: add windows reload file handle logic. return errors.New("windows not support for now.") } diff --git a/bcs-services/bcs-bscp/cmd/sidecar/scheduler/scheduler.go b/bcs-services/bcs-bscp/cmd/sidecar/scheduler/scheduler.go index d5d9835cc8..a1edb2059c 100644 --- a/bcs-services/bcs-bscp/cmd/sidecar/scheduler/scheduler.go +++ b/bcs-services/bcs-bscp/cmd/sidecar/scheduler/scheduler.go @@ -65,7 +65,7 @@ func (sch *Scheduler) OnAppReleaseChange(event *sfs.ReleaseChangeEvent) { // parse payload according the api version. pl := new(sfs.ReleaseChangePayload) if err := jsoni.Unmarshal(event.Payload, pl); err != nil { - // Note: sch.stream.FireEvent() + // TODO: sch.stream.FireEvent() logs.Errorf("decode release change event payload failed, skip the event, err: %v, rid: %s", err, event.Rid) return } diff --git a/bcs-services/bcs-bscp/cmd/sidecar/scheduler/workspace.go b/bcs-services/bcs-bscp/cmd/sidecar/scheduler/workspace.go index 058efb3565..50e078c29b 100644 --- a/bcs-services/bcs-bscp/cmd/sidecar/scheduler/workspace.go +++ b/bcs-services/bcs-bscp/cmd/sidecar/scheduler/workspace.go @@ -56,7 +56,7 @@ func NewWorkspace(ws cc.SidecarWorkspace, spec cc.SidecarAppSpec) (*RuntimeWorks return rw, nil } -// Note: update this landscape. +// TODO: update this landscape. // sidecar's workspace landscape. // ${workspaceRootDirectory}/bk-bscp // ├── file-release-v1 diff --git a/bcs-services/bcs-bscp/cmd/sidecar/stream/client/balancer.go b/bcs-services/bcs-bscp/cmd/sidecar/stream/client/balancer.go index 26a41b47c2..bbc63e74c1 100644 --- a/bcs-services/bcs-bscp/cmd/sidecar/stream/client/balancer.go +++ b/bcs-services/bcs-bscp/cmd/sidecar/stream/client/balancer.go @@ -52,7 +52,7 @@ func (r *balancer) PickOne() string { return r.endpoints[r.max] } - r.index++ + r.index += 1 return r.endpoints[r.index-1] } diff --git a/bcs-services/bcs-bscp/cmd/sidecar/stream/client/client.go b/bcs-services/bcs-bscp/cmd/sidecar/stream/client/client.go index 5271dd6690..19da3dd2ae 100644 --- a/bcs-services/bcs-bscp/cmd/sidecar/stream/client/client.go +++ b/bcs-services/bcs-bscp/cmd/sidecar/stream/client/client.go @@ -57,7 +57,7 @@ func New(opt cc.SidecarUpstream) (Interface, error) { dialOpts := make([]grpc.DialOption, 0) // blocks until the connection is established. dialOpts = append(dialOpts, grpc.WithBlock()) - // Note: confirm this + // TODO: confirm this dialOpts = append(dialOpts, grpc.WithUserAgent("bscp-sidecar")) if !opt.TLS.Enable() { @@ -187,7 +187,7 @@ func (rc *rollingClient) EnableBounce(bounceIntervalHour uint) { func (rc *rollingClient) waitForStateChange() { for { if rc.conn.WaitForStateChange(context.TODO(), connectivity.Ready) { - // Note: loop and wait and then determine whether we need to create a + // TODO: loop and wait and then determine whether we need to create a // new connection } } diff --git a/bcs-services/bcs-bscp/cmd/sidecar/stream/heartbeat.go b/bcs-services/bcs-bscp/cmd/sidecar/stream/heartbeat.go index dee7a472b0..da28b8caf5 100644 --- a/bcs-services/bcs-bscp/cmd/sidecar/stream/heartbeat.go +++ b/bcs-services/bcs-bscp/cmd/sidecar/stream/heartbeat.go @@ -24,7 +24,7 @@ import ( ) const ( - // Note: these config can set by config file. + // TODO: these config can set by config file. // defaultHeartbeatIntervalSec defines heartbeat default interval. defaultHeartbeatInterval = 15 * time.Second // defaultHeartbeatTimeout defines default heartbeat request timeout. diff --git a/bcs-services/bcs-bscp/cmd/sidecar/stream/watch.go b/bcs-services/bcs-bscp/cmd/sidecar/stream/watch.go index 63bd7f0ca5..9fe80fa6fb 100644 --- a/bcs-services/bcs-bscp/cmd/sidecar/stream/watch.go +++ b/bcs-services/bcs-bscp/cmd/sidecar/stream/watch.go @@ -129,7 +129,7 @@ func (w *watch) loopReceiveWatchedEvent(vas *kit.Vas, wStream pbfs.Upstream_Watc if !sfs.IsAPIVersionMatch(event.ApiVersion) { // 此处是不是不应该做版本兼容的校验? - // Note: set sidecar unhealthy, offline and exit. + // TODO: set sidecar unhealthy, offline and exit. logs.Errorf("watch stream received incompatible event version: %s, rid: %s", event.ApiVersion.Format(), event.Rid) break @@ -157,7 +157,7 @@ func (w *watch) loopReceiveWatchedEvent(vas *kit.Vas, wStream pbfs.Upstream_Watc } } - // Note: version is not compatible, do something + // TODO: version is not compatible, do something } diff --git a/bcs-services/bcs-bscp/cmd/ui/service/web.go b/bcs-services/bcs-bscp/cmd/ui/service/web.go index 813340b052..b1aeae71e9 100644 --- a/bcs-services/bcs-bscp/cmd/ui/service/web.go +++ b/bcs-services/bcs-bscp/cmd/ui/service/web.go @@ -177,11 +177,11 @@ func (s *WebServer) subRouter() http.Handler { return r } -// HealthzHandler Healthz 接口 // @Summary Healthz 接口 // @Tags Healthz // @Success 200 {string} string // @Router /healthz [get] +// HealthzHandler Healthz 接口 func (s *WebServer) HealthzHandler(w http.ResponseWriter, r *http.Request) { if err := s.state.Healthz(); err != nil { w.WriteHeader(http.StatusServiceUnavailable) diff --git a/bcs-services/bcs-bscp/embed.go b/bcs-services/bcs-bscp/embed.go index 254ca0cbd5..c7bce15159 100644 --- a/bcs-services/bcs-bscp/embed.go +++ b/bcs-services/bcs-bscp/embed.go @@ -57,8 +57,7 @@ type gzipFileInfo struct { filePath string } -// EmbedWeb .. -type EmbedWeb struct { +type embedWeb struct { dist fs.FS tpl *template.Template root http.FileSystem @@ -66,7 +65,7 @@ type EmbedWeb struct { } // NewEmbedWeb 初始化模版和fs -func NewEmbedWeb() *EmbedWeb { +func NewEmbedWeb() *embedWeb { // dist 路径 dist, err := fs.Sub(frontendAssets, "ui/dist") if err != nil { @@ -78,7 +77,7 @@ func NewEmbedWeb() *EmbedWeb { root := http.FS(dist) - w := &EmbedWeb{ + w := &embedWeb{ dist: dist, tpl: tpl, root: root, @@ -88,7 +87,7 @@ func NewEmbedWeb() *EmbedWeb { } // FaviconHandler favicon Handler -func (e *EmbedWeb) FaviconHandler(w http.ResponseWriter, r *http.Request) { +func (e *embedWeb) FaviconHandler(w http.ResponseWriter, r *http.Request) { // 填写实际的 icon 路径 r.URL.Path = "/favicon.ico" @@ -100,7 +99,7 @@ func (e *EmbedWeb) FaviconHandler(w http.ResponseWriter, r *http.Request) { } // RenderIndexHandler vue html 模板渲染 -func (e *EmbedWeb) RenderIndexHandler(conf *IndexConfig) http.Handler { +func (e *embedWeb) RenderIndexHandler(conf *IndexConfig) http.Handler { fn := func(w http.ResponseWriter, r *http.Request) { tplData := map[string]string{ "BK_STATIC_URL": conf.StaticURL, @@ -121,7 +120,7 @@ func (e *EmbedWeb) RenderIndexHandler(conf *IndexConfig) http.Handler { return http.HandlerFunc(fn) } -func (e *EmbedWeb) shouldCompress(r *http.Request) (bool, *gzipFileInfo) { +func (e *embedWeb) shouldCompress(r *http.Request) (bool, *gzipFileInfo) { // 必须包含 gzip 编码 if !strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") { return false, nil @@ -166,7 +165,7 @@ func (e *EmbedWeb) shouldCompress(r *http.Request) (bool, *gzipFileInfo) { } // StaticFileHandler 静态文件处理函数 -func (e *EmbedWeb) StaticFileHandler(prefix string) http.Handler { +func (e *embedWeb) StaticFileHandler(prefix string) http.Handler { fn := func(w http.ResponseWriter, r *http.Request) { if ok, fileInfo := e.shouldCompress(r); ok { r.URL.Path = fileInfo.filePath diff --git a/bcs-services/bcs-bscp/go.mod b/bcs-services/bcs-bscp/go.mod index ad78eef41a..30d28b2ec8 100644 --- a/bcs-services/bcs-bscp/go.mod +++ b/bcs-services/bcs-bscp/go.mod @@ -41,7 +41,6 @@ require ( github.com/stretchr/testify v1.8.2 github.com/swaggo/http-swagger v1.3.4 github.com/swaggo/swag v1.16.1 - github.com/tencentyun/cos-go-sdk-v5 v0.7.41 github.com/tidwall/gjson v1.14.4 github.com/tidwall/sjson v1.2.5 go.etcd.io/etcd/api/v3 v3.5.8 @@ -61,7 +60,7 @@ require ( gorm.io/plugin/opentelemetry v0.1.2 gorm.io/plugin/prometheus v0.0.0-20230504115745-1aec2356381b gorm.io/sharding v0.5.3 - k8s.io/klog/v2 v2.100.1 + k8s.io/klog/v2 v2.90.1 ) require ( @@ -72,7 +71,6 @@ require ( github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect github.com/bwmarrin/snowflake v0.3.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/clbanning/mxj v1.8.4 // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd/v22 v22.3.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -88,7 +86,6 @@ require ( github.com/go-playground/universal-translator v0.17.0 // indirect github.com/go-playground/validator/v10 v10.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/google/go-querystring v1.0.0 // indirect github.com/gopherjs/gopherjs v1.17.2 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect @@ -109,7 +106,6 @@ require ( github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/mozillazg/go-httpheader v0.2.1 // indirect github.com/parnurzeal/gorequest v0.2.16 // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pelletier/go-toml/v2 v2.0.6 // indirect diff --git a/bcs-services/bcs-bscp/go.sum b/bcs-services/bcs-bscp/go.sum index a269e67537..134695d773 100644 --- a/bcs-services/bcs-bscp/go.sum +++ b/bcs-services/bcs-bscp/go.sum @@ -44,7 +44,6 @@ github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= -github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/Tencent/bk-bcs/bcs-common v0.0.0-20230424025302-1a6fd25f4b45 h1:pKWr/XdjSh/K6ssqprB1z0vkaA2w3jkjO8N+GU2T4Rs= @@ -97,8 +96,6 @@ github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I= -github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -274,8 +271,6 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -292,7 +287,6 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -446,7 +440,6 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -456,8 +449,6 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mozillazg/go-httpheader v0.2.1 h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSrwhe88TQQ= -github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= @@ -631,10 +622,6 @@ github.com/swaggo/http-swagger v1.3.4 h1:q7t/XLx0n15H1Q9/tk3Y9L4n210XzJF5WtnDX64 github.com/swaggo/http-swagger v1.3.4/go.mod h1:9dAh0unqMBAlbp1uE2Uc2mQTxNMU/ha4UbucIg1MFkQ= github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg= github.com/swaggo/swag v1.16.1/go.mod h1:9/LMvHycG3NFHfR6LwvikHv5iFvmPADQ359cKikGxto= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.194/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.194/go.mod h1:yrBKWhChnDqNz1xuXdSbWXG56XawEq0G5j1lg4VwBD4= -github.com/tencentyun/cos-go-sdk-v5 v0.7.41 h1:iU0Li/Np78H4SBna0ECQoF3mpgi6ImLXU+doGzPFXGc= -github.com/tencentyun/cos-go-sdk-v5 v0.7.41/go.mod h1:4dCEtLHGh8QPxHEkgq+nFaky7yZxQuYwgSJM87icDaw= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM= github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= @@ -1167,8 +1154,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= +k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= moul.io/http2curl v1.0.0 h1:6XwpyZOYsgZJrU8exnG87ncVkU1FVCcTRpwzOkTDUi8= moul.io/http2curl v1.0.0/go.mod h1:f6cULg+e4Md/oW1cYmwW4IWQOVl2lGbmCNGOHvzX2kE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/bcs-services/bcs-bscp/pkg/components/bkpaas/bkpaas.go b/bcs-services/bcs-bscp/pkg/components/bkpaas/bkpaas.go index fdda644fec..38b6b8f38d 100644 --- a/bcs-services/bcs-bscp/pkg/components/bkpaas/bkpaas.go +++ b/bcs-services/bcs-bscp/pkg/components/bkpaas/bkpaas.go @@ -53,13 +53,13 @@ func buildAbsoluteUri(webHost string, r *http.Request) string { } // buildLoginURL 返回前端的URL -func buildLoginURL(r *http.Request, loginhost string) string { - u := fmt.Sprintf("%s/login/?c_url=", loginhost) +func buildLoginURL(r *http.Request, Loginhost string) string { + u := fmt.Sprintf("%s/login/?c_url=", Loginhost) return u } // buildLoginPlainURL 返回前端的URL -func buildLoginPlainURL(r *http.Request, loginhost string) string { - u := fmt.Sprintf("%s/login/plain/?c_url=", loginhost) +func buildLoginPlainURL(r *http.Request, Loginhost string) string { + u := fmt.Sprintf("%s/login/plain/?c_url=", Loginhost) return u } diff --git a/bcs-services/bcs-bscp/pkg/config/base.go b/bcs-services/bcs-bscp/pkg/config/base.go index 73b293780f..6e196b7a53 100644 --- a/bcs-services/bcs-bscp/pkg/config/base.go +++ b/bcs-services/bcs-bscp/pkg/config/base.go @@ -15,15 +15,15 @@ package config import ( "time" - _ "time/tzdata" // tzdata .. + _ "time/tzdata" // tzdata TODO ) const ( - // DevEnv .. + // DevEnv TODO DevEnv = "dev" - // StagEnv .. + // StagEnv TODO StagEnv = "stag" - // ProdEnv .. + // ProdEnv TODO ProdEnv = "prod" ) diff --git a/bcs-services/bcs-bscp/pkg/criteria/constant/key.go b/bcs-services/bcs-bscp/pkg/criteria/constant/key.go index fbe10cacc0..82acf554d0 100644 --- a/bcs-services/bcs-bscp/pkg/criteria/constant/key.go +++ b/bcs-services/bcs-bscp/pkg/criteria/constant/key.go @@ -21,8 +21,6 @@ const ( // RidKey is request id header key. RidKey = "X-Bkapi-Request-Id" - // RidKeyGeneric for generic header key - RidKeyGeneric = "X-Request-Id" // UserKey is operator name header key. UserKey = "X-Bkapi-User-Name" @@ -70,11 +68,3 @@ const ( AuthLoginUID = "auth-login-uid" AuthLoginToken = "auth-login-token" ) - -var ( - // RidKeys support request_id keys - RidKeys = []string{ - RidKey, - RidKeyGeneric, - } -) diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/app.go b/bcs-services/bcs-bscp/pkg/dal/dao/app.go index 6b1876d8e0..4eb59a2ccc 100644 --- a/bcs-services/bcs-bscp/pkg/dal/dao/app.go +++ b/bcs-services/bcs-bscp/pkg/dal/dao/app.go @@ -13,16 +13,24 @@ limitations under the License. package dao import ( + "bytes" "errors" "fmt" + "strconv" + "time" - rawgen "gorm.io/gen" - - "bscp.io/pkg/dal/gen" + "bscp.io/pkg/criteria/enumor" + "bscp.io/pkg/criteria/errf" + "bscp.io/pkg/dal/orm" + "bscp.io/pkg/dal/sharding" "bscp.io/pkg/dal/table" "bscp.io/pkg/kit" "bscp.io/pkg/logs" + "bscp.io/pkg/runtime/filter" + "bscp.io/pkg/tools" "bscp.io/pkg/types" + + "github.com/jmoiron/sqlx" ) // App supplies all the app related operations. @@ -38,11 +46,9 @@ type App interface { // get app by name. GetByName(kit *kit.Kit, bizID uint32, name string) (*table.App, error) // List apps with options. - List(kit *kit.Kit, bizList []uint32, name, operator string, opt *types.BasePage) ([]*table.App, int64, error) + List(kit *kit.Kit, opts *types.ListAppsOption) (*types.ListAppDetails, error) // ListAppsByGroupID list apps by group id. ListAppsByGroupID(kit *kit.Kit, groupID, bizID uint32) ([]*table.App, error) - // ListAppsByIDs list apps by app ids. - ListAppsByIDs(kit *kit.Kit, ids []uint32) ([]*table.App, error) // Delete one app instance. Delete(kit *kit.Kit, app *table.App) error // ListAppMetaForCache list app's basic meta info. @@ -52,193 +58,266 @@ type App interface { var _ App = new(appDao) type appDao struct { - genQ *gen.Query + orm orm.Interface + sd *sharding.Sharding idGen IDGenInterface auditDao AuditDao event Event } // List app's detail info with the filter's expression. -func (dao *appDao) List(kit *kit.Kit, bizList []uint32, name, operator string, opt *types.BasePage) ( - []*table.App, int64, error) { - m := dao.genQ.App - q := dao.genQ.App.WithContext(kit.Ctx) +func (ap *appDao) List(kit *kit.Kit, opts *types.ListAppsOption) (*types.ListAppDetails, error) { - var conds []rawgen.Condition - // 当len(bizList) > 1时,适用于导航查询场景 - conds = append(conds, m.BizID.In(bizList...)) - if operator != "" { - conds = append(conds, m.Creator.Eq(operator)) + if opts == nil { + return nil, errf.New(errf.InvalidParameter, "list app options is nil") } - if name != "" { - // 按名称模糊搜索 - conds = append(conds, m.Name.Regexp("(?i)"+name)) + + po := &types.PageOption{ + EnableUnlimitedLimit: true, + DisabledSort: false, } - result, count, err := q.Where(conds...).FindByPage(opt.Offset(), opt.LimitInt()) - if err != nil { - return nil, 0, err + if err := opts.Validate(po); err != nil { + return nil, err } - return result, count, nil -} + sqlOpt := &filter.SQLWhereOption{ + Priority: filter.Priority{"id", "biz_id"}, + CrownedOption: &filter.CrownedOption{ + CrownedOp: filter.And, + Rules: []filter.RuleFactory{}, + }, + } -// ListAppsByGroupID list apps by group id. -func (dao *appDao) ListAppsByGroupID(kit *kit.Kit, groupID, bizID uint32) ([]*table.App, error) { - if bizID == 0 { - return nil, errors.New("biz id is 0") + // 导航查询场景 + if len(opts.BizList) > 1 { + sqlOpt.CrownedOption.Rules = []filter.RuleFactory{ + &filter.AtomRule{ + Field: "biz_id", + Op: filter.OpFactory(filter.In), + Value: opts.BizList, + }, + } + } else { + sqlOpt.CrownedOption.Rules = []filter.RuleFactory{ + &filter.AtomRule{ + Field: "biz_id", + Op: filter.OpFactory(filter.Equal), + Value: opts.BizID, + }, + } } - if groupID == 0 { - return nil, errors.New("group id is 0") + whereExpr, args, err := opts.Filter.SQLWhereExpr(sqlOpt) + if err != nil { + return nil, err } - gm := dao.genQ.Group - gq := dao.genQ.Group.WithContext(kit.Ctx) - group, err := gq.Where(gm.BizID.Eq(bizID), gm.ID.Eq(groupID)).Take() + // 如果 app 有分库分表, 跨 spaces 查询将不可用 + // do count operation only. + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT COUNT(*) FROM ", table.AppTable.Name(), whereExpr) + countSql := filter.SqlJoint(sqlSentence) + count, err := ap.orm.Do(ap.sd.ShardingOne(opts.BizID).DB()).Count(kit.Ctx, countSql, args...) if err != nil { - return nil, fmt.Errorf("get group failed, err: %v", err) + return nil, err } - bm := dao.genQ.GroupAppBind - bq := dao.genQ.GroupAppBind.WithContext(kit.Ctx) - am := dao.genQ.App - aq := dao.genQ.App.WithContext(kit.Ctx) - var conds []rawgen.Condition - conds = append(conds, am.BizID.Eq(bizID)) - - if !group.Spec.Public { - conds = append(conds, aq.Columns(am.ID).In(bq.Select(bm.AppID).Where(bm.GroupID.Eq(groupID)))) + // query app list for now. + pageExpr, err := opts.Page.SQLExpr(&types.PageSQLOption{Sort: types.SortOption{Sort: "id", IfNotPresent: true}}) + if err != nil { + return nil, err } - result, err := aq.Where(conds...).Find() + var sqlQuery []string + sqlQuery = append(sqlQuery, "SELECT ", table.AppColumns.NamedExpr(), " FROM ", table.AppTable.Name(), whereExpr, pageExpr) + querySql := filter.SqlJoint(sqlQuery) + + list := make([]*table.App, 0) + err = ap.orm.Do(ap.sd.ShardingOne(opts.BizID).DB()).Select(kit.Ctx, &list, querySql, args...) if err != nil { return nil, err } - return result, nil + return &types.ListAppDetails{Count: count, Details: list}, nil } -// ListAppsByIDs list apps by app ids. -func (dao *appDao) ListAppsByIDs(kit *kit.Kit, ids []uint32) ([]*table.App, error) { - m := dao.genQ.App - q := dao.genQ.App.WithContext(kit.Ctx) - result, err := q.Where(m.ID.In(ids...)).Find() +// ListAppsByGroupID list apps by group id. +func (ap *appDao) ListAppsByGroupID(kit *kit.Kit, groupID, bizID uint32) ([]*table.App, error) { + + if bizID == 0 { + return nil, errf.New(errf.InvalidParameter, "biz id is 0") + } + if groupID == 0 { + return nil, errf.New(errf.InvalidParameter, "group id is 0") + } + + group := &table.Group{} + var sqlBuf bytes.Buffer + sqlBuf.WriteString("SELECT ") + sqlBuf.WriteString(table.GroupColumns.NamedExpr()) + sqlBuf.WriteString(" FROM ") + sqlBuf.WriteString(table.GroupTable.Name()) + sqlBuf.WriteString(" WHERE biz_id = ? AND id = ?") + + err := ap.orm.Do(ap.sd.ShardingOne(bizID).DB()).Get(kit.Ctx, group, sqlBuf.String(), bizID, groupID) if err != nil { return nil, err } + list := make([]*table.App, 0) - return result, nil + if group.Spec.Public { + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.AppColumns.NamedExpr(), " FROM ", table.AppTable.Name(), + " WHERE biz_id = ?") + sql := filter.SqlJoint(sqlSentence) + + if err := ap.orm.Do(ap.sd.ShardingOne(bizID).DB()).Select(kit.Ctx, &list, sql, bizID); err != nil { + return nil, err + } + } else { + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.AppColumns.NamedExpr(), " FROM ", table.AppTable.Name(), + " WHERE biz_id = ? AND id IN (SELECT app_id FROM ", table.GroupAppBindTable.Name(), " WHERE group_id = ?)") + sql := filter.SqlJoint(sqlSentence) + + err := ap.orm.Do(ap.sd.ShardingOne(bizID).DB()).Select(kit.Ctx, &list, sql, bizID, groupID) + if err != nil { + return nil, err + } + } + return list, nil } // Create one app instance -func (dao *appDao) Create(kit *kit.Kit, g *table.App) (uint32, error) { - if g == nil { - return 0, errors.New("app is nil") +func (ap *appDao) Create(kit *kit.Kit, app *table.App) (uint32, error) { + + if app == nil { + return 0, errf.New(errf.InvalidParameter, "app is nil") } - if err := g.ValidateCreate(); err != nil { - return 0, err + if err := app.ValidateCreate(); err != nil { + return 0, errf.New(errf.InvalidParameter, err.Error()) } - // generate an app id and update to g. - id, err := dao.idGen.One(kit, table.Name(g.TableName())) + // generate an app id and update to app. + id, err := ap.idGen.One(kit, table.AppTable) if err != nil { return 0, err } - g.ID = id - ad := dao.auditDao.DecoratorV2(kit, g.BizID).PrepareCreate(g) - eDecorator := dao.event.Eventf(kit) + app.ID = id - // 多个使用事务处理 - createTx := func(tx *gen.Query) error { - q := tx.App.WithContext(kit.Ctx) - if err = q.Create(g); err != nil { + var sqlSentence []string + sqlSentence = append(sqlSentence, "INSERT INTO ", table.AppTable.Name(), + " (", table.AppColumns.ColumnExpr(), ") ", "VALUES(", table.AppColumns.ColonNameExpr(), ")") + sql := filter.SqlJoint(sqlSentence) + eDecorator := ap.event.Eventf(kit) + err = ap.sd.ShardingOne(app.BizID).AutoTxn(kit, func(txn *sqlx.Tx, opt *sharding.TxnOption) error { + if err := ap.orm.Txn(txn).Insert(kit.Ctx, sql, app); err != nil { return err } - if err = ad.Do(tx); err != nil { - return err + // audit this to be create app details. + au := &AuditOption{Txn: txn, ResShardingUid: opt.ShardingUid} + if err = ap.auditDao.Decorator(kit, app.BizID, enumor.App).AuditCreate(app, au); err != nil { + return fmt.Errorf("audit create app failed, err: %v", err) } // fire the event with txn to ensure the if save the event failed then the business logic is failed anyway. one := types.Event{ Spec: &table.EventSpec{ Resource: table.Application, - ResourceID: g.ID, + ResourceID: app.ID, OpType: table.InsertOp, }, - Attachment: &table.EventAttachment{BizID: g.BizID, AppID: g.ID}, - Revision: &table.CreatedRevision{Creator: kit.User}, + Attachment: &table.EventAttachment{BizID: app.BizID, AppID: app.ID}, + Revision: &table.CreatedRevision{Creator: kit.User, CreatedAt: time.Now()}, } if err = eDecorator.Fire(one); err != nil { - logs.Errorf("fire create app: %s event failed, err: %v, rid: %s", g.ID, err, kit.Rid) - return errors.New("fire event failed, " + err.Error()) + logs.Errorf("fire create app: %s event failed, err: %v, rid: %s", app.ID, err, kit.Rid) + return errf.New(errf.DBOpFailed, "fire event failed, "+err.Error()) } - return nil - } - err = dao.genQ.Transaction(createTx) + }) eDecorator.Finalizer(err) if err != nil { - return 0, err + logs.Errorf("create app, but do auto txn failed, err: %v, rid: %s", err, kit.Rid) + return 0, fmt.Errorf("create app, but auto run txn failed, err: %v", err) } return id, nil } // Update an app instance. -func (dao *appDao) Update(kit *kit.Kit, g *table.App) error { - if g == nil { - return errors.New("app is nil") +func (ap *appDao) Update(kit *kit.Kit, app *table.App) error { + + if app == nil { + return errf.New(errf.InvalidParameter, "app is nil") } - oldOne, err := dao.Get(kit, g.BizID, g.ID) + updateApp, err := ap.Get(kit, app.BizID, app.ID) if err != nil { return fmt.Errorf("get update app failed, err: %v", err) } - if err = g.ValidateUpdate(oldOne.Spec.ConfigType); err != nil { - return err + if err := app.ValidateUpdate(updateApp.Spec.ConfigType); err != nil { + return errf.New(errf.InvalidParameter, err.Error()) } - // 更新操作, 获取当前记录做审计 - m := dao.genQ.App - q := dao.genQ.App.WithContext(kit.Ctx) - ad := dao.auditDao.DecoratorV2(kit, g.BizID).PrepareUpdate(g, oldOne) - eDecorator := dao.event.Eventf(kit) + opts := orm.NewFieldOptions().AddBlankedFields("memo").AddIgnoredFields("id", "biz_id") + expr, toUpdate, err := orm.RearrangeSQLDataWithOption(app, opts) + if err != nil { + return fmt.Errorf("prepare parsed sql expr failed, err: %v", err) + } + + ab := ap.auditDao.Decorator(kit, app.BizID, enumor.App).PrepareUpdate(app) - // 多个使用事务处理 - updateTx := func(tx *gen.Query) error { - q = tx.App.WithContext(kit.Ctx) - if _, err = q.Where(m.BizID.Eq(g.BizID), m.ID.Eq(g.ID)). - Select(m.Memo, m.Reviser).Updates(g); err != nil { + var sqlSentence []string + sqlSentence = append(sqlSentence, "UPDATE ", table.AppTable.Name(), " SET ", expr, " WHERE id = ", + strconv.Itoa(int(app.ID)), " and biz_id = ", strconv.Itoa(int(app.BizID))) + sql := filter.SqlJoint(sqlSentence) + + eDecorator := ap.event.Eventf(kit) + err = ap.sd.ShardingOne(app.BizID).AutoTxn(kit, func(txn *sqlx.Tx, opt *sharding.TxnOption) error { + effected, err := ap.orm.Txn(txn).Update(kit.Ctx, sql, toUpdate) + if err != nil { + logs.Errorf("update app: %d failed, err: %v, rid: %v", app.ID, err, kit.Rid) return err } - if err = ad.Do(tx); err != nil { - return err + if effected == 0 { + logs.Errorf("update one app: %d, but record not found, rid: %v", app.ID, kit.Rid) + return errf.New(errf.RecordNotFound, orm.ErrRecordNotFound.Error()) + } + + if effected > 1 { + logs.Errorf("update one app: %d, but got updated app count: %d, rid: %v", app.ID, effected, kit.Rid) + return fmt.Errorf("matched app count %d is not as excepted", effected) + } + + // do audit + if err := ab.Do(&AuditOption{Txn: txn, ResShardingUid: opt.ShardingUid}); err != nil { + return fmt.Errorf("do app update audit failed, err: %v", err) } // fire the event with txn to ensure the if save the event failed then the business logic is failed anyway. one := types.Event{ Spec: &table.EventSpec{ Resource: table.Application, - ResourceID: g.ID, + ResourceID: app.ID, OpType: table.UpdateOp, }, - Attachment: &table.EventAttachment{BizID: g.BizID, AppID: g.ID}, - Revision: &table.CreatedRevision{Creator: kit.User}, + Attachment: &table.EventAttachment{BizID: app.BizID, AppID: app.ID}, + Revision: &table.CreatedRevision{Creator: kit.User, CreatedAt: time.Now()}, } - if err = eDecorator.Fire(one); err != nil { - logs.Errorf("fire update app: %s event failed, err: %v, rid: %s", g.ID, err, kit.Rid) - return errors.New("fire event failed, " + err.Error()) + if err := eDecorator.Fire(one); err != nil { + logs.Errorf("fire update app: %s event failed, err: %v, rid: %s", app.ID, err, kit.Rid) + return errf.New(errf.DBOpFailed, "fire event failed, "+err.Error()) } return nil - } - err = dao.genQ.Transaction(updateTx) + }) eDecorator.Finalizer(err) @@ -250,121 +329,160 @@ func (dao *appDao) Update(kit *kit.Kit, g *table.App) error { } // Delete an app instance. -func (dao *appDao) Delete(kit *kit.Kit, g *table.App) error { - if g == nil { - return errors.New("app is nil") - } +func (ap *appDao) Delete(kit *kit.Kit, app *table.App) error { - if err := g.ValidateDelete(); err != nil { - return err + if app == nil { + return errf.New(errf.InvalidParameter, "app is nil") } - // 删除操作, 获取当前记录做审计 - m := dao.genQ.App - q := dao.genQ.App.WithContext(kit.Ctx) - oldOne, err := q.Where(m.ID.Eq(g.ID), m.BizID.Eq(g.BizID)).Take() - if err != nil { - return err + if err := app.ValidateDelete(); err != nil { + return errf.New(errf.InvalidParameter, err.Error()) } - ad := dao.auditDao.DecoratorV2(kit, g.BizID).PrepareDelete(oldOne) - eDecorator := dao.event.Eventf(kit) - // 多个使用事务处理 - deleteTx := func(tx *gen.Query) error { - q = tx.App.WithContext(kit.Ctx) - if _, err = q.Where(m.BizID.Eq(g.BizID)).Delete(g); err != nil { + ab := ap.auditDao.Decorator(kit, app.BizID, enumor.App).PrepareDelete(app.ID) + + var sqlSentence []string + sqlSentence = append(sqlSentence, "DELETE FROM ", table.AppTable.Name(), " WHERE id = ", + strconv.Itoa(int(app.ID)), " AND biz_id = ", strconv.Itoa(int(app.BizID))) + sql := filter.SqlJoint(sqlSentence) + + eDecorator := ap.event.Eventf(kit) + err := ap.sd.ShardingOne(app.BizID).AutoTxn(kit, func(txn *sqlx.Tx, opt *sharding.TxnOption) error { + oldApp, err := ap.Get(kit, app.BizID, app.ID) + if err != nil { + return fmt.Errorf("get pre app failed, err: %v", err) + } + + // delete the app at first. + err = ap.orm.Txn(txn).Delete(kit.Ctx, sql) + if err != nil { return err } // archived this deleted app to archive table. - if err = dao.archiveApp(kit, tx, oldOne); err != nil { + if err := ap.archiveApp(kit, txn, oldApp); err != nil { return err } - if err = ad.Do(tx); err != nil { - return err + // audit this delete app details. + auditOpt := &AuditOption{Txn: txn, ResShardingUid: opt.ShardingUid} + if err := ab.Do(auditOpt); err != nil { + return fmt.Errorf("audit delete app failed, err: %v", err) } // fire the event with txn to ensure the if save the event failed then the business logic is failed anyway. one := types.Event{ Spec: &table.EventSpec{ Resource: table.Application, - ResourceID: g.ID, + ResourceID: app.ID, OpType: table.DeleteOp, }, - Attachment: &table.EventAttachment{BizID: g.BizID, AppID: g.ID}, - Revision: &table.CreatedRevision{Creator: kit.User}, + Attachment: &table.EventAttachment{BizID: app.BizID, AppID: app.ID}, + Revision: &table.CreatedRevision{Creator: kit.User, CreatedAt: time.Now()}, } - if err = eDecorator.Fire(one); err != nil { - logs.Errorf("fire delete app: %s event failed, err: %v, rid: %s", g.ID, err, kit.Rid) - return errors.New("fire event failed, " + err.Error()) + if err := eDecorator.Fire(one); err != nil { + logs.Errorf("fire delete app: %s event failed, err: %v, rid: %s", app.ID, err, kit.Rid) + return errf.New(errf.DBOpFailed, "fire event failed, "+err.Error()) } return nil - } - err = dao.genQ.Transaction(deleteTx) + }) eDecorator.Finalizer(err) if err != nil { - logs.Errorf("delete app: %d failed, err: %v, rid: %v", g.ID, err, kit.Rid) - return err + logs.Errorf("delete app: %d failed, err: %v, rid: %v", app.ID, err, kit.Rid) + return fmt.Errorf("delete app, but run txn failed, err: %v", err) } return nil } -// Get 获取单个app详情 -func (dao *appDao) Get(kit *kit.Kit, bizID uint32, appID uint32) (*table.App, error) { - m := dao.genQ.App - q := dao.genQ.App.WithContext(kit.Ctx) - detail, err := q.Where(m.ID.Eq(appID), m.BizID.Eq(bizID)).Take() +func (ap *appDao) Get(kit *kit.Kit, bizID uint32, appID uint32) (*table.App, error) { + + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.AppColumns.NamedExpr(), " FROM ", + table.AppTable.Name(), " WHERE id = ", strconv.Itoa(int(appID)), " AND biz_id = ", strconv.Itoa(int(bizID))) + sql := filter.SqlJoint(sqlSentence) + + one := new(table.App) + err := ap.orm.Do(ap.sd.MustSharding(bizID)).Get(kit.Ctx, one, sql) if err != nil { - return nil, err + return nil, fmt.Errorf("get app details failed, err: %v", err) } - return detail, nil + + return one, nil } // GetByID 通过 AppId 查询 -func (dao *appDao) GetByID(kit *kit.Kit, appID uint32) (*table.App, error) { - m := dao.genQ.App - q := dao.genQ.App.WithContext(kit.Ctx) - - app, err := q.Where(m.ID.Eq(appID)).Take() +func (ap *appDao) GetByID(kit *kit.Kit, appID uint32) (*table.App, error) { + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.AppColumns.NamedExpr(), " FROM ", table.AppTable.Name(), + " WHERE id = ", strconv.Itoa(int(appID))) + expr := filter.SqlJoint(sqlSentence) + one := new(table.App) + err := ap.orm.Do(ap.sd.Admin().DB()).Get(kit.Ctx, one, expr) if err != nil { - return nil, fmt.Errorf("get app failed, err: %v", err) + return nil, fmt.Errorf("get app details failed, err: %v", err) } - return app, nil + return one, nil } // GetByName 通过 name 查询 -func (dao *appDao) GetByName(kit *kit.Kit, bizID uint32, name string) (*table.App, error) { - m := dao.genQ.App - q := dao.genQ.App.WithContext(kit.Ctx) +func (ap *appDao) GetByName(kit *kit.Kit, bizID uint32, name string) (*table.App, error) { + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.AppColumns.NamedExpr(), " FROM ", table.AppTable.Name(), + " WHERE name = '", name, "' AND biz_id = ", strconv.Itoa(int(bizID))) + expr := filter.SqlJoint(sqlSentence) + one := new(table.App) + err := ap.orm.Do(ap.sd.Admin().DB()).Get(kit.Ctx, one, expr) + if err != nil { + return nil, fmt.Errorf("get app details failed, err: %v", err) + } + + return one, nil +} + +func getAppMode(kit *kit.Kit, orm orm.Interface, sd *sharding.Sharding, bizID, appID uint32) (table.AppMode, error) { - app, err := q.Where(m.BizID.Eq(bizID), m.Name.Eq(name)).Take() + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.AppColumns.NamedExpr(), " FROM ", table.AppTable.Name(), + " WHERE id = ", strconv.Itoa(int(appID)), " AND biz_id = ", strconv.Itoa(int(bizID))) + sql := filter.SqlJoint(sqlSentence) + one := new(table.App) + err := orm.Do(sd.MustSharding(bizID)).Get(kit.Ctx, one, sql) if err != nil { - return nil, fmt.Errorf("get app failed, err: %v", err) + return "", errf.New(errf.DBOpFailed, fmt.Sprintf("get app mode failed, err: %v", err)) } - return app, nil + if err := one.Spec.Mode.Validate(); err != nil { + return "", errf.New(errf.InvalidParameter, err.Error()) + } + + return one.Spec.Mode, nil } -func (dao *appDao) archiveApp(kit *kit.Kit, tx *gen.Query, g *table.App) error { - id, err := dao.idGen.One(kit, table.ArchivedAppTable) +func (ap *appDao) archiveApp(kit *kit.Kit, txn *sqlx.Tx, app *table.App) error { + + id, err := ap.idGen.One(kit, table.ArchivedAppTable) if err != nil { return err } archivedApp := &table.ArchivedApp{ - ID: id, - AppID: g.ID, - BizID: g.BizID, + ID: id, + AppID: app.ID, + BizID: app.BizID, + CreatedAt: time.Now(), } - q := tx.ArchivedApp.WithContext(kit.Ctx) - if err = q.Create(archivedApp); err != nil { + var sqlSentence []string + sqlSentence = append(sqlSentence, "INSERT INTO ", table.ArchivedAppTable.Name(), + " (", table.ArchivedAppColumns.ColumnExpr(), ") ", "VALUES(", table.ArchivedAppColumns.ColonNameExpr(), ")") + sql := filter.SqlJoint(sqlSentence) + err = ap.orm.Txn(txn).Insert(kit.Ctx, sql, archivedApp) + if err != nil { return fmt.Errorf("archived delete app failed, err: %v", err) } @@ -372,23 +490,26 @@ func (dao *appDao) archiveApp(kit *kit.Kit, tx *gen.Query, g *table.App) error { } // ListAppMetaForCache list app's basic meta info. -func (dao *appDao) ListAppMetaForCache(kit *kit.Kit, bizID uint32, appIDs []uint32) ( +func (ap *appDao) ListAppMetaForCache(kt *kit.Kit, bizID uint32, appIDs []uint32) ( map[uint32]*types.AppCacheMeta, error) { + if bizID <= 0 || len(appIDs) == 0 { return nil, errors.New("invalid biz id or app id list") } - m := dao.genQ.App - q := dao.genQ.App.WithContext(kit.Ctx) - - result, err := q.Select(m.ID, m.Name, m.ConfigType, m.Mode, m.ReloadType, m.ReloadFilePath). - Where(m.BizID.Eq(bizID), m.ID.In(appIDs...)).Find() - if err != nil { - return nil, err + appIDList := tools.JoinUint32(appIDs, ",") + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT id, name AS 'spec.name', config_type AS 'spec.config_type', mode AS 'spec.mode', reload_type AS ", + "'spec.reload.reload_type', reload_file_path AS 'spec.reload.file_reload_spec.reload_file_path' ", + "FROM ", table.AppTable.Name(), " WHERE id IN (", appIDList, ") AND biz_id = ", strconv.Itoa(int(bizID))) + sql := filter.SqlJoint(sqlSentence) + appList := make([]*table.App, 0) + if err := ap.orm.Do(ap.sd.MustSharding(bizID)).Select(kt.Ctx, &appList, sql); err != nil { + return nil, fmt.Errorf("query db with app failed, err: %v", err) } meta := make(map[uint32]*types.AppCacheMeta) - for _, one := range result { + for _, one := range appList { meta[one.ID] = &types.AppCacheMeta{ Name: one.Spec.Name, ConfigType: one.Spec.ConfigType, diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/audit_builder.go b/bcs-services/bcs-bscp/pkg/dal/dao/audit_builder.go index 178ad2c9ca..18697f21b0 100644 --- a/bcs-services/bcs-bscp/pkg/dal/dao/audit_builder.go +++ b/bcs-services/bcs-bscp/pkg/dal/dao/audit_builder.go @@ -90,6 +90,11 @@ func (ab *AuditBuilder) AuditCreate(cur interface{}, opt *AuditOption) error { ab.prev = cur switch cur.(type) { + case *table.App: + app := cur.(*table.App) + ab.toAudit.AppID = app.ID + ab.toAudit.ResourceID = app.ID + case *table.ConfigItem: configItem := cur.(*table.ConfigItem) ab.toAudit.AppID = configItem.Attachment.AppID @@ -110,8 +115,14 @@ func (ab *AuditBuilder) AuditCreate(cur interface{}, opt *AuditOption) error { ab.toAudit.AppID = release.Attachment.AppID ab.toAudit.ResourceID = release.ID + case *table.Strategy: + strategy := cur.(*table.Strategy) + ab.toAudit.AppID = strategy.Attachment.AppID + ab.toAudit.ResourceID = strategy.ID + case *table.Hook: sset := cur.(*table.Hook) + ab.toAudit.AppID = sset.Attachment.AppID ab.toAudit.ResourceID = sset.ID case *table.TemplateSpace: @@ -127,6 +138,14 @@ func (ab *AuditBuilder) AuditCreate(cur interface{}, opt *AuditOption) error { ab.toAudit.AppID = items[0].Attachment.AppID ab.toAudit.ResourceID = items[0].ReleaseID + case *table.Credential: + sset := cur.(*table.Credential) + ab.toAudit.ResourceID = sset.ID + + case *table.CredentialScope: + sset := cur.(*table.CredentialScope) + ab.toAudit.ResourceID = sset.ID + default: logs.Errorf("unsupported audit create resource: %s, type: %s, rid: %v", ab.toAudit.ResourceType, reflect.TypeOf(cur), ab.toAudit.Rid) @@ -196,6 +215,13 @@ func (ab *AuditBuilder) PrepareUpdate(updatedTo interface{}) AuditDecorator { ab.toAudit.Action = enumor.Update switch updatedTo.(type) { + case *table.App: + app := updatedTo.(*table.App) + if err := ab.decorateAppUpdate(app); err != nil { + ab.hitErr = err + return ab + } + case *table.ConfigItem: ci := updatedTo.(*table.ConfigItem) if err := ab.decorateConfigItemUpdate(ci); err != nil { @@ -203,6 +229,13 @@ func (ab *AuditBuilder) PrepareUpdate(updatedTo interface{}) AuditDecorator { return ab } + case *table.Strategy: + strategy := updatedTo.(*table.Strategy) + if err := ab.decorateStrategyUpdate(strategy); err != nil { + ab.hitErr = err + return ab + } + case *table.Group: group := updatedTo.(*table.Group) if err := ab.decorateGroupUpdate(group); err != nil { @@ -210,6 +243,27 @@ func (ab *AuditBuilder) PrepareUpdate(updatedTo interface{}) AuditDecorator { return ab } + case *table.Hook: + hook := updatedTo.(*table.Hook) + if err := ab.decorateHookUpdate(hook); err != nil { + ab.hitErr = err + return ab + } + + case *table.Credential: + credential := updatedTo.(*table.Credential) + if err := ab.decorateCredentialUpdate(credential); err != nil { + ab.hitErr = err + return ab + } + + case *table.CredentialScope: + credentialScope := updatedTo.(*table.CredentialScope) + if err := ab.decorateCredentialScopeUpdate(credentialScope); err != nil { + ab.hitErr = err + return ab + } + default: logs.Errorf("unsupported audit update resource: %s, type: %s, rid: %v", ab.toAudit.ResourceType, reflect.TypeOf(updatedTo), ab.toAudit.Rid) @@ -232,6 +286,27 @@ func (ab *AuditBuilder) PrepareUpdate(updatedTo interface{}) AuditDecorator { return ab } +func (ab *AuditBuilder) decorateAppUpdate(app *table.App) error { + ab.toAudit.AppID = app.ID + ab.toAudit.ResourceID = app.ID + + prevApp, err := ab.getApp(app.ID) + if err != nil { + return err + } + + ab.prev = prevApp + + changed, err := parseChangedSpecFields(prevApp, app) + if err != nil { + ab.hitErr = err + return fmt.Errorf("parse app changed spec field failed, err: %v", err) + } + + ab.changed = changed + return nil +} + func (ab *AuditBuilder) decorateConfigItemUpdate(ci *table.ConfigItem) error { ab.toAudit.AppID = ci.Attachment.AppID ab.toAudit.ResourceID = ci.ID @@ -253,6 +328,27 @@ func (ab *AuditBuilder) decorateConfigItemUpdate(ci *table.ConfigItem) error { return nil } +func (ab *AuditBuilder) decorateStrategyUpdate(strategy *table.Strategy) error { + ab.toAudit.AppID = strategy.Attachment.AppID + ab.toAudit.ResourceID = strategy.ID + + preStrategy, err := ab.getStrategy(strategy.ID) + if err != nil { + return err + } + + ab.prev = preStrategy + + changed, err := parseChangedSpecFields(preStrategy, strategy) + if err != nil { + ab.hitErr = err + return fmt.Errorf("parse strategy changed spec field failed, err: %v", err) + } + + ab.changed = changed + return nil +} + func (ab *AuditBuilder) decorateGroupUpdate(group *table.Group) error { ab.toAudit.ResourceID = group.ID @@ -273,6 +369,67 @@ func (ab *AuditBuilder) decorateGroupUpdate(group *table.Group) error { return nil } +func (ab *AuditBuilder) decorateHookUpdate(hook *table.Hook) error { + ab.toAudit.AppID = hook.Attachment.AppID + ab.toAudit.ResourceID = hook.ID + + preHook, err := ab.getHook(hook.ID) + if err != nil { + return err + } + + ab.prev = preHook + + changed, err := parseChangedSpecFields(preHook, hook) + if err != nil { + ab.hitErr = err + return fmt.Errorf("parse hook changed spec field failed, err: %v", err) + } + + ab.changed = changed + return nil +} + +func (ab *AuditBuilder) decorateCredentialUpdate(credential *table.Credential) error { + ab.toAudit.ResourceID = credential.ID + + preCredential, err := ab.getCredential(credential.ID) + if err != nil { + return err + } + + ab.prev = preCredential + + changed, err := parseChangedSpecFields(preCredential, credential) + if err != nil { + ab.hitErr = err + return fmt.Errorf("parse credential changed spec field failed, err: %v", err) + } + + ab.changed = changed + return nil +} + +func (ab *AuditBuilder) decorateCredentialScopeUpdate(credentialScope *table.CredentialScope) error { + ab.toAudit.ResourceID = credentialScope.ID + + preCredential, err := ab.getCredentialScope(credentialScope.ID) + if err != nil { + return err + } + + ab.prev = preCredential + + changed, err := parseChangedSpecFields(preCredential, credentialScope) + if err != nil { + ab.hitErr = err + return fmt.Errorf("parse credential scope changed spec field failed, err: %v", err) + } + + ab.changed = changed + return nil +} + // PrepareDelete prepare the resource's previous instance details by // get the instance's detail from db and save it to ab.prev for later use. // Note: call this before resource is deleted. @@ -284,6 +441,16 @@ func (ab *AuditBuilder) PrepareDelete(resID uint32) AuditDecorator { ab.toAudit.Action = enumor.Delete switch ab.toAudit.ResourceType { + case enumor.App: + app, err := ab.getApp(resID) + if err != nil { + ab.hitErr = err + return ab + } + ab.toAudit.AppID = app.ID + ab.toAudit.ResourceID = app.ID + ab.prev = app + case enumor.ConfigItem: configItem, err := ab.getConfigItem(resID) if err != nil { @@ -294,6 +461,16 @@ func (ab *AuditBuilder) PrepareDelete(resID uint32) AuditDecorator { ab.toAudit.ResourceID = configItem.ID ab.prev = configItem + case enumor.Strategy: + strategy, err := ab.getStrategy(resID) + if err != nil { + ab.hitErr = err + return ab + } + ab.toAudit.AppID = strategy.Attachment.AppID + ab.toAudit.ResourceID = strategy.ID + ab.prev = strategy + case enumor.Group: group, err := ab.getGroup(resID) if err != nil { @@ -303,6 +480,34 @@ func (ab *AuditBuilder) PrepareDelete(resID uint32) AuditDecorator { ab.toAudit.ResourceID = group.ID ab.prev = group + case enumor.Hook: + hook, err := ab.getHook(resID) + if err != nil { + ab.hitErr = err + return ab + } + ab.toAudit.AppID = hook.Attachment.AppID + ab.toAudit.ResourceID = hook.ID + ab.prev = hook + + case enumor.Credential: + credential, err := ab.getCredential(resID) + if err != nil { + ab.hitErr = err + return ab + } + ab.toAudit.ResourceID = credential.ID + ab.prev = credential + + case enumor.CredentialScope: + credentialScope, err := ab.getCredentialScope(resID) + if err != nil { + ab.hitErr = err + return ab + } + ab.toAudit.ResourceID = credentialScope.ID + ab.prev = credentialScope + default: ab.hitErr = fmt.Errorf("unsupported audit deleted resource: %s", ab.toAudit.ResourceType) return ab @@ -334,6 +539,20 @@ func (ab *AuditBuilder) Do(opt *AuditOption) error { } +func (ab *AuditBuilder) getApp(appID uint32) (*table.App, error) { + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.AppColumns.NamedExpr(), " FROM ", table.AppTable.Name(), " WHERE id = ", strconv.Itoa(int(appID)), " AND biz_id = ", strconv.Itoa(int(ab.bizID))) + filter := filter2.SqlJoint(sqlSentence) + + one := new(table.App) + err := ab.ad.orm.Do(ab.ad.sd.MustSharding(ab.bizID)).Get(ab.kit.Ctx, one, filter) + if err != nil { + return nil, fmt.Errorf("get app details failed, err: %v", err) + } + + return one, nil +} + func (ab *AuditBuilder) getConfigItem(configItemID uint32) (*table.ConfigItem, error) { var sqlSentence []string sqlSentence = append(sqlSentence, "SELECT ", table.ConfigItemColumns.NamedExpr(), " FROM ", table.ConfigItemTable.Name(), @@ -349,6 +568,21 @@ func (ab *AuditBuilder) getConfigItem(configItemID uint32) (*table.ConfigItem, e return one, nil } +func (ab *AuditBuilder) getStrategy(strategyID uint32) (*table.Strategy, error) { + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.StrategyColumns.NamedExpr(), " FROM ", table.StrategyTable.Name(), + " WHERE id = ", strconv.Itoa(int(strategyID)), " AND biz_id = ", strconv.Itoa(int(ab.bizID))) + filter := filter2.SqlJoint(sqlSentence) + + one := new(table.Strategy) + err := ab.ad.orm.Do(ab.ad.sd.MustSharding(ab.bizID)).Get(ab.kit.Ctx, one, filter) + if err != nil { + return nil, fmt.Errorf("get strategy details failed, err: %v", err) + } + + return one, nil +} + func (ab *AuditBuilder) getGroup(groupID uint32) (*table.Group, error) { var sqlSentence []string sqlSentence = append(sqlSentence, "SELECT ", table.GroupColumns.NamedExpr(), " FROM ", table.GroupTable.Name(), @@ -364,6 +598,51 @@ func (ab *AuditBuilder) getGroup(groupID uint32) (*table.Group, error) { return one, nil } +func (ab *AuditBuilder) getHook(hookID uint32) (*table.Hook, error) { + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.HookColumns.NamedExpr(), " FROM ", table.HookTable.Name(), + " WHERE id = ", strconv.Itoa(int(hookID)), " AND biz_id = ", strconv.Itoa(int(ab.bizID))) + filter := filter2.SqlJoint(sqlSentence) + + one := new(table.Hook) + err := ab.ad.orm.Do(ab.ad.sd.MustSharding(ab.bizID)).Get(ab.kit.Ctx, one, filter) + if err != nil { + return nil, fmt.Errorf("get hook details failed, err: %v", err) + } + + return one, nil +} + +func (ab *AuditBuilder) getCredential(credentialID uint32) (*table.Credential, error) { + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.CredentialColumns.NamedExpr(), " FROM ", table.CredentialTable.Name(), + " WHERE id = ", strconv.Itoa(int(credentialID)), " AND biz_id = ", strconv.Itoa(int(ab.bizID))) + filter := filter2.SqlJoint(sqlSentence) + + one := new(table.Credential) + err := ab.ad.orm.Do(ab.ad.sd.MustSharding(ab.bizID)).Get(ab.kit.Ctx, one, filter) + if err != nil { + return nil, fmt.Errorf("get credential details failed, err: %v", err) + } + + return one, nil +} + +func (ab *AuditBuilder) getCredentialScope(id uint32) (*table.CredentialScope, error) { + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.CredentialScopeColumns.NamedExpr(), " FROM ", table.CredentialScopeTable.Name(), + " WHERE id = ", strconv.Itoa(int(id)), " AND biz_id = ", strconv.Itoa(int(ab.bizID))) + filter := filter2.SqlJoint(sqlSentence) + + one := new(table.CredentialScope) + err := ab.ad.orm.Do(ab.ad.sd.MustSharding(ab.bizID)).Get(ab.kit.Ctx, one, filter) + if err != nil { + return nil, fmt.Errorf("get credential scope details failed, err: %v", err) + } + + return one, nil +} + // parseChangedSpecFields parse the changed filed with pre and cur *structs' Spec field. // both pre and curl should be a *struct, if not, it will 'panic'. // Note: diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/audit_builder_v2.go b/bcs-services/bcs-bscp/pkg/dal/dao/audit_builder_v2.go index dfb50ba9de..9a2b1aea14 100644 --- a/bcs-services/bcs-bscp/pkg/dal/dao/audit_builder_v2.go +++ b/bcs-services/bcs-bscp/pkg/dal/dao/audit_builder_v2.go @@ -41,7 +41,6 @@ type AuditPrepare interface { PrepareCreate(obj AuditRes) AuditDo PrepareUpdate(obj, oldObj AuditRes) AuditDo PrepareDelete(obj AuditRes) AuditDo - PreparePublish(obj AuditRes) AuditDo } // initAuditBuilderV2 create a new audit builder instance. @@ -163,25 +162,3 @@ func (ab *AuditBuilderV2) PrepareDelete(obj AuditRes) AuditDo { ab.toAudit.Detail = string(js) return ab } - -// PreparePublish 发布配置 -func (ab *AuditBuilderV2) PreparePublish(obj AuditRes) AuditDo { - ab.toAudit.ResourceType = enumor.AuditResourceType(obj.ResType()) - ab.toAudit.ResourceID = obj.ResID() - ab.toAudit.Action = enumor.Publish - ab.prev = obj - - detail := &table.AuditBasicDetail{ - Prev: ab.prev, - Changed: nil, - } - - js, err := json.Marshal(detail) - if err != nil { - ab.hitErr = err - return ab - } - ab.toAudit.Detail = string(js) - - return ab -} diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/config_hook.go b/bcs-services/bcs-bscp/pkg/dal/dao/config_hook.go deleted file mode 100644 index be15834b7e..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/dao/config_hook.go +++ /dev/null @@ -1,122 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 dao - -import ( - "bscp.io/pkg/dal/gen" - "bscp.io/pkg/dal/table" - "bscp.io/pkg/kit" -) - -// ConfigHook supplies all the ConfigHook related operations. -type ConfigHook interface { - // Create one ConfigHook instance. - Create(kit *kit.Kit, g *table.ConfigHook) (uint32, error) - // Update one ConfigHook info. - Update(kit *kit.Kit, g *table.ConfigHook) error - // GetByAppID get configHook by name. - GetByAppID(kit *kit.Kit, bizID, appID uint32) (*table.ConfigHook, error) -} - -var _ ConfigHook = new(configHookDao) - -type configHookDao struct { - genQ *gen.Query - idGen IDGenInterface - auditDao AuditDao -} - -// Create one ConfigHook instance. -func (dao *configHookDao) Create(kit *kit.Kit, g *table.ConfigHook) (uint32, error) { - if err := g.ValidateCreate(); err != nil { - return 0, err - } - - // generate a ConfigHook id and update to ConfigHook. - id, err := dao.idGen.One(kit, table.Name(g.TableName())) - if err != nil { - return 0, err - } - g.ID = id - - ad := dao.auditDao.DecoratorV2(kit, g.Attachment.BizID).PrepareCreate(g) - - // 多个使用事务处理 - createTx := func(tx *gen.Query) error { - q := tx.ConfigHook.WithContext(kit.Ctx) - if e := q.Create(g); e != nil { - return e - } - - if e := ad.Do(tx); e != nil { - return e - } - - return nil - } - if e := dao.genQ.Transaction(createTx); e != nil { - return 0, e - } - - return g.ID, nil -} - -// Update one TemplateSpace's info. -func (dao *configHookDao) Update(kit *kit.Kit, g *table.ConfigHook) error { - if err := g.ValidateUpdate(); err != nil { - return err - } - - m := dao.genQ.ConfigHook - - // 更新操作, 获取当前记录做审计 - q := dao.genQ.ConfigHook.WithContext(kit.Ctx) - oldOne, err := q.Where(m.AppID.Eq(g.Attachment.AppID), m.BizID.Eq(g.Attachment.BizID)).Take() - if err != nil { - return err - } - ad := dao.auditDao.DecoratorV2(kit, g.Attachment.BizID).PrepareUpdate(g, oldOne) - - // 多个使用事务处理 - updateTx := func(tx *gen.Query) error { - q = tx.ConfigHook.WithContext(kit.Ctx) - if _, e := q.Where(m.AppID.Eq(g.Attachment.AppID), m.BizID.Eq(g.Attachment.BizID)). - Select(m.PreHookID, m.PreHookReleaseID, m.PostHookID, m.PostHookReleaseID, m.Reviser).Updates(g); e != nil { - return e - } - - if e := ad.Do(tx); e != nil { - return e - } - return nil - } - if e := dao.genQ.Transaction(updateTx); e != nil { - return e - } - - return nil -} - -// GetByAppID get configHook by appID. -func (dao *configHookDao) GetByAppID(kit *kit.Kit, bizID, appID uint32) (*table.ConfigHook, error) { - - m := dao.genQ.ConfigHook - q := dao.genQ.ConfigHook.WithContext(kit.Ctx) - - hook, err := q.Where(m.BizID.Eq(bizID), m.AppID.Eq(appID)).Take() - if err != nil { - return nil, err - } - return hook, nil - -} diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/config_item.go b/bcs-services/bcs-bscp/pkg/dal/dao/config_item.go index fc7486bcc6..86655bfc0c 100644 --- a/bcs-services/bcs-bscp/pkg/dal/dao/config_item.go +++ b/bcs-services/bcs-bscp/pkg/dal/dao/config_item.go @@ -175,7 +175,7 @@ func (dao *configItemDao) Update(kit *kit.Kit, ci *table.ConfigItem) error { } // Get configItem by ID. -// Note: !!!current db is sharded by biz_id,it can not adapt bcs project,need redesign +// TODO: !!!current db is sharded by biz_id,it can not adapt bcs project,need redesign func (dao *configItemDao) Get(kit *kit.Kit, id, bizID uint32) (*table.ConfigItem, error) { if id == 0 { diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/content.go b/bcs-services/bcs-bscp/pkg/dal/dao/content.go index c9a71e4cae..90c9506769 100644 --- a/bcs-services/bcs-bscp/pkg/dal/dao/content.go +++ b/bcs-services/bcs-bscp/pkg/dal/dao/content.go @@ -140,7 +140,7 @@ func (dao *contentDao) CreateWithTx(kit *kit.Kit, tx *sharding.Tx, content *tabl } // Get content by id. -// Note: !!!current db is sharded by biz_id,it can not adapt bcs project,need redesign +// TODO: !!!current db is sharded by biz_id,it can not adapt bcs project,need redesign func (dao *contentDao) Get(kit *kit.Kit, id, bizID uint32) (*table.Content, error) { if id == 0 { diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/credential.go b/bcs-services/bcs-bscp/pkg/dal/dao/credential.go index ccb986f40b..3d849c23d1 100644 --- a/bcs-services/bcs-bscp/pkg/dal/dao/credential.go +++ b/bcs-services/bcs-bscp/pkg/dal/dao/credential.go @@ -1,28 +1,22 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 dao import ( - "errors" "fmt" + "strconv" + "time" + + "github.com/jmoiron/sqlx" "bscp.io/pkg/cc" + "bscp.io/pkg/criteria/constant" + "bscp.io/pkg/criteria/enumor" "bscp.io/pkg/criteria/errf" - "bscp.io/pkg/dal/gen" "bscp.io/pkg/dal/orm" "bscp.io/pkg/dal/sharding" "bscp.io/pkg/dal/table" "bscp.io/pkg/kit" + "bscp.io/pkg/logs" + "bscp.io/pkg/runtime/filter" "bscp.io/pkg/tools" "bscp.io/pkg/types" ) @@ -36,54 +30,53 @@ type Credential interface { // Create one credential instance. Create(kit *kit.Kit, credential *table.Credential) (uint32, error) // List get credentials - List(kit *kit.Kit, bizID uint32, searchKey string, opt *types.BasePage) ([]*table.Credential, int64, error) + List(kit *kit.Kit, opts *types.ListCredentialsOption) (*types.ListCredentialDetails, error) // Delete delete credential Delete(kit *kit.Kit, strategy *table.Credential) error // Update update credential Update(kit *kit.Kit, credential *table.Credential) error // UpdateRevisionWithTx update credential revision with transaction - UpdateRevisionWithTx(kit *kit.Kit, tx *gen.QueryTx, bizID, id uint32) error + UpdateRevisionWithTx(kit *kit.Kit, tx *sharding.Tx, bizID, id uint32) error } var _ Credential = new(credentialDao) type credentialDao struct { - genQ *gen.Query - idGen IDGenInterface - auditDao AuditDao - orm orm.Interface sd *sharding.Sharding credentialSetting cc.Credential + idGen IDGenInterface + auditDao AuditDao event Event } func (dao *credentialDao) Get(kit *kit.Kit, bizID, id uint32) (*table.Credential, error) { if bizID == 0 { - return nil, errors.New("bizID is empty") + return nil, errf.New(errf.InvalidParameter, "bizID is empty") } if id == 0 { - return nil, errors.New("credential id is empty") + return nil, errf.New(errf.InvalidParameter, "credential id is empty") } - m := dao.genQ.Credential - q := dao.genQ.Credential.WithContext(kit.Ctx) + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.CredentialColumns.NamedExpr(), " FROM ", + table.CredentialTable.Name(), " WHERE id = '", strconv.Itoa(int(id)), "' AND biz_id = ", strconv.Itoa(int(bizID))) + sql := filter.SqlJoint(sqlSentence) - credential, err := q.Where(m.BizID.Eq(bizID), m.ID.Eq(id)).Take() - if err != nil { + one := new(table.Credential) + if err := dao.orm.Do(dao.sd.MustSharding(bizID)).Get(kit.Ctx, one, sql); err != nil { return nil, fmt.Errorf("get credential failed, err: %v", err) } - - return credential, nil + return one, nil } // Get Credential by encoded credential string. func (dao *credentialDao) GetByCredentialString(kit *kit.Kit, bizID uint32, str string) (*table.Credential, error) { if bizID == 0 { - return nil, errors.New("bizID is empty") + return nil, errf.New(errf.InvalidParameter, "bizID is empty") } if str == "" { - return nil, errors.New("credential string is empty") + return nil, errf.New(errf.InvalidParameter, "credential string is empty") } // encode credential string @@ -94,133 +87,204 @@ func (dao *credentialDao) GetByCredentialString(kit *kit.Kit, bizID uint32, str return nil, errf.ErrCredentialInvalid } - m := dao.genQ.Credential - q := dao.genQ.Credential.WithContext(kit.Ctx) + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.CredentialColumns.NamedExpr(), " FROM ", + table.CredentialTable.Name(), " WHERE enc_credential = '", encrypted, "' AND biz_id = ", strconv.Itoa(int(bizID))) + sql := filter.SqlJoint(sqlSentence) - credential, err := q.Where(m.BizID.Eq(bizID), m.EncCredential.Eq(encrypted)).Take() - if err != nil { + one := new(table.Credential) + if err := dao.orm.Do(dao.sd.MustSharding(bizID)).Get(kit.Ctx, one, sql); err != nil { return nil, fmt.Errorf("get credential failed, err: %v", err) } - return credential, nil + return one, nil } // Create create credential -func (dao *credentialDao) Create(kit *kit.Kit, g *table.Credential) (uint32, error) { - if err := g.ValidateCreate(); err != nil { - return 0, err +func (dao *credentialDao) Create(kit *kit.Kit, c *table.Credential) (uint32, error) { + + if c == nil { + return 0, errf.New(errf.InvalidParameter, "credential is nil") + } + + if err := c.ValidateCreate(); err != nil { + return 0, errf.New(errf.InvalidParameter, err.Error()) } // generate a credential id and update to credential. - id, err := dao.idGen.One(kit, table.Name(g.TableName())) + id, err := dao.idGen.One(kit, table.CredentialTable) if err != nil { return 0, err } - g.ID = id - ad := dao.auditDao.DecoratorV2(kit, g.Attachment.BizID).PrepareCreate(g) + c.ID = id + var sqlSentence []string + sqlSentence = append(sqlSentence, "INSERT INTO ", table.CredentialTable.Name(), " (", table.CredentialColumns.ColumnExpr(), ") VALUES(", table.CredentialColumns.ColonNameExpr(), ")") - // 多个使用事务处理 - createTx := func(tx *gen.Query) error { - q := tx.Credential.WithContext(kit.Ctx) - if err := q.Create(g); err != nil { - return err - } + sql := filter.SqlJoint(sqlSentence) + err = dao.sd.ShardingOne(c.Attachment.BizID).AutoTxn(kit, + func(txn *sqlx.Tx, opt *sharding.TxnOption) error { + if err := dao.orm.Txn(txn).Insert(kit.Ctx, sql, c); err != nil { + return err + } - if err := ad.Do(tx); err != nil { - return err - } + au := &AuditOption{Txn: txn, ResShardingUid: opt.ShardingUid} + if err = dao.auditDao.Decorator(kit, c.Attachment.BizID, + enumor.Credential).AuditCreate(c, au); err != nil { + return fmt.Errorf("audit create credential failed, err: %v", err) + } - return nil - } - if err := dao.genQ.Transaction(createTx); err != nil { - return 0, nil + return nil + }) + + if err != nil { + logs.Errorf("create credential, but do auto txn failed, err: %v, rid: %s", err, kit.Rid) + return 0, fmt.Errorf("create credential, but auto run txn failed, err: %v", err) } - return g.ID, nil + return id, nil } // List get credentials -func (dao *credentialDao) List(kit *kit.Kit, bizID uint32, searchKey string, opt *types.BasePage) ( - []*table.Credential, int64, error) { - m := dao.genQ.Credential - q := dao.genQ.Credential.WithContext(kit.Ctx) - - result, count, err := q.Where(m.BizID.Eq(bizID)). - Where(q.Where(m.Memo.Regexp("(?i)"+searchKey)).Or(m.Reviser.Regexp("(?i)"+searchKey))). - FindByPage(opt.Offset(), opt.LimitInt()) +func (dao *credentialDao) List(kit *kit.Kit, opts *types.ListCredentialsOption) (*types.ListCredentialDetails, error) { + if opts == nil { + return nil, errf.New(errf.InvalidParameter, "list credential options null") + } + if err := opts.Validate(types.DefaultPageOption); err != nil { + return nil, err + } + sqlOpt := &filter.SQLWhereOption{ + Priority: filter.Priority{"id", "biz_id"}, + CrownedOption: &filter.CrownedOption{ + CrownedOp: filter.And, + Rules: []filter.RuleFactory{ + &filter.AtomRule{ + Field: "biz_id", + Op: filter.Equal.Factory(), + Value: opts.BizID, + }, + }, + }, + } + whereExpr, args, err := opts.Filter.SQLWhereExpr(sqlOpt) + if err != nil { + return nil, err + } + var sqlSentenceCount []string + sqlSentenceCount = append(sqlSentenceCount, "SELECT COUNT(*) FROM ", table.CredentialTable.Name(), whereExpr) + countSql := filter.SqlJoint(sqlSentenceCount) + count, err := dao.orm.Do(dao.sd.ShardingOne(opts.BizID).DB()).Count(kit.Ctx, countSql, args...) if err != nil { - return nil, 0, err + return nil, err } - return result, count, nil + pageExpr, err := opts.Page.SQLExpr(&types.PageSQLOption{Sort: types.SortOption{Sort: "id", IfNotPresent: true}}) + if err != nil { + return nil, err + } + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.CredentialColumns.NamedExpr(), " FROM ", table.CredentialTable.Name(), whereExpr, pageExpr) + sql := filter.SqlJoint(sqlSentence) + + list := make([]*table.Credential, 0) + err = dao.orm.Do(dao.sd.ShardingOne(opts.BizID).DB()).Select(kit.Ctx, &list, sql, args...) + if err != nil { + return nil, err + } + + return &types.ListCredentialDetails{Count: count, Details: list}, nil } // Delete delete credential func (dao *credentialDao) Delete(kit *kit.Kit, g *table.Credential) error { - // 参数校验 - if err := g.ValidateDelete(); err != nil { - return err + if g == nil { + return errf.New(errf.InvalidParameter, "credential is nil") } - // 删除操作, 获取当前记录做审计 - m := dao.genQ.Credential - q := dao.genQ.Credential.WithContext(kit.Ctx) - oldOne, err := q.Where(m.ID.Eq(g.ID), m.BizID.Eq(g.Attachment.BizID)).Take() - if err != nil { - return err + if err := g.ValidateDelete(); err != nil { + return errf.New(errf.InvalidParameter, err.Error()) } - ad := dao.auditDao.DecoratorV2(kit, g.Attachment.BizID).PrepareDelete(oldOne) - // 多个使用事务处理 - deleteTx := func(tx *gen.Query) error { - q = tx.Credential.WithContext(kit.Ctx) - if _, err := q.Where(m.BizID.Eq(g.Attachment.BizID)).Delete(g); err != nil { + ab := dao.auditDao.Decorator(kit, g.Attachment.BizID, enumor.Credential).PrepareDelete(g.ID) + + var sqlSentence []string + sqlSentence = append(sqlSentence, "DELETE FROM ", table.CredentialTable.Name(), " WHERE id = ", strconv.Itoa(int(g.ID)), + " AND biz_id = ", strconv.Itoa(int(g.Attachment.BizID))) + expr := filter.SqlJoint(sqlSentence) + + err := dao.sd.ShardingOne(g.Attachment.BizID).AutoTxn(kit, func(txn *sqlx.Tx, opt *sharding.TxnOption) error { + + err := dao.orm.Txn(txn).Delete(kit.Ctx, expr) + if err != nil { return err } - if err := ad.Do(tx); err != nil { - return err + auditOpt := &AuditOption{Txn: txn, ResShardingUid: opt.ShardingUid} + if err := ab.Do(auditOpt); err != nil { + return fmt.Errorf("audit delete credential failed, err: %v", err) } + return nil - } - if err := dao.genQ.Transaction(deleteTx); err != nil { - return err - } + }) + if err != nil { + logs.Errorf("delete credential: %d failed, err: %v, rid: %v", g.ID, err, kit.Rid) + return fmt.Errorf("delete credential, but run txn failed, err: %v", err) + } return nil } // Update update credential // Note: only update name, description, enable func (dao *credentialDao) Update(kit *kit.Kit, g *table.Credential) error { + if g == nil { + return errf.New(errf.InvalidParameter, "credential is nil") + } + if err := g.ValidateUpdate(); err != nil { - return err + return errf.New(errf.InvalidParameter, err.Error()) } - // 更新操作, 获取当前记录做审计 - m := dao.genQ.Credential - q := dao.genQ.Credential.WithContext(kit.Ctx) - oldOne, err := q.Where(m.ID.Eq(g.ID), m.BizID.Eq(g.Attachment.BizID)).Take() + opts := orm.NewFieldOptions().AddBlankedFields("enable", "memo"). + AddIgnoredFields("id", "biz_id", "enc_algorithm", "enc_credential", "credential_type") + expr, toUpdate, err := orm.RearrangeSQLDataWithOption(g, opts) if err != nil { - return err + return fmt.Errorf("prepare parsed sql expr failed, err: %v", err) } - ad := dao.auditDao.DecoratorV2(kit, g.Attachment.BizID).PrepareUpdate(g, oldOne) - // 多个使用事务处理 - updateTx := func(tx *gen.Query) error { - q = tx.Credential.WithContext(kit.Ctx) - if _, err := q.Where(m.BizID.Eq(g.Attachment.BizID), m.ID.Eq(g.ID)). - Select(m.Memo, m.Enable).Updates(g); err != nil { - return err - } + ab := dao.auditDao.Decorator(kit, g.Attachment.BizID, enumor.Credential).PrepareUpdate(g) + var sqlSentence []string + sqlSentence = append(sqlSentence, "UPDATE ", table.CredentialTable.Name(), " SET ", expr, " WHERE id = ", strconv.Itoa(int(g.ID)), + " AND biz_id = ", strconv.Itoa(int(g.Attachment.BizID))) + sql := filter.SqlJoint(sqlSentence) + err = dao.sd.ShardingOne(g.Attachment.BizID).AutoTxn(kit, + func(txn *sqlx.Tx, opt *sharding.TxnOption) error { + var effected int64 + effected, err = dao.orm.Txn(txn).Update(kit.Ctx, sql, toUpdate) + if err != nil { + logs.Errorf("update credential: %d failed, err: %v, rid: %v", g.ID, err, kit.Rid) + return err + } + + if effected == 0 { + logs.Errorf("update one credential: %d, but record not found, rid: %v", g.ID, kit.Rid) + return errf.New(errf.RecordNotFound, orm.ErrRecordNotFound.Error()) + } + + if effected > 1 { + logs.Errorf("update one credential: %d, but got updated credential count: %d, rid: %v", g.ID, + effected, kit.Rid) + return fmt.Errorf("matched credential count %d is not as excepted", effected) + } + + // do audit + if err := ab.Do(&AuditOption{Txn: txn, ResShardingUid: opt.ShardingUid}); err != nil { + return fmt.Errorf("do credential update audit failed, err: %v", err) + } + return nil + }) - if err := ad.Do(tx); err != nil { - return err - } - return nil - } - if err := dao.genQ.Transaction(updateTx); err != nil { + if err != nil { return err } @@ -228,15 +292,26 @@ func (dao *credentialDao) Update(kit *kit.Kit, g *table.Credential) error { } // UpdateRevisionWithTx update credential revision with transaction -func (dao *credentialDao) UpdateRevisionWithTx(kit *kit.Kit, tx *gen.QueryTx, bizID uint32, id uint32) error { +func (dao *credentialDao) UpdateRevisionWithTx(kit *kit.Kit, tx *sharding.Tx, bizID uint32, id uint32) error { if bizID == 0 || id == 0 { - return errors.New("credential bizID or id is zero") + return errf.New(errf.InvalidParameter, "credential bizID or id is zero") } - m := tx.Credential - q := tx.Credential.WithContext(kit.Ctx) - if _, err := q.Where(m.BizID.Eq(bizID), m.ID.Eq(id)). - Select(m.Reviser).Update(m.Reviser, kit.User); err != nil { + var sqlSentence []string + now := time.Now().Format(constant.TimeStdFormat) + sqlSentence = append(sqlSentence, "UPDATE ", table.CredentialTable.Name(), + " SET updated_at = :updated_at, reviser = :reviser"+ + " WHERE id = ", strconv.Itoa(int(id)), " AND biz_id = ", strconv.Itoa(int(bizID))) + sql := filter.SqlJoint(sqlSentence) + + toUpdate := map[string]interface{}{ + "updated_at": now, + "reviser": kit.User, + } + + _, err := dao.orm.Txn(tx.Tx()).Update(kit.Ctx, sql, toUpdate) + if err != nil { + logs.Errorf("update credential %d revision failed, err: %v, rid: %v", id, err, kit.Rid) return err } diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/credential_scope.go b/bcs-services/bcs-bscp/pkg/dal/dao/credential_scope.go index 889c30a336..0f80b52335 100644 --- a/bcs-services/bcs-bscp/pkg/dal/dao/credential_scope.go +++ b/bcs-services/bcs-bscp/pkg/dal/dao/credential_scope.go @@ -1,37 +1,30 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 dao import ( - "errors" + "fmt" + "strconv" - "bscp.io/pkg/dal/gen" + "bscp.io/pkg/criteria/enumor" + "bscp.io/pkg/criteria/errf" "bscp.io/pkg/dal/orm" "bscp.io/pkg/dal/sharding" "bscp.io/pkg/dal/table" "bscp.io/pkg/kit" + "bscp.io/pkg/logs" + "bscp.io/pkg/runtime/filter" + "bscp.io/pkg/types" ) // CredentialScope supplies all the credential scope related operations. type CredentialScope interface { // CreateWithTx create credential scope with transaction - CreateWithTx(kit *kit.Kit, tx *gen.QueryTx, credential *table.CredentialScope) (uint32, error) + CreateWithTx(kit *kit.Kit, tx *sharding.Tx, credential *table.CredentialScope) (uint32, error) // Get get credential scopes - Get(kit *kit.Kit, credentialId, bizID uint32) ([]*table.CredentialScope, int64, error) + Get(kit *kit.Kit, credentialId, bizId uint32) (*types.ListCredentialScopeDetails, error) // DeleteWithTx delete credential scope with transaction - DeleteWithTx(kit *kit.Kit, tx *gen.QueryTx, bizID, id uint32) error + DeleteWithTx(kit *kit.Kit, tx *sharding.Tx, bizID, id uint32) error // UpdateWithTx update credential scope with transaction - UpdateWithTx(kit *kit.Kit, tx *gen.QueryTx, credentialScope *table.CredentialScope) error + UpdateWithTx(kit *kit.Kit, tx *sharding.Tx, credentialScope *table.CredentialScope) error // // UpdateCredentialScopes update credential scopes // UpdateCredentialScopes(kit *kit.Kit, option *types.UpdateCredentialScopesOption) error } @@ -39,106 +32,175 @@ type CredentialScope interface { var _ CredentialScope = new(credentialScopeDao) type credentialScopeDao struct { - genQ *gen.Query + orm orm.Interface + sd *sharding.Sharding idGen IDGenInterface auditDao AuditDao - - orm orm.Interface - sd *sharding.Sharding } // CreateWithTx create credential scope with transaction -func (dao *credentialScopeDao) CreateWithTx(kit *kit.Kit, tx *gen.QueryTx, g *table.CredentialScope) (uint32, error) { - if err := g.ValidateCreate(); err != nil { - return 0, err +func (dao *credentialScopeDao) CreateWithTx(kit *kit.Kit, tx *sharding.Tx, c *table.CredentialScope) (uint32, error) { + + if c == nil { + return 0, errf.New(errf.InvalidParameter, "credential scope is nil") } - // generate a Template id and update to Template. - id, err := dao.idGen.One(kit, table.Name(g.TableName())) + if err := c.ValidateCreate(); err != nil { + return 0, errf.New(errf.InvalidParameter, err.Error()) + } + + // generate a credential id and update to credential. + id, err := dao.idGen.One(kit, table.CredentialScopeTable) if err != nil { return 0, err } - g.ID = id - q := tx.CredentialScope.WithContext(kit.Ctx) - if err := q.Create(g); err != nil { + c.ID = id + var sqlSentence []string + sqlSentence = append(sqlSentence, "INSERT INTO ", table.CredentialScopeTable.Name(), " (", table.CredentialScopeColumns.ColumnExpr(), ") VALUES(", table.CredentialScopeColumns.ColonNameExpr(), ")") + + sql := filter.SqlJoint(sqlSentence) + + if err := dao.orm.Txn(tx.Tx()).Insert(kit.Ctx, sql, c); err != nil { return 0, err } - ad := dao.auditDao.DecoratorV2(kit, g.Attachment.BizID).PrepareCreate(g) - if err := ad.Do(tx.Query); err != nil { - return 0, err + // + au := &AuditOption{Txn: tx.Tx(), ResShardingUid: tx.ShardingUid()} + if err = dao.auditDao.Decorator(kit, c.Attachment.BizID, + enumor.CredentialScope).AuditCreate(c, au); err != nil { + return 0, fmt.Errorf("audit create credential scope failed, err: %v", err) } - return g.ID, nil + return id, nil } // Get get credential scope -func (dao *credentialScopeDao) Get(kit *kit.Kit, credentialId, bizID uint32) ([]*table.CredentialScope, int64, error) { - m := dao.genQ.CredentialScope - q := dao.genQ.CredentialScope.WithContext(kit.Ctx) +func (dao *credentialScopeDao) Get(kit *kit.Kit, credentialId, bizId uint32) (*types.ListCredentialScopeDetails, error) { + if credentialId == 0 { + return nil, errf.New(errf.InvalidParameter, "credential scope credential id null") + } + sqlOpt := &filter.SQLWhereOption{ + Priority: filter.Priority{"id", "biz_id", "credential_id"}, + CrownedOption: &filter.CrownedOption{ + CrownedOp: filter.And, + Rules: []filter.RuleFactory{ + &filter.AtomRule{ + Field: "biz_id", + Op: filter.Equal.Factory(), + Value: bizId, + }, + &filter.AtomRule{ + Field: "credential_id", + Op: filter.Equal.Factory(), + Value: credentialId, + }, + }, + }, + } + ft := &filter.Expression{ + Op: filter.Or, + Rules: []filter.RuleFactory{}, + } + whereExpr, args, err := ft.SQLWhereExpr(sqlOpt) + if err != nil { + return nil, err + } + var sqlSentenceCount []string + sqlSentenceCount = append(sqlSentenceCount, "SELECT COUNT(*) FROM ", table.CredentialScopeTable.Name(), whereExpr) + countSql := filter.SqlJoint(sqlSentenceCount) + count, err := dao.orm.Do(dao.sd.ShardingOne(bizId).DB()).Count(kit.Ctx, countSql, args...) + if err != nil { + return nil, err + } - result, err := q.Where(m.BizID.Eq(bizID), m.CredentialId.Eq(credentialId)).Find() + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.CredentialScopeColumns.NamedExpr(), " FROM ", table.CredentialScopeTable.Name(), whereExpr) + sql := filter.SqlJoint(sqlSentence) + list := make([]*table.CredentialScope, 0) + err = dao.orm.Do(dao.sd.ShardingOne(bizId).DB()).Select(kit.Ctx, &list, sql, args...) if err != nil { - return nil, 0, err + return nil, err } - return result, int64(len(result)), nil + return &types.ListCredentialScopeDetails{Count: count, Details: list}, nil } // DeleteWithTx delete credential scope with transaction -func (dao *credentialScopeDao) DeleteWithTx(kit *kit.Kit, tx *gen.QueryTx, bizID, id uint32) error { +func (dao *credentialScopeDao) DeleteWithTx(kit *kit.Kit, tx *sharding.Tx, bizID, id uint32) error { if bizID == 0 { - return errors.New("biz id is zero") + return errf.New(errf.InvalidParameter, "biz id is zero") } if id == 0 { - return errors.New("credential scope id is zero") + return errf.New(errf.InvalidParameter, "credential scope id is zero") } - // 删除操作, 获取当前记录做审计 - m := tx.CredentialScope - q := tx.CredentialScope.WithContext(kit.Ctx) - oldOne, err := q.Where(m.ID.Eq(id), m.BizID.Eq(bizID)).Take() - if err != nil { - return err - } + ab := dao.auditDao.Decorator(kit, bizID, enumor.CredentialScope).PrepareDelete(id) - if _, err := q.Where(m.BizID.Eq(bizID), m.ID.Eq(id)).Delete(); err != nil { - return err - } + var sqlSentence []string + sqlSentence = append(sqlSentence, "DELETE FROM ", table.CredentialScopeTable.Name(), " WHERE id = ", strconv.Itoa(int(id)), + " AND biz_id = ", strconv.Itoa(int(bizID))) + expr := filter.SqlJoint(sqlSentence) - ad := dao.auditDao.DecoratorV2(kit, bizID).PrepareDelete(oldOne) - if err := ad.Do(tx.Query); err != nil { + err := dao.orm.Txn(tx.Tx()).Delete(kit.Ctx, expr) + if err != nil { + logs.Errorf("delete credential scope: %d failed, err: %v, rid: %v", id, err, kit.Rid) return err } + auditOpt := &AuditOption{Txn: tx.Tx(), ResShardingUid: tx.ShardingUid()} + if err := ab.Do(auditOpt); err != nil { + return fmt.Errorf("audit delete credential scope failed, err: %v", err) + } return nil } // UpdateWithTx update credential scope with transaction -func (dao *credentialScopeDao) UpdateWithTx(kit *kit.Kit, tx *gen.QueryTx, g *table.CredentialScope) error { - if err := g.ValidateUpdate(); err != nil { - return err +func (dao *credentialScopeDao) UpdateWithTx(kit *kit.Kit, tx *sharding.Tx, c *table.CredentialScope) error { + + if c == nil { + return errf.New(errf.InvalidParameter, "credential scope is nil") + } + + if err := c.ValidateUpdate(); err != nil { + return errf.New(errf.InvalidParameter, err.Error()) } - // 更新操作, 获取当前记录做审计 - m := tx.CredentialScope - q := tx.CredentialScope.WithContext(kit.Ctx) - oldOne, err := q.Where(m.ID.Eq(g.ID), m.BizID.Eq(g.Attachment.BizID)).Take() + opts := orm.NewFieldOptions().AddIgnoredFields( + "id", "biz_id") + expr, toUpdate, err := orm.RearrangeSQLDataWithOption(c, opts) if err != nil { - return err + return fmt.Errorf("prepare parsed sql expr failed, err: %v", err) } - q = tx.CredentialScope.WithContext(kit.Ctx) - if _, err := q.Where(m.BizID.Eq(g.Attachment.BizID), m.ID.Eq(g.ID)). - Omit(m.BizID, m.ID).Updates(g); err != nil { + ab := dao.auditDao.Decorator(kit, c.Attachment.BizID, enumor.CredentialScope).PrepareUpdate(c) + var sqlSentence []string + sqlSentence = append(sqlSentence, "UPDATE ", table.CredentialScopeTable.Name(), " SET ", expr, " WHERE id = ", strconv.Itoa(int(c.ID)), + " AND biz_id = ", strconv.Itoa(int(c.Attachment.BizID))) + sql := filter.SqlJoint(sqlSentence) + + var effected int64 + effected, err = dao.orm.Txn(tx.Tx()).Update(kit.Ctx, sql, toUpdate) + if err != nil { + logs.Errorf("update credential scope: %d failed, err: %v, rid: %v", c.ID, err, kit.Rid) return err } - ad := dao.auditDao.DecoratorV2(kit, g.Attachment.BizID).PrepareUpdate(g, oldOne) - if err := ad.Do(tx.Query); err != nil { - return err + if effected == 0 { + logs.Errorf("update one credential scope: %d, but record not found, rid: %v", c.ID, kit.Rid) + return errf.New(errf.RecordNotFound, orm.ErrRecordNotFound.Error()) + } + + if effected > 1 { + logs.Errorf("update one credential scope: %d, but got updated credential count: %d, rid: %v", c.ID, + effected, kit.Rid) + return fmt.Errorf("matched credential scope count %d is not as excepted", effected) + } + + // do audit + if err := ab.Do(&AuditOption{Txn: tx.Tx(), ResShardingUid: tx.ShardingUid()}); err != nil { + return fmt.Errorf("do credential scope update audit failed, err: %v", err) } return nil diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/dao.go b/bcs-services/bcs-bscp/pkg/dal/dao/dao.go index aa54b05e09..e43022c665 100644 --- a/bcs-services/bcs-bscp/pkg/dal/dao/dao.go +++ b/bcs-services/bcs-bscp/pkg/dal/dao/dao.go @@ -41,7 +41,6 @@ type Set interface { Release() Release ReleasedCI() ReleasedCI Hook() Hook - HookRelease() HookRelease TemplateSpace() TemplateSpace Template() Template TemplateRelease() TemplateRelease @@ -55,7 +54,6 @@ type Set interface { Healthz() error Credential() Credential CredentialScope() CredentialScope - ConfigHook() ConfigHook } // NewDaoSet create the DAO set instance. @@ -102,8 +100,6 @@ func NewDaoSet(opt cc.Sharding, credentialSetting cc.Credential) (Set, error) { if err != nil { return nil, fmt.Errorf("new audit dao failed, err: %v", err) } - eventDao := &eventDao{genQ: genQ, idGen: idDao, auditDao: auditDao} - lockDao := &lockDao{orm: ormInst, idGen: idDao} s := &set{ orm: ormInst, @@ -113,8 +109,8 @@ func NewDaoSet(opt cc.Sharding, credentialSetting cc.Credential) (Set, error) { credentialSetting: credentialSetting, idGen: idDao, auditDao: auditDao, - event: eventDao, - lock: lockDao, + event: &eventDao{orm: ormInst, sd: sd, idGen: idDao}, + lock: &lockDao{orm: ormInst, idGen: idDao}, } return s, nil @@ -145,9 +141,10 @@ func (s *set) ID() IDGenInterface { // App returns the application's DAO func (s *set) App() App { return &appDao{ + orm: s.orm, + sd: s.sd, idGen: s.idGen, auditDao: s.auditDao, - genQ: s.genQ, event: s.event, } } @@ -187,7 +184,6 @@ func (s *set) Content() Content { func (s *set) Release() Release { return &releaseDao{ orm: s.orm, - genQ: s.genQ, sd: s.sd, idGen: s.idGen, auditDao: s.auditDao, @@ -207,18 +203,10 @@ func (s *set) ReleasedCI() ReleasedCI { // Hook returns the hook's DAO func (s *set) Hook() Hook { return &hookDao{ + orm: s.orm, + sd: s.sd, idGen: s.idGen, auditDao: s.auditDao, - genQ: s.genQ, - } -} - -// HookRelease returns the hookRelease's DAO -func (s *set) HookRelease() HookRelease { - return &hookReleaseDao{ - idGen: s.idGen, - auditDao: s.auditDao, - genQ: s.genQ, } } @@ -285,9 +273,10 @@ func (s *set) ReleasedGroup() ReleasedGroup { // Publish returns the publish operation related DAO func (s *set) Publish() Publish { return &pubDao{ + orm: s.orm, + sd: s.sd, idGen: s.idGen, auditDao: s.auditDao, - genQ: s.genQ, event: s.event, } } @@ -316,9 +305,9 @@ func (s *set) IAM() IAM { // Event returns the event operation related DAO func (s *set) Event() Event { return &eventDao{ - idGen: s.idGen, - auditDao: s.auditDao, - genQ: s.genQ, + orm: s.orm, + sd: s.sd, + idGen: s.idGen, } } @@ -330,25 +319,20 @@ func (s *set) Healthz() error { // Credential returns the Credential's DAO func (s *set) Credential() Credential { return &credentialDao{ - idGen: s.idGen, - auditDao: s.auditDao, - genQ: s.genQ, + orm: s.orm, + sd: s.sd, + credentialSetting: s.credentialSetting, + idGen: s.idGen, + auditDao: s.auditDao, + event: s.event, } } // CredentialScope returns the Credential scope's DAO func (s *set) CredentialScope() CredentialScope { return &credentialScopeDao{ - idGen: s.idGen, - auditDao: s.auditDao, - genQ: s.genQ, - } -} - -// ConfigHook returns the configHook's DAO -func (s *set) ConfigHook() ConfigHook { - return &configHookDao{ - genQ: s.genQ, + orm: s.orm, + sd: s.sd, idGen: s.idGen, auditDao: s.auditDao, } diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/event.go b/bcs-services/bcs-bscp/pkg/dal/dao/event.go index 3787b650c1..384e451f20 100644 --- a/bcs-services/bcs-bscp/pkg/dal/dao/event.go +++ b/bcs-services/bcs-bscp/pkg/dal/dao/event.go @@ -13,18 +13,21 @@ limitations under the License. package dao import ( + "context" "errors" "fmt" + "strconv" + "strings" "time" - "gorm.io/gen/field" - "gorm.io/gorm" - + "bscp.io/pkg/criteria/constant" "bscp.io/pkg/criteria/errf" - "bscp.io/pkg/dal/gen" + "bscp.io/pkg/dal/orm" + "bscp.io/pkg/dal/sharding" "bscp.io/pkg/dal/table" "bscp.io/pkg/kit" "bscp.io/pkg/logs" + "bscp.io/pkg/runtime/filter" "bscp.io/pkg/types" ) @@ -32,20 +35,20 @@ import ( type Event interface { // Eventf initialize an event decorator instance to fire the event and // update the event's state - Eventf(kit *kit.Kit) *EDecorator + Eventf(kt *kit.Kit) *EDecorator // List events with options. - List(kit *kit.Kit, startCursor uint32, opt *types.BasePage) ([]*table.Event, int64, error) + List(kt *kit.Kit, opts *types.ListEventsOption) (*types.ListEventDetails, error) // ListConsumedEvents list events with options that is handle event by cache service. - ListConsumedEvents(kit *kit.Kit, startCursor uint32, opt *types.BasePage) ([]*table.Event, int64, error) + ListConsumedEvents(kt *kit.Kit, opts *types.ListEventsOption) (*types.ListEventDetails, error) // LatestCursor get the latest event cursor which is the last already // consumed event's id. // Note: // if the returned cursor(event id) is 0, this means no event has been // consumed. - LatestCursor(kit *kit.Kit) (uint32, error) + LatestCursor(kt *kit.Kit) (uint32, error) // RecordCursor is used to record the cursor which describe where // the event has already been consumed with event id, so that the @@ -60,18 +63,19 @@ type Event interface { var _ Event = new(eventDao) type eventDao struct { - genQ *gen.Query - idGen IDGenInterface - auditDao AuditDao + orm orm.Interface + sd *sharding.Sharding + idGen IDGenInterface } // Eventf initialize an event decorator instance to fire the event and // update the event's state. -func (ed *eventDao) Eventf(kit *kit.Kit) *EDecorator { +func (ed *eventDao) Eventf(kt *kit.Kit) *EDecorator { return &EDecorator{ - kit: kit, + kt: kt, + orm: ed.orm, + sd: ed.sd, idGen: ed.idGen, - genQ: ed.genQ, } } @@ -79,22 +83,23 @@ func (ed *eventDao) Eventf(kit *kit.Kit) *EDecorator { // update the final state after the previous related resource operate db // transaction is finished. type EDecorator struct { - kit *kit.Kit + kt *kit.Kit // the event id list. idList []uint32 + orm orm.Interface + sd *sharding.Sharding idGen IDGenInterface - genQ *gen.Query } // Fire a resource's operate(Create/Update/Delete) event. // After fire the event success, user should call the Finalizer function to do // the event finalize work. // Note: -// 1. Fire must be called *AFTER* all the logical operation has +// 1. Eventf must be called *AFTER* all the logical operation has // already been finished within the same transaction, which means // the related resource's has already been created or updated or // deleted. -// 2. Make sure that if the Fire execute failed, then the former +// 2. Make sure that if the Eventf execute failed, then the former // resource's operations must be failed at the same time, which // means the transaction will be aborted or rollback. // 3. It's accepted that if a resource operation is failed but its @@ -110,22 +115,24 @@ func (ef *EDecorator) Fire(es ...types.Event) error { if len(es) == 0 { return nil } + for _, one := range es { if err := one.Validate(); err != nil { return err } } + num := len(es) - ids, err := ef.idGen.Batch(ef.kit, table.EventTable, num) + ids, err := ef.idGen.Batch(ef.kt, table.EventTable, num) if err != nil { return errf.New(errf.DBOpFailed, "generate event id failed, err: "+err.Error()) } - list := make([]*table.Event, num) + list := make([]table.Event, num) for idx := range es { one := es[idx] - list[idx] = &table.Event{ + list[idx] = table.Event{ ID: ids[idx], Spec: one.Spec, State: &table.EventState{ @@ -135,11 +142,17 @@ func (ef *EDecorator) Fire(es ...types.Event) error { Revision: one.Revision, } } - batchSize := 100 - q := ef.genQ.Event.WithContext(ef.kit.Ctx) - if err := q.CreateInBatches(list, batchSize); err != nil { - return fmt.Errorf("insert events failed, err: %v", err) + one := ef.sd.Event() + if err := one.Err(); err != nil { + return errf.New(errf.Aborted, "insert events, but get event db failed, err: "+err.Error()) + } + + var sqlSentence []string + sqlSentence = append(sqlSentence, "INSERT INTO ", table.EventTable.Name(), " (", table.EventColumns.ColumnExpr(), ") VALUES(", table.EventColumns.ColonNameExpr(), ")") + sql := filter.SqlJoint(sqlSentence) + if err := ef.orm.Do(one.DB()).BulkInsert(ef.kt.Ctx, sql, list); err != nil { + return errf.New(errf.InvalidParameter, "insert events failed, err: "+err.Error()) } // remember the event id list for the following finalize operation use. @@ -150,26 +163,28 @@ func (ef *EDecorator) Fire(es ...types.Event) error { // FireWithTx is used to fire the event with the given transaction. // Note: FireWithTx would make event to success state directly -func (ef *EDecorator) FireWithTx(tx *gen.QueryTx, es ...types.Event) error { +func (ef *EDecorator) FireWithTx(tx *sharding.Tx, es ...types.Event) error { if len(es) == 0 { return nil } + for _, one := range es { if err := one.Validate(); err != nil { return err } } + num := len(es) - ids, err := ef.idGen.Batch(ef.kit, table.EventTable, num) + ids, err := ef.idGen.Batch(ef.kt, table.EventTable, num) if err != nil { return errf.New(errf.DBOpFailed, "generate event id failed, err: "+err.Error()) } - list := make([]*table.Event, num) + list := make([]table.Event, num) for idx := range es { one := es[idx] - list[idx] = &table.Event{ + list[idx] = table.Event{ ID: ids[idx], Spec: one.Spec, State: &table.EventState{ @@ -179,11 +194,12 @@ func (ef *EDecorator) FireWithTx(tx *gen.QueryTx, es ...types.Event) error { Revision: one.Revision, } } - batchSize := 100 - q := tx.Event.WithContext(ef.kit.Ctx) - if err := q.CreateInBatches(list, batchSize); err != nil { - return fmt.Errorf("insert events failed, err: %v", err) + var sqlSentence []string + sqlSentence = append(sqlSentence, "INSERT INTO ", table.EventTable.Name(), " (", table.EventColumns.ColumnExpr(), ") VALUES(", table.EventColumns.ColonNameExpr(), ")") + sql := filter.SqlJoint(sqlSentence) + if err := ef.orm.Txn(tx.Tx()).BulkInsert(ef.kt.Ctx, sql, list); err != nil { + return errf.New(errf.InvalidParameter, "insert events failed, err: "+err.Error()) } // remember the event id list for the following finalize operation use. @@ -205,71 +221,142 @@ func (ef *EDecorator) Finalizer(txnError error) { state = table.FailedFS } - m := ef.genQ.Event - q := ef.genQ.Event.WithContext(ef.kit.Ctx) - if _, err := q.Where(m.ID.In(ef.idList...)). - Select(m.FinalStatus).Update(m.FinalStatus, state); err != nil { - logs.ErrorDepthf(1, "update event final state to %d failed, id list: %s, err: %v, rid: %s", state, ef.idList, - err, ef.kit.Rid) + in := make([]string, len(ef.idList)) + for idx := range ef.idList { + in[idx] = strconv.FormatUint(uint64(ef.idList[idx]), 10) + } + joined := strings.Join(in, ",") + + var sqlSentence []string + sqlSentence = append(sqlSentence, "UPDATE ", table.EventTable.Name(), " SET final_status = ", strconv.Itoa(int(state)), " WHERE id IN(", joined, ")") + sql := filter.SqlJoint(sqlSentence) + _, err := ef.orm.Do(ef.sd.Event().DB()).Exec(context.TODO(), sql) + if err != nil { + logs.ErrorDepthf(1, "update event final state to %d failed, id list: %s, err: %v, rid: %s", state, joined, + err, ef.kt.Rid) + return } return } // List events with options. -func (dao *eventDao) List(kit *kit.Kit, startCursor uint32, opt *types.BasePage) ([]*table.Event, int64, error) { - m := dao.genQ.Event - q := dao.genQ.Event.WithContext(kit.Ctx) +func (ed *eventDao) List(kt *kit.Kit, opts *types.ListEventsOption) (*types.ListEventDetails, error) { + + if opts == nil { + return nil, errf.New(errf.InvalidParameter, "list events options is nil") + } + + if err := opts.Validate(types.DefaultPageOption); err != nil { + return nil, err + } - orderCol, ok := m.GetFieldByName(opt.Sort) - if !ok { - return nil, 0, fmt.Errorf("talbe events doesn't contains column %s", opt.Sort) + sqlOpt := &filter.SQLWhereOption{ + Priority: filter.Priority{"id", "resource", "biz_id"}, + CrownedOption: &filter.CrownedOption{ + CrownedOp: filter.And, + Rules: []filter.RuleFactory{ + // can not query + &filter.AtomRule{ + Field: "resource", + Op: filter.NotEqual.Factory(), + Value: table.CursorReminder, + }}, + }, + } + + whereExpr, args, err := opts.Filter.SQLWhereExpr(sqlOpt) + if err != nil { + return nil, err } - var orderCond field.Expr - if opt.Order == types.Ascending { - orderCond = orderCol - } else { - orderCond = orderCol.Desc() + var sqlSentence []string + if opts.Page.Count { + // this is a count request, then do count operation only. + sqlSentence = append(sqlSentence, "SELECT COUNT(*) FROM ", table.EventTable.Name(), whereExpr) + sql := filter.SqlJoint(sqlSentence) + var count uint32 + count, err = ed.orm.Do(ed.sd.Event().DB()).Count(kt.Ctx, sql, args...) + if err != nil { + return nil, err + } + + return &types.ListEventDetails{Count: count, Details: make([]*table.Event, 0)}, nil } - result, count, err := q.Where(m.ID.Gt(startCursor), m.Resource.Neq(string(table.CursorReminder))).Order(orderCond). - FindByPage(opt.Offset(), opt.LimitInt()) + pageOption := &types.PageSQLOption{Sort: types.SortOption{Sort: "id", IfNotPresent: true}} + pageExpr, err := opts.Page.SQLExpr(pageOption) if err != nil { - return nil, 0, err + return nil, err } - return result, count, nil + sqlSentence = append(sqlSentence, "SELECT ", table.EventColumns.NamedExpr(), " FROM ", table.EventTable.Name(), whereExpr, pageExpr) + sql := filter.SqlJoint(sqlSentence) + + list := make([]*table.Event, 0) + err = ed.orm.Do(ed.sd.Event().DB()).Select(kt.Ctx, &list, sql, args...) + if err != nil { + return nil, err + } + + return &types.ListEventDetails{Count: 0, Details: list}, nil } // ListConsumedEvents list events with options that is handle event by cache service. -func (dao *eventDao) ListConsumedEvents(kit *kit.Kit, startCursor uint32, opt *types.BasePage) ( - []*table.Event, int64, error) { - m := dao.genQ.Event - q := dao.genQ.Event.WithContext(kit.Ctx) +func (ed *eventDao) ListConsumedEvents(kt *kit.Kit, opts *types.ListEventsOption) (*types.ListEventDetails, error) { - orderCol, ok := m.GetFieldByName(opt.Sort) - if !ok { - return nil, 0, fmt.Errorf("talbe events doesn't contains column %s", opt.Sort) + if opts == nil { + return nil, errf.New(errf.InvalidParameter, "list consumed events options is nil") } - var orderCond field.Expr - if opt.Order == types.Ascending { - orderCond = orderCol - } else { - orderCond = orderCol.Desc() + if opts.Page.Count { + return nil, errf.New(errf.InvalidParameter, "list consumed events not support count") } - result, count, err := q.Where( - m.ID.Gt(startCursor), - m.Resource.Neq(string(table.CursorReminder)), - q.Columns(m.ID).Lte(q.Select(m.ResourceID).Where(m.Resource.Eq(string(table.CursorReminder))))). - Order(orderCond).FindByPage(opt.Offset(), opt.LimitInt()) + if err := opts.Validate(types.DefaultPageOption); err != nil { + return nil, err + } + + sqlOpt := &filter.SQLWhereOption{ + Priority: filter.Priority{"id", "resource", "biz_id"}, + CrownedOption: &filter.CrownedOption{ + CrownedOp: filter.And, + Rules: []filter.RuleFactory{ + // can not query + &filter.AtomRule{ + Field: "resource", + Op: filter.NotEqual.Factory(), + Value: table.CursorReminder, + }}, + }, + } + + whereExpr, args, err := opts.Filter.SQLWhereExpr(sqlOpt) + if err != nil { + return nil, err + } + + pageOption := &types.PageSQLOption{Sort: types.SortOption{Sort: "id", IfNotPresent: true}} + pageExpr, err := opts.Page.SQLExpr(pageOption) + if err != nil { + return nil, err + } + + var sqlSentenceSub []string + sqlSentenceSub = append(sqlSentenceSub, "SELECT resource_id FROM ", table.EventTable.Name(), " WHERE resource = '", string(table.CursorReminder), "'") + subSql := filter.SqlJoint(sqlSentenceSub) + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.EventColumns.NamedExpr(), " FROM ", table.EventTable.Name(), whereExpr, + " AND id <= (", subSql, ") ", pageExpr) + sql := filter.SqlJoint(sqlSentence) + + list := make([]*table.Event, 0) + err = ed.orm.Do(ed.sd.Event().DB()).Select(kt.Ctx, &list, sql, args...) if err != nil { - return nil, 0, err + return nil, err } - return result, count, nil + return &types.ListEventDetails{Count: 0, Details: list}, nil } // LatestCursor get the latest event cursor which is the last already @@ -277,13 +364,19 @@ func (dao *eventDao) ListConsumedEvents(kit *kit.Kit, startCursor uint32, opt *t // Note: // if the returned cursor(event id) is 0, this means no event has been // consumed. -func (dao *eventDao) LatestCursor(kit *kit.Kit) (uint32, error) { - m := dao.genQ.Event - q := dao.genQ.Event.WithContext(kit.Ctx) +func (ed *eventDao) LatestCursor(kt *kit.Kit) (uint32, error) { - var cursor uint32 - if err := q.Select(m.ResourceID).Where(m.Resource.Eq(string(table.CursorReminder))).Limit(1).Scan(&cursor); err != nil { - return 0, err + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT resource_id FROM ", table.EventTable.Name(), " WHERE resource = '", string(table.CursorReminder), "' limit 1") + sql := filter.SqlJoint(sqlSentence) + + cursor := uint32(0) + if err := ed.orm.Do(ed.sd.Event().DB()).Get(kt.Ctx, &cursor, sql); err != nil { + if err == orm.ErrRecordNotFound { + return 0, nil + } + + return 0, errf.New(errf.DBOpFailed, err.Error()) } return cursor, nil @@ -300,75 +393,89 @@ const eventUser = "bscp.io" // 1. the cursor is recorded with a special event resource which is // table.CursorReminder. // 2. this is an upsert operation. -func (dao *eventDao) RecordCursor(kit *kit.Kit, eventID uint32) error { +func (ed *eventDao) RecordCursor(kt *kit.Kit, eventID uint32) error { + if eventID <= 0 { return errors.New("invalid event id to record the cursor") } - m := dao.genQ.Event - q := dao.genQ.Event.WithContext(kit.Ctx) + at := time.Now().Format(constant.TimeStdFormat) + var sqlSentence []string + sqlSentence = append(sqlSentence, "UPDATE ", table.EventTable.Name(), " SET resource_id = ", strconv.Itoa(int(eventID)), + ", created_at = '", at, "' WHERE id = ", strconv.Itoa(table.EventCursorReminderPrimaryID)) + sql := filter.SqlJoint(sqlSentence) - result, err := q.Where(m.ID.Eq(uint32(table.EventCursorReminderPrimaryID))). - Select(m.ResourceID, m.CreatedAt). - UpdateSimple(m.ResourceID.Value(eventID), m.CreatedAt.Value(time.Now())) + one := ed.sd.Event() + if err := one.Err(); err != nil { + return fmt.Errorf("get event db failed, err: %v", err) + } + + cnt, err := ed.orm.Do(one.DB()).Exec(kt.Ctx, sql) if err != nil { return err } - if result.RowsAffected == 1 { + + if cnt == 1 { return nil } // the cursorReminder event is lost, insert it now, normally this can not happen, because // this event is initialed when the database is created. - g := &table.Event{ - ID: uint32(table.EventCursorReminderPrimaryID), - Spec: &table.EventSpec{ - Resource: table.CursorReminder, - ResourceID: eventID, - ResourceUid: "", - OpType: "", - }, - Attachment: &table.EventAttachment{ - BizID: 0, - AppID: 0, - }, - Revision: &table.CreatedRevision{ - Creator: eventUser, - }, - } - if err := q.Create(g); err != nil { + var sqlSentenceInsert []string + sqlSentenceInsert = append(sqlSentenceInsert, "INSERT INTO ", table.EventTable.Name(), " (id, biz_id, app_id, op_type, resource, resource_id, creator, created_at) ", + "VALUES(", strconv.Itoa(table.EventCursorReminderPrimaryID), ", 0, 0, '', '", string(table.CursorReminder), "', ", strconv.Itoa(int(eventID)), ", '", eventUser, "', '", at, "')") + sql = filter.SqlJoint(sqlSentenceInsert) + + cnt, err = ed.orm.Do(one.DB()).Exec(kt.Ctx, sql) + if err != nil { return err } + if cnt != 1 { + return fmt.Errorf("record event cursor failed, effected rows: %d", cnt) + } + return nil } // Purge is used to try to remove number of consumed events, which is // created before, from the oldest to now order by event id. -func (dao *eventDao) Purge(kit *kit.Kit, daysAgo uint) error { - m := dao.genQ.Event - q := dao.genQ.Event.WithContext(kit.Ctx) - - var lastID uint32 - oldDate := time.Now().AddDate(0, 0, -int(daysAgo)) - if err := q.Select(m.ID).Where(m.CreatedAt.Lte(oldDate)).Order(m.ID.Desc()).Limit(1).Scan(&lastID); err != nil { - if errors.Is(err, gorm.ErrRecordNotFound) { +func (ed *eventDao) Purge(kt *kit.Kit, daysAgo uint) error { + one := ed.sd.Event() + if err := one.Err(); err != nil { + return fmt.Errorf("get event db failed, err: %v", err) + } + + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT id FROM ", table.EventTable.Name(), " WHERE created_at <= (NOW() - INTERVAL ", strconv.Itoa(int(daysAgo)), " DAY) ORDER BY id DESC LIMIT 1") + sql := filter.SqlJoint(sqlSentence) + + lastID := uint32(0) + if err := ed.orm.Do(one.DB()).Get(kt.Ctx, &lastID, sql); err != nil { + if err == orm.ErrRecordNotFound { return nil } + return fmt.Errorf("get last event id to purge failed, err: %v", err) } - logs.Infof("start to delete events less than or equal last id %d, rid: %s", lastID, kit.Rid) + logs.Infof("start to delete events less than or equal last id %d, rid: %s", lastID, kt.Rid) const step = 100 + for { - result, err := q.Where(m.ID.Lte(lastID), m.ID.Neq(uint32(table.EventCursorReminderPrimaryID))).Order(m.ID). - Limit(step).Delete() + var sqlSentenceDel []string + sqlSentenceDel = append(sqlSentenceDel, "DELETE FROM ", table.EventTable.Name(), " WHERE id <= ", + strconv.Itoa(int(lastID)), " and id != ", strconv.Itoa(table.EventCursorReminderPrimaryID), + " ORDER BY id ASC LIMIT ", strconv.Itoa(int(step))) + sql = filter.SqlJoint(sqlSentenceDel) + cnt, err := ed.orm.Do(one.DB()).Exec(kt.Ctx, sql) if err != nil { return fmt.Errorf("delete event failed, last id: %d, err: %v", lastID, err) } - logs.Infof("deleted %d events successfully, rid: %s", result.RowsAffected, kit.Rid) - if result.RowsAffected < step { + logs.Infof("deleted %d events successfully, rid: %s", cnt, kt.Rid) + + if cnt < step { return nil } diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/hook.go b/bcs-services/bcs-bscp/pkg/dal/dao/hook.go index 8f209d86fd..c283255a3f 100644 --- a/bcs-services/bcs-bscp/pkg/dal/dao/hook.go +++ b/bcs-services/bcs-bscp/pkg/dal/dao/hook.go @@ -13,178 +13,283 @@ limitations under the License. package dao import ( - "errors" "fmt" + "strconv" - "bscp.io/pkg/dal/gen" + "github.com/jmoiron/sqlx" + + "bscp.io/pkg/criteria/enumor" + "bscp.io/pkg/criteria/errf" + "bscp.io/pkg/dal/orm" + "bscp.io/pkg/dal/sharding" "bscp.io/pkg/dal/table" "bscp.io/pkg/kit" + "bscp.io/pkg/logs" + "bscp.io/pkg/runtime/filter" "bscp.io/pkg/types" ) // Hook supplies all the hook related operations. type Hook interface { - // CreateWithTx create one hook instance with transaction. - CreateWithTx(kit *kit.Kit, tx *gen.QueryTx, hook *table.Hook) (uint32, error) + // Create one hook instance. + Create(kit *kit.Kit, hook *table.Hook) (uint32, error) + // Update one hook's info. + Update(kit *kit.Kit, hook *table.Hook) error // List hooks with options. - List(kit *kit.Kit, opt *types.ListHooksOption) ([]*table.Hook, int64, error) - // CountHookTag count hook tag - CountHookTag(kit *kit.Kit, bizID uint32) ([]*types.HookTagCount, error) - // DeleteWithTx delete hook instance with transaction. - DeleteWithTx(kit *kit.Kit, tx *gen.QueryTx, g *table.Hook) error - // GetByID get hook only with id. - GetByID(kit *kit.Kit, bizID, hookID uint32) (*table.Hook, error) - // GetByName get hook by name - GetByName(kit *kit.Kit, bizID uint32, name string) (*table.Hook, error) + List(kit *kit.Kit, opts *types.ListHooksOption) (*types.ListHookDetails, error) + // Delete one strategy instance. + Delete(kit *kit.Kit, strategy *table.Hook) error } var _ Hook = new(hookDao) type hookDao struct { - genQ *gen.Query + orm orm.Interface + sd *sharding.Sharding idGen IDGenInterface auditDao AuditDao } -// CreateWithTx create one hook instance with transaction. -func (dao *hookDao) CreateWithTx(kit *kit.Kit, tx *gen.QueryTx, g *table.Hook) (uint32, error) { +// Create one hook instance. +func (dao *hookDao) Create(kit *kit.Kit, g *table.Hook) (uint32, error) { + if g == nil { - return 0, errors.New("hook is nil") + return 0, errf.New(errf.InvalidParameter, "hook is nil") } if err := g.ValidateCreate(); err != nil { + return 0, errf.New(errf.InvalidParameter, err.Error()) + } + + if err := dao.validateAttachmentResExist(kit, g.Attachment); err != nil { return 0, err } - //generate a hook id and update to hook. - id, err := dao.idGen.One(kit, table.Name(g.TableName())) + // generate a hook id and update to hook. + id, err := dao.idGen.One(kit, table.HookTable) if err != nil { return 0, err } + g.ID = id + var sqlSentence []string + sqlSentence = append(sqlSentence, "INSERT INTO ", table.HookTable.Name(), " (", table.HookColumns.ColumnExpr(), ") VALUES(", table.HookColumns.ColonNameExpr(), ")") - ad := dao.auditDao.DecoratorV2(kit, g.Attachment.BizID).PrepareCreate(g) + sql := filter.SqlJoint(sqlSentence) - // 多个使用事务处理 + err = dao.sd.ShardingOne(g.Attachment.BizID).AutoTxn(kit, + func(txn *sqlx.Tx, opt *sharding.TxnOption) error { + if err := dao.orm.Txn(txn).Insert(kit.Ctx, sql, g); err != nil { + return err + } - q := tx.Hook.WithContext(kit.Ctx) - if e := q.Create(g); e != nil { - return 0, e - } + // audit this to be created hook details. + au := &AuditOption{Txn: txn, ResShardingUid: opt.ShardingUid} + if err = dao.auditDao.Decorator(kit, g.Attachment.BizID, + enumor.Hook).AuditCreate(g, au); err != nil { + return fmt.Errorf("audit create hook failed, err: %v", err) + } - if e := ad.Do(tx.Query); e != nil { - return 0, e + return nil + }) + + if err != nil { + logs.Errorf("create hook, but do auto txn failed, err: %v, rid: %s", err, kit.Rid) + return 0, fmt.Errorf("create hook, but auto run txn failed, err: %v", err) } - return g.ID, nil + return id, nil } -// List hooks with options. -func (dao *hookDao) List(kit *kit.Kit, opt *types.ListHooksOption) ([]*table.Hook, int64, error) { - - m := dao.genQ.Hook - q := dao.genQ.Hook.WithContext(kit.Ctx).Where(m.BizID.Eq(opt.BizID)).Order(m.ID.Desc()) +// Update one hook instance. +func (dao *hookDao) Update(kit *kit.Kit, g *table.Hook) error { - if opt.Name != "" { - q = q.Where(m.Name.Like(fmt.Sprintf("%%%s%%", opt.Name))) + if g == nil { + return errf.New(errf.InvalidParameter, "hook is nil") } - if opt.Tag != "" { - q = q.Where(m.Tag.Eq(opt.Tag)) - } else { - if opt.NotTag { - q = q.Where(m.Tag.Eq("")) - } + + if err := g.ValidateUpdate(); err != nil { + return errf.New(errf.InvalidParameter, err.Error()) } - if opt.Page.Start == 0 && opt.Page.Limit == 0 { - result, err := q.Find() - if err != nil { - return nil, 0, err - } + if err := dao.validateAttachmentAppExist(kit, g.Attachment); err != nil { + return err + } - return result, int64(len(result)), err + opts := orm.NewFieldOptions().AddIgnoredFields( + "id", "biz_id", "app_id") + expr, toUpdate, err := orm.RearrangeSQLDataWithOption(g, opts) + if err != nil { + return fmt.Errorf("prepare parsed sql expr failed, err: %v", err) + } - } else { - result, count, err := q.FindByPage(opt.Page.Offset(), opt.Page.LimitInt()) - if err != nil { - return nil, 0, err - } + ab := dao.auditDao.Decorator(kit, g.Attachment.BizID, enumor.Hook).PrepareUpdate(g) + + var sqlSentence []string + sqlSentence = append(sqlSentence, "UPDATE ", table.HookTable.Name(), " SET ", expr, " WHERE id = ", strconv.Itoa(int(g.ID)), + " AND biz_id = ", strconv.Itoa(int(g.Attachment.BizID))) + sql := filter.SqlJoint(sqlSentence) + + err = dao.sd.ShardingOne(g.Attachment.BizID).AutoTxn(kit, + func(txn *sqlx.Tx, opt *sharding.TxnOption) error { + var effected int64 + effected, err = dao.orm.Txn(txn).Update(kit.Ctx, sql, toUpdate) + if err != nil { + logs.Errorf("update hook: %d failed, err: %v, rid: %v", g.ID, err, kit.Rid) + return err + } + + if effected == 0 { + logs.Errorf("update one hook: %d, but record not found, rid: %v", g.ID, kit.Rid) + return errf.New(errf.RecordNotFound, orm.ErrRecordNotFound.Error()) + } + + if effected > 1 { + logs.Errorf("update one hook: %d, but got updated hook count: %d, rid: %v", g.ID, + effected, kit.Rid) + return fmt.Errorf("matched hook count %d is not as excepted", effected) + } + + // do audit + if err := ab.Do(&AuditOption{Txn: txn, ResShardingUid: opt.ShardingUid}); err != nil { + return fmt.Errorf("do hook update audit failed, err: %v", err) + } + + return nil + }) - return result, count, err + if err != nil { + return err } + return nil } -// CountHookTag count hook tag -func (dao *hookDao) CountHookTag(kit *kit.Kit, bizID uint32) ([]*types.HookTagCount, error) { +// List hooks with options. +func (dao *hookDao) List(kit *kit.Kit, opts *types.ListHooksOption) ( + *types.ListHookDetails, error) { + + if opts == nil { + return nil, errf.New(errf.InvalidParameter, "list hook options null") + } + + if err := opts.Validate(types.DefaultPageOption); err != nil { + return nil, err + } + + sqlOpt := &filter.SQLWhereOption{ + Priority: filter.Priority{"id", "biz_id", "app_id"}, + CrownedOption: &filter.CrownedOption{ + CrownedOp: filter.And, + Rules: []filter.RuleFactory{ + &filter.AtomRule{ + Field: "biz_id", + Op: filter.Equal.Factory(), + Value: opts.BizID, + }, + &filter.AtomRule{ + Field: "app_id", + Op: filter.Equal.Factory(), + Value: opts.AppID, + }, + }, + }, + } + whereExpr, args, err := opts.Filter.SQLWhereExpr(sqlOpt) + if err != nil { + return nil, err + } + var sqlSentenceCount []string + sqlSentenceCount = append(sqlSentenceCount, "SELECT COUNT(*) FROM ", table.HookTable.Name(), whereExpr) + countSql := filter.SqlJoint(sqlSentenceCount) + count, err := dao.orm.Do(dao.sd.ShardingOne(opts.BizID).DB()).Count(kit.Ctx, countSql, args...) + if err != nil { + return nil, err + } + + // query hook list for now. + pageExpr, err := opts.Page.SQLExpr(&types.PageSQLOption{Sort: types.SortOption{Sort: "id", IfNotPresent: true}}) + if err != nil { + return nil, err + } - m := dao.genQ.Hook - q := dao.genQ.Hook.WithContext(kit.Ctx) + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.HookColumns.NamedExpr(), " FROM ", table.HookTable.Name(), whereExpr, pageExpr) + sql := filter.SqlJoint(sqlSentence) - counts := make([]*types.HookTagCount, 0) - err := q.Select(m.Tag, m.ID.Count().As("counts")).Where(m.BizID.Eq(bizID), m.Tag.Neq("")).Group(m.Tag).Scan(&counts) + list := make([]*table.Hook, 0) + err = dao.orm.Do(dao.sd.ShardingOne(opts.BizID).DB()).Select(kit.Ctx, &list, sql, args...) if err != nil { return nil, err } - return counts, nil + return &types.ListHookDetails{Count: count, Details: list}, nil } -// DeleteWithTx one hook instance. -func (dao *hookDao) DeleteWithTx(kit *kit.Kit, tx *gen.QueryTx, g *table.Hook) error { +// Delete one hook instance. +func (dao *hookDao) Delete(kit *kit.Kit, g *table.Hook) error { if g == nil { - return errors.New("hook is nil") + return errf.New(errf.InvalidParameter, "hook is nil") } if err := g.ValidateDelete(); err != nil { - return err + return errf.New(errf.InvalidParameter, err.Error()) } - m := tx.Hook - q := tx.Hook.WithContext(kit.Ctx) - - oldOne, err := q.Where(m.BizID.Eq(g.Attachment.BizID), m.ID.Eq(g.ID)).Take() - if err != nil { + if err := dao.validateAttachmentAppExist(kit, g.Attachment); err != nil { return err } - ad := dao.auditDao.DecoratorV2(kit, g.Attachment.BizID).PrepareDelete(oldOne) - _, err = q.Where(m.BizID.Eq(g.Attachment.BizID)).Delete(g) - if err != nil { - return err - } + ab := dao.auditDao.Decorator(kit, g.Attachment.BizID, enumor.Hook).PrepareDelete(g.ID) - if e := ad.Do(tx.Query); e != nil { - return e - } + var sqlSentence []string + sqlSentence = append(sqlSentence, "DELETE FROM ", table.HookTable.Name(), " WHERE id = ", strconv.Itoa(int(g.ID)), + " AND biz_id = ", strconv.Itoa(int(g.Attachment.BizID))) + expr := filter.SqlJoint(sqlSentence) - return nil -} + err := dao.sd.ShardingOne(g.Attachment.BizID).AutoTxn(kit, func(txn *sqlx.Tx, opt *sharding.TxnOption) error { + // delete the hook at first. + err := dao.orm.Txn(txn).Delete(kit.Ctx, expr) + if err != nil { + return err + } -// GetByID get hook only with id. -func (dao *hookDao) GetByID(kit *kit.Kit, bizID, hookID uint32) (*table.Hook, error) { + // audit this delete hook details. + auditOpt := &AuditOption{Txn: txn, ResShardingUid: opt.ShardingUid} + if err := ab.Do(auditOpt); err != nil { + return fmt.Errorf("audit delete hook failed, err: %v", err) + } - m := dao.genQ.Hook - q := dao.genQ.Hook.WithContext(kit.Ctx) + return nil + }) - hook, err := q.Where(m.BizID.Eq(bizID), m.ID.Eq(hookID)).Take() if err != nil { - return nil, err + logs.Errorf("delete hook: %d failed, err: %v, rid: %v", g.ID, err, kit.Rid) + return fmt.Errorf("delete hook, but run txn failed, err: %v", err) } - return hook, nil + return nil } -// GetByName get a Hook by name -func (dao *hookDao) GetByName(kit *kit.Kit, bizID uint32, name string) (*table.Hook, error) { - m := dao.genQ.Hook - q := dao.genQ.Hook.WithContext(kit.Ctx) +// validateAttachmentResExist validate if attachment resource exists before creating hook. +func (dao *hookDao) validateAttachmentResExist(kit *kit.Kit, am *table.HookAttachment) error { + return dao.validateAttachmentAppExist(kit, am) +} - hook, err := q.Where(m.BizID.Eq(bizID), m.Name.Eq(name)).Take() +// validateAttachmentAppExist validate if attachment app exists before creating hook. +func (dao *hookDao) validateAttachmentAppExist(kit *kit.Kit, am *table.HookAttachment) error { + var sqlSentence []string + sqlSentence = append(sqlSentence, "WHERE id = ", strconv.Itoa(int(am.AppID)), " AND biz_id = ", strconv.Itoa(int(am.BizID))) + sql := filter.SqlJoint(sqlSentence) + exist, err := isResExist(kit, dao.orm, dao.sd.ShardingOne(am.BizID), table.AppTable, sql) if err != nil { - return nil, err + return err } - return hook, nil + if !exist { + return errf.New(errf.RelatedResNotExist, fmt.Sprintf("hook attached app %d is not exist", am.AppID)) + } + + return nil } diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/hook_release.go b/bcs-services/bcs-bscp/pkg/dal/dao/hook_release.go deleted file mode 100644 index 7c59628e15..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/dao/hook_release.go +++ /dev/null @@ -1,385 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 dao - -import ( - "fmt" - - "gorm.io/gorm" - - "bscp.io/pkg/dal/gen" - "bscp.io/pkg/dal/table" - "bscp.io/pkg/kit" - "bscp.io/pkg/types" -) - -// HookRelease supplies all the hook release related operations. -type HookRelease interface { - // Create one hook release instance. - Create(kit *kit.Kit, hook *table.HookRelease) (uint32, error) - // CreateWithTx create hook release instance with transaction. - CreateWithTx(kit *kit.Kit, tx *gen.QueryTx, g *table.HookRelease) (uint32, error) - // Get hook release by id - Get(kit *kit.Kit, bizID, hookID, id uint32) (*table.HookRelease, error) - // GetByName get HookRelease by name - GetByName(kit *kit.Kit, bizID, hookID uint32, name string) (*table.HookRelease, error) - // List hooks with options. - List(kit *kit.Kit, opt *types.ListHookReleasesOption) ([]*table.HookRelease, int64, error) - // Delete one strategy instance. - Delete(kit *kit.Kit, g *table.HookRelease) error - // GetByPubState hook release by State - GetByPubState(kit *kit.Kit, opt *types.GetByPubStateOption) (*table.HookRelease, error) - // DeleteByHookIDWithTx delete release revision with transaction - DeleteByHookIDWithTx(kit *kit.Kit, tx *gen.QueryTx, g *table.HookRelease) error - // PublishNumPlusOneWithTx PublishNum +1 revision with transaction - PublishNumPlusOneWithTx(kit *kit.Kit, tx *gen.Query) error - // UpdatePubStateWithTx update hookRelease State instance with transaction. - UpdatePubStateWithTx(kit *kit.Kit, tx *gen.QueryTx, g *table.HookRelease) error - // Update one HookRelease's info. - Update(kit *kit.Kit, g *table.HookRelease) error - // ListHookReleasesReferences 获取被引用脚本版本列表 - ListHookReleasesReferences(kit *kit.Kit, opt *types.ListHookReleasesReferencesOption) ([]*types.ListHookReleasesReferences, int64, error) -} - -var _ HookRelease = new(hookReleaseDao) - -type hookReleaseDao struct { - genQ *gen.Query - idGen IDGenInterface - auditDao AuditDao -} - -// Create one hook instance. -func (dao *hookReleaseDao) Create(kit *kit.Kit, g *table.HookRelease) (uint32, error) { - - if err := g.ValidateCreate(); err != nil { - return 0, err - } - - // generate a HookRelease id and update to HookRelease. - id, err := dao.idGen.One(kit, table.Name(g.TableName())) - if err != nil { - return 0, err - } - g.ID = id - - ad := dao.auditDao.DecoratorV2(kit, g.Attachment.BizID).PrepareCreate(g) - - // 多个使用事务处理 - createTx := func(tx *gen.Query) error { - q := tx.HookRelease.WithContext(kit.Ctx) - if e := q.Create(g); e != nil { - return e - } - - if e := ad.Do(tx); e != nil { - return e - } - - return nil - } - if e := dao.genQ.Transaction(createTx); e != nil { - return 0, e - } - - return g.ID, nil - -} - -// CreateWithTx create one hookRelease instance with transaction. -func (dao *hookReleaseDao) CreateWithTx(kit *kit.Kit, tx *gen.QueryTx, g *table.HookRelease) (uint32, error) { - - if err := g.ValidateCreate(); err != nil { - return 0, err - } - - // generate a HookRelease id and update to HookRelease. - id, err := dao.idGen.One(kit, table.Name(g.TableName())) - if err != nil { - return 0, err - } - g.ID = id - - ad := dao.auditDao.DecoratorV2(kit, g.Attachment.BizID).PrepareCreate(g) - - err = tx.HookRelease.WithContext(kit.Ctx).Create(g) - if err != nil { - return 0, err - } - err = ad.Do(tx.Query) - if err != nil { - return 0, err - } - - return g.ID, nil -} - -// Get hookRelease by id -func (dao *hookReleaseDao) Get(kit *kit.Kit, bizID, hookID, id uint32) (*table.HookRelease, error) { - - m := dao.genQ.HookRelease - q := dao.genQ.HookRelease.WithContext(kit.Ctx) - - tplSpace, err := q.Where(m.BizID.Eq(bizID), m.HookID.Eq(hookID), m.ID.Eq(id)).Take() - if err != nil { - return nil, fmt.Errorf("get hookRelease failed, err: %v", err) - } - - return tplSpace, nil -} - -// GetByName get HookRelease by name -func (dao *hookReleaseDao) GetByName(kit *kit.Kit, bizID, hookID uint32, name string) (*table.HookRelease, error) { - m := dao.genQ.HookRelease - q := dao.genQ.HookRelease.WithContext(kit.Ctx) - - tplSpace, err := q.Where(m.BizID.Eq(bizID), m.HookID.Eq(hookID), m.Name.Eq(name)).Take() - if err != nil { - return nil, fmt.Errorf("get hookRelease failed, err: %v", err) - } - - return tplSpace, nil -} - -// List hooks with options. -func (dao *hookReleaseDao) List(kit *kit.Kit, - opt *types.ListHookReleasesOption) ([]*table.HookRelease, int64, error) { - - m := dao.genQ.HookRelease - q := dao.genQ.HookRelease.WithContext(kit.Ctx).Where( - m.BizID.Eq(opt.BizID), - m.HookID.Eq(opt.HookID)).Order(m.ID.Desc()) - - if opt.SearchKey != "" { - q = q.Where(m.Name.Like(fmt.Sprintf("%%%s%%", opt.SearchKey))) - } - - if opt.State != "" { - q = q.Where(m.State.Eq(opt.State.String())) - } - - if opt.Page.Start == 0 && opt.Page.Limit == 0 { - result, err := q.Find() - if err != nil { - return nil, 0, err - } - - return result, int64(len(result)), err - - } else { - result, count, err := q.FindByPage(opt.Page.Offset(), opt.Page.LimitInt()) - if err != nil { - return nil, 0, err - } - - return result, count, err - } - -} - -// Delete one strategy instance. -func (dao *hookReleaseDao) Delete(kit *kit.Kit, g *table.HookRelease) error { - - // 参数校验 - if err := g.ValidateDelete(); err != nil { - return err - } - - // 删除操作, 获取当前记录做审计 - m := dao.genQ.HookRelease - q := dao.genQ.HookRelease.WithContext(kit.Ctx) - oldOne, err := q.Where(m.ID.Eq(g.ID), m.BizID.Eq(g.Attachment.BizID)).Take() - if err != nil { - return err - } - ad := dao.auditDao.DecoratorV2(kit, g.Attachment.BizID).PrepareDelete(oldOne) - - // 多个使用事务处理 - deleteTx := func(tx *gen.Query) error { - q = tx.HookRelease.WithContext(kit.Ctx) - if _, e := q.Where(m.BizID.Eq(g.Attachment.BizID), m.ID.Eq(g.ID)).Delete(g); e != nil { - return e - } - - if e := ad.Do(tx); e != nil { - return e - } - return nil - } - if e := dao.genQ.Transaction(deleteTx); e != nil { - return e - } - - return nil -} - -// DeleteByHookIDWithTx delete release revision with transaction -func (dao *hookReleaseDao) DeleteByHookIDWithTx(kit *kit.Kit, tx *gen.QueryTx, g *table.HookRelease) error { - - // 参数校验 - if err := g.ValidateDeleteByHookID(); err != nil { - return err - } - - // 删除操作, 获取当前记录做审计 - m := tx.HookRelease - q := tx.HookRelease.WithContext(kit.Ctx) - - oldOne, err := q.Where(m.HookID.Eq(g.Attachment.HookID), m.BizID.Eq(g.Attachment.BizID)).Take() - if err != nil { - return err - } - ad := dao.auditDao.DecoratorV2(kit, g.Attachment.BizID).PrepareDelete(oldOne) - - if _, e := q.Where(m.BizID.Eq(g.Attachment.BizID), m.HookID.Eq(g.Attachment.HookID)).Delete(g); e != nil { - return e - } - - if e := ad.Do(tx.Query); e != nil { - return err - } - - return nil -} - -// GetByPubState hook release by State -func (dao *hookReleaseDao) GetByPubState(kit *kit.Kit, - opt *types.GetByPubStateOption) (*table.HookRelease, error) { - - // 参数校验 - if err := opt.Validate(); err != nil { - return nil, err - } - - m := dao.genQ.HookRelease - q := dao.genQ.HookRelease.WithContext(kit.Ctx) - - release, err := q.Where( - m.BizID.Eq(opt.BizID), - m.HookID.Eq(opt.HookID), - m.State.Eq(opt.State.String()), - ).Take() - if err != nil { - return nil, err - } - - return release, nil - -} - -// PublishNumPlusOneWithTx PublishNum +1 revision with transaction -func (dao *hookReleaseDao) PublishNumPlusOneWithTx(kit *kit.Kit, tx *gen.Query) error { - - m := tx.HookRelease - _, err := tx.WithContext(kit.Ctx).Hook.Update(m.PublishNum, gorm.Expr("publish_num + ?", 1)) - return err -} - -// UpdatePubStateWithTx update hookRelease State instance with transaction. -func (dao *hookReleaseDao) UpdatePubStateWithTx(kit *kit.Kit, tx *gen.QueryTx, g *table.HookRelease) error { - - if err := g.ValidatePublish(); err != nil { - return err - } - - q := tx.HookRelease.WithContext(kit.Ctx) - m := tx.HookRelease - - oldOne, err := q.Where(m.HookID.Eq(g.Attachment.HookID), m.BizID.Eq(g.Attachment.BizID)).Take() - if err != nil { - return err - } - ad := dao.auditDao.DecoratorV2(kit, g.Attachment.BizID).PrepareUpdate(g, oldOne) - - if _, e := q.Where(m.ID.Eq(g.ID), m.BizID.Eq(g.Attachment.BizID)).Select(m.State, m.Reviser).Updates(g); e != nil { - return e - } - - if e := ad.Do(tx.Query); e != nil { - return e - } - - return nil -} - -// Update one HookRelease's info. -func (dao *hookReleaseDao) Update(kit *kit.Kit, g *table.HookRelease) error { - - if err := g.ValidateUpdate(); err != nil { - return err - } - - q := dao.genQ.HookRelease.WithContext(kit.Ctx) - m := dao.genQ.HookRelease - - oldOne, err := q.Where(m.HookID.Eq(g.Attachment.HookID), m.BizID.Eq(g.Attachment.BizID)).Take() - if err != nil { - return err - } - ad := dao.auditDao.DecoratorV2(kit, g.Attachment.BizID).PrepareUpdate(g, oldOne) - - // 多个使用事务处理 - updateTx := func(tx *gen.Query) error { - q = tx.HookRelease.WithContext(kit.Ctx) - if _, e := q.Where(m.BizID.Eq(g.Attachment.BizID), m.ID.Eq(g.ID)).Select(m.Name, m.Memo, m.Content, m.Reviser).Updates(g); e != nil { - return e - } - - if e := ad.Do(tx); e != nil { - return e - } - return nil - } - if e := dao.genQ.Transaction(updateTx); e != nil { - return e - } - - return nil -} - -// ListHookReleasesReferences 获取被引用脚本版本列表 -func (dao *hookReleaseDao) ListHookReleasesReferences(kit *kit.Kit, - opt *types.ListHookReleasesReferencesOption) ([]*types.ListHookReleasesReferences, int64, error) { - - release := dao.genQ.Release - hr := dao.genQ.HookRelease.As("hr") - r := release.As("r") - app := dao.genQ.App.As("app") - - var results []*types.ListHookReleasesReferences - - q := r.WithContext(kit.Ctx). - Select(r.ID.As("config_release_id"), r.Name.As("config_release_name"), - hr.HookID.As("hook_id"), app.ID.As("app_id"), hr.Name.As("hook_release_name"), - hr.ID.As("hook_release_id"), app.Name.As("app_name")). - LeftJoin(hr, r.PreHookReleaseID.EqCol(hr.ID)). - LeftJoin(app, r.AppID.EqCol(app.ID)) - - if opt.HookReleasesID > 0 { - q = q.Where(r.PreHookReleaseID.Eq(opt.HookReleasesID), r.PreHookID.Eq(opt.HookID)). - Or(r.PostHookReleaseID.Eq(opt.HookReleasesID), r.PostHookID.Eq(opt.HookID)) - } else { - q.Where(r.PreHookID.Eq(opt.HookID)).Or(r.PostHookID.Eq(opt.HookID)) - } - - count, err := q.Group(r.ID, r.Name, hr.Name, hr.Name, app.Name). - Order(r.ID.Desc()). - ScanByPage(&results, opt.Page.Offset(), opt.Page.LimitInt()) - - if err != nil { - return nil, 0, err - } - - return results, count, nil - -} diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/publish.go b/bcs-services/bcs-bscp/pkg/dal/dao/publish.go index bb231fd0b7..db9fd6b425 100644 --- a/bcs-services/bcs-bscp/pkg/dal/dao/publish.go +++ b/bcs-services/bcs-bscp/pkg/dal/dao/publish.go @@ -13,16 +13,24 @@ limitations under the License. package dao import ( - "errors" + "fmt" + "strconv" + "strings" "time" - "bscp.io/pkg/dal/gen" + "bscp.io/pkg/criteria/enumor" + "bscp.io/pkg/criteria/errf" + "bscp.io/pkg/dal/orm" + "bscp.io/pkg/dal/sharding" "bscp.io/pkg/dal/table" "bscp.io/pkg/kit" "bscp.io/pkg/logs" + "bscp.io/pkg/runtime/filter" "bscp.io/pkg/runtime/selector" "bscp.io/pkg/tools" "bscp.io/pkg/types" + + "github.com/jmoiron/sqlx" ) // Publish defines all the publish operation related operations. @@ -32,13 +40,14 @@ type Publish interface { // all its released config items are effected immediately. Publish(kit *kit.Kit, opt *types.PublishOption) (id uint32, err error) - PublishWithTx(kit *kit.Kit, tx *gen.QueryTx, opt *types.PublishOption) (id uint32, err error) + PublishWithTx(kit *kit.Kit, tx *sharding.Tx, opt *types.PublishOption) (id uint32, err error) } var _ Publish = new(pubDao) type pubDao struct { - genQ *gen.Query + orm orm.Interface + sd *sharding.Sharding idGen IDGenInterface auditDao AuditDao event Event @@ -48,65 +57,97 @@ type pubDao struct { // once an app's strategy along with its release id is published, // all its released config items are effected immediately. // return the published strategy history record id. -func (dao *pubDao) Publish(kit *kit.Kit, opt *types.PublishOption) (uint32, error) { +func (pd *pubDao) Publish(kit *kit.Kit, opt *types.PublishOption) (uint32, error) { + if opt == nil { - return 0, errors.New("publish strategy option is nil") + return 0, errf.New(errf.InvalidParameter, "publish strategy option is nil") } if err := opt.Validate(); err != nil { return 0, err } - eDecorator := dao.event.Eventf(kit) - var pubID uint32 - - // 多个使用事务处理 - createTx := func(tx *gen.Query) error { + eDecorator := pd.event.Eventf(kit) + var pshID uint32 + err := pd.sd.ShardingOne(opt.BizID).AutoTxn(kit, func(txn *sqlx.Tx, options *sharding.TxnOption) error { groups := make([]*table.Group, 0, len(opt.Groups)) if !opt.All { - m := dao.genQ.Group - q := dao.genQ.Group.WithContext(kit.Ctx) - var err error - groups, err = q.Where(m.ID.In(opt.Groups...)).Find() - if err != nil { + // list groups if gray release + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.GroupColumns.NamedExpr(), " FROM ", table.GroupTable.Name(), + " WHERE id IN (", tools.JoinUint32(opt.Groups, ","), ")") + lgExpr := filter.SqlJoint(sqlSentence) + if err := pd.orm.Do(pd.sd.MustSharding(opt.BizID)).Select(kit.Ctx, &groups, lgExpr); err != nil { logs.Errorf("get to be published groups(%s) failed, err: %v, rid: %s", tools.JoinUint32(opt.Groups, ","), err, kit.Rid) - return err + return errf.New(errf.DBOpFailed, err.Error()) } } - // create strategy to publish it later - stgID, err := dao.idGen.One(kit, table.StrategyTable) + now := time.Now() + stgID, err := pd.idGen.One(kit, table.StrategyTable) if err != nil { logs.Errorf("generate strategy id failed, err: %v, rid: %s", err, kit.Rid) - return err + return errf.New(errf.DBOpFailed, err.Error()) } - pubID = stgID - stg := genStrategy(kit, opt, stgID, groups) + pshID = stgID + + stg := &table.Strategy{ + ID: stgID, + Spec: &table.StrategySpec{ + Name: now.Format(time.RFC3339), + ReleaseID: opt.ReleaseID, + AsDefault: opt.Default, + Scope: &table.Scope{ + Groups: groups, + }, + Mode: table.Normal, + Memo: opt.Memo, + }, + State: &table.StrategyState{ + PubState: table.Publishing, + }, + Attachment: &table.StrategyAttachment{ + BizID: opt.BizID, + AppID: opt.AppID, + }, + Revision: &table.Revision{ + Creator: kit.User, + Reviser: kit.User, + CreatedAt: now, + UpdatedAt: now, + }, + } + var sqlSentence []string + sqlSentence = append(sqlSentence, "INSERT INTO ", table.StrategyTable.Name(), " (", table.StrategyColumns.ColumnExpr(), + ") VALUES(", table.StrategyColumns.ColonNameExpr(), ")") + stgExpr := filter.SqlJoint(sqlSentence) - sq := dao.genQ.Strategy.WithContext(kit.Ctx) - if err := sq.Create(stg); err != nil { + if err = pd.orm.Txn(txn).Insert(kit.Ctx, stgExpr, stg); err != nil { return err } - // audit this to create strategy details - ad := dao.auditDao.DecoratorV2(kit, opt.BizID).PrepareCreate(stg) - if err := ad.Do(tx); err != nil { - return err + // audit this to create strategy details. + auc := &AuditOption{Txn: txn, ResShardingUid: options.ShardingUid} + if err = pd.auditDao.Decorator(kit, stg.Attachment.BizID, + enumor.Strategy).AuditCreate(stg, auc); err != nil { + return fmt.Errorf("audit create strategy failed, err: %v", err) } - // audit this to publish details - ad = dao.auditDao.DecoratorV2(kit, opt.BizID).PreparePublish(stg) - if err := ad.Do(tx); err != nil { - return err + + // audit this to publish strategy details. + aup := &AuditOption{Txn: txn, ResShardingUid: options.ShardingUid} + if err = pd.auditDao.Decorator(kit, stg.Attachment.BizID, + enumor.Strategy).AuditPublish(stg, aup); err != nil { + return fmt.Errorf("audit publish strategy failed, err: %v", err) } // add release publish num - if err := dao.increaseReleasePublishNum(kit, tx, stg.Spec.ReleaseID); err != nil { + if err := pd.increaseReleasePublishNum(kit, txn, stg.Spec.ReleaseID); err != nil { logs.Errorf("increate release publish num failed, err: %v, rid: %s", err, kit.Rid) return err } - if err := dao.upsertReleasedGroups(kit, tx, opt, stg); err != nil { + if err := pd.upsertReleasedGroups(kit, txn, opt, stg); err != nil { logs.Errorf("upsert group current releases failed, err: %v, rid: %s", err, kit.Rid) return err } @@ -120,126 +161,131 @@ func (dao *pubDao) Publish(kit *kit.Kit, opt *types.PublishOption) (uint32, erro OpType: table.InsertOp, }, Attachment: &table.EventAttachment{BizID: opt.BizID, AppID: opt.AppID}, - Revision: &table.CreatedRevision{Creator: kit.User}, + Revision: &table.CreatedRevision{Creator: kit.User, CreatedAt: time.Now()}, } if err := eDecorator.Fire(one); err != nil { logs.Errorf("fire publish strategy event failed, err: %v, rid: %s", err, kit.Rid) - return errors.New("fire event failed, " + err.Error()) + return errf.New(errf.DBOpFailed, "fire event failed, "+err.Error()) } return nil - } - err := dao.genQ.Transaction(createTx) + }) eDecorator.Finalizer(err) if err != nil { + logs.Errorf("publish strategy failed, err: %v, rid: %s", err, kit.Rid) return 0, err } - return pubID, nil + return pshID, nil } -func genStrategy(kit *kit.Kit, opt *types.PublishOption, stgID uint32, groups []*table.Group) *table.Strategy { - now := time.Now() - return &table.Strategy{ - ID: stgID, - Spec: &table.StrategySpec{ - Name: now.Format(time.RFC3339), - ReleaseID: opt.ReleaseID, - AsDefault: opt.Default, - Scope: &table.Scope{ - Groups: groups, - }, - Mode: table.Normal, - Memo: opt.Memo, - }, - State: &table.StrategyState{ - PubState: table.Publishing, - }, - Attachment: &table.StrategyAttachment{ - BizID: opt.BizID, - AppID: opt.AppID, - }, - Revision: &table.Revision{ - Creator: kit.User, - Reviser: kit.User, - }, - } -} +// Publish publish with transaction +func (pd *pubDao) PublishWithTx(kit *kit.Kit, tx *sharding.Tx, opt *types.PublishOption) (uint32, error) { -// PublishWithTx publish with transaction -func (dao *pubDao) PublishWithTx(kit *kit.Kit, tx *gen.QueryTx, opt *types.PublishOption) (uint32, error) { if opt == nil { - return 0, errors.New("publish strategy option is nil") + return 0, errf.New(errf.InvalidParameter, "publish strategy option is nil") } if err := opt.Validate(); err != nil { return 0, err } - eDecorator := dao.event.Eventf(kit) - var pubID uint32 - groupIDs := opt.Groups if opt.All { - m := dao.genQ.ReleasedGroup - q := dao.genQ.ReleasedGroup.WithContext(kit.Ctx) - err := q.Select(m.GroupID).Where(m.BizID.Eq(opt.BizID), m.AppID.Eq(opt.AppID), - m.GroupID.Neq(0)).Scan(&groupIDs) - if err != nil { + // list groups if gray release + var lgSql []string + lgSql = append(lgSql, "SELECT group_id FROM ", table.ReleasedGroupTable.Name(), + " WHERE group_id <> 0 AND app_id = ", strconv.Itoa(int(opt.AppID)), + " AND biz_id = ", strconv.Itoa(int(opt.BizID))) + lgExpr := filter.SqlJoint(lgSql) + if err := pd.orm.Do(pd.sd.MustSharding(opt.BizID)).Select(kit.Ctx, &groupIDs, lgExpr); err != nil { logs.Errorf("get to be published groups(all) failed, err: %v, rid: %s", err, kit.Rid) - return 0, err + return 0, errf.New(errf.DBOpFailed, err.Error()) } opt.Default = true } + eDecorator := pd.event.Eventf(kit) + groups := make([]*table.Group, 0, len(groupIDs)) // list groups if gray release if len(groupIDs) > 0 { - m := dao.genQ.Group - q := dao.genQ.Group.WithContext(kit.Ctx) - var err error - groups, err = q.Where(m.ID.In(groupIDs...)).Find() - if err != nil { + var lgSentence []string + lgSentence = append(lgSentence, "SELECT ", table.GroupColumns.NamedExpr(), " FROM ", table.GroupTable.Name(), + " WHERE id IN (", tools.JoinUint32(groupIDs, ","), ")") + lgExpr := filter.SqlJoint(lgSentence) + if err := pd.orm.Do(pd.sd.MustSharding(opt.BizID)).Select(kit.Ctx, &groups, lgExpr); err != nil { logs.Errorf("get to be published groups(%s) failed, err: %v, rid: %s", - tools.JoinUint32(opt.Groups, ","), err, kit.Rid) - return 0, err + tools.JoinUint32(groupIDs, ","), err, kit.Rid) + return 0, errf.New(errf.DBOpFailed, err.Error()) } } - // create strategy to publish it later - stgID, err := dao.idGen.One(kit, table.StrategyTable) + now := time.Now() + stgID, err := pd.idGen.One(kit, table.StrategyTable) if err != nil { logs.Errorf("generate strategy id failed, err: %v, rid: %s", err, kit.Rid) - return 0, err + return 0, errf.New(errf.DBOpFailed, err.Error()) } - pubID = stgID - stg := genStrategy(kit, opt, stgID, groups) + pshID := stgID + stg := &table.Strategy{ + ID: stgID, + Spec: &table.StrategySpec{ + Name: now.Format(time.RFC3339), + ReleaseID: opt.ReleaseID, + AsDefault: opt.Default, + Scope: &table.Scope{ + Groups: groups, + }, + Mode: table.Normal, + Memo: opt.Memo, + }, + State: &table.StrategyState{ + PubState: table.Publishing, + }, + Attachment: &table.StrategyAttachment{ + BizID: opt.BizID, + AppID: opt.AppID, + }, + Revision: &table.Revision{ + Creator: kit.User, + Reviser: kit.User, + CreatedAt: now, + UpdatedAt: now, + }, + } + var sqlSentence []string + sqlSentence = append(sqlSentence, "INSERT INTO ", table.StrategyTable.Name(), " (", table.StrategyColumns.ColumnExpr(), + ") VALUES(", table.StrategyColumns.ColonNameExpr(), ")") + stgExpr := filter.SqlJoint(sqlSentence) - sq := tx.Strategy.WithContext(kit.Ctx) - if err := sq.Create(stg); err != nil { + if err = pd.orm.Txn(tx.Tx()).Insert(kit.Ctx, stgExpr, stg); err != nil { return 0, err } - // audit this to create strategy details - ad := dao.auditDao.DecoratorV2(kit, opt.BizID).PrepareCreate(stg) - if err := ad.Do(tx.Query); err != nil { - return 0, err + // audit this to create strategy details. + auc := &AuditOption{Txn: tx.Tx(), ResShardingUid: tx.ShardingUid()} + if err = pd.auditDao.Decorator(kit, stg.Attachment.BizID, + enumor.Strategy).AuditCreate(stg, auc); err != nil { + return 0, fmt.Errorf("audit create strategy failed, err: %v", err) } - // audit this to publish details - ad = dao.auditDao.DecoratorV2(kit, opt.BizID).PreparePublish(stg) - if err := ad.Do(tx.Query); err != nil { - return 0, err + + // audit this to publish strategy details. + aup := &AuditOption{Txn: tx.Tx(), ResShardingUid: tx.ShardingUid()} + if err = pd.auditDao.Decorator(kit, stg.Attachment.BizID, + enumor.Strategy).AuditPublish(stg, aup); err != nil { + return 0, fmt.Errorf("audit publish strategy failed, err: %v", err) } // add release publish num - if err := dao.increaseReleasePublishNum(kit, tx.Query, stg.Spec.ReleaseID); err != nil { + if err := pd.increaseReleasePublishNum(kit, tx.Tx(), stg.Spec.ReleaseID); err != nil { logs.Errorf("increate release publish num failed, err: %v, rid: %s", err, kit.Rid) return 0, err } - if err := dao.upsertReleasedGroups(kit, tx.Query, opt, stg); err != nil { + if err := pd.upsertReleasedGroups(kit, tx.Tx(), opt, stg); err != nil { logs.Errorf("upsert group current releases failed, err: %v, rid: %s", err, kit.Rid) return 0, err } @@ -253,30 +299,33 @@ func (dao *pubDao) PublishWithTx(kit *kit.Kit, tx *gen.QueryTx, opt *types.Publi OpType: table.InsertOp, }, Attachment: &table.EventAttachment{BizID: opt.BizID, AppID: opt.AppID}, - Revision: &table.CreatedRevision{Creator: kit.User}, + Revision: &table.CreatedRevision{Creator: kit.User, CreatedAt: time.Now()}, } - if err := eDecorator.FireWithTx(tx, one); err != nil { - logs.Errorf("fire publish strategy event failed, err: %v, rid: %s", err, kit.Rid) - return 0, errors.New("fire event failed, " + err.Error()) + if e := eDecorator.FireWithTx(tx, one); e != nil { + logs.Errorf("fire publish strategy event failed, err: %v, rid: %s", e, kit.Rid) + return 0, errf.New(errf.DBOpFailed, "fire event failed, "+e.Error()) } - return pubID, nil + return pshID, nil } // increaseReleasePublishNum increase release publish num by 1 -func (dao *pubDao) increaseReleasePublishNum(kit *kit.Kit, tx *gen.Query, releaseID uint32) error { - m := tx.Release - q := tx.Release.WithContext(kit.Ctx) - if _, err := q.Where(m.ID.Eq(releaseID)).UpdateSimple(m.PublishNum.Add(1)); err != nil { - logs.Errorf("increase release publish num failed, err: %v, rid: %s", err, kit.Rid) - return err +func (pd *pubDao) increaseReleasePublishNum(kit *kit.Kit, txn *sqlx.Tx, releaseID uint32) error { + var sqlSentence []string + sqlSentence = append(sqlSentence, "UPDATE ", table.ReleaseTable.Name(), + " SET publish_num = publish_num + 1 WHERE id = ", strconv.Itoa(int(releaseID))) + sql := filter.SqlJoint(sqlSentence) + if _, err := txn.ExecContext(kit.Ctx, sql); err != nil { + logs.Errorf("increate release publish num failed, sql: %s, err: %v, rid: %s", sql, err, kit.Rid) + return errf.New(errf.DBOpFailed, "insert published strategy history failed, err: "+err.Error()) } return nil } -func (dao *pubDao) upsertReleasedGroups(kit *kit.Kit, tx *gen.Query, opt *types.PublishOption, - stg *table.Strategy) error { +func (pd *pubDao) upsertReleasedGroups(kit *kit.Kit, txn *sqlx.Tx, + opt *types.PublishOption, stg *table.Strategy) error { groups := stg.Spec.Scope.Groups + now := time.Now() if opt.Default { groups = append(groups, &table.Group{ ID: 0, @@ -289,9 +338,8 @@ func (dao *pubDao) upsertReleasedGroups(kit *kit.Kit, tx *gen.Query, opt *types. }, }) } - for _, group := range groups { - rg := &table.ReleasedGroup{ + gcr := &table.ReleasedGroup{ GroupID: group.ID, AppID: opt.AppID, ReleaseID: opt.ReleaseID, @@ -302,30 +350,50 @@ func (dao *pubDao) upsertReleasedGroups(kit *kit.Kit, tx *gen.Query, opt *types. Edited: false, BizID: opt.BizID, Reviser: kit.User, + UpdatedAt: now, + } + opts := orm.NewFieldOptions().AddIgnoredFields("id").AddBlankedFields("edited") + expr, toUpdate, err := orm.RearrangeSQLDataWithOption(gcr, opts) + var sqlSentence []string + sqlSentence = append(sqlSentence, "UPDATE ", table.ReleasedGroupTable.Name(), " SET ", expr, + " WHERE biz_id = ", strconv.Itoa(int(opt.BizID)), " AND group_id = ", strconv.Itoa(int(group.ID)), + " AND app_id = ", strconv.Itoa(int(opt.AppID))) + sql := filter.SqlJoint(sqlSentence) + result, err := txn.NamedExecContext(kit.Ctx, sql, toUpdate) + if err != nil { + return errf.New(errf.DBOpFailed, "update group current releases failed, err: "+err.Error()) } - m := tx.ReleasedGroup - q := tx.ReleasedGroup.WithContext(kit.Ctx) - - result, err := q.Where(m.BizID.Eq(opt.BizID), m.AppID.Eq(opt.AppID), m.GroupID.Eq(group.ID)). - Omit(m.ID).Updates(rg) + rowsAffected, err := result.RowsAffected() if err != nil { - return err + return errf.New(errf.DBOpFailed, err.Error()) } - if result.RowsAffected == 1 { + + if rowsAffected > 1 { + return fmt.Errorf("update group current releases affected is %d", rowsAffected) + } + + if rowsAffected == 1 { continue } - id, err := dao.idGen.One(kit, table.ReleasedGroupTable) + id, err := pd.idGen.One(kit, table.ReleasedGroupTable) if err != nil { - return err + return errf.New(errf.DBOpFailed, "generate group current releases id failed, err: "+err.Error()) } - rg.ID = id - - if err := q.Create(rg); err != nil { - return err + gcr.ID = id + + var sqlSentenceIn []string + sqlSentenceIn = append(sqlSentenceIn, "INSERT INTO ", table.ReleasedGroupTable.Name(), " (", + table.ReleasedGroupColumns.ColumnExpr(), ") VALUES(", table.ReleasedGroupColumns.ColonNameExpr(), ")") + sql = filter.SqlJoint(sqlSentenceIn) + if _, err := txn.NamedExecContext(kit.Ctx, sql, gcr); err != nil { + // concurrency can cause deadlock problems and provide three retries + if strings.Contains(err.Error(), orm.ErrDeadLock) { + return sharding.ErrRetryTransaction + } + return errf.New(errf.DBOpFailed, "insert group current releases failed, err: "+err.Error()) } } - return nil } diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/release.go b/bcs-services/bcs-bscp/pkg/dal/dao/release.go index a7bbcefccb..8bb54734fa 100644 --- a/bcs-services/bcs-bscp/pkg/dal/dao/release.go +++ b/bcs-services/bcs-bscp/pkg/dal/dao/release.go @@ -20,7 +20,6 @@ import ( "bscp.io/pkg/criteria/enumor" "bscp.io/pkg/criteria/errf" - "bscp.io/pkg/dal/gen" "bscp.io/pkg/dal/orm" "bscp.io/pkg/dal/sharding" "bscp.io/pkg/dal/table" @@ -31,14 +30,11 @@ import ( // Release supplies all the release related operations. type Release interface { - // CreateWithTx create one release instance with tx. + // CreateWithTx one release instance with tx. CreateWithTx(kit *kit.Kit, tx *sharding.Tx, release *table.Release) (uint32, error) - // CreateWithTxV2 create one release instance with tx. - // NOTE: unify CreateWithTxV2 and CreateWithTx to be one with gorm/gen - CreateWithTxV2(kit *kit.Kit, tx *gen.QueryTx, release *table.Release) (uint32, error) // List releases with options. List(kit *kit.Kit, opts *types.ListReleasesOption) (*types.ListReleaseDetails, error) - // GetByName .. + // GetByName GetByName(kit *kit.Kit, bizID uint32, appID uint32, name string) (*table.Release, error) } @@ -46,47 +42,12 @@ var _ Release = new(releaseDao) type releaseDao struct { orm orm.Interface - genQ *gen.Query sd *sharding.Sharding idGen IDGenInterface auditDao AuditDao } -// CreateWithTxV2 create one release instance with tx. -func (dao *releaseDao) CreateWithTxV2(kit *kit.Kit, tx *gen.QueryTx, g *table.Release) (uint32, error) { - if g == nil { - return 0, errors.New("release is nil") - } - - if err := g.ValidateCreate(); err != nil { - return 0, err - } - - if err := dao.validateAttachmentResExist(kit, g.Attachment); err != nil { - return 0, err - } - - // generate an release id and update to release. - id, err := dao.idGen.One(kit, table.ReleaseTable) - if err != nil { - return 0, err - } - g.ID = id - - q := tx.Release.WithContext(kit.Ctx) - if err := q.Create(g); err != nil { - return 0, err - } - - ad := dao.auditDao.DecoratorV2(kit, g.Attachment.BizID).PrepareCreate(g) - if err := ad.Do(tx.Query); err != nil { - return 0, err - } - - return g.ID, nil -} - -// CreateWithTx create one release instance with tx. +// CreateWithTx one release instance with tx. func (dao *releaseDao) CreateWithTx(kit *kit.Kit, tx *sharding.Tx, release *table.Release) (uint32, error) { if release == nil { return 0, errf.New(errf.InvalidParameter, "release is nil") @@ -154,30 +115,60 @@ func (dao *releaseDao) List(kit *kit.Kit, opts *types.ListReleasesOption) ( return nil, err } - m := dao.genQ.Release - q := dao.genQ.Release.WithContext(kit.Ctx).Where( - m.BizID.Eq(opts.BizID), - m.AppID.Eq(opts.AppID), - m.Deprecated.Is(opts.Deprecated)) - - if opts.Page.Start == 0 && opts.Page.Limit == 0 { - result, err := q.Find() - if err != nil { - return nil, err - } + sqlOpt := &filter.SQLWhereOption{ + Priority: filter.Priority{"id", "biz_id", "app_id"}, + CrownedOption: &filter.CrownedOption{ + CrownedOp: filter.And, + Rules: []filter.RuleFactory{ + &filter.AtomRule{ + Field: "biz_id", + Op: filter.Equal.Factory(), + Value: opts.BizID, + }, + &filter.AtomRule{ + Field: "app_id", + Op: filter.Equal.Factory(), + Value: opts.AppID, + }, + &filter.AtomRule{ + Field: "deprecated", + Op: filter.Equal.Factory(), + Value: opts.Deprecated, + }, + }, + }, + } + whereExpr, args, err := opts.Filter.SQLWhereExpr(sqlOpt) + if err != nil { + return nil, err + } - return &types.ListReleaseDetails{Count: uint32(len(result)), Details: result}, nil + var sqlSentenceCount []string + sqlSentenceCount = append(sqlSentenceCount, "SELECT COUNT(*) FROM ", table.ReleaseTable.Name(), whereExpr) + countSql := filter.SqlJoint(sqlSentenceCount) + count, err := dao.orm.Do(dao.sd.ShardingOne(opts.BizID).DB()).Count(kit.Ctx, countSql, args...) + if err != nil { + return nil, err + } - } else { - result, count, err := q.FindByPage(opts.Page.Offset(), opts.Page.LimitInt()) - if err != nil { - return nil, err - } + // query release list for now. + pageExpr, err := opts.Page.SQLExpr(&types.PageSQLOption{Sort: types.SortOption{Sort: "id", IfNotPresent: true}}) + if err != nil { + return nil, err + } - return &types.ListReleaseDetails{Count: uint32(count), Details: result}, nil + var sqlSentence []string + sqlSentence = append(sqlSentence, "SELECT ", table.ReleaseColumns.NamedExpr(), + " FROM ", table.ReleaseTable.Name(), whereExpr, pageExpr) + sql := filter.SqlJoint(sqlSentence) + list := make([]*table.Release, 0) + err = dao.orm.Do(dao.sd.ShardingOne(opts.BizID).DB()).Select(kit.Ctx, &list, sql, args...) + if err != nil { + return nil, err } + return &types.ListReleaseDetails{Count: count, Details: list}, nil } // validateAttachmentResExist validate if attachment resource exists before creating release. diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/release_ci.go b/bcs-services/bcs-bscp/pkg/dal/dao/release_ci.go index 9a27e56a6b..03f407916b 100644 --- a/bcs-services/bcs-bscp/pkg/dal/dao/release_ci.go +++ b/bcs-services/bcs-bscp/pkg/dal/dao/release_ci.go @@ -14,13 +14,11 @@ package dao import ( "bytes" - "errors" "fmt" "strconv" "bscp.io/pkg/criteria/enumor" "bscp.io/pkg/criteria/errf" - "bscp.io/pkg/dal/gen" "bscp.io/pkg/dal/orm" "bscp.io/pkg/dal/sharding" "bscp.io/pkg/dal/table" @@ -33,9 +31,6 @@ import ( type ReleasedCI interface { // BulkCreateWithTx bulk create released config items with tx. BulkCreateWithTx(kit *kit.Kit, tx *sharding.Tx, items []*table.ReleasedConfigItem) error - // BulkCreateWithTxV2 bulk create released config items with tx. - // NOTE: unify BulkCreateWithTxV2 and BulkCreateWithTx to be one with gorm/gen - BulkCreateWithTxV2(kit *kit.Kit, tx *gen.QueryTx, items []*table.ReleasedConfigItem) error // Get released config item by id and released id Get(kit *kit.Kit, id, bizID, releasedID uint32) (*table.ReleasedConfigItem, error) // GetReleasedLately released config item by app id and biz id @@ -53,45 +48,6 @@ type releasedCIDao struct { auditDao AuditDao } -// BulkCreateWithTxV2 bulk create released config items. -func (dao *releasedCIDao) BulkCreateWithTxV2(kit *kit.Kit, tx *gen.QueryTx, items []*table.ReleasedConfigItem) error { - if len(items) == 0 { - return errors.New("released config items is empty") - } - - // validate released config item field. - for _, item := range items { - if err := item.Validate(); err != nil { - return err - } - } - - // generate released config items id. - ids, err := dao.idGen.Batch(kit, table.ReleasedConfigItemTable, len(items)) - if err != nil { - return err - } - - start := 0 - for _, item := range items { - item.ID = ids[start] - start++ - } - batchSize := 100 - - q := tx.ReleasedConfigItem.WithContext(kit.Ctx) - if err := q.CreateInBatches(items, batchSize); err != nil { - return fmt.Errorf("insert events failed, err: %v", err) - } - - ad := dao.auditDao.DecoratorV2(kit, items[0].Attachment.BizID).PrepareCreate(table.RciList(items)) - if err := ad.Do(tx.Query); err != nil { - return err - } - - return nil -} - // BulkCreateWithTx bulk create released config items. func (dao *releasedCIDao) BulkCreateWithTx(kit *kit.Kit, tx *sharding.Tx, items []*table.ReleasedConfigItem) error { if items == nil { diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/template.go b/bcs-services/bcs-bscp/pkg/dal/dao/template.go index 4fa70c480b..32b0083db3 100644 --- a/bcs-services/bcs-bscp/pkg/dal/dao/template.go +++ b/bcs-services/bcs-bscp/pkg/dal/dao/template.go @@ -121,8 +121,9 @@ func (dao *templateDao) Update(kit *kit.Kit, g *table.Template) error { return err } - // 更新操作, 获取当前记录做审计 m := dao.genQ.Template + + // 更新操作, 获取当前记录做审计 q := dao.genQ.Template.WithContext(kit.Ctx) oldOne, err := q.Where(m.ID.Eq(g.ID), m.BizID.Eq(g.Attachment.BizID)).Take() if err != nil { @@ -206,13 +207,13 @@ func (dao *templateDao) GetByUniqueKey(kit *kit.Kit, bizID, templateSpaceID uint m := dao.genQ.Template q := dao.genQ.Template.WithContext(kit.Ctx) - template, err := q.Where(m.BizID.Eq(bizID), m.TemplateSpaceID.Eq(templateSpaceID), m.Name.Eq(name), + tplSpace, err := q.Where(m.BizID.Eq(bizID), m.TemplateSpaceID.Eq(templateSpaceID), m.Name.Eq(name), m.Path.Eq(path)).Take() if err != nil { return nil, fmt.Errorf("get template failed, err: %v", err) } - return template, nil + return tplSpace, nil } // GetByID get template by id diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/template_release.go b/bcs-services/bcs-bscp/pkg/dal/dao/template_release.go index 415a117c0d..78227d97f8 100644 --- a/bcs-services/bcs-bscp/pkg/dal/dao/template_release.go +++ b/bcs-services/bcs-bscp/pkg/dal/dao/template_release.go @@ -167,13 +167,12 @@ func (dao *templateReleaseDao) GetByUniqueKey(kit *kit.Kit, bizID, templateID ui m := dao.genQ.TemplateRelease q := dao.genQ.TemplateRelease.WithContext(kit.Ctx) - templateRelease, err := q.Where(m.BizID.Eq(bizID), m.TemplateID.Eq(templateID), - m.ReleaseName.Eq(releaseName)).Take() + tplSpace, err := q.Where(m.BizID.Eq(bizID), m.TemplateID.Eq(templateID), m.ReleaseName.Eq(releaseName)).Take() if err != nil { return nil, fmt.Errorf("get template release failed, err: %v", err) } - return templateRelease, nil + return tplSpace, nil } // validateAttachmentExist validate if attachment resource exists before operating template release diff --git a/bcs-services/bcs-bscp/pkg/dal/dao/template_space.go b/bcs-services/bcs-bscp/pkg/dal/dao/template_space.go index 5a9832ea93..56cbe1f62e 100644 --- a/bcs-services/bcs-bscp/pkg/dal/dao/template_space.go +++ b/bcs-services/bcs-bscp/pkg/dal/dao/template_space.go @@ -84,8 +84,9 @@ func (dao *templateSpaceDao) Update(kit *kit.Kit, g *table.TemplateSpace) error return err } - // 更新操作, 获取当前记录做审计 m := dao.genQ.TemplateSpace + + // 更新操作, 获取当前记录做审计 q := dao.genQ.TemplateSpace.WithContext(kit.Ctx) oldOne, err := q.Where(m.ID.Eq(g.ID), m.BizID.Eq(g.Attachment.BizID)).Take() if err != nil { @@ -165,10 +166,10 @@ func (dao *templateSpaceDao) GetByUniqueKey(kit *kit.Kit, bizID uint32, name str m := dao.genQ.TemplateSpace q := dao.genQ.TemplateSpace.WithContext(kit.Ctx) - templateSpace, err := q.Where(m.BizID.Eq(bizID), m.Name.Eq(name)).Take() + tplSpace, err := q.Where(m.BizID.Eq(bizID), m.Name.Eq(name)).Take() if err != nil { - return nil, fmt.Errorf("get template space failed, err: %v", err) + return nil, fmt.Errorf("get templateSpace failed, err: %v", err) } - return templateSpace, nil + return tplSpace, nil } diff --git a/bcs-services/bcs-bscp/pkg/dal/gen/applications.gen.go b/bcs-services/bcs-bscp/pkg/dal/gen/applications.gen.go deleted file mode 100644 index e1f88cd6de..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/gen/applications.gen.go +++ /dev/null @@ -1,434 +0,0 @@ -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. - -package gen - -import ( - "context" - - "gorm.io/gorm" - "gorm.io/gorm/clause" - "gorm.io/gorm/schema" - - "gorm.io/gen" - "gorm.io/gen/field" - - "gorm.io/plugin/dbresolver" - - "bscp.io/pkg/dal/table" -) - -func newApp(db *gorm.DB, opts ...gen.DOOption) app { - _app := app{} - - _app.appDo.UseDB(db, opts...) - _app.appDo.UseModel(&table.App{}) - - tableName := _app.appDo.TableName() - _app.ALL = field.NewAsterisk(tableName) - _app.ID = field.NewUint32(tableName, "id") - _app.BizID = field.NewUint32(tableName, "biz_id") - _app.Name = field.NewString(tableName, "name") - _app.ConfigType = field.NewString(tableName, "config_type") - _app.Mode = field.NewString(tableName, "mode") - _app.Memo = field.NewString(tableName, "memo") - _app.ReloadType = field.NewString(tableName, "reload_type") - _app.ReloadFilePath = field.NewString(tableName, "reload_file_path") - _app.Creator = field.NewString(tableName, "creator") - _app.Reviser = field.NewString(tableName, "reviser") - _app.CreatedAt = field.NewTime(tableName, "created_at") - _app.UpdatedAt = field.NewTime(tableName, "updated_at") - - _app.fillFieldMap() - - return _app -} - -type app struct { - appDo appDo - - ALL field.Asterisk - ID field.Uint32 - BizID field.Uint32 - Name field.String - ConfigType field.String - Mode field.String - Memo field.String - ReloadType field.String - ReloadFilePath field.String - Creator field.String - Reviser field.String - CreatedAt field.Time - UpdatedAt field.Time - - fieldMap map[string]field.Expr -} - -func (a app) Table(newTableName string) *app { - a.appDo.UseTable(newTableName) - return a.updateTableName(newTableName) -} - -func (a app) As(alias string) *app { - a.appDo.DO = *(a.appDo.As(alias).(*gen.DO)) - return a.updateTableName(alias) -} - -func (a *app) updateTableName(table string) *app { - a.ALL = field.NewAsterisk(table) - a.ID = field.NewUint32(table, "id") - a.BizID = field.NewUint32(table, "biz_id") - a.Name = field.NewString(table, "name") - a.ConfigType = field.NewString(table, "config_type") - a.Mode = field.NewString(table, "mode") - a.Memo = field.NewString(table, "memo") - a.ReloadType = field.NewString(table, "reload_type") - a.ReloadFilePath = field.NewString(table, "reload_file_path") - a.Creator = field.NewString(table, "creator") - a.Reviser = field.NewString(table, "reviser") - a.CreatedAt = field.NewTime(table, "created_at") - a.UpdatedAt = field.NewTime(table, "updated_at") - - a.fillFieldMap() - - return a -} - -func (a *app) WithContext(ctx context.Context) IAppDo { return a.appDo.WithContext(ctx) } - -func (a app) TableName() string { return a.appDo.TableName() } - -func (a app) Alias() string { return a.appDo.Alias() } - -func (a *app) GetFieldByName(fieldName string) (field.OrderExpr, bool) { - _f, ok := a.fieldMap[fieldName] - if !ok || _f == nil { - return nil, false - } - _oe, ok := _f.(field.OrderExpr) - return _oe, ok -} - -func (a *app) fillFieldMap() { - a.fieldMap = make(map[string]field.Expr, 12) - a.fieldMap["id"] = a.ID - a.fieldMap["biz_id"] = a.BizID - a.fieldMap["name"] = a.Name - a.fieldMap["config_type"] = a.ConfigType - a.fieldMap["mode"] = a.Mode - a.fieldMap["memo"] = a.Memo - a.fieldMap["reload_type"] = a.ReloadType - a.fieldMap["reload_file_path"] = a.ReloadFilePath - a.fieldMap["creator"] = a.Creator - a.fieldMap["reviser"] = a.Reviser - a.fieldMap["created_at"] = a.CreatedAt - a.fieldMap["updated_at"] = a.UpdatedAt -} - -func (a app) clone(db *gorm.DB) app { - a.appDo.ReplaceConnPool(db.Statement.ConnPool) - return a -} - -func (a app) replaceDB(db *gorm.DB) app { - a.appDo.ReplaceDB(db) - return a -} - -type appDo struct{ gen.DO } - -type IAppDo interface { - gen.SubQuery - Debug() IAppDo - WithContext(ctx context.Context) IAppDo - WithResult(fc func(tx gen.Dao)) gen.ResultInfo - ReplaceDB(db *gorm.DB) - ReadDB() IAppDo - WriteDB() IAppDo - As(alias string) gen.Dao - Session(config *gorm.Session) IAppDo - Columns(cols ...field.Expr) gen.Columns - Clauses(conds ...clause.Expression) IAppDo - Not(conds ...gen.Condition) IAppDo - Or(conds ...gen.Condition) IAppDo - Select(conds ...field.Expr) IAppDo - Where(conds ...gen.Condition) IAppDo - Order(conds ...field.Expr) IAppDo - Distinct(cols ...field.Expr) IAppDo - Omit(cols ...field.Expr) IAppDo - Join(table schema.Tabler, on ...field.Expr) IAppDo - LeftJoin(table schema.Tabler, on ...field.Expr) IAppDo - RightJoin(table schema.Tabler, on ...field.Expr) IAppDo - Group(cols ...field.Expr) IAppDo - Having(conds ...gen.Condition) IAppDo - Limit(limit int) IAppDo - Offset(offset int) IAppDo - Count() (count int64, err error) - Scopes(funcs ...func(gen.Dao) gen.Dao) IAppDo - Unscoped() IAppDo - Create(values ...*table.App) error - CreateInBatches(values []*table.App, batchSize int) error - Save(values ...*table.App) error - First() (*table.App, error) - Take() (*table.App, error) - Last() (*table.App, error) - Find() ([]*table.App, error) - FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.App, err error) - FindInBatches(result *[]*table.App, batchSize int, fc func(tx gen.Dao, batch int) error) error - Pluck(column field.Expr, dest interface{}) error - Delete(...*table.App) (info gen.ResultInfo, err error) - Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - Updates(value interface{}) (info gen.ResultInfo, err error) - UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - UpdateColumns(value interface{}) (info gen.ResultInfo, err error) - UpdateFrom(q gen.SubQuery) gen.Dao - Attrs(attrs ...field.AssignExpr) IAppDo - Assign(attrs ...field.AssignExpr) IAppDo - Joins(fields ...field.RelationField) IAppDo - Preload(fields ...field.RelationField) IAppDo - FirstOrInit() (*table.App, error) - FirstOrCreate() (*table.App, error) - FindByPage(offset int, limit int) (result []*table.App, count int64, err error) - ScanByPage(result interface{}, offset int, limit int) (count int64, err error) - Scan(result interface{}) (err error) - Returning(value interface{}, columns ...string) IAppDo - UnderlyingDB() *gorm.DB - schema.Tabler -} - -func (a appDo) Debug() IAppDo { - return a.withDO(a.DO.Debug()) -} - -func (a appDo) WithContext(ctx context.Context) IAppDo { - return a.withDO(a.DO.WithContext(ctx)) -} - -func (a appDo) ReadDB() IAppDo { - return a.Clauses(dbresolver.Read) -} - -func (a appDo) WriteDB() IAppDo { - return a.Clauses(dbresolver.Write) -} - -func (a appDo) Session(config *gorm.Session) IAppDo { - return a.withDO(a.DO.Session(config)) -} - -func (a appDo) Clauses(conds ...clause.Expression) IAppDo { - return a.withDO(a.DO.Clauses(conds...)) -} - -func (a appDo) Returning(value interface{}, columns ...string) IAppDo { - return a.withDO(a.DO.Returning(value, columns...)) -} - -func (a appDo) Not(conds ...gen.Condition) IAppDo { - return a.withDO(a.DO.Not(conds...)) -} - -func (a appDo) Or(conds ...gen.Condition) IAppDo { - return a.withDO(a.DO.Or(conds...)) -} - -func (a appDo) Select(conds ...field.Expr) IAppDo { - return a.withDO(a.DO.Select(conds...)) -} - -func (a appDo) Where(conds ...gen.Condition) IAppDo { - return a.withDO(a.DO.Where(conds...)) -} - -func (a appDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IAppDo { - return a.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - -func (a appDo) Order(conds ...field.Expr) IAppDo { - return a.withDO(a.DO.Order(conds...)) -} - -func (a appDo) Distinct(cols ...field.Expr) IAppDo { - return a.withDO(a.DO.Distinct(cols...)) -} - -func (a appDo) Omit(cols ...field.Expr) IAppDo { - return a.withDO(a.DO.Omit(cols...)) -} - -func (a appDo) Join(table schema.Tabler, on ...field.Expr) IAppDo { - return a.withDO(a.DO.Join(table, on...)) -} - -func (a appDo) LeftJoin(table schema.Tabler, on ...field.Expr) IAppDo { - return a.withDO(a.DO.LeftJoin(table, on...)) -} - -func (a appDo) RightJoin(table schema.Tabler, on ...field.Expr) IAppDo { - return a.withDO(a.DO.RightJoin(table, on...)) -} - -func (a appDo) Group(cols ...field.Expr) IAppDo { - return a.withDO(a.DO.Group(cols...)) -} - -func (a appDo) Having(conds ...gen.Condition) IAppDo { - return a.withDO(a.DO.Having(conds...)) -} - -func (a appDo) Limit(limit int) IAppDo { - return a.withDO(a.DO.Limit(limit)) -} - -func (a appDo) Offset(offset int) IAppDo { - return a.withDO(a.DO.Offset(offset)) -} - -func (a appDo) Scopes(funcs ...func(gen.Dao) gen.Dao) IAppDo { - return a.withDO(a.DO.Scopes(funcs...)) -} - -func (a appDo) Unscoped() IAppDo { - return a.withDO(a.DO.Unscoped()) -} - -func (a appDo) Create(values ...*table.App) error { - if len(values) == 0 { - return nil - } - return a.DO.Create(values) -} - -func (a appDo) CreateInBatches(values []*table.App, batchSize int) error { - return a.DO.CreateInBatches(values, batchSize) -} - -// Save : !!! underlying implementation is different with GORM -// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) -func (a appDo) Save(values ...*table.App) error { - if len(values) == 0 { - return nil - } - return a.DO.Save(values) -} - -func (a appDo) First() (*table.App, error) { - if result, err := a.DO.First(); err != nil { - return nil, err - } else { - return result.(*table.App), nil - } -} - -func (a appDo) Take() (*table.App, error) { - if result, err := a.DO.Take(); err != nil { - return nil, err - } else { - return result.(*table.App), nil - } -} - -func (a appDo) Last() (*table.App, error) { - if result, err := a.DO.Last(); err != nil { - return nil, err - } else { - return result.(*table.App), nil - } -} - -func (a appDo) Find() ([]*table.App, error) { - result, err := a.DO.Find() - return result.([]*table.App), err -} - -func (a appDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.App, err error) { - buf := make([]*table.App, 0, batchSize) - err = a.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { - defer func() { results = append(results, buf...) }() - return fc(tx, batch) - }) - return results, err -} - -func (a appDo) FindInBatches(result *[]*table.App, batchSize int, fc func(tx gen.Dao, batch int) error) error { - return a.DO.FindInBatches(result, batchSize, fc) -} - -func (a appDo) Attrs(attrs ...field.AssignExpr) IAppDo { - return a.withDO(a.DO.Attrs(attrs...)) -} - -func (a appDo) Assign(attrs ...field.AssignExpr) IAppDo { - return a.withDO(a.DO.Assign(attrs...)) -} - -func (a appDo) Joins(fields ...field.RelationField) IAppDo { - for _, _f := range fields { - a = *a.withDO(a.DO.Joins(_f)) - } - return &a -} - -func (a appDo) Preload(fields ...field.RelationField) IAppDo { - for _, _f := range fields { - a = *a.withDO(a.DO.Preload(_f)) - } - return &a -} - -func (a appDo) FirstOrInit() (*table.App, error) { - if result, err := a.DO.FirstOrInit(); err != nil { - return nil, err - } else { - return result.(*table.App), nil - } -} - -func (a appDo) FirstOrCreate() (*table.App, error) { - if result, err := a.DO.FirstOrCreate(); err != nil { - return nil, err - } else { - return result.(*table.App), nil - } -} - -func (a appDo) FindByPage(offset int, limit int) (result []*table.App, count int64, err error) { - result, err = a.Offset(offset).Limit(limit).Find() - if err != nil { - return - } - - if size := len(result); 0 < limit && 0 < size && size < limit { - count = int64(size + offset) - return - } - - count, err = a.Offset(-1).Limit(-1).Count() - return -} - -func (a appDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { - count, err = a.Count() - if err != nil { - return - } - - err = a.Offset(offset).Limit(limit).Scan(result) - return -} - -func (a appDo) Scan(result interface{}) (err error) { - return a.DO.Scan(result) -} - -func (a appDo) Delete(models ...*table.App) (result gen.ResultInfo, err error) { - return a.DO.Delete(models) -} - -func (a *appDo) withDO(do gen.Dao) *appDo { - a.DO = *do.(*gen.DO) - return a -} diff --git a/bcs-services/bcs-bscp/pkg/dal/gen/archived_apps.gen.go b/bcs-services/bcs-bscp/pkg/dal/gen/archived_apps.gen.go deleted file mode 100644 index 2fb81401af..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/gen/archived_apps.gen.go +++ /dev/null @@ -1,404 +0,0 @@ -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. - -package gen - -import ( - "context" - - "gorm.io/gorm" - "gorm.io/gorm/clause" - "gorm.io/gorm/schema" - - "gorm.io/gen" - "gorm.io/gen/field" - - "gorm.io/plugin/dbresolver" - - "bscp.io/pkg/dal/table" -) - -func newArchivedApp(db *gorm.DB, opts ...gen.DOOption) archivedApp { - _archivedApp := archivedApp{} - - _archivedApp.archivedAppDo.UseDB(db, opts...) - _archivedApp.archivedAppDo.UseModel(&table.ArchivedApp{}) - - tableName := _archivedApp.archivedAppDo.TableName() - _archivedApp.ALL = field.NewAsterisk(tableName) - _archivedApp.ID = field.NewUint32(tableName, "id") - _archivedApp.BizID = field.NewUint32(tableName, "biz_id") - _archivedApp.AppID = field.NewUint32(tableName, "app_id") - _archivedApp.CreatedAt = field.NewTime(tableName, "created_at") - - _archivedApp.fillFieldMap() - - return _archivedApp -} - -type archivedApp struct { - archivedAppDo archivedAppDo - - ALL field.Asterisk - ID field.Uint32 - BizID field.Uint32 - AppID field.Uint32 - CreatedAt field.Time - - fieldMap map[string]field.Expr -} - -func (a archivedApp) Table(newTableName string) *archivedApp { - a.archivedAppDo.UseTable(newTableName) - return a.updateTableName(newTableName) -} - -func (a archivedApp) As(alias string) *archivedApp { - a.archivedAppDo.DO = *(a.archivedAppDo.As(alias).(*gen.DO)) - return a.updateTableName(alias) -} - -func (a *archivedApp) updateTableName(table string) *archivedApp { - a.ALL = field.NewAsterisk(table) - a.ID = field.NewUint32(table, "id") - a.BizID = field.NewUint32(table, "biz_id") - a.AppID = field.NewUint32(table, "app_id") - a.CreatedAt = field.NewTime(table, "created_at") - - a.fillFieldMap() - - return a -} - -func (a *archivedApp) WithContext(ctx context.Context) IArchivedAppDo { - return a.archivedAppDo.WithContext(ctx) -} - -func (a archivedApp) TableName() string { return a.archivedAppDo.TableName() } - -func (a archivedApp) Alias() string { return a.archivedAppDo.Alias() } - -func (a *archivedApp) GetFieldByName(fieldName string) (field.OrderExpr, bool) { - _f, ok := a.fieldMap[fieldName] - if !ok || _f == nil { - return nil, false - } - _oe, ok := _f.(field.OrderExpr) - return _oe, ok -} - -func (a *archivedApp) fillFieldMap() { - a.fieldMap = make(map[string]field.Expr, 4) - a.fieldMap["id"] = a.ID - a.fieldMap["biz_id"] = a.BizID - a.fieldMap["app_id"] = a.AppID - a.fieldMap["created_at"] = a.CreatedAt -} - -func (a archivedApp) clone(db *gorm.DB) archivedApp { - a.archivedAppDo.ReplaceConnPool(db.Statement.ConnPool) - return a -} - -func (a archivedApp) replaceDB(db *gorm.DB) archivedApp { - a.archivedAppDo.ReplaceDB(db) - return a -} - -type archivedAppDo struct{ gen.DO } - -type IArchivedAppDo interface { - gen.SubQuery - Debug() IArchivedAppDo - WithContext(ctx context.Context) IArchivedAppDo - WithResult(fc func(tx gen.Dao)) gen.ResultInfo - ReplaceDB(db *gorm.DB) - ReadDB() IArchivedAppDo - WriteDB() IArchivedAppDo - As(alias string) gen.Dao - Session(config *gorm.Session) IArchivedAppDo - Columns(cols ...field.Expr) gen.Columns - Clauses(conds ...clause.Expression) IArchivedAppDo - Not(conds ...gen.Condition) IArchivedAppDo - Or(conds ...gen.Condition) IArchivedAppDo - Select(conds ...field.Expr) IArchivedAppDo - Where(conds ...gen.Condition) IArchivedAppDo - Order(conds ...field.Expr) IArchivedAppDo - Distinct(cols ...field.Expr) IArchivedAppDo - Omit(cols ...field.Expr) IArchivedAppDo - Join(table schema.Tabler, on ...field.Expr) IArchivedAppDo - LeftJoin(table schema.Tabler, on ...field.Expr) IArchivedAppDo - RightJoin(table schema.Tabler, on ...field.Expr) IArchivedAppDo - Group(cols ...field.Expr) IArchivedAppDo - Having(conds ...gen.Condition) IArchivedAppDo - Limit(limit int) IArchivedAppDo - Offset(offset int) IArchivedAppDo - Count() (count int64, err error) - Scopes(funcs ...func(gen.Dao) gen.Dao) IArchivedAppDo - Unscoped() IArchivedAppDo - Create(values ...*table.ArchivedApp) error - CreateInBatches(values []*table.ArchivedApp, batchSize int) error - Save(values ...*table.ArchivedApp) error - First() (*table.ArchivedApp, error) - Take() (*table.ArchivedApp, error) - Last() (*table.ArchivedApp, error) - Find() ([]*table.ArchivedApp, error) - FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.ArchivedApp, err error) - FindInBatches(result *[]*table.ArchivedApp, batchSize int, fc func(tx gen.Dao, batch int) error) error - Pluck(column field.Expr, dest interface{}) error - Delete(...*table.ArchivedApp) (info gen.ResultInfo, err error) - Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - Updates(value interface{}) (info gen.ResultInfo, err error) - UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - UpdateColumns(value interface{}) (info gen.ResultInfo, err error) - UpdateFrom(q gen.SubQuery) gen.Dao - Attrs(attrs ...field.AssignExpr) IArchivedAppDo - Assign(attrs ...field.AssignExpr) IArchivedAppDo - Joins(fields ...field.RelationField) IArchivedAppDo - Preload(fields ...field.RelationField) IArchivedAppDo - FirstOrInit() (*table.ArchivedApp, error) - FirstOrCreate() (*table.ArchivedApp, error) - FindByPage(offset int, limit int) (result []*table.ArchivedApp, count int64, err error) - ScanByPage(result interface{}, offset int, limit int) (count int64, err error) - Scan(result interface{}) (err error) - Returning(value interface{}, columns ...string) IArchivedAppDo - UnderlyingDB() *gorm.DB - schema.Tabler -} - -func (a archivedAppDo) Debug() IArchivedAppDo { - return a.withDO(a.DO.Debug()) -} - -func (a archivedAppDo) WithContext(ctx context.Context) IArchivedAppDo { - return a.withDO(a.DO.WithContext(ctx)) -} - -func (a archivedAppDo) ReadDB() IArchivedAppDo { - return a.Clauses(dbresolver.Read) -} - -func (a archivedAppDo) WriteDB() IArchivedAppDo { - return a.Clauses(dbresolver.Write) -} - -func (a archivedAppDo) Session(config *gorm.Session) IArchivedAppDo { - return a.withDO(a.DO.Session(config)) -} - -func (a archivedAppDo) Clauses(conds ...clause.Expression) IArchivedAppDo { - return a.withDO(a.DO.Clauses(conds...)) -} - -func (a archivedAppDo) Returning(value interface{}, columns ...string) IArchivedAppDo { - return a.withDO(a.DO.Returning(value, columns...)) -} - -func (a archivedAppDo) Not(conds ...gen.Condition) IArchivedAppDo { - return a.withDO(a.DO.Not(conds...)) -} - -func (a archivedAppDo) Or(conds ...gen.Condition) IArchivedAppDo { - return a.withDO(a.DO.Or(conds...)) -} - -func (a archivedAppDo) Select(conds ...field.Expr) IArchivedAppDo { - return a.withDO(a.DO.Select(conds...)) -} - -func (a archivedAppDo) Where(conds ...gen.Condition) IArchivedAppDo { - return a.withDO(a.DO.Where(conds...)) -} - -func (a archivedAppDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IArchivedAppDo { - return a.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - -func (a archivedAppDo) Order(conds ...field.Expr) IArchivedAppDo { - return a.withDO(a.DO.Order(conds...)) -} - -func (a archivedAppDo) Distinct(cols ...field.Expr) IArchivedAppDo { - return a.withDO(a.DO.Distinct(cols...)) -} - -func (a archivedAppDo) Omit(cols ...field.Expr) IArchivedAppDo { - return a.withDO(a.DO.Omit(cols...)) -} - -func (a archivedAppDo) Join(table schema.Tabler, on ...field.Expr) IArchivedAppDo { - return a.withDO(a.DO.Join(table, on...)) -} - -func (a archivedAppDo) LeftJoin(table schema.Tabler, on ...field.Expr) IArchivedAppDo { - return a.withDO(a.DO.LeftJoin(table, on...)) -} - -func (a archivedAppDo) RightJoin(table schema.Tabler, on ...field.Expr) IArchivedAppDo { - return a.withDO(a.DO.RightJoin(table, on...)) -} - -func (a archivedAppDo) Group(cols ...field.Expr) IArchivedAppDo { - return a.withDO(a.DO.Group(cols...)) -} - -func (a archivedAppDo) Having(conds ...gen.Condition) IArchivedAppDo { - return a.withDO(a.DO.Having(conds...)) -} - -func (a archivedAppDo) Limit(limit int) IArchivedAppDo { - return a.withDO(a.DO.Limit(limit)) -} - -func (a archivedAppDo) Offset(offset int) IArchivedAppDo { - return a.withDO(a.DO.Offset(offset)) -} - -func (a archivedAppDo) Scopes(funcs ...func(gen.Dao) gen.Dao) IArchivedAppDo { - return a.withDO(a.DO.Scopes(funcs...)) -} - -func (a archivedAppDo) Unscoped() IArchivedAppDo { - return a.withDO(a.DO.Unscoped()) -} - -func (a archivedAppDo) Create(values ...*table.ArchivedApp) error { - if len(values) == 0 { - return nil - } - return a.DO.Create(values) -} - -func (a archivedAppDo) CreateInBatches(values []*table.ArchivedApp, batchSize int) error { - return a.DO.CreateInBatches(values, batchSize) -} - -// Save : !!! underlying implementation is different with GORM -// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) -func (a archivedAppDo) Save(values ...*table.ArchivedApp) error { - if len(values) == 0 { - return nil - } - return a.DO.Save(values) -} - -func (a archivedAppDo) First() (*table.ArchivedApp, error) { - if result, err := a.DO.First(); err != nil { - return nil, err - } else { - return result.(*table.ArchivedApp), nil - } -} - -func (a archivedAppDo) Take() (*table.ArchivedApp, error) { - if result, err := a.DO.Take(); err != nil { - return nil, err - } else { - return result.(*table.ArchivedApp), nil - } -} - -func (a archivedAppDo) Last() (*table.ArchivedApp, error) { - if result, err := a.DO.Last(); err != nil { - return nil, err - } else { - return result.(*table.ArchivedApp), nil - } -} - -func (a archivedAppDo) Find() ([]*table.ArchivedApp, error) { - result, err := a.DO.Find() - return result.([]*table.ArchivedApp), err -} - -func (a archivedAppDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.ArchivedApp, err error) { - buf := make([]*table.ArchivedApp, 0, batchSize) - err = a.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { - defer func() { results = append(results, buf...) }() - return fc(tx, batch) - }) - return results, err -} - -func (a archivedAppDo) FindInBatches(result *[]*table.ArchivedApp, batchSize int, fc func(tx gen.Dao, batch int) error) error { - return a.DO.FindInBatches(result, batchSize, fc) -} - -func (a archivedAppDo) Attrs(attrs ...field.AssignExpr) IArchivedAppDo { - return a.withDO(a.DO.Attrs(attrs...)) -} - -func (a archivedAppDo) Assign(attrs ...field.AssignExpr) IArchivedAppDo { - return a.withDO(a.DO.Assign(attrs...)) -} - -func (a archivedAppDo) Joins(fields ...field.RelationField) IArchivedAppDo { - for _, _f := range fields { - a = *a.withDO(a.DO.Joins(_f)) - } - return &a -} - -func (a archivedAppDo) Preload(fields ...field.RelationField) IArchivedAppDo { - for _, _f := range fields { - a = *a.withDO(a.DO.Preload(_f)) - } - return &a -} - -func (a archivedAppDo) FirstOrInit() (*table.ArchivedApp, error) { - if result, err := a.DO.FirstOrInit(); err != nil { - return nil, err - } else { - return result.(*table.ArchivedApp), nil - } -} - -func (a archivedAppDo) FirstOrCreate() (*table.ArchivedApp, error) { - if result, err := a.DO.FirstOrCreate(); err != nil { - return nil, err - } else { - return result.(*table.ArchivedApp), nil - } -} - -func (a archivedAppDo) FindByPage(offset int, limit int) (result []*table.ArchivedApp, count int64, err error) { - result, err = a.Offset(offset).Limit(limit).Find() - if err != nil { - return - } - - if size := len(result); 0 < limit && 0 < size && size < limit { - count = int64(size + offset) - return - } - - count, err = a.Offset(-1).Limit(-1).Count() - return -} - -func (a archivedAppDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { - count, err = a.Count() - if err != nil { - return - } - - err = a.Offset(offset).Limit(limit).Scan(result) - return -} - -func (a archivedAppDo) Scan(result interface{}) (err error) { - return a.DO.Scan(result) -} - -func (a archivedAppDo) Delete(models ...*table.ArchivedApp) (result gen.ResultInfo, err error) { - return a.DO.Delete(models) -} - -func (a *archivedAppDo) withDO(do gen.Dao) *archivedAppDo { - a.DO = *do.(*gen.DO) - return a -} diff --git a/bcs-services/bcs-bscp/pkg/dal/gen/config_hooks.gen.go b/bcs-services/bcs-bscp/pkg/dal/gen/config_hooks.gen.go deleted file mode 100644 index 2f0636ea04..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/gen/config_hooks.gen.go +++ /dev/null @@ -1,432 +0,0 @@ -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. - -package gen - -import ( - "context" - - "gorm.io/gorm" - "gorm.io/gorm/clause" - "gorm.io/gorm/schema" - - "gorm.io/gen" - "gorm.io/gen/field" - - "gorm.io/plugin/dbresolver" - - "bscp.io/pkg/dal/table" -) - -func newConfigHook(db *gorm.DB, opts ...gen.DOOption) configHook { - _configHook := configHook{} - - _configHook.configHookDo.UseDB(db, opts...) - _configHook.configHookDo.UseModel(&table.ConfigHook{}) - - tableName := _configHook.configHookDo.TableName() - _configHook.ALL = field.NewAsterisk(tableName) - _configHook.ID = field.NewUint32(tableName, "id") - _configHook.PreHookID = field.NewUint32(tableName, "pre_hook_id") - _configHook.PreHookReleaseID = field.NewUint32(tableName, "pre_hook_release_id") - _configHook.PostHookID = field.NewUint32(tableName, "post_hook_id") - _configHook.PostHookReleaseID = field.NewUint32(tableName, "post_hook_release_id") - _configHook.BizID = field.NewUint32(tableName, "biz_id") - _configHook.AppID = field.NewUint32(tableName, "app_id") - _configHook.Creator = field.NewString(tableName, "creator") - _configHook.Reviser = field.NewString(tableName, "reviser") - _configHook.CreatedAt = field.NewTime(tableName, "created_at") - _configHook.UpdatedAt = field.NewTime(tableName, "updated_at") - - _configHook.fillFieldMap() - - return _configHook -} - -type configHook struct { - configHookDo configHookDo - - ALL field.Asterisk - ID field.Uint32 - PreHookID field.Uint32 - PreHookReleaseID field.Uint32 - PostHookID field.Uint32 - PostHookReleaseID field.Uint32 - BizID field.Uint32 - AppID field.Uint32 - Creator field.String - Reviser field.String - CreatedAt field.Time - UpdatedAt field.Time - - fieldMap map[string]field.Expr -} - -func (c configHook) Table(newTableName string) *configHook { - c.configHookDo.UseTable(newTableName) - return c.updateTableName(newTableName) -} - -func (c configHook) As(alias string) *configHook { - c.configHookDo.DO = *(c.configHookDo.As(alias).(*gen.DO)) - return c.updateTableName(alias) -} - -func (c *configHook) updateTableName(table string) *configHook { - c.ALL = field.NewAsterisk(table) - c.ID = field.NewUint32(table, "id") - c.PreHookID = field.NewUint32(table, "pre_hook_id") - c.PreHookReleaseID = field.NewUint32(table, "pre_hook_release_id") - c.PostHookID = field.NewUint32(table, "post_hook_id") - c.PostHookReleaseID = field.NewUint32(table, "post_hook_release_id") - c.BizID = field.NewUint32(table, "biz_id") - c.AppID = field.NewUint32(table, "app_id") - c.Creator = field.NewString(table, "creator") - c.Reviser = field.NewString(table, "reviser") - c.CreatedAt = field.NewTime(table, "created_at") - c.UpdatedAt = field.NewTime(table, "updated_at") - - c.fillFieldMap() - - return c -} - -func (c *configHook) WithContext(ctx context.Context) IConfigHookDo { - return c.configHookDo.WithContext(ctx) -} - -func (c configHook) TableName() string { return c.configHookDo.TableName() } - -func (c configHook) Alias() string { return c.configHookDo.Alias() } - -func (c *configHook) GetFieldByName(fieldName string) (field.OrderExpr, bool) { - _f, ok := c.fieldMap[fieldName] - if !ok || _f == nil { - return nil, false - } - _oe, ok := _f.(field.OrderExpr) - return _oe, ok -} - -func (c *configHook) fillFieldMap() { - c.fieldMap = make(map[string]field.Expr, 11) - c.fieldMap["id"] = c.ID - c.fieldMap["pre_hook_id"] = c.PreHookID - c.fieldMap["pre_hook_release_id"] = c.PreHookReleaseID - c.fieldMap["post_hook_id"] = c.PostHookID - c.fieldMap["post_hook_release_id"] = c.PostHookReleaseID - c.fieldMap["biz_id"] = c.BizID - c.fieldMap["app_id"] = c.AppID - c.fieldMap["creator"] = c.Creator - c.fieldMap["reviser"] = c.Reviser - c.fieldMap["created_at"] = c.CreatedAt - c.fieldMap["updated_at"] = c.UpdatedAt -} - -func (c configHook) clone(db *gorm.DB) configHook { - c.configHookDo.ReplaceConnPool(db.Statement.ConnPool) - return c -} - -func (c configHook) replaceDB(db *gorm.DB) configHook { - c.configHookDo.ReplaceDB(db) - return c -} - -type configHookDo struct{ gen.DO } - -type IConfigHookDo interface { - gen.SubQuery - Debug() IConfigHookDo - WithContext(ctx context.Context) IConfigHookDo - WithResult(fc func(tx gen.Dao)) gen.ResultInfo - ReplaceDB(db *gorm.DB) - ReadDB() IConfigHookDo - WriteDB() IConfigHookDo - As(alias string) gen.Dao - Session(config *gorm.Session) IConfigHookDo - Columns(cols ...field.Expr) gen.Columns - Clauses(conds ...clause.Expression) IConfigHookDo - Not(conds ...gen.Condition) IConfigHookDo - Or(conds ...gen.Condition) IConfigHookDo - Select(conds ...field.Expr) IConfigHookDo - Where(conds ...gen.Condition) IConfigHookDo - Order(conds ...field.Expr) IConfigHookDo - Distinct(cols ...field.Expr) IConfigHookDo - Omit(cols ...field.Expr) IConfigHookDo - Join(table schema.Tabler, on ...field.Expr) IConfigHookDo - LeftJoin(table schema.Tabler, on ...field.Expr) IConfigHookDo - RightJoin(table schema.Tabler, on ...field.Expr) IConfigHookDo - Group(cols ...field.Expr) IConfigHookDo - Having(conds ...gen.Condition) IConfigHookDo - Limit(limit int) IConfigHookDo - Offset(offset int) IConfigHookDo - Count() (count int64, err error) - Scopes(funcs ...func(gen.Dao) gen.Dao) IConfigHookDo - Unscoped() IConfigHookDo - Create(values ...*table.ConfigHook) error - CreateInBatches(values []*table.ConfigHook, batchSize int) error - Save(values ...*table.ConfigHook) error - First() (*table.ConfigHook, error) - Take() (*table.ConfigHook, error) - Last() (*table.ConfigHook, error) - Find() ([]*table.ConfigHook, error) - FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.ConfigHook, err error) - FindInBatches(result *[]*table.ConfigHook, batchSize int, fc func(tx gen.Dao, batch int) error) error - Pluck(column field.Expr, dest interface{}) error - Delete(...*table.ConfigHook) (info gen.ResultInfo, err error) - Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - Updates(value interface{}) (info gen.ResultInfo, err error) - UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - UpdateColumns(value interface{}) (info gen.ResultInfo, err error) - UpdateFrom(q gen.SubQuery) gen.Dao - Attrs(attrs ...field.AssignExpr) IConfigHookDo - Assign(attrs ...field.AssignExpr) IConfigHookDo - Joins(fields ...field.RelationField) IConfigHookDo - Preload(fields ...field.RelationField) IConfigHookDo - FirstOrInit() (*table.ConfigHook, error) - FirstOrCreate() (*table.ConfigHook, error) - FindByPage(offset int, limit int) (result []*table.ConfigHook, count int64, err error) - ScanByPage(result interface{}, offset int, limit int) (count int64, err error) - Scan(result interface{}) (err error) - Returning(value interface{}, columns ...string) IConfigHookDo - UnderlyingDB() *gorm.DB - schema.Tabler -} - -func (c configHookDo) Debug() IConfigHookDo { - return c.withDO(c.DO.Debug()) -} - -func (c configHookDo) WithContext(ctx context.Context) IConfigHookDo { - return c.withDO(c.DO.WithContext(ctx)) -} - -func (c configHookDo) ReadDB() IConfigHookDo { - return c.Clauses(dbresolver.Read) -} - -func (c configHookDo) WriteDB() IConfigHookDo { - return c.Clauses(dbresolver.Write) -} - -func (c configHookDo) Session(config *gorm.Session) IConfigHookDo { - return c.withDO(c.DO.Session(config)) -} - -func (c configHookDo) Clauses(conds ...clause.Expression) IConfigHookDo { - return c.withDO(c.DO.Clauses(conds...)) -} - -func (c configHookDo) Returning(value interface{}, columns ...string) IConfigHookDo { - return c.withDO(c.DO.Returning(value, columns...)) -} - -func (c configHookDo) Not(conds ...gen.Condition) IConfigHookDo { - return c.withDO(c.DO.Not(conds...)) -} - -func (c configHookDo) Or(conds ...gen.Condition) IConfigHookDo { - return c.withDO(c.DO.Or(conds...)) -} - -func (c configHookDo) Select(conds ...field.Expr) IConfigHookDo { - return c.withDO(c.DO.Select(conds...)) -} - -func (c configHookDo) Where(conds ...gen.Condition) IConfigHookDo { - return c.withDO(c.DO.Where(conds...)) -} - -func (c configHookDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IConfigHookDo { - return c.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - -func (c configHookDo) Order(conds ...field.Expr) IConfigHookDo { - return c.withDO(c.DO.Order(conds...)) -} - -func (c configHookDo) Distinct(cols ...field.Expr) IConfigHookDo { - return c.withDO(c.DO.Distinct(cols...)) -} - -func (c configHookDo) Omit(cols ...field.Expr) IConfigHookDo { - return c.withDO(c.DO.Omit(cols...)) -} - -func (c configHookDo) Join(table schema.Tabler, on ...field.Expr) IConfigHookDo { - return c.withDO(c.DO.Join(table, on...)) -} - -func (c configHookDo) LeftJoin(table schema.Tabler, on ...field.Expr) IConfigHookDo { - return c.withDO(c.DO.LeftJoin(table, on...)) -} - -func (c configHookDo) RightJoin(table schema.Tabler, on ...field.Expr) IConfigHookDo { - return c.withDO(c.DO.RightJoin(table, on...)) -} - -func (c configHookDo) Group(cols ...field.Expr) IConfigHookDo { - return c.withDO(c.DO.Group(cols...)) -} - -func (c configHookDo) Having(conds ...gen.Condition) IConfigHookDo { - return c.withDO(c.DO.Having(conds...)) -} - -func (c configHookDo) Limit(limit int) IConfigHookDo { - return c.withDO(c.DO.Limit(limit)) -} - -func (c configHookDo) Offset(offset int) IConfigHookDo { - return c.withDO(c.DO.Offset(offset)) -} - -func (c configHookDo) Scopes(funcs ...func(gen.Dao) gen.Dao) IConfigHookDo { - return c.withDO(c.DO.Scopes(funcs...)) -} - -func (c configHookDo) Unscoped() IConfigHookDo { - return c.withDO(c.DO.Unscoped()) -} - -func (c configHookDo) Create(values ...*table.ConfigHook) error { - if len(values) == 0 { - return nil - } - return c.DO.Create(values) -} - -func (c configHookDo) CreateInBatches(values []*table.ConfigHook, batchSize int) error { - return c.DO.CreateInBatches(values, batchSize) -} - -// Save : !!! underlying implementation is different with GORM -// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) -func (c configHookDo) Save(values ...*table.ConfigHook) error { - if len(values) == 0 { - return nil - } - return c.DO.Save(values) -} - -func (c configHookDo) First() (*table.ConfigHook, error) { - if result, err := c.DO.First(); err != nil { - return nil, err - } else { - return result.(*table.ConfigHook), nil - } -} - -func (c configHookDo) Take() (*table.ConfigHook, error) { - if result, err := c.DO.Take(); err != nil { - return nil, err - } else { - return result.(*table.ConfigHook), nil - } -} - -func (c configHookDo) Last() (*table.ConfigHook, error) { - if result, err := c.DO.Last(); err != nil { - return nil, err - } else { - return result.(*table.ConfigHook), nil - } -} - -func (c configHookDo) Find() ([]*table.ConfigHook, error) { - result, err := c.DO.Find() - return result.([]*table.ConfigHook), err -} - -func (c configHookDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.ConfigHook, err error) { - buf := make([]*table.ConfigHook, 0, batchSize) - err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { - defer func() { results = append(results, buf...) }() - return fc(tx, batch) - }) - return results, err -} - -func (c configHookDo) FindInBatches(result *[]*table.ConfigHook, batchSize int, fc func(tx gen.Dao, batch int) error) error { - return c.DO.FindInBatches(result, batchSize, fc) -} - -func (c configHookDo) Attrs(attrs ...field.AssignExpr) IConfigHookDo { - return c.withDO(c.DO.Attrs(attrs...)) -} - -func (c configHookDo) Assign(attrs ...field.AssignExpr) IConfigHookDo { - return c.withDO(c.DO.Assign(attrs...)) -} - -func (c configHookDo) Joins(fields ...field.RelationField) IConfigHookDo { - for _, _f := range fields { - c = *c.withDO(c.DO.Joins(_f)) - } - return &c -} - -func (c configHookDo) Preload(fields ...field.RelationField) IConfigHookDo { - for _, _f := range fields { - c = *c.withDO(c.DO.Preload(_f)) - } - return &c -} - -func (c configHookDo) FirstOrInit() (*table.ConfigHook, error) { - if result, err := c.DO.FirstOrInit(); err != nil { - return nil, err - } else { - return result.(*table.ConfigHook), nil - } -} - -func (c configHookDo) FirstOrCreate() (*table.ConfigHook, error) { - if result, err := c.DO.FirstOrCreate(); err != nil { - return nil, err - } else { - return result.(*table.ConfigHook), nil - } -} - -func (c configHookDo) FindByPage(offset int, limit int) (result []*table.ConfigHook, count int64, err error) { - result, err = c.Offset(offset).Limit(limit).Find() - if err != nil { - return - } - - if size := len(result); 0 < limit && 0 < size && size < limit { - count = int64(size + offset) - return - } - - count, err = c.Offset(-1).Limit(-1).Count() - return -} - -func (c configHookDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { - count, err = c.Count() - if err != nil { - return - } - - err = c.Offset(offset).Limit(limit).Scan(result) - return -} - -func (c configHookDo) Scan(result interface{}) (err error) { - return c.DO.Scan(result) -} - -func (c configHookDo) Delete(models ...*table.ConfigHook) (result gen.ResultInfo, err error) { - return c.DO.Delete(models) -} - -func (c *configHookDo) withDO(do gen.Dao) *configHookDo { - c.DO = *do.(*gen.DO) - return c -} diff --git a/bcs-services/bcs-bscp/pkg/dal/gen/credential_scopes.gen.go b/bcs-services/bcs-bscp/pkg/dal/gen/credential_scopes.gen.go deleted file mode 100644 index ecd5624fd2..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/gen/credential_scopes.gen.go +++ /dev/null @@ -1,424 +0,0 @@ -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. - -package gen - -import ( - "context" - - "gorm.io/gorm" - "gorm.io/gorm/clause" - "gorm.io/gorm/schema" - - "gorm.io/gen" - "gorm.io/gen/field" - - "gorm.io/plugin/dbresolver" - - "bscp.io/pkg/dal/table" -) - -func newCredentialScope(db *gorm.DB, opts ...gen.DOOption) credentialScope { - _credentialScope := credentialScope{} - - _credentialScope.credentialScopeDo.UseDB(db, opts...) - _credentialScope.credentialScopeDo.UseModel(&table.CredentialScope{}) - - tableName := _credentialScope.credentialScopeDo.TableName() - _credentialScope.ALL = field.NewAsterisk(tableName) - _credentialScope.ID = field.NewUint32(tableName, "id") - _credentialScope.CredentialScope = field.NewString(tableName, "credential_scope") - _credentialScope.ExpiredAt = field.NewTime(tableName, "expired_at") - _credentialScope.BizID = field.NewUint32(tableName, "biz_id") - _credentialScope.CredentialId = field.NewUint32(tableName, "credential_id") - _credentialScope.Creator = field.NewString(tableName, "creator") - _credentialScope.Reviser = field.NewString(tableName, "reviser") - _credentialScope.CreatedAt = field.NewTime(tableName, "created_at") - _credentialScope.UpdatedAt = field.NewTime(tableName, "updated_at") - - _credentialScope.fillFieldMap() - - return _credentialScope -} - -type credentialScope struct { - credentialScopeDo credentialScopeDo - - ALL field.Asterisk - ID field.Uint32 - CredentialScope field.String - ExpiredAt field.Time - BizID field.Uint32 - CredentialId field.Uint32 - Creator field.String - Reviser field.String - CreatedAt field.Time - UpdatedAt field.Time - - fieldMap map[string]field.Expr -} - -func (c credentialScope) Table(newTableName string) *credentialScope { - c.credentialScopeDo.UseTable(newTableName) - return c.updateTableName(newTableName) -} - -func (c credentialScope) As(alias string) *credentialScope { - c.credentialScopeDo.DO = *(c.credentialScopeDo.As(alias).(*gen.DO)) - return c.updateTableName(alias) -} - -func (c *credentialScope) updateTableName(table string) *credentialScope { - c.ALL = field.NewAsterisk(table) - c.ID = field.NewUint32(table, "id") - c.CredentialScope = field.NewString(table, "credential_scope") - c.ExpiredAt = field.NewTime(table, "expired_at") - c.BizID = field.NewUint32(table, "biz_id") - c.CredentialId = field.NewUint32(table, "credential_id") - c.Creator = field.NewString(table, "creator") - c.Reviser = field.NewString(table, "reviser") - c.CreatedAt = field.NewTime(table, "created_at") - c.UpdatedAt = field.NewTime(table, "updated_at") - - c.fillFieldMap() - - return c -} - -func (c *credentialScope) WithContext(ctx context.Context) ICredentialScopeDo { - return c.credentialScopeDo.WithContext(ctx) -} - -func (c credentialScope) TableName() string { return c.credentialScopeDo.TableName() } - -func (c credentialScope) Alias() string { return c.credentialScopeDo.Alias() } - -func (c *credentialScope) GetFieldByName(fieldName string) (field.OrderExpr, bool) { - _f, ok := c.fieldMap[fieldName] - if !ok || _f == nil { - return nil, false - } - _oe, ok := _f.(field.OrderExpr) - return _oe, ok -} - -func (c *credentialScope) fillFieldMap() { - c.fieldMap = make(map[string]field.Expr, 9) - c.fieldMap["id"] = c.ID - c.fieldMap["credential_scope"] = c.CredentialScope - c.fieldMap["expired_at"] = c.ExpiredAt - c.fieldMap["biz_id"] = c.BizID - c.fieldMap["credential_id"] = c.CredentialId - c.fieldMap["creator"] = c.Creator - c.fieldMap["reviser"] = c.Reviser - c.fieldMap["created_at"] = c.CreatedAt - c.fieldMap["updated_at"] = c.UpdatedAt -} - -func (c credentialScope) clone(db *gorm.DB) credentialScope { - c.credentialScopeDo.ReplaceConnPool(db.Statement.ConnPool) - return c -} - -func (c credentialScope) replaceDB(db *gorm.DB) credentialScope { - c.credentialScopeDo.ReplaceDB(db) - return c -} - -type credentialScopeDo struct{ gen.DO } - -type ICredentialScopeDo interface { - gen.SubQuery - Debug() ICredentialScopeDo - WithContext(ctx context.Context) ICredentialScopeDo - WithResult(fc func(tx gen.Dao)) gen.ResultInfo - ReplaceDB(db *gorm.DB) - ReadDB() ICredentialScopeDo - WriteDB() ICredentialScopeDo - As(alias string) gen.Dao - Session(config *gorm.Session) ICredentialScopeDo - Columns(cols ...field.Expr) gen.Columns - Clauses(conds ...clause.Expression) ICredentialScopeDo - Not(conds ...gen.Condition) ICredentialScopeDo - Or(conds ...gen.Condition) ICredentialScopeDo - Select(conds ...field.Expr) ICredentialScopeDo - Where(conds ...gen.Condition) ICredentialScopeDo - Order(conds ...field.Expr) ICredentialScopeDo - Distinct(cols ...field.Expr) ICredentialScopeDo - Omit(cols ...field.Expr) ICredentialScopeDo - Join(table schema.Tabler, on ...field.Expr) ICredentialScopeDo - LeftJoin(table schema.Tabler, on ...field.Expr) ICredentialScopeDo - RightJoin(table schema.Tabler, on ...field.Expr) ICredentialScopeDo - Group(cols ...field.Expr) ICredentialScopeDo - Having(conds ...gen.Condition) ICredentialScopeDo - Limit(limit int) ICredentialScopeDo - Offset(offset int) ICredentialScopeDo - Count() (count int64, err error) - Scopes(funcs ...func(gen.Dao) gen.Dao) ICredentialScopeDo - Unscoped() ICredentialScopeDo - Create(values ...*table.CredentialScope) error - CreateInBatches(values []*table.CredentialScope, batchSize int) error - Save(values ...*table.CredentialScope) error - First() (*table.CredentialScope, error) - Take() (*table.CredentialScope, error) - Last() (*table.CredentialScope, error) - Find() ([]*table.CredentialScope, error) - FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.CredentialScope, err error) - FindInBatches(result *[]*table.CredentialScope, batchSize int, fc func(tx gen.Dao, batch int) error) error - Pluck(column field.Expr, dest interface{}) error - Delete(...*table.CredentialScope) (info gen.ResultInfo, err error) - Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - Updates(value interface{}) (info gen.ResultInfo, err error) - UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - UpdateColumns(value interface{}) (info gen.ResultInfo, err error) - UpdateFrom(q gen.SubQuery) gen.Dao - Attrs(attrs ...field.AssignExpr) ICredentialScopeDo - Assign(attrs ...field.AssignExpr) ICredentialScopeDo - Joins(fields ...field.RelationField) ICredentialScopeDo - Preload(fields ...field.RelationField) ICredentialScopeDo - FirstOrInit() (*table.CredentialScope, error) - FirstOrCreate() (*table.CredentialScope, error) - FindByPage(offset int, limit int) (result []*table.CredentialScope, count int64, err error) - ScanByPage(result interface{}, offset int, limit int) (count int64, err error) - Scan(result interface{}) (err error) - Returning(value interface{}, columns ...string) ICredentialScopeDo - UnderlyingDB() *gorm.DB - schema.Tabler -} - -func (c credentialScopeDo) Debug() ICredentialScopeDo { - return c.withDO(c.DO.Debug()) -} - -func (c credentialScopeDo) WithContext(ctx context.Context) ICredentialScopeDo { - return c.withDO(c.DO.WithContext(ctx)) -} - -func (c credentialScopeDo) ReadDB() ICredentialScopeDo { - return c.Clauses(dbresolver.Read) -} - -func (c credentialScopeDo) WriteDB() ICredentialScopeDo { - return c.Clauses(dbresolver.Write) -} - -func (c credentialScopeDo) Session(config *gorm.Session) ICredentialScopeDo { - return c.withDO(c.DO.Session(config)) -} - -func (c credentialScopeDo) Clauses(conds ...clause.Expression) ICredentialScopeDo { - return c.withDO(c.DO.Clauses(conds...)) -} - -func (c credentialScopeDo) Returning(value interface{}, columns ...string) ICredentialScopeDo { - return c.withDO(c.DO.Returning(value, columns...)) -} - -func (c credentialScopeDo) Not(conds ...gen.Condition) ICredentialScopeDo { - return c.withDO(c.DO.Not(conds...)) -} - -func (c credentialScopeDo) Or(conds ...gen.Condition) ICredentialScopeDo { - return c.withDO(c.DO.Or(conds...)) -} - -func (c credentialScopeDo) Select(conds ...field.Expr) ICredentialScopeDo { - return c.withDO(c.DO.Select(conds...)) -} - -func (c credentialScopeDo) Where(conds ...gen.Condition) ICredentialScopeDo { - return c.withDO(c.DO.Where(conds...)) -} - -func (c credentialScopeDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) ICredentialScopeDo { - return c.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - -func (c credentialScopeDo) Order(conds ...field.Expr) ICredentialScopeDo { - return c.withDO(c.DO.Order(conds...)) -} - -func (c credentialScopeDo) Distinct(cols ...field.Expr) ICredentialScopeDo { - return c.withDO(c.DO.Distinct(cols...)) -} - -func (c credentialScopeDo) Omit(cols ...field.Expr) ICredentialScopeDo { - return c.withDO(c.DO.Omit(cols...)) -} - -func (c credentialScopeDo) Join(table schema.Tabler, on ...field.Expr) ICredentialScopeDo { - return c.withDO(c.DO.Join(table, on...)) -} - -func (c credentialScopeDo) LeftJoin(table schema.Tabler, on ...field.Expr) ICredentialScopeDo { - return c.withDO(c.DO.LeftJoin(table, on...)) -} - -func (c credentialScopeDo) RightJoin(table schema.Tabler, on ...field.Expr) ICredentialScopeDo { - return c.withDO(c.DO.RightJoin(table, on...)) -} - -func (c credentialScopeDo) Group(cols ...field.Expr) ICredentialScopeDo { - return c.withDO(c.DO.Group(cols...)) -} - -func (c credentialScopeDo) Having(conds ...gen.Condition) ICredentialScopeDo { - return c.withDO(c.DO.Having(conds...)) -} - -func (c credentialScopeDo) Limit(limit int) ICredentialScopeDo { - return c.withDO(c.DO.Limit(limit)) -} - -func (c credentialScopeDo) Offset(offset int) ICredentialScopeDo { - return c.withDO(c.DO.Offset(offset)) -} - -func (c credentialScopeDo) Scopes(funcs ...func(gen.Dao) gen.Dao) ICredentialScopeDo { - return c.withDO(c.DO.Scopes(funcs...)) -} - -func (c credentialScopeDo) Unscoped() ICredentialScopeDo { - return c.withDO(c.DO.Unscoped()) -} - -func (c credentialScopeDo) Create(values ...*table.CredentialScope) error { - if len(values) == 0 { - return nil - } - return c.DO.Create(values) -} - -func (c credentialScopeDo) CreateInBatches(values []*table.CredentialScope, batchSize int) error { - return c.DO.CreateInBatches(values, batchSize) -} - -// Save : !!! underlying implementation is different with GORM -// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) -func (c credentialScopeDo) Save(values ...*table.CredentialScope) error { - if len(values) == 0 { - return nil - } - return c.DO.Save(values) -} - -func (c credentialScopeDo) First() (*table.CredentialScope, error) { - if result, err := c.DO.First(); err != nil { - return nil, err - } else { - return result.(*table.CredentialScope), nil - } -} - -func (c credentialScopeDo) Take() (*table.CredentialScope, error) { - if result, err := c.DO.Take(); err != nil { - return nil, err - } else { - return result.(*table.CredentialScope), nil - } -} - -func (c credentialScopeDo) Last() (*table.CredentialScope, error) { - if result, err := c.DO.Last(); err != nil { - return nil, err - } else { - return result.(*table.CredentialScope), nil - } -} - -func (c credentialScopeDo) Find() ([]*table.CredentialScope, error) { - result, err := c.DO.Find() - return result.([]*table.CredentialScope), err -} - -func (c credentialScopeDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.CredentialScope, err error) { - buf := make([]*table.CredentialScope, 0, batchSize) - err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { - defer func() { results = append(results, buf...) }() - return fc(tx, batch) - }) - return results, err -} - -func (c credentialScopeDo) FindInBatches(result *[]*table.CredentialScope, batchSize int, fc func(tx gen.Dao, batch int) error) error { - return c.DO.FindInBatches(result, batchSize, fc) -} - -func (c credentialScopeDo) Attrs(attrs ...field.AssignExpr) ICredentialScopeDo { - return c.withDO(c.DO.Attrs(attrs...)) -} - -func (c credentialScopeDo) Assign(attrs ...field.AssignExpr) ICredentialScopeDo { - return c.withDO(c.DO.Assign(attrs...)) -} - -func (c credentialScopeDo) Joins(fields ...field.RelationField) ICredentialScopeDo { - for _, _f := range fields { - c = *c.withDO(c.DO.Joins(_f)) - } - return &c -} - -func (c credentialScopeDo) Preload(fields ...field.RelationField) ICredentialScopeDo { - for _, _f := range fields { - c = *c.withDO(c.DO.Preload(_f)) - } - return &c -} - -func (c credentialScopeDo) FirstOrInit() (*table.CredentialScope, error) { - if result, err := c.DO.FirstOrInit(); err != nil { - return nil, err - } else { - return result.(*table.CredentialScope), nil - } -} - -func (c credentialScopeDo) FirstOrCreate() (*table.CredentialScope, error) { - if result, err := c.DO.FirstOrCreate(); err != nil { - return nil, err - } else { - return result.(*table.CredentialScope), nil - } -} - -func (c credentialScopeDo) FindByPage(offset int, limit int) (result []*table.CredentialScope, count int64, err error) { - result, err = c.Offset(offset).Limit(limit).Find() - if err != nil { - return - } - - if size := len(result); 0 < limit && 0 < size && size < limit { - count = int64(size + offset) - return - } - - count, err = c.Offset(-1).Limit(-1).Count() - return -} - -func (c credentialScopeDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { - count, err = c.Count() - if err != nil { - return - } - - err = c.Offset(offset).Limit(limit).Scan(result) - return -} - -func (c credentialScopeDo) Scan(result interface{}) (err error) { - return c.DO.Scan(result) -} - -func (c credentialScopeDo) Delete(models ...*table.CredentialScope) (result gen.ResultInfo, err error) { - return c.DO.Delete(models) -} - -func (c *credentialScopeDo) withDO(do gen.Dao) *credentialScopeDo { - c.DO = *do.(*gen.DO) - return c -} diff --git a/bcs-services/bcs-bscp/pkg/dal/gen/credentials.gen.go b/bcs-services/bcs-bscp/pkg/dal/gen/credentials.gen.go deleted file mode 100644 index e2716a0ee5..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/gen/credentials.gen.go +++ /dev/null @@ -1,436 +0,0 @@ -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. - -package gen - -import ( - "context" - - "gorm.io/gorm" - "gorm.io/gorm/clause" - "gorm.io/gorm/schema" - - "gorm.io/gen" - "gorm.io/gen/field" - - "gorm.io/plugin/dbresolver" - - "bscp.io/pkg/dal/table" -) - -func newCredential(db *gorm.DB, opts ...gen.DOOption) credential { - _credential := credential{} - - _credential.credentialDo.UseDB(db, opts...) - _credential.credentialDo.UseModel(&table.Credential{}) - - tableName := _credential.credentialDo.TableName() - _credential.ALL = field.NewAsterisk(tableName) - _credential.ID = field.NewUint32(tableName, "id") - _credential.CredentialType = field.NewString(tableName, "credential_type") - _credential.EncCredential = field.NewString(tableName, "enc_credential") - _credential.EncAlgorithm = field.NewString(tableName, "enc_algorithm") - _credential.Memo = field.NewString(tableName, "memo") - _credential.Enable = field.NewBool(tableName, "enable") - _credential.ExpiredAt = field.NewTime(tableName, "expired_at") - _credential.BizID = field.NewUint32(tableName, "biz_id") - _credential.Creator = field.NewString(tableName, "creator") - _credential.Reviser = field.NewString(tableName, "reviser") - _credential.CreatedAt = field.NewTime(tableName, "created_at") - _credential.UpdatedAt = field.NewTime(tableName, "updated_at") - - _credential.fillFieldMap() - - return _credential -} - -type credential struct { - credentialDo credentialDo - - ALL field.Asterisk - ID field.Uint32 - CredentialType field.String - EncCredential field.String - EncAlgorithm field.String - Memo field.String - Enable field.Bool - ExpiredAt field.Time - BizID field.Uint32 - Creator field.String - Reviser field.String - CreatedAt field.Time - UpdatedAt field.Time - - fieldMap map[string]field.Expr -} - -func (c credential) Table(newTableName string) *credential { - c.credentialDo.UseTable(newTableName) - return c.updateTableName(newTableName) -} - -func (c credential) As(alias string) *credential { - c.credentialDo.DO = *(c.credentialDo.As(alias).(*gen.DO)) - return c.updateTableName(alias) -} - -func (c *credential) updateTableName(table string) *credential { - c.ALL = field.NewAsterisk(table) - c.ID = field.NewUint32(table, "id") - c.CredentialType = field.NewString(table, "credential_type") - c.EncCredential = field.NewString(table, "enc_credential") - c.EncAlgorithm = field.NewString(table, "enc_algorithm") - c.Memo = field.NewString(table, "memo") - c.Enable = field.NewBool(table, "enable") - c.ExpiredAt = field.NewTime(table, "expired_at") - c.BizID = field.NewUint32(table, "biz_id") - c.Creator = field.NewString(table, "creator") - c.Reviser = field.NewString(table, "reviser") - c.CreatedAt = field.NewTime(table, "created_at") - c.UpdatedAt = field.NewTime(table, "updated_at") - - c.fillFieldMap() - - return c -} - -func (c *credential) WithContext(ctx context.Context) ICredentialDo { - return c.credentialDo.WithContext(ctx) -} - -func (c credential) TableName() string { return c.credentialDo.TableName() } - -func (c credential) Alias() string { return c.credentialDo.Alias() } - -func (c *credential) GetFieldByName(fieldName string) (field.OrderExpr, bool) { - _f, ok := c.fieldMap[fieldName] - if !ok || _f == nil { - return nil, false - } - _oe, ok := _f.(field.OrderExpr) - return _oe, ok -} - -func (c *credential) fillFieldMap() { - c.fieldMap = make(map[string]field.Expr, 12) - c.fieldMap["id"] = c.ID - c.fieldMap["credential_type"] = c.CredentialType - c.fieldMap["enc_credential"] = c.EncCredential - c.fieldMap["enc_algorithm"] = c.EncAlgorithm - c.fieldMap["memo"] = c.Memo - c.fieldMap["enable"] = c.Enable - c.fieldMap["expired_at"] = c.ExpiredAt - c.fieldMap["biz_id"] = c.BizID - c.fieldMap["creator"] = c.Creator - c.fieldMap["reviser"] = c.Reviser - c.fieldMap["created_at"] = c.CreatedAt - c.fieldMap["updated_at"] = c.UpdatedAt -} - -func (c credential) clone(db *gorm.DB) credential { - c.credentialDo.ReplaceConnPool(db.Statement.ConnPool) - return c -} - -func (c credential) replaceDB(db *gorm.DB) credential { - c.credentialDo.ReplaceDB(db) - return c -} - -type credentialDo struct{ gen.DO } - -type ICredentialDo interface { - gen.SubQuery - Debug() ICredentialDo - WithContext(ctx context.Context) ICredentialDo - WithResult(fc func(tx gen.Dao)) gen.ResultInfo - ReplaceDB(db *gorm.DB) - ReadDB() ICredentialDo - WriteDB() ICredentialDo - As(alias string) gen.Dao - Session(config *gorm.Session) ICredentialDo - Columns(cols ...field.Expr) gen.Columns - Clauses(conds ...clause.Expression) ICredentialDo - Not(conds ...gen.Condition) ICredentialDo - Or(conds ...gen.Condition) ICredentialDo - Select(conds ...field.Expr) ICredentialDo - Where(conds ...gen.Condition) ICredentialDo - Order(conds ...field.Expr) ICredentialDo - Distinct(cols ...field.Expr) ICredentialDo - Omit(cols ...field.Expr) ICredentialDo - Join(table schema.Tabler, on ...field.Expr) ICredentialDo - LeftJoin(table schema.Tabler, on ...field.Expr) ICredentialDo - RightJoin(table schema.Tabler, on ...field.Expr) ICredentialDo - Group(cols ...field.Expr) ICredentialDo - Having(conds ...gen.Condition) ICredentialDo - Limit(limit int) ICredentialDo - Offset(offset int) ICredentialDo - Count() (count int64, err error) - Scopes(funcs ...func(gen.Dao) gen.Dao) ICredentialDo - Unscoped() ICredentialDo - Create(values ...*table.Credential) error - CreateInBatches(values []*table.Credential, batchSize int) error - Save(values ...*table.Credential) error - First() (*table.Credential, error) - Take() (*table.Credential, error) - Last() (*table.Credential, error) - Find() ([]*table.Credential, error) - FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.Credential, err error) - FindInBatches(result *[]*table.Credential, batchSize int, fc func(tx gen.Dao, batch int) error) error - Pluck(column field.Expr, dest interface{}) error - Delete(...*table.Credential) (info gen.ResultInfo, err error) - Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - Updates(value interface{}) (info gen.ResultInfo, err error) - UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - UpdateColumns(value interface{}) (info gen.ResultInfo, err error) - UpdateFrom(q gen.SubQuery) gen.Dao - Attrs(attrs ...field.AssignExpr) ICredentialDo - Assign(attrs ...field.AssignExpr) ICredentialDo - Joins(fields ...field.RelationField) ICredentialDo - Preload(fields ...field.RelationField) ICredentialDo - FirstOrInit() (*table.Credential, error) - FirstOrCreate() (*table.Credential, error) - FindByPage(offset int, limit int) (result []*table.Credential, count int64, err error) - ScanByPage(result interface{}, offset int, limit int) (count int64, err error) - Scan(result interface{}) (err error) - Returning(value interface{}, columns ...string) ICredentialDo - UnderlyingDB() *gorm.DB - schema.Tabler -} - -func (c credentialDo) Debug() ICredentialDo { - return c.withDO(c.DO.Debug()) -} - -func (c credentialDo) WithContext(ctx context.Context) ICredentialDo { - return c.withDO(c.DO.WithContext(ctx)) -} - -func (c credentialDo) ReadDB() ICredentialDo { - return c.Clauses(dbresolver.Read) -} - -func (c credentialDo) WriteDB() ICredentialDo { - return c.Clauses(dbresolver.Write) -} - -func (c credentialDo) Session(config *gorm.Session) ICredentialDo { - return c.withDO(c.DO.Session(config)) -} - -func (c credentialDo) Clauses(conds ...clause.Expression) ICredentialDo { - return c.withDO(c.DO.Clauses(conds...)) -} - -func (c credentialDo) Returning(value interface{}, columns ...string) ICredentialDo { - return c.withDO(c.DO.Returning(value, columns...)) -} - -func (c credentialDo) Not(conds ...gen.Condition) ICredentialDo { - return c.withDO(c.DO.Not(conds...)) -} - -func (c credentialDo) Or(conds ...gen.Condition) ICredentialDo { - return c.withDO(c.DO.Or(conds...)) -} - -func (c credentialDo) Select(conds ...field.Expr) ICredentialDo { - return c.withDO(c.DO.Select(conds...)) -} - -func (c credentialDo) Where(conds ...gen.Condition) ICredentialDo { - return c.withDO(c.DO.Where(conds...)) -} - -func (c credentialDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) ICredentialDo { - return c.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - -func (c credentialDo) Order(conds ...field.Expr) ICredentialDo { - return c.withDO(c.DO.Order(conds...)) -} - -func (c credentialDo) Distinct(cols ...field.Expr) ICredentialDo { - return c.withDO(c.DO.Distinct(cols...)) -} - -func (c credentialDo) Omit(cols ...field.Expr) ICredentialDo { - return c.withDO(c.DO.Omit(cols...)) -} - -func (c credentialDo) Join(table schema.Tabler, on ...field.Expr) ICredentialDo { - return c.withDO(c.DO.Join(table, on...)) -} - -func (c credentialDo) LeftJoin(table schema.Tabler, on ...field.Expr) ICredentialDo { - return c.withDO(c.DO.LeftJoin(table, on...)) -} - -func (c credentialDo) RightJoin(table schema.Tabler, on ...field.Expr) ICredentialDo { - return c.withDO(c.DO.RightJoin(table, on...)) -} - -func (c credentialDo) Group(cols ...field.Expr) ICredentialDo { - return c.withDO(c.DO.Group(cols...)) -} - -func (c credentialDo) Having(conds ...gen.Condition) ICredentialDo { - return c.withDO(c.DO.Having(conds...)) -} - -func (c credentialDo) Limit(limit int) ICredentialDo { - return c.withDO(c.DO.Limit(limit)) -} - -func (c credentialDo) Offset(offset int) ICredentialDo { - return c.withDO(c.DO.Offset(offset)) -} - -func (c credentialDo) Scopes(funcs ...func(gen.Dao) gen.Dao) ICredentialDo { - return c.withDO(c.DO.Scopes(funcs...)) -} - -func (c credentialDo) Unscoped() ICredentialDo { - return c.withDO(c.DO.Unscoped()) -} - -func (c credentialDo) Create(values ...*table.Credential) error { - if len(values) == 0 { - return nil - } - return c.DO.Create(values) -} - -func (c credentialDo) CreateInBatches(values []*table.Credential, batchSize int) error { - return c.DO.CreateInBatches(values, batchSize) -} - -// Save : !!! underlying implementation is different with GORM -// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) -func (c credentialDo) Save(values ...*table.Credential) error { - if len(values) == 0 { - return nil - } - return c.DO.Save(values) -} - -func (c credentialDo) First() (*table.Credential, error) { - if result, err := c.DO.First(); err != nil { - return nil, err - } else { - return result.(*table.Credential), nil - } -} - -func (c credentialDo) Take() (*table.Credential, error) { - if result, err := c.DO.Take(); err != nil { - return nil, err - } else { - return result.(*table.Credential), nil - } -} - -func (c credentialDo) Last() (*table.Credential, error) { - if result, err := c.DO.Last(); err != nil { - return nil, err - } else { - return result.(*table.Credential), nil - } -} - -func (c credentialDo) Find() ([]*table.Credential, error) { - result, err := c.DO.Find() - return result.([]*table.Credential), err -} - -func (c credentialDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.Credential, err error) { - buf := make([]*table.Credential, 0, batchSize) - err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { - defer func() { results = append(results, buf...) }() - return fc(tx, batch) - }) - return results, err -} - -func (c credentialDo) FindInBatches(result *[]*table.Credential, batchSize int, fc func(tx gen.Dao, batch int) error) error { - return c.DO.FindInBatches(result, batchSize, fc) -} - -func (c credentialDo) Attrs(attrs ...field.AssignExpr) ICredentialDo { - return c.withDO(c.DO.Attrs(attrs...)) -} - -func (c credentialDo) Assign(attrs ...field.AssignExpr) ICredentialDo { - return c.withDO(c.DO.Assign(attrs...)) -} - -func (c credentialDo) Joins(fields ...field.RelationField) ICredentialDo { - for _, _f := range fields { - c = *c.withDO(c.DO.Joins(_f)) - } - return &c -} - -func (c credentialDo) Preload(fields ...field.RelationField) ICredentialDo { - for _, _f := range fields { - c = *c.withDO(c.DO.Preload(_f)) - } - return &c -} - -func (c credentialDo) FirstOrInit() (*table.Credential, error) { - if result, err := c.DO.FirstOrInit(); err != nil { - return nil, err - } else { - return result.(*table.Credential), nil - } -} - -func (c credentialDo) FirstOrCreate() (*table.Credential, error) { - if result, err := c.DO.FirstOrCreate(); err != nil { - return nil, err - } else { - return result.(*table.Credential), nil - } -} - -func (c credentialDo) FindByPage(offset int, limit int) (result []*table.Credential, count int64, err error) { - result, err = c.Offset(offset).Limit(limit).Find() - if err != nil { - return - } - - if size := len(result); 0 < limit && 0 < size && size < limit { - count = int64(size + offset) - return - } - - count, err = c.Offset(-1).Limit(-1).Count() - return -} - -func (c credentialDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { - count, err = c.Count() - if err != nil { - return - } - - err = c.Offset(offset).Limit(limit).Scan(result) - return -} - -func (c credentialDo) Scan(result interface{}) (err error) { - return c.DO.Scan(result) -} - -func (c credentialDo) Delete(models ...*table.Credential) (result gen.ResultInfo, err error) { - return c.DO.Delete(models) -} - -func (c *credentialDo) withDO(do gen.Dao) *credentialDo { - c.DO = *do.(*gen.DO) - return c -} diff --git a/bcs-services/bcs-bscp/pkg/dal/gen/events.gen.go b/bcs-services/bcs-bscp/pkg/dal/gen/events.gen.go deleted file mode 100644 index f80d38ed56..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/gen/events.gen.go +++ /dev/null @@ -1,426 +0,0 @@ -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. - -package gen - -import ( - "context" - - "gorm.io/gorm" - "gorm.io/gorm/clause" - "gorm.io/gorm/schema" - - "gorm.io/gen" - "gorm.io/gen/field" - - "gorm.io/plugin/dbresolver" - - "bscp.io/pkg/dal/table" -) - -func newEvent(db *gorm.DB, opts ...gen.DOOption) event { - _event := event{} - - _event.eventDo.UseDB(db, opts...) - _event.eventDo.UseModel(&table.Event{}) - - tableName := _event.eventDo.TableName() - _event.ALL = field.NewAsterisk(tableName) - _event.ID = field.NewUint32(tableName, "id") - _event.Resource = field.NewString(tableName, "resource") - _event.ResourceID = field.NewUint32(tableName, "resource_id") - _event.ResourceUid = field.NewString(tableName, "resource_uid") - _event.OpType = field.NewString(tableName, "op_type") - _event.BizID = field.NewUint32(tableName, "biz_id") - _event.AppID = field.NewUint32(tableName, "app_id") - _event.FinalStatus = field.NewUint(tableName, "final_status") - _event.Creator = field.NewString(tableName, "creator") - _event.CreatedAt = field.NewTime(tableName, "created_at") - - _event.fillFieldMap() - - return _event -} - -type event struct { - eventDo eventDo - - ALL field.Asterisk - ID field.Uint32 - Resource field.String - ResourceID field.Uint32 - ResourceUid field.String - OpType field.String - BizID field.Uint32 - AppID field.Uint32 - FinalStatus field.Uint - Creator field.String - CreatedAt field.Time - - fieldMap map[string]field.Expr -} - -func (e event) Table(newTableName string) *event { - e.eventDo.UseTable(newTableName) - return e.updateTableName(newTableName) -} - -func (e event) As(alias string) *event { - e.eventDo.DO = *(e.eventDo.As(alias).(*gen.DO)) - return e.updateTableName(alias) -} - -func (e *event) updateTableName(table string) *event { - e.ALL = field.NewAsterisk(table) - e.ID = field.NewUint32(table, "id") - e.Resource = field.NewString(table, "resource") - e.ResourceID = field.NewUint32(table, "resource_id") - e.ResourceUid = field.NewString(table, "resource_uid") - e.OpType = field.NewString(table, "op_type") - e.BizID = field.NewUint32(table, "biz_id") - e.AppID = field.NewUint32(table, "app_id") - e.FinalStatus = field.NewUint(table, "final_status") - e.Creator = field.NewString(table, "creator") - e.CreatedAt = field.NewTime(table, "created_at") - - e.fillFieldMap() - - return e -} - -func (e *event) WithContext(ctx context.Context) IEventDo { return e.eventDo.WithContext(ctx) } - -func (e event) TableName() string { return e.eventDo.TableName() } - -func (e event) Alias() string { return e.eventDo.Alias() } - -func (e *event) GetFieldByName(fieldName string) (field.OrderExpr, bool) { - _f, ok := e.fieldMap[fieldName] - if !ok || _f == nil { - return nil, false - } - _oe, ok := _f.(field.OrderExpr) - return _oe, ok -} - -func (e *event) fillFieldMap() { - e.fieldMap = make(map[string]field.Expr, 10) - e.fieldMap["id"] = e.ID - e.fieldMap["resource"] = e.Resource - e.fieldMap["resource_id"] = e.ResourceID - e.fieldMap["resource_uid"] = e.ResourceUid - e.fieldMap["op_type"] = e.OpType - e.fieldMap["biz_id"] = e.BizID - e.fieldMap["app_id"] = e.AppID - e.fieldMap["final_status"] = e.FinalStatus - e.fieldMap["creator"] = e.Creator - e.fieldMap["created_at"] = e.CreatedAt -} - -func (e event) clone(db *gorm.DB) event { - e.eventDo.ReplaceConnPool(db.Statement.ConnPool) - return e -} - -func (e event) replaceDB(db *gorm.DB) event { - e.eventDo.ReplaceDB(db) - return e -} - -type eventDo struct{ gen.DO } - -type IEventDo interface { - gen.SubQuery - Debug() IEventDo - WithContext(ctx context.Context) IEventDo - WithResult(fc func(tx gen.Dao)) gen.ResultInfo - ReplaceDB(db *gorm.DB) - ReadDB() IEventDo - WriteDB() IEventDo - As(alias string) gen.Dao - Session(config *gorm.Session) IEventDo - Columns(cols ...field.Expr) gen.Columns - Clauses(conds ...clause.Expression) IEventDo - Not(conds ...gen.Condition) IEventDo - Or(conds ...gen.Condition) IEventDo - Select(conds ...field.Expr) IEventDo - Where(conds ...gen.Condition) IEventDo - Order(conds ...field.Expr) IEventDo - Distinct(cols ...field.Expr) IEventDo - Omit(cols ...field.Expr) IEventDo - Join(table schema.Tabler, on ...field.Expr) IEventDo - LeftJoin(table schema.Tabler, on ...field.Expr) IEventDo - RightJoin(table schema.Tabler, on ...field.Expr) IEventDo - Group(cols ...field.Expr) IEventDo - Having(conds ...gen.Condition) IEventDo - Limit(limit int) IEventDo - Offset(offset int) IEventDo - Count() (count int64, err error) - Scopes(funcs ...func(gen.Dao) gen.Dao) IEventDo - Unscoped() IEventDo - Create(values ...*table.Event) error - CreateInBatches(values []*table.Event, batchSize int) error - Save(values ...*table.Event) error - First() (*table.Event, error) - Take() (*table.Event, error) - Last() (*table.Event, error) - Find() ([]*table.Event, error) - FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.Event, err error) - FindInBatches(result *[]*table.Event, batchSize int, fc func(tx gen.Dao, batch int) error) error - Pluck(column field.Expr, dest interface{}) error - Delete(...*table.Event) (info gen.ResultInfo, err error) - Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - Updates(value interface{}) (info gen.ResultInfo, err error) - UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - UpdateColumns(value interface{}) (info gen.ResultInfo, err error) - UpdateFrom(q gen.SubQuery) gen.Dao - Attrs(attrs ...field.AssignExpr) IEventDo - Assign(attrs ...field.AssignExpr) IEventDo - Joins(fields ...field.RelationField) IEventDo - Preload(fields ...field.RelationField) IEventDo - FirstOrInit() (*table.Event, error) - FirstOrCreate() (*table.Event, error) - FindByPage(offset int, limit int) (result []*table.Event, count int64, err error) - ScanByPage(result interface{}, offset int, limit int) (count int64, err error) - Scan(result interface{}) (err error) - Returning(value interface{}, columns ...string) IEventDo - UnderlyingDB() *gorm.DB - schema.Tabler -} - -func (e eventDo) Debug() IEventDo { - return e.withDO(e.DO.Debug()) -} - -func (e eventDo) WithContext(ctx context.Context) IEventDo { - return e.withDO(e.DO.WithContext(ctx)) -} - -func (e eventDo) ReadDB() IEventDo { - return e.Clauses(dbresolver.Read) -} - -func (e eventDo) WriteDB() IEventDo { - return e.Clauses(dbresolver.Write) -} - -func (e eventDo) Session(config *gorm.Session) IEventDo { - return e.withDO(e.DO.Session(config)) -} - -func (e eventDo) Clauses(conds ...clause.Expression) IEventDo { - return e.withDO(e.DO.Clauses(conds...)) -} - -func (e eventDo) Returning(value interface{}, columns ...string) IEventDo { - return e.withDO(e.DO.Returning(value, columns...)) -} - -func (e eventDo) Not(conds ...gen.Condition) IEventDo { - return e.withDO(e.DO.Not(conds...)) -} - -func (e eventDo) Or(conds ...gen.Condition) IEventDo { - return e.withDO(e.DO.Or(conds...)) -} - -func (e eventDo) Select(conds ...field.Expr) IEventDo { - return e.withDO(e.DO.Select(conds...)) -} - -func (e eventDo) Where(conds ...gen.Condition) IEventDo { - return e.withDO(e.DO.Where(conds...)) -} - -func (e eventDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IEventDo { - return e.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - -func (e eventDo) Order(conds ...field.Expr) IEventDo { - return e.withDO(e.DO.Order(conds...)) -} - -func (e eventDo) Distinct(cols ...field.Expr) IEventDo { - return e.withDO(e.DO.Distinct(cols...)) -} - -func (e eventDo) Omit(cols ...field.Expr) IEventDo { - return e.withDO(e.DO.Omit(cols...)) -} - -func (e eventDo) Join(table schema.Tabler, on ...field.Expr) IEventDo { - return e.withDO(e.DO.Join(table, on...)) -} - -func (e eventDo) LeftJoin(table schema.Tabler, on ...field.Expr) IEventDo { - return e.withDO(e.DO.LeftJoin(table, on...)) -} - -func (e eventDo) RightJoin(table schema.Tabler, on ...field.Expr) IEventDo { - return e.withDO(e.DO.RightJoin(table, on...)) -} - -func (e eventDo) Group(cols ...field.Expr) IEventDo { - return e.withDO(e.DO.Group(cols...)) -} - -func (e eventDo) Having(conds ...gen.Condition) IEventDo { - return e.withDO(e.DO.Having(conds...)) -} - -func (e eventDo) Limit(limit int) IEventDo { - return e.withDO(e.DO.Limit(limit)) -} - -func (e eventDo) Offset(offset int) IEventDo { - return e.withDO(e.DO.Offset(offset)) -} - -func (e eventDo) Scopes(funcs ...func(gen.Dao) gen.Dao) IEventDo { - return e.withDO(e.DO.Scopes(funcs...)) -} - -func (e eventDo) Unscoped() IEventDo { - return e.withDO(e.DO.Unscoped()) -} - -func (e eventDo) Create(values ...*table.Event) error { - if len(values) == 0 { - return nil - } - return e.DO.Create(values) -} - -func (e eventDo) CreateInBatches(values []*table.Event, batchSize int) error { - return e.DO.CreateInBatches(values, batchSize) -} - -// Save : !!! underlying implementation is different with GORM -// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) -func (e eventDo) Save(values ...*table.Event) error { - if len(values) == 0 { - return nil - } - return e.DO.Save(values) -} - -func (e eventDo) First() (*table.Event, error) { - if result, err := e.DO.First(); err != nil { - return nil, err - } else { - return result.(*table.Event), nil - } -} - -func (e eventDo) Take() (*table.Event, error) { - if result, err := e.DO.Take(); err != nil { - return nil, err - } else { - return result.(*table.Event), nil - } -} - -func (e eventDo) Last() (*table.Event, error) { - if result, err := e.DO.Last(); err != nil { - return nil, err - } else { - return result.(*table.Event), nil - } -} - -func (e eventDo) Find() ([]*table.Event, error) { - result, err := e.DO.Find() - return result.([]*table.Event), err -} - -func (e eventDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.Event, err error) { - buf := make([]*table.Event, 0, batchSize) - err = e.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { - defer func() { results = append(results, buf...) }() - return fc(tx, batch) - }) - return results, err -} - -func (e eventDo) FindInBatches(result *[]*table.Event, batchSize int, fc func(tx gen.Dao, batch int) error) error { - return e.DO.FindInBatches(result, batchSize, fc) -} - -func (e eventDo) Attrs(attrs ...field.AssignExpr) IEventDo { - return e.withDO(e.DO.Attrs(attrs...)) -} - -func (e eventDo) Assign(attrs ...field.AssignExpr) IEventDo { - return e.withDO(e.DO.Assign(attrs...)) -} - -func (e eventDo) Joins(fields ...field.RelationField) IEventDo { - for _, _f := range fields { - e = *e.withDO(e.DO.Joins(_f)) - } - return &e -} - -func (e eventDo) Preload(fields ...field.RelationField) IEventDo { - for _, _f := range fields { - e = *e.withDO(e.DO.Preload(_f)) - } - return &e -} - -func (e eventDo) FirstOrInit() (*table.Event, error) { - if result, err := e.DO.FirstOrInit(); err != nil { - return nil, err - } else { - return result.(*table.Event), nil - } -} - -func (e eventDo) FirstOrCreate() (*table.Event, error) { - if result, err := e.DO.FirstOrCreate(); err != nil { - return nil, err - } else { - return result.(*table.Event), nil - } -} - -func (e eventDo) FindByPage(offset int, limit int) (result []*table.Event, count int64, err error) { - result, err = e.Offset(offset).Limit(limit).Find() - if err != nil { - return - } - - if size := len(result); 0 < limit && 0 < size && size < limit { - count = int64(size + offset) - return - } - - count, err = e.Offset(-1).Limit(-1).Count() - return -} - -func (e eventDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { - count, err = e.Count() - if err != nil { - return - } - - err = e.Offset(offset).Limit(limit).Scan(result) - return -} - -func (e eventDo) Scan(result interface{}) (err error) { - return e.DO.Scan(result) -} - -func (e eventDo) Delete(models ...*table.Event) (result gen.ResultInfo, err error) { - return e.DO.Delete(models) -} - -func (e *eventDo) withDO(do gen.Dao) *eventDo { - e.DO = *do.(*gen.DO) - return e -} diff --git a/bcs-services/bcs-bscp/pkg/dal/gen/gen.go b/bcs-services/bcs-bscp/pkg/dal/gen/gen.go index 5ce9f204ed..15a1c01fbc 100644 --- a/bcs-services/bcs-bscp/pkg/dal/gen/gen.go +++ b/bcs-services/bcs-bscp/pkg/dal/gen/gen.go @@ -16,46 +16,18 @@ import ( ) var ( - Q = new(Query) - App *app - ArchivedApp *archivedApp - Audit *audit - ConfigHook *configHook - Credential *credential - CredentialScope *credentialScope - Event *event - Group *group - GroupAppBind *groupAppBind - Hook *hook - HookRelease *hookRelease - IDGenerator *iDGenerator - Release *release - ReleasedConfigItem *releasedConfigItem - ReleasedGroup *releasedGroup - Strategy *strategy - Template *template - TemplateRelease *templateRelease - TemplateSpace *templateSpace + Q = new(Query) + Audit *audit + IDGenerator *iDGenerator + Template *template + TemplateRelease *templateRelease + TemplateSpace *templateSpace ) func SetDefault(db *gorm.DB, opts ...gen.DOOption) { *Q = *Use(db, opts...) - App = &Q.App - ArchivedApp = &Q.ArchivedApp Audit = &Q.Audit - ConfigHook = &Q.ConfigHook - Credential = &Q.Credential - CredentialScope = &Q.CredentialScope - Event = &Q.Event - Group = &Q.Group - GroupAppBind = &Q.GroupAppBind - Hook = &Q.Hook - HookRelease = &Q.HookRelease IDGenerator = &Q.IDGenerator - Release = &Q.Release - ReleasedConfigItem = &Q.ReleasedConfigItem - ReleasedGroup = &Q.ReleasedGroup - Strategy = &Q.Strategy Template = &Q.Template TemplateRelease = &Q.TemplateRelease TemplateSpace = &Q.TemplateSpace @@ -63,77 +35,35 @@ func SetDefault(db *gorm.DB, opts ...gen.DOOption) { func Use(db *gorm.DB, opts ...gen.DOOption) *Query { return &Query{ - db: db, - App: newApp(db, opts...), - ArchivedApp: newArchivedApp(db, opts...), - Audit: newAudit(db, opts...), - ConfigHook: newConfigHook(db, opts...), - Credential: newCredential(db, opts...), - CredentialScope: newCredentialScope(db, opts...), - Event: newEvent(db, opts...), - Group: newGroup(db, opts...), - GroupAppBind: newGroupAppBind(db, opts...), - Hook: newHook(db, opts...), - HookRelease: newHookRelease(db, opts...), - IDGenerator: newIDGenerator(db, opts...), - Release: newRelease(db, opts...), - ReleasedConfigItem: newReleasedConfigItem(db, opts...), - ReleasedGroup: newReleasedGroup(db, opts...), - Strategy: newStrategy(db, opts...), - Template: newTemplate(db, opts...), - TemplateRelease: newTemplateRelease(db, opts...), - TemplateSpace: newTemplateSpace(db, opts...), + db: db, + Audit: newAudit(db, opts...), + IDGenerator: newIDGenerator(db, opts...), + Template: newTemplate(db, opts...), + TemplateRelease: newTemplateRelease(db, opts...), + TemplateSpace: newTemplateSpace(db, opts...), } } type Query struct { db *gorm.DB - App app - ArchivedApp archivedApp - Audit audit - ConfigHook configHook - Credential credential - CredentialScope credentialScope - Event event - Group group - GroupAppBind groupAppBind - Hook hook - HookRelease hookRelease - IDGenerator iDGenerator - Release release - ReleasedConfigItem releasedConfigItem - ReleasedGroup releasedGroup - Strategy strategy - Template template - TemplateRelease templateRelease - TemplateSpace templateSpace + Audit audit + IDGenerator iDGenerator + Template template + TemplateRelease templateRelease + TemplateSpace templateSpace } func (q *Query) Available() bool { return q.db != nil } func (q *Query) clone(db *gorm.DB) *Query { return &Query{ - db: db, - App: q.App.clone(db), - ArchivedApp: q.ArchivedApp.clone(db), - Audit: q.Audit.clone(db), - ConfigHook: q.ConfigHook.clone(db), - Credential: q.Credential.clone(db), - CredentialScope: q.CredentialScope.clone(db), - Event: q.Event.clone(db), - Group: q.Group.clone(db), - GroupAppBind: q.GroupAppBind.clone(db), - Hook: q.Hook.clone(db), - HookRelease: q.HookRelease.clone(db), - IDGenerator: q.IDGenerator.clone(db), - Release: q.Release.clone(db), - ReleasedConfigItem: q.ReleasedConfigItem.clone(db), - ReleasedGroup: q.ReleasedGroup.clone(db), - Strategy: q.Strategy.clone(db), - Template: q.Template.clone(db), - TemplateRelease: q.TemplateRelease.clone(db), - TemplateSpace: q.TemplateSpace.clone(db), + db: db, + Audit: q.Audit.clone(db), + IDGenerator: q.IDGenerator.clone(db), + Template: q.Template.clone(db), + TemplateRelease: q.TemplateRelease.clone(db), + TemplateSpace: q.TemplateSpace.clone(db), } } @@ -147,72 +77,30 @@ func (q *Query) WriteDB() *Query { func (q *Query) ReplaceDB(db *gorm.DB) *Query { return &Query{ - db: db, - App: q.App.replaceDB(db), - ArchivedApp: q.ArchivedApp.replaceDB(db), - Audit: q.Audit.replaceDB(db), - ConfigHook: q.ConfigHook.replaceDB(db), - Credential: q.Credential.replaceDB(db), - CredentialScope: q.CredentialScope.replaceDB(db), - Event: q.Event.replaceDB(db), - Group: q.Group.replaceDB(db), - GroupAppBind: q.GroupAppBind.replaceDB(db), - Hook: q.Hook.replaceDB(db), - HookRelease: q.HookRelease.replaceDB(db), - IDGenerator: q.IDGenerator.replaceDB(db), - Release: q.Release.replaceDB(db), - ReleasedConfigItem: q.ReleasedConfigItem.replaceDB(db), - ReleasedGroup: q.ReleasedGroup.replaceDB(db), - Strategy: q.Strategy.replaceDB(db), - Template: q.Template.replaceDB(db), - TemplateRelease: q.TemplateRelease.replaceDB(db), - TemplateSpace: q.TemplateSpace.replaceDB(db), + db: db, + Audit: q.Audit.replaceDB(db), + IDGenerator: q.IDGenerator.replaceDB(db), + Template: q.Template.replaceDB(db), + TemplateRelease: q.TemplateRelease.replaceDB(db), + TemplateSpace: q.TemplateSpace.replaceDB(db), } } type queryCtx struct { - App IAppDo - ArchivedApp IArchivedAppDo - Audit IAuditDo - ConfigHook IConfigHookDo - Credential ICredentialDo - CredentialScope ICredentialScopeDo - Event IEventDo - Group IGroupDo - GroupAppBind IGroupAppBindDo - Hook IHookDo - HookRelease IHookReleaseDo - IDGenerator IIDGeneratorDo - Release IReleaseDo - ReleasedConfigItem IReleasedConfigItemDo - ReleasedGroup IReleasedGroupDo - Strategy IStrategyDo - Template ITemplateDo - TemplateRelease ITemplateReleaseDo - TemplateSpace ITemplateSpaceDo + Audit IAuditDo + IDGenerator IIDGeneratorDo + Template ITemplateDo + TemplateRelease ITemplateReleaseDo + TemplateSpace ITemplateSpaceDo } func (q *Query) WithContext(ctx context.Context) *queryCtx { return &queryCtx{ - App: q.App.WithContext(ctx), - ArchivedApp: q.ArchivedApp.WithContext(ctx), - Audit: q.Audit.WithContext(ctx), - ConfigHook: q.ConfigHook.WithContext(ctx), - Credential: q.Credential.WithContext(ctx), - CredentialScope: q.CredentialScope.WithContext(ctx), - Event: q.Event.WithContext(ctx), - Group: q.Group.WithContext(ctx), - GroupAppBind: q.GroupAppBind.WithContext(ctx), - Hook: q.Hook.WithContext(ctx), - HookRelease: q.HookRelease.WithContext(ctx), - IDGenerator: q.IDGenerator.WithContext(ctx), - Release: q.Release.WithContext(ctx), - ReleasedConfigItem: q.ReleasedConfigItem.WithContext(ctx), - ReleasedGroup: q.ReleasedGroup.WithContext(ctx), - Strategy: q.Strategy.WithContext(ctx), - Template: q.Template.WithContext(ctx), - TemplateRelease: q.TemplateRelease.WithContext(ctx), - TemplateSpace: q.TemplateSpace.WithContext(ctx), + Audit: q.Audit.WithContext(ctx), + IDGenerator: q.IDGenerator.WithContext(ctx), + Template: q.Template.WithContext(ctx), + TemplateRelease: q.TemplateRelease.WithContext(ctx), + TemplateSpace: q.TemplateSpace.WithContext(ctx), } } diff --git a/bcs-services/bcs-bscp/pkg/dal/gen/group_app_binds.gen.go b/bcs-services/bcs-bscp/pkg/dal/gen/group_app_binds.gen.go deleted file mode 100644 index 71b21d0d47..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/gen/group_app_binds.gen.go +++ /dev/null @@ -1,404 +0,0 @@ -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. - -package gen - -import ( - "context" - - "gorm.io/gorm" - "gorm.io/gorm/clause" - "gorm.io/gorm/schema" - - "gorm.io/gen" - "gorm.io/gen/field" - - "gorm.io/plugin/dbresolver" - - "bscp.io/pkg/dal/table" -) - -func newGroupAppBind(db *gorm.DB, opts ...gen.DOOption) groupAppBind { - _groupAppBind := groupAppBind{} - - _groupAppBind.groupAppBindDo.UseDB(db, opts...) - _groupAppBind.groupAppBindDo.UseModel(&table.GroupAppBind{}) - - tableName := _groupAppBind.groupAppBindDo.TableName() - _groupAppBind.ALL = field.NewAsterisk(tableName) - _groupAppBind.ID = field.NewUint32(tableName, "id") - _groupAppBind.GroupID = field.NewUint32(tableName, "group_id") - _groupAppBind.AppID = field.NewUint32(tableName, "app_id") - _groupAppBind.BizID = field.NewUint32(tableName, "biz_id") - - _groupAppBind.fillFieldMap() - - return _groupAppBind -} - -type groupAppBind struct { - groupAppBindDo groupAppBindDo - - ALL field.Asterisk - ID field.Uint32 - GroupID field.Uint32 - AppID field.Uint32 - BizID field.Uint32 - - fieldMap map[string]field.Expr -} - -func (g groupAppBind) Table(newTableName string) *groupAppBind { - g.groupAppBindDo.UseTable(newTableName) - return g.updateTableName(newTableName) -} - -func (g groupAppBind) As(alias string) *groupAppBind { - g.groupAppBindDo.DO = *(g.groupAppBindDo.As(alias).(*gen.DO)) - return g.updateTableName(alias) -} - -func (g *groupAppBind) updateTableName(table string) *groupAppBind { - g.ALL = field.NewAsterisk(table) - g.ID = field.NewUint32(table, "id") - g.GroupID = field.NewUint32(table, "group_id") - g.AppID = field.NewUint32(table, "app_id") - g.BizID = field.NewUint32(table, "biz_id") - - g.fillFieldMap() - - return g -} - -func (g *groupAppBind) WithContext(ctx context.Context) IGroupAppBindDo { - return g.groupAppBindDo.WithContext(ctx) -} - -func (g groupAppBind) TableName() string { return g.groupAppBindDo.TableName() } - -func (g groupAppBind) Alias() string { return g.groupAppBindDo.Alias() } - -func (g *groupAppBind) GetFieldByName(fieldName string) (field.OrderExpr, bool) { - _f, ok := g.fieldMap[fieldName] - if !ok || _f == nil { - return nil, false - } - _oe, ok := _f.(field.OrderExpr) - return _oe, ok -} - -func (g *groupAppBind) fillFieldMap() { - g.fieldMap = make(map[string]field.Expr, 4) - g.fieldMap["id"] = g.ID - g.fieldMap["group_id"] = g.GroupID - g.fieldMap["app_id"] = g.AppID - g.fieldMap["biz_id"] = g.BizID -} - -func (g groupAppBind) clone(db *gorm.DB) groupAppBind { - g.groupAppBindDo.ReplaceConnPool(db.Statement.ConnPool) - return g -} - -func (g groupAppBind) replaceDB(db *gorm.DB) groupAppBind { - g.groupAppBindDo.ReplaceDB(db) - return g -} - -type groupAppBindDo struct{ gen.DO } - -type IGroupAppBindDo interface { - gen.SubQuery - Debug() IGroupAppBindDo - WithContext(ctx context.Context) IGroupAppBindDo - WithResult(fc func(tx gen.Dao)) gen.ResultInfo - ReplaceDB(db *gorm.DB) - ReadDB() IGroupAppBindDo - WriteDB() IGroupAppBindDo - As(alias string) gen.Dao - Session(config *gorm.Session) IGroupAppBindDo - Columns(cols ...field.Expr) gen.Columns - Clauses(conds ...clause.Expression) IGroupAppBindDo - Not(conds ...gen.Condition) IGroupAppBindDo - Or(conds ...gen.Condition) IGroupAppBindDo - Select(conds ...field.Expr) IGroupAppBindDo - Where(conds ...gen.Condition) IGroupAppBindDo - Order(conds ...field.Expr) IGroupAppBindDo - Distinct(cols ...field.Expr) IGroupAppBindDo - Omit(cols ...field.Expr) IGroupAppBindDo - Join(table schema.Tabler, on ...field.Expr) IGroupAppBindDo - LeftJoin(table schema.Tabler, on ...field.Expr) IGroupAppBindDo - RightJoin(table schema.Tabler, on ...field.Expr) IGroupAppBindDo - Group(cols ...field.Expr) IGroupAppBindDo - Having(conds ...gen.Condition) IGroupAppBindDo - Limit(limit int) IGroupAppBindDo - Offset(offset int) IGroupAppBindDo - Count() (count int64, err error) - Scopes(funcs ...func(gen.Dao) gen.Dao) IGroupAppBindDo - Unscoped() IGroupAppBindDo - Create(values ...*table.GroupAppBind) error - CreateInBatches(values []*table.GroupAppBind, batchSize int) error - Save(values ...*table.GroupAppBind) error - First() (*table.GroupAppBind, error) - Take() (*table.GroupAppBind, error) - Last() (*table.GroupAppBind, error) - Find() ([]*table.GroupAppBind, error) - FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.GroupAppBind, err error) - FindInBatches(result *[]*table.GroupAppBind, batchSize int, fc func(tx gen.Dao, batch int) error) error - Pluck(column field.Expr, dest interface{}) error - Delete(...*table.GroupAppBind) (info gen.ResultInfo, err error) - Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - Updates(value interface{}) (info gen.ResultInfo, err error) - UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - UpdateColumns(value interface{}) (info gen.ResultInfo, err error) - UpdateFrom(q gen.SubQuery) gen.Dao - Attrs(attrs ...field.AssignExpr) IGroupAppBindDo - Assign(attrs ...field.AssignExpr) IGroupAppBindDo - Joins(fields ...field.RelationField) IGroupAppBindDo - Preload(fields ...field.RelationField) IGroupAppBindDo - FirstOrInit() (*table.GroupAppBind, error) - FirstOrCreate() (*table.GroupAppBind, error) - FindByPage(offset int, limit int) (result []*table.GroupAppBind, count int64, err error) - ScanByPage(result interface{}, offset int, limit int) (count int64, err error) - Scan(result interface{}) (err error) - Returning(value interface{}, columns ...string) IGroupAppBindDo - UnderlyingDB() *gorm.DB - schema.Tabler -} - -func (g groupAppBindDo) Debug() IGroupAppBindDo { - return g.withDO(g.DO.Debug()) -} - -func (g groupAppBindDo) WithContext(ctx context.Context) IGroupAppBindDo { - return g.withDO(g.DO.WithContext(ctx)) -} - -func (g groupAppBindDo) ReadDB() IGroupAppBindDo { - return g.Clauses(dbresolver.Read) -} - -func (g groupAppBindDo) WriteDB() IGroupAppBindDo { - return g.Clauses(dbresolver.Write) -} - -func (g groupAppBindDo) Session(config *gorm.Session) IGroupAppBindDo { - return g.withDO(g.DO.Session(config)) -} - -func (g groupAppBindDo) Clauses(conds ...clause.Expression) IGroupAppBindDo { - return g.withDO(g.DO.Clauses(conds...)) -} - -func (g groupAppBindDo) Returning(value interface{}, columns ...string) IGroupAppBindDo { - return g.withDO(g.DO.Returning(value, columns...)) -} - -func (g groupAppBindDo) Not(conds ...gen.Condition) IGroupAppBindDo { - return g.withDO(g.DO.Not(conds...)) -} - -func (g groupAppBindDo) Or(conds ...gen.Condition) IGroupAppBindDo { - return g.withDO(g.DO.Or(conds...)) -} - -func (g groupAppBindDo) Select(conds ...field.Expr) IGroupAppBindDo { - return g.withDO(g.DO.Select(conds...)) -} - -func (g groupAppBindDo) Where(conds ...gen.Condition) IGroupAppBindDo { - return g.withDO(g.DO.Where(conds...)) -} - -func (g groupAppBindDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IGroupAppBindDo { - return g.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - -func (g groupAppBindDo) Order(conds ...field.Expr) IGroupAppBindDo { - return g.withDO(g.DO.Order(conds...)) -} - -func (g groupAppBindDo) Distinct(cols ...field.Expr) IGroupAppBindDo { - return g.withDO(g.DO.Distinct(cols...)) -} - -func (g groupAppBindDo) Omit(cols ...field.Expr) IGroupAppBindDo { - return g.withDO(g.DO.Omit(cols...)) -} - -func (g groupAppBindDo) Join(table schema.Tabler, on ...field.Expr) IGroupAppBindDo { - return g.withDO(g.DO.Join(table, on...)) -} - -func (g groupAppBindDo) LeftJoin(table schema.Tabler, on ...field.Expr) IGroupAppBindDo { - return g.withDO(g.DO.LeftJoin(table, on...)) -} - -func (g groupAppBindDo) RightJoin(table schema.Tabler, on ...field.Expr) IGroupAppBindDo { - return g.withDO(g.DO.RightJoin(table, on...)) -} - -func (g groupAppBindDo) Group(cols ...field.Expr) IGroupAppBindDo { - return g.withDO(g.DO.Group(cols...)) -} - -func (g groupAppBindDo) Having(conds ...gen.Condition) IGroupAppBindDo { - return g.withDO(g.DO.Having(conds...)) -} - -func (g groupAppBindDo) Limit(limit int) IGroupAppBindDo { - return g.withDO(g.DO.Limit(limit)) -} - -func (g groupAppBindDo) Offset(offset int) IGroupAppBindDo { - return g.withDO(g.DO.Offset(offset)) -} - -func (g groupAppBindDo) Scopes(funcs ...func(gen.Dao) gen.Dao) IGroupAppBindDo { - return g.withDO(g.DO.Scopes(funcs...)) -} - -func (g groupAppBindDo) Unscoped() IGroupAppBindDo { - return g.withDO(g.DO.Unscoped()) -} - -func (g groupAppBindDo) Create(values ...*table.GroupAppBind) error { - if len(values) == 0 { - return nil - } - return g.DO.Create(values) -} - -func (g groupAppBindDo) CreateInBatches(values []*table.GroupAppBind, batchSize int) error { - return g.DO.CreateInBatches(values, batchSize) -} - -// Save : !!! underlying implementation is different with GORM -// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) -func (g groupAppBindDo) Save(values ...*table.GroupAppBind) error { - if len(values) == 0 { - return nil - } - return g.DO.Save(values) -} - -func (g groupAppBindDo) First() (*table.GroupAppBind, error) { - if result, err := g.DO.First(); err != nil { - return nil, err - } else { - return result.(*table.GroupAppBind), nil - } -} - -func (g groupAppBindDo) Take() (*table.GroupAppBind, error) { - if result, err := g.DO.Take(); err != nil { - return nil, err - } else { - return result.(*table.GroupAppBind), nil - } -} - -func (g groupAppBindDo) Last() (*table.GroupAppBind, error) { - if result, err := g.DO.Last(); err != nil { - return nil, err - } else { - return result.(*table.GroupAppBind), nil - } -} - -func (g groupAppBindDo) Find() ([]*table.GroupAppBind, error) { - result, err := g.DO.Find() - return result.([]*table.GroupAppBind), err -} - -func (g groupAppBindDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.GroupAppBind, err error) { - buf := make([]*table.GroupAppBind, 0, batchSize) - err = g.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { - defer func() { results = append(results, buf...) }() - return fc(tx, batch) - }) - return results, err -} - -func (g groupAppBindDo) FindInBatches(result *[]*table.GroupAppBind, batchSize int, fc func(tx gen.Dao, batch int) error) error { - return g.DO.FindInBatches(result, batchSize, fc) -} - -func (g groupAppBindDo) Attrs(attrs ...field.AssignExpr) IGroupAppBindDo { - return g.withDO(g.DO.Attrs(attrs...)) -} - -func (g groupAppBindDo) Assign(attrs ...field.AssignExpr) IGroupAppBindDo { - return g.withDO(g.DO.Assign(attrs...)) -} - -func (g groupAppBindDo) Joins(fields ...field.RelationField) IGroupAppBindDo { - for _, _f := range fields { - g = *g.withDO(g.DO.Joins(_f)) - } - return &g -} - -func (g groupAppBindDo) Preload(fields ...field.RelationField) IGroupAppBindDo { - for _, _f := range fields { - g = *g.withDO(g.DO.Preload(_f)) - } - return &g -} - -func (g groupAppBindDo) FirstOrInit() (*table.GroupAppBind, error) { - if result, err := g.DO.FirstOrInit(); err != nil { - return nil, err - } else { - return result.(*table.GroupAppBind), nil - } -} - -func (g groupAppBindDo) FirstOrCreate() (*table.GroupAppBind, error) { - if result, err := g.DO.FirstOrCreate(); err != nil { - return nil, err - } else { - return result.(*table.GroupAppBind), nil - } -} - -func (g groupAppBindDo) FindByPage(offset int, limit int) (result []*table.GroupAppBind, count int64, err error) { - result, err = g.Offset(offset).Limit(limit).Find() - if err != nil { - return - } - - if size := len(result); 0 < limit && 0 < size && size < limit { - count = int64(size + offset) - return - } - - count, err = g.Offset(-1).Limit(-1).Count() - return -} - -func (g groupAppBindDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { - count, err = g.Count() - if err != nil { - return - } - - err = g.Offset(offset).Limit(limit).Scan(result) - return -} - -func (g groupAppBindDo) Scan(result interface{}) (err error) { - return g.DO.Scan(result) -} - -func (g groupAppBindDo) Delete(models ...*table.GroupAppBind) (result gen.ResultInfo, err error) { - return g.DO.Delete(models) -} - -func (g *groupAppBindDo) withDO(do gen.Dao) *groupAppBindDo { - g.DO = *do.(*gen.DO) - return g -} diff --git a/bcs-services/bcs-bscp/pkg/dal/gen/groups.gen.go b/bcs-services/bcs-bscp/pkg/dal/gen/groups.gen.go deleted file mode 100644 index d98ffe606f..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/gen/groups.gen.go +++ /dev/null @@ -1,430 +0,0 @@ -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. - -package gen - -import ( - "context" - - "gorm.io/gorm" - "gorm.io/gorm/clause" - "gorm.io/gorm/schema" - - "gorm.io/gen" - "gorm.io/gen/field" - - "gorm.io/plugin/dbresolver" - - "bscp.io/pkg/dal/table" -) - -func newGroup(db *gorm.DB, opts ...gen.DOOption) group { - _group := group{} - - _group.groupDo.UseDB(db, opts...) - _group.groupDo.UseModel(&table.Group{}) - - tableName := _group.groupDo.TableName() - _group.ALL = field.NewAsterisk(tableName) - _group.ID = field.NewUint32(tableName, "id") - _group.Name = field.NewString(tableName, "name") - _group.Public = field.NewBool(tableName, "public") - _group.Mode = field.NewString(tableName, "mode") - _group.Selector = field.NewField(tableName, "selector") - _group.UID = field.NewString(tableName, "uid") - _group.BizID = field.NewUint32(tableName, "biz_id") - _group.Creator = field.NewString(tableName, "creator") - _group.Reviser = field.NewString(tableName, "reviser") - _group.CreatedAt = field.NewTime(tableName, "created_at") - _group.UpdatedAt = field.NewTime(tableName, "updated_at") - - _group.fillFieldMap() - - return _group -} - -type group struct { - groupDo groupDo - - ALL field.Asterisk - ID field.Uint32 - Name field.String - Public field.Bool - Mode field.String - Selector field.Field - UID field.String - BizID field.Uint32 - Creator field.String - Reviser field.String - CreatedAt field.Time - UpdatedAt field.Time - - fieldMap map[string]field.Expr -} - -func (g group) Table(newTableName string) *group { - g.groupDo.UseTable(newTableName) - return g.updateTableName(newTableName) -} - -func (g group) As(alias string) *group { - g.groupDo.DO = *(g.groupDo.As(alias).(*gen.DO)) - return g.updateTableName(alias) -} - -func (g *group) updateTableName(table string) *group { - g.ALL = field.NewAsterisk(table) - g.ID = field.NewUint32(table, "id") - g.Name = field.NewString(table, "name") - g.Public = field.NewBool(table, "public") - g.Mode = field.NewString(table, "mode") - g.Selector = field.NewField(table, "selector") - g.UID = field.NewString(table, "uid") - g.BizID = field.NewUint32(table, "biz_id") - g.Creator = field.NewString(table, "creator") - g.Reviser = field.NewString(table, "reviser") - g.CreatedAt = field.NewTime(table, "created_at") - g.UpdatedAt = field.NewTime(table, "updated_at") - - g.fillFieldMap() - - return g -} - -func (g *group) WithContext(ctx context.Context) IGroupDo { return g.groupDo.WithContext(ctx) } - -func (g group) TableName() string { return g.groupDo.TableName() } - -func (g group) Alias() string { return g.groupDo.Alias() } - -func (g *group) GetFieldByName(fieldName string) (field.OrderExpr, bool) { - _f, ok := g.fieldMap[fieldName] - if !ok || _f == nil { - return nil, false - } - _oe, ok := _f.(field.OrderExpr) - return _oe, ok -} - -func (g *group) fillFieldMap() { - g.fieldMap = make(map[string]field.Expr, 11) - g.fieldMap["id"] = g.ID - g.fieldMap["name"] = g.Name - g.fieldMap["public"] = g.Public - g.fieldMap["mode"] = g.Mode - g.fieldMap["selector"] = g.Selector - g.fieldMap["uid"] = g.UID - g.fieldMap["biz_id"] = g.BizID - g.fieldMap["creator"] = g.Creator - g.fieldMap["reviser"] = g.Reviser - g.fieldMap["created_at"] = g.CreatedAt - g.fieldMap["updated_at"] = g.UpdatedAt -} - -func (g group) clone(db *gorm.DB) group { - g.groupDo.ReplaceConnPool(db.Statement.ConnPool) - return g -} - -func (g group) replaceDB(db *gorm.DB) group { - g.groupDo.ReplaceDB(db) - return g -} - -type groupDo struct{ gen.DO } - -type IGroupDo interface { - gen.SubQuery - Debug() IGroupDo - WithContext(ctx context.Context) IGroupDo - WithResult(fc func(tx gen.Dao)) gen.ResultInfo - ReplaceDB(db *gorm.DB) - ReadDB() IGroupDo - WriteDB() IGroupDo - As(alias string) gen.Dao - Session(config *gorm.Session) IGroupDo - Columns(cols ...field.Expr) gen.Columns - Clauses(conds ...clause.Expression) IGroupDo - Not(conds ...gen.Condition) IGroupDo - Or(conds ...gen.Condition) IGroupDo - Select(conds ...field.Expr) IGroupDo - Where(conds ...gen.Condition) IGroupDo - Order(conds ...field.Expr) IGroupDo - Distinct(cols ...field.Expr) IGroupDo - Omit(cols ...field.Expr) IGroupDo - Join(table schema.Tabler, on ...field.Expr) IGroupDo - LeftJoin(table schema.Tabler, on ...field.Expr) IGroupDo - RightJoin(table schema.Tabler, on ...field.Expr) IGroupDo - Group(cols ...field.Expr) IGroupDo - Having(conds ...gen.Condition) IGroupDo - Limit(limit int) IGroupDo - Offset(offset int) IGroupDo - Count() (count int64, err error) - Scopes(funcs ...func(gen.Dao) gen.Dao) IGroupDo - Unscoped() IGroupDo - Create(values ...*table.Group) error - CreateInBatches(values []*table.Group, batchSize int) error - Save(values ...*table.Group) error - First() (*table.Group, error) - Take() (*table.Group, error) - Last() (*table.Group, error) - Find() ([]*table.Group, error) - FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.Group, err error) - FindInBatches(result *[]*table.Group, batchSize int, fc func(tx gen.Dao, batch int) error) error - Pluck(column field.Expr, dest interface{}) error - Delete(...*table.Group) (info gen.ResultInfo, err error) - Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - Updates(value interface{}) (info gen.ResultInfo, err error) - UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - UpdateColumns(value interface{}) (info gen.ResultInfo, err error) - UpdateFrom(q gen.SubQuery) gen.Dao - Attrs(attrs ...field.AssignExpr) IGroupDo - Assign(attrs ...field.AssignExpr) IGroupDo - Joins(fields ...field.RelationField) IGroupDo - Preload(fields ...field.RelationField) IGroupDo - FirstOrInit() (*table.Group, error) - FirstOrCreate() (*table.Group, error) - FindByPage(offset int, limit int) (result []*table.Group, count int64, err error) - ScanByPage(result interface{}, offset int, limit int) (count int64, err error) - Scan(result interface{}) (err error) - Returning(value interface{}, columns ...string) IGroupDo - UnderlyingDB() *gorm.DB - schema.Tabler -} - -func (g groupDo) Debug() IGroupDo { - return g.withDO(g.DO.Debug()) -} - -func (g groupDo) WithContext(ctx context.Context) IGroupDo { - return g.withDO(g.DO.WithContext(ctx)) -} - -func (g groupDo) ReadDB() IGroupDo { - return g.Clauses(dbresolver.Read) -} - -func (g groupDo) WriteDB() IGroupDo { - return g.Clauses(dbresolver.Write) -} - -func (g groupDo) Session(config *gorm.Session) IGroupDo { - return g.withDO(g.DO.Session(config)) -} - -func (g groupDo) Clauses(conds ...clause.Expression) IGroupDo { - return g.withDO(g.DO.Clauses(conds...)) -} - -func (g groupDo) Returning(value interface{}, columns ...string) IGroupDo { - return g.withDO(g.DO.Returning(value, columns...)) -} - -func (g groupDo) Not(conds ...gen.Condition) IGroupDo { - return g.withDO(g.DO.Not(conds...)) -} - -func (g groupDo) Or(conds ...gen.Condition) IGroupDo { - return g.withDO(g.DO.Or(conds...)) -} - -func (g groupDo) Select(conds ...field.Expr) IGroupDo { - return g.withDO(g.DO.Select(conds...)) -} - -func (g groupDo) Where(conds ...gen.Condition) IGroupDo { - return g.withDO(g.DO.Where(conds...)) -} - -func (g groupDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IGroupDo { - return g.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - -func (g groupDo) Order(conds ...field.Expr) IGroupDo { - return g.withDO(g.DO.Order(conds...)) -} - -func (g groupDo) Distinct(cols ...field.Expr) IGroupDo { - return g.withDO(g.DO.Distinct(cols...)) -} - -func (g groupDo) Omit(cols ...field.Expr) IGroupDo { - return g.withDO(g.DO.Omit(cols...)) -} - -func (g groupDo) Join(table schema.Tabler, on ...field.Expr) IGroupDo { - return g.withDO(g.DO.Join(table, on...)) -} - -func (g groupDo) LeftJoin(table schema.Tabler, on ...field.Expr) IGroupDo { - return g.withDO(g.DO.LeftJoin(table, on...)) -} - -func (g groupDo) RightJoin(table schema.Tabler, on ...field.Expr) IGroupDo { - return g.withDO(g.DO.RightJoin(table, on...)) -} - -func (g groupDo) Group(cols ...field.Expr) IGroupDo { - return g.withDO(g.DO.Group(cols...)) -} - -func (g groupDo) Having(conds ...gen.Condition) IGroupDo { - return g.withDO(g.DO.Having(conds...)) -} - -func (g groupDo) Limit(limit int) IGroupDo { - return g.withDO(g.DO.Limit(limit)) -} - -func (g groupDo) Offset(offset int) IGroupDo { - return g.withDO(g.DO.Offset(offset)) -} - -func (g groupDo) Scopes(funcs ...func(gen.Dao) gen.Dao) IGroupDo { - return g.withDO(g.DO.Scopes(funcs...)) -} - -func (g groupDo) Unscoped() IGroupDo { - return g.withDO(g.DO.Unscoped()) -} - -func (g groupDo) Create(values ...*table.Group) error { - if len(values) == 0 { - return nil - } - return g.DO.Create(values) -} - -func (g groupDo) CreateInBatches(values []*table.Group, batchSize int) error { - return g.DO.CreateInBatches(values, batchSize) -} - -// Save : !!! underlying implementation is different with GORM -// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) -func (g groupDo) Save(values ...*table.Group) error { - if len(values) == 0 { - return nil - } - return g.DO.Save(values) -} - -func (g groupDo) First() (*table.Group, error) { - if result, err := g.DO.First(); err != nil { - return nil, err - } else { - return result.(*table.Group), nil - } -} - -func (g groupDo) Take() (*table.Group, error) { - if result, err := g.DO.Take(); err != nil { - return nil, err - } else { - return result.(*table.Group), nil - } -} - -func (g groupDo) Last() (*table.Group, error) { - if result, err := g.DO.Last(); err != nil { - return nil, err - } else { - return result.(*table.Group), nil - } -} - -func (g groupDo) Find() ([]*table.Group, error) { - result, err := g.DO.Find() - return result.([]*table.Group), err -} - -func (g groupDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.Group, err error) { - buf := make([]*table.Group, 0, batchSize) - err = g.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { - defer func() { results = append(results, buf...) }() - return fc(tx, batch) - }) - return results, err -} - -func (g groupDo) FindInBatches(result *[]*table.Group, batchSize int, fc func(tx gen.Dao, batch int) error) error { - return g.DO.FindInBatches(result, batchSize, fc) -} - -func (g groupDo) Attrs(attrs ...field.AssignExpr) IGroupDo { - return g.withDO(g.DO.Attrs(attrs...)) -} - -func (g groupDo) Assign(attrs ...field.AssignExpr) IGroupDo { - return g.withDO(g.DO.Assign(attrs...)) -} - -func (g groupDo) Joins(fields ...field.RelationField) IGroupDo { - for _, _f := range fields { - g = *g.withDO(g.DO.Joins(_f)) - } - return &g -} - -func (g groupDo) Preload(fields ...field.RelationField) IGroupDo { - for _, _f := range fields { - g = *g.withDO(g.DO.Preload(_f)) - } - return &g -} - -func (g groupDo) FirstOrInit() (*table.Group, error) { - if result, err := g.DO.FirstOrInit(); err != nil { - return nil, err - } else { - return result.(*table.Group), nil - } -} - -func (g groupDo) FirstOrCreate() (*table.Group, error) { - if result, err := g.DO.FirstOrCreate(); err != nil { - return nil, err - } else { - return result.(*table.Group), nil - } -} - -func (g groupDo) FindByPage(offset int, limit int) (result []*table.Group, count int64, err error) { - result, err = g.Offset(offset).Limit(limit).Find() - if err != nil { - return - } - - if size := len(result); 0 < limit && 0 < size && size < limit { - count = int64(size + offset) - return - } - - count, err = g.Offset(-1).Limit(-1).Count() - return -} - -func (g groupDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { - count, err = g.Count() - if err != nil { - return - } - - err = g.Offset(offset).Limit(limit).Scan(result) - return -} - -func (g groupDo) Scan(result interface{}) (err error) { - return g.DO.Scan(result) -} - -func (g groupDo) Delete(models ...*table.Group) (result gen.ResultInfo, err error) { - return g.DO.Delete(models) -} - -func (g *groupDo) withDO(do gen.Dao) *groupDo { - g.DO = *do.(*gen.DO) - return g -} diff --git a/bcs-services/bcs-bscp/pkg/dal/gen/hook_releases.gen.go b/bcs-services/bcs-bscp/pkg/dal/gen/hook_releases.gen.go deleted file mode 100644 index d7c99d9f31..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/gen/hook_releases.gen.go +++ /dev/null @@ -1,436 +0,0 @@ -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. - -package gen - -import ( - "context" - - "gorm.io/gorm" - "gorm.io/gorm/clause" - "gorm.io/gorm/schema" - - "gorm.io/gen" - "gorm.io/gen/field" - - "gorm.io/plugin/dbresolver" - - "bscp.io/pkg/dal/table" -) - -func newHookRelease(db *gorm.DB, opts ...gen.DOOption) hookRelease { - _hookRelease := hookRelease{} - - _hookRelease.hookReleaseDo.UseDB(db, opts...) - _hookRelease.hookReleaseDo.UseModel(&table.HookRelease{}) - - tableName := _hookRelease.hookReleaseDo.TableName() - _hookRelease.ALL = field.NewAsterisk(tableName) - _hookRelease.ID = field.NewUint32(tableName, "id") - _hookRelease.Name = field.NewString(tableName, "name") - _hookRelease.PublishNum = field.NewUint32(tableName, "publish_num") - _hookRelease.State = field.NewString(tableName, "state") - _hookRelease.Content = field.NewString(tableName, "content") - _hookRelease.Memo = field.NewString(tableName, "memo") - _hookRelease.BizID = field.NewUint32(tableName, "biz_id") - _hookRelease.HookID = field.NewUint32(tableName, "hook_id") - _hookRelease.Creator = field.NewString(tableName, "creator") - _hookRelease.Reviser = field.NewString(tableName, "reviser") - _hookRelease.CreatedAt = field.NewTime(tableName, "created_at") - _hookRelease.UpdatedAt = field.NewTime(tableName, "updated_at") - - _hookRelease.fillFieldMap() - - return _hookRelease -} - -type hookRelease struct { - hookReleaseDo hookReleaseDo - - ALL field.Asterisk - ID field.Uint32 - Name field.String - PublishNum field.Uint32 - State field.String - Content field.String - Memo field.String - BizID field.Uint32 - HookID field.Uint32 - Creator field.String - Reviser field.String - CreatedAt field.Time - UpdatedAt field.Time - - fieldMap map[string]field.Expr -} - -func (h hookRelease) Table(newTableName string) *hookRelease { - h.hookReleaseDo.UseTable(newTableName) - return h.updateTableName(newTableName) -} - -func (h hookRelease) As(alias string) *hookRelease { - h.hookReleaseDo.DO = *(h.hookReleaseDo.As(alias).(*gen.DO)) - return h.updateTableName(alias) -} - -func (h *hookRelease) updateTableName(table string) *hookRelease { - h.ALL = field.NewAsterisk(table) - h.ID = field.NewUint32(table, "id") - h.Name = field.NewString(table, "name") - h.PublishNum = field.NewUint32(table, "publish_num") - h.State = field.NewString(table, "state") - h.Content = field.NewString(table, "content") - h.Memo = field.NewString(table, "memo") - h.BizID = field.NewUint32(table, "biz_id") - h.HookID = field.NewUint32(table, "hook_id") - h.Creator = field.NewString(table, "creator") - h.Reviser = field.NewString(table, "reviser") - h.CreatedAt = field.NewTime(table, "created_at") - h.UpdatedAt = field.NewTime(table, "updated_at") - - h.fillFieldMap() - - return h -} - -func (h *hookRelease) WithContext(ctx context.Context) IHookReleaseDo { - return h.hookReleaseDo.WithContext(ctx) -} - -func (h hookRelease) TableName() string { return h.hookReleaseDo.TableName() } - -func (h hookRelease) Alias() string { return h.hookReleaseDo.Alias() } - -func (h *hookRelease) GetFieldByName(fieldName string) (field.OrderExpr, bool) { - _f, ok := h.fieldMap[fieldName] - if !ok || _f == nil { - return nil, false - } - _oe, ok := _f.(field.OrderExpr) - return _oe, ok -} - -func (h *hookRelease) fillFieldMap() { - h.fieldMap = make(map[string]field.Expr, 12) - h.fieldMap["id"] = h.ID - h.fieldMap["name"] = h.Name - h.fieldMap["publish_num"] = h.PublishNum - h.fieldMap["state"] = h.State - h.fieldMap["content"] = h.Content - h.fieldMap["memo"] = h.Memo - h.fieldMap["biz_id"] = h.BizID - h.fieldMap["hook_id"] = h.HookID - h.fieldMap["creator"] = h.Creator - h.fieldMap["reviser"] = h.Reviser - h.fieldMap["created_at"] = h.CreatedAt - h.fieldMap["updated_at"] = h.UpdatedAt -} - -func (h hookRelease) clone(db *gorm.DB) hookRelease { - h.hookReleaseDo.ReplaceConnPool(db.Statement.ConnPool) - return h -} - -func (h hookRelease) replaceDB(db *gorm.DB) hookRelease { - h.hookReleaseDo.ReplaceDB(db) - return h -} - -type hookReleaseDo struct{ gen.DO } - -type IHookReleaseDo interface { - gen.SubQuery - Debug() IHookReleaseDo - WithContext(ctx context.Context) IHookReleaseDo - WithResult(fc func(tx gen.Dao)) gen.ResultInfo - ReplaceDB(db *gorm.DB) - ReadDB() IHookReleaseDo - WriteDB() IHookReleaseDo - As(alias string) gen.Dao - Session(config *gorm.Session) IHookReleaseDo - Columns(cols ...field.Expr) gen.Columns - Clauses(conds ...clause.Expression) IHookReleaseDo - Not(conds ...gen.Condition) IHookReleaseDo - Or(conds ...gen.Condition) IHookReleaseDo - Select(conds ...field.Expr) IHookReleaseDo - Where(conds ...gen.Condition) IHookReleaseDo - Order(conds ...field.Expr) IHookReleaseDo - Distinct(cols ...field.Expr) IHookReleaseDo - Omit(cols ...field.Expr) IHookReleaseDo - Join(table schema.Tabler, on ...field.Expr) IHookReleaseDo - LeftJoin(table schema.Tabler, on ...field.Expr) IHookReleaseDo - RightJoin(table schema.Tabler, on ...field.Expr) IHookReleaseDo - Group(cols ...field.Expr) IHookReleaseDo - Having(conds ...gen.Condition) IHookReleaseDo - Limit(limit int) IHookReleaseDo - Offset(offset int) IHookReleaseDo - Count() (count int64, err error) - Scopes(funcs ...func(gen.Dao) gen.Dao) IHookReleaseDo - Unscoped() IHookReleaseDo - Create(values ...*table.HookRelease) error - CreateInBatches(values []*table.HookRelease, batchSize int) error - Save(values ...*table.HookRelease) error - First() (*table.HookRelease, error) - Take() (*table.HookRelease, error) - Last() (*table.HookRelease, error) - Find() ([]*table.HookRelease, error) - FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.HookRelease, err error) - FindInBatches(result *[]*table.HookRelease, batchSize int, fc func(tx gen.Dao, batch int) error) error - Pluck(column field.Expr, dest interface{}) error - Delete(...*table.HookRelease) (info gen.ResultInfo, err error) - Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - Updates(value interface{}) (info gen.ResultInfo, err error) - UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - UpdateColumns(value interface{}) (info gen.ResultInfo, err error) - UpdateFrom(q gen.SubQuery) gen.Dao - Attrs(attrs ...field.AssignExpr) IHookReleaseDo - Assign(attrs ...field.AssignExpr) IHookReleaseDo - Joins(fields ...field.RelationField) IHookReleaseDo - Preload(fields ...field.RelationField) IHookReleaseDo - FirstOrInit() (*table.HookRelease, error) - FirstOrCreate() (*table.HookRelease, error) - FindByPage(offset int, limit int) (result []*table.HookRelease, count int64, err error) - ScanByPage(result interface{}, offset int, limit int) (count int64, err error) - Scan(result interface{}) (err error) - Returning(value interface{}, columns ...string) IHookReleaseDo - UnderlyingDB() *gorm.DB - schema.Tabler -} - -func (h hookReleaseDo) Debug() IHookReleaseDo { - return h.withDO(h.DO.Debug()) -} - -func (h hookReleaseDo) WithContext(ctx context.Context) IHookReleaseDo { - return h.withDO(h.DO.WithContext(ctx)) -} - -func (h hookReleaseDo) ReadDB() IHookReleaseDo { - return h.Clauses(dbresolver.Read) -} - -func (h hookReleaseDo) WriteDB() IHookReleaseDo { - return h.Clauses(dbresolver.Write) -} - -func (h hookReleaseDo) Session(config *gorm.Session) IHookReleaseDo { - return h.withDO(h.DO.Session(config)) -} - -func (h hookReleaseDo) Clauses(conds ...clause.Expression) IHookReleaseDo { - return h.withDO(h.DO.Clauses(conds...)) -} - -func (h hookReleaseDo) Returning(value interface{}, columns ...string) IHookReleaseDo { - return h.withDO(h.DO.Returning(value, columns...)) -} - -func (h hookReleaseDo) Not(conds ...gen.Condition) IHookReleaseDo { - return h.withDO(h.DO.Not(conds...)) -} - -func (h hookReleaseDo) Or(conds ...gen.Condition) IHookReleaseDo { - return h.withDO(h.DO.Or(conds...)) -} - -func (h hookReleaseDo) Select(conds ...field.Expr) IHookReleaseDo { - return h.withDO(h.DO.Select(conds...)) -} - -func (h hookReleaseDo) Where(conds ...gen.Condition) IHookReleaseDo { - return h.withDO(h.DO.Where(conds...)) -} - -func (h hookReleaseDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IHookReleaseDo { - return h.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - -func (h hookReleaseDo) Order(conds ...field.Expr) IHookReleaseDo { - return h.withDO(h.DO.Order(conds...)) -} - -func (h hookReleaseDo) Distinct(cols ...field.Expr) IHookReleaseDo { - return h.withDO(h.DO.Distinct(cols...)) -} - -func (h hookReleaseDo) Omit(cols ...field.Expr) IHookReleaseDo { - return h.withDO(h.DO.Omit(cols...)) -} - -func (h hookReleaseDo) Join(table schema.Tabler, on ...field.Expr) IHookReleaseDo { - return h.withDO(h.DO.Join(table, on...)) -} - -func (h hookReleaseDo) LeftJoin(table schema.Tabler, on ...field.Expr) IHookReleaseDo { - return h.withDO(h.DO.LeftJoin(table, on...)) -} - -func (h hookReleaseDo) RightJoin(table schema.Tabler, on ...field.Expr) IHookReleaseDo { - return h.withDO(h.DO.RightJoin(table, on...)) -} - -func (h hookReleaseDo) Group(cols ...field.Expr) IHookReleaseDo { - return h.withDO(h.DO.Group(cols...)) -} - -func (h hookReleaseDo) Having(conds ...gen.Condition) IHookReleaseDo { - return h.withDO(h.DO.Having(conds...)) -} - -func (h hookReleaseDo) Limit(limit int) IHookReleaseDo { - return h.withDO(h.DO.Limit(limit)) -} - -func (h hookReleaseDo) Offset(offset int) IHookReleaseDo { - return h.withDO(h.DO.Offset(offset)) -} - -func (h hookReleaseDo) Scopes(funcs ...func(gen.Dao) gen.Dao) IHookReleaseDo { - return h.withDO(h.DO.Scopes(funcs...)) -} - -func (h hookReleaseDo) Unscoped() IHookReleaseDo { - return h.withDO(h.DO.Unscoped()) -} - -func (h hookReleaseDo) Create(values ...*table.HookRelease) error { - if len(values) == 0 { - return nil - } - return h.DO.Create(values) -} - -func (h hookReleaseDo) CreateInBatches(values []*table.HookRelease, batchSize int) error { - return h.DO.CreateInBatches(values, batchSize) -} - -// Save : !!! underlying implementation is different with GORM -// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) -func (h hookReleaseDo) Save(values ...*table.HookRelease) error { - if len(values) == 0 { - return nil - } - return h.DO.Save(values) -} - -func (h hookReleaseDo) First() (*table.HookRelease, error) { - if result, err := h.DO.First(); err != nil { - return nil, err - } else { - return result.(*table.HookRelease), nil - } -} - -func (h hookReleaseDo) Take() (*table.HookRelease, error) { - if result, err := h.DO.Take(); err != nil { - return nil, err - } else { - return result.(*table.HookRelease), nil - } -} - -func (h hookReleaseDo) Last() (*table.HookRelease, error) { - if result, err := h.DO.Last(); err != nil { - return nil, err - } else { - return result.(*table.HookRelease), nil - } -} - -func (h hookReleaseDo) Find() ([]*table.HookRelease, error) { - result, err := h.DO.Find() - return result.([]*table.HookRelease), err -} - -func (h hookReleaseDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.HookRelease, err error) { - buf := make([]*table.HookRelease, 0, batchSize) - err = h.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { - defer func() { results = append(results, buf...) }() - return fc(tx, batch) - }) - return results, err -} - -func (h hookReleaseDo) FindInBatches(result *[]*table.HookRelease, batchSize int, fc func(tx gen.Dao, batch int) error) error { - return h.DO.FindInBatches(result, batchSize, fc) -} - -func (h hookReleaseDo) Attrs(attrs ...field.AssignExpr) IHookReleaseDo { - return h.withDO(h.DO.Attrs(attrs...)) -} - -func (h hookReleaseDo) Assign(attrs ...field.AssignExpr) IHookReleaseDo { - return h.withDO(h.DO.Assign(attrs...)) -} - -func (h hookReleaseDo) Joins(fields ...field.RelationField) IHookReleaseDo { - for _, _f := range fields { - h = *h.withDO(h.DO.Joins(_f)) - } - return &h -} - -func (h hookReleaseDo) Preload(fields ...field.RelationField) IHookReleaseDo { - for _, _f := range fields { - h = *h.withDO(h.DO.Preload(_f)) - } - return &h -} - -func (h hookReleaseDo) FirstOrInit() (*table.HookRelease, error) { - if result, err := h.DO.FirstOrInit(); err != nil { - return nil, err - } else { - return result.(*table.HookRelease), nil - } -} - -func (h hookReleaseDo) FirstOrCreate() (*table.HookRelease, error) { - if result, err := h.DO.FirstOrCreate(); err != nil { - return nil, err - } else { - return result.(*table.HookRelease), nil - } -} - -func (h hookReleaseDo) FindByPage(offset int, limit int) (result []*table.HookRelease, count int64, err error) { - result, err = h.Offset(offset).Limit(limit).Find() - if err != nil { - return - } - - if size := len(result); 0 < limit && 0 < size && size < limit { - count = int64(size + offset) - return - } - - count, err = h.Offset(-1).Limit(-1).Count() - return -} - -func (h hookReleaseDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { - count, err = h.Count() - if err != nil { - return - } - - err = h.Offset(offset).Limit(limit).Scan(result) - return -} - -func (h hookReleaseDo) Scan(result interface{}) (err error) { - return h.DO.Scan(result) -} - -func (h hookReleaseDo) Delete(models ...*table.HookRelease) (result gen.ResultInfo, err error) { - return h.DO.Delete(models) -} - -func (h *hookReleaseDo) withDO(do gen.Dao) *hookReleaseDo { - h.DO = *do.(*gen.DO) - return h -} diff --git a/bcs-services/bcs-bscp/pkg/dal/gen/hooks.gen.go b/bcs-services/bcs-bscp/pkg/dal/gen/hooks.gen.go deleted file mode 100644 index 6a3d41d261..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/gen/hooks.gen.go +++ /dev/null @@ -1,430 +0,0 @@ -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. - -package gen - -import ( - "context" - - "gorm.io/gorm" - "gorm.io/gorm/clause" - "gorm.io/gorm/schema" - - "gorm.io/gen" - "gorm.io/gen/field" - - "gorm.io/plugin/dbresolver" - - "bscp.io/pkg/dal/table" -) - -func newHook(db *gorm.DB, opts ...gen.DOOption) hook { - _hook := hook{} - - _hook.hookDo.UseDB(db, opts...) - _hook.hookDo.UseModel(&table.Hook{}) - - tableName := _hook.hookDo.TableName() - _hook.ALL = field.NewAsterisk(tableName) - _hook.ID = field.NewUint32(tableName, "id") - _hook.Name = field.NewString(tableName, "name") - _hook.Type = field.NewString(tableName, "type") - _hook.PublishNum = field.NewUint32(tableName, "publish_num") - _hook.Tag = field.NewString(tableName, "tag") - _hook.Memo = field.NewString(tableName, "memo") - _hook.BizID = field.NewUint32(tableName, "biz_id") - _hook.Creator = field.NewString(tableName, "creator") - _hook.Reviser = field.NewString(tableName, "reviser") - _hook.CreatedAt = field.NewTime(tableName, "created_at") - _hook.UpdatedAt = field.NewTime(tableName, "updated_at") - - _hook.fillFieldMap() - - return _hook -} - -type hook struct { - hookDo hookDo - - ALL field.Asterisk - ID field.Uint32 - Name field.String - Type field.String - PublishNum field.Uint32 - Tag field.String - Memo field.String - BizID field.Uint32 - Creator field.String - Reviser field.String - CreatedAt field.Time - UpdatedAt field.Time - - fieldMap map[string]field.Expr -} - -func (h hook) Table(newTableName string) *hook { - h.hookDo.UseTable(newTableName) - return h.updateTableName(newTableName) -} - -func (h hook) As(alias string) *hook { - h.hookDo.DO = *(h.hookDo.As(alias).(*gen.DO)) - return h.updateTableName(alias) -} - -func (h *hook) updateTableName(table string) *hook { - h.ALL = field.NewAsterisk(table) - h.ID = field.NewUint32(table, "id") - h.Name = field.NewString(table, "name") - h.Type = field.NewString(table, "type") - h.PublishNum = field.NewUint32(table, "publish_num") - h.Tag = field.NewString(table, "tag") - h.Memo = field.NewString(table, "memo") - h.BizID = field.NewUint32(table, "biz_id") - h.Creator = field.NewString(table, "creator") - h.Reviser = field.NewString(table, "reviser") - h.CreatedAt = field.NewTime(table, "created_at") - h.UpdatedAt = field.NewTime(table, "updated_at") - - h.fillFieldMap() - - return h -} - -func (h *hook) WithContext(ctx context.Context) IHookDo { return h.hookDo.WithContext(ctx) } - -func (h hook) TableName() string { return h.hookDo.TableName() } - -func (h hook) Alias() string { return h.hookDo.Alias() } - -func (h *hook) GetFieldByName(fieldName string) (field.OrderExpr, bool) { - _f, ok := h.fieldMap[fieldName] - if !ok || _f == nil { - return nil, false - } - _oe, ok := _f.(field.OrderExpr) - return _oe, ok -} - -func (h *hook) fillFieldMap() { - h.fieldMap = make(map[string]field.Expr, 11) - h.fieldMap["id"] = h.ID - h.fieldMap["name"] = h.Name - h.fieldMap["type"] = h.Type - h.fieldMap["publish_num"] = h.PublishNum - h.fieldMap["tag"] = h.Tag - h.fieldMap["memo"] = h.Memo - h.fieldMap["biz_id"] = h.BizID - h.fieldMap["creator"] = h.Creator - h.fieldMap["reviser"] = h.Reviser - h.fieldMap["created_at"] = h.CreatedAt - h.fieldMap["updated_at"] = h.UpdatedAt -} - -func (h hook) clone(db *gorm.DB) hook { - h.hookDo.ReplaceConnPool(db.Statement.ConnPool) - return h -} - -func (h hook) replaceDB(db *gorm.DB) hook { - h.hookDo.ReplaceDB(db) - return h -} - -type hookDo struct{ gen.DO } - -type IHookDo interface { - gen.SubQuery - Debug() IHookDo - WithContext(ctx context.Context) IHookDo - WithResult(fc func(tx gen.Dao)) gen.ResultInfo - ReplaceDB(db *gorm.DB) - ReadDB() IHookDo - WriteDB() IHookDo - As(alias string) gen.Dao - Session(config *gorm.Session) IHookDo - Columns(cols ...field.Expr) gen.Columns - Clauses(conds ...clause.Expression) IHookDo - Not(conds ...gen.Condition) IHookDo - Or(conds ...gen.Condition) IHookDo - Select(conds ...field.Expr) IHookDo - Where(conds ...gen.Condition) IHookDo - Order(conds ...field.Expr) IHookDo - Distinct(cols ...field.Expr) IHookDo - Omit(cols ...field.Expr) IHookDo - Join(table schema.Tabler, on ...field.Expr) IHookDo - LeftJoin(table schema.Tabler, on ...field.Expr) IHookDo - RightJoin(table schema.Tabler, on ...field.Expr) IHookDo - Group(cols ...field.Expr) IHookDo - Having(conds ...gen.Condition) IHookDo - Limit(limit int) IHookDo - Offset(offset int) IHookDo - Count() (count int64, err error) - Scopes(funcs ...func(gen.Dao) gen.Dao) IHookDo - Unscoped() IHookDo - Create(values ...*table.Hook) error - CreateInBatches(values []*table.Hook, batchSize int) error - Save(values ...*table.Hook) error - First() (*table.Hook, error) - Take() (*table.Hook, error) - Last() (*table.Hook, error) - Find() ([]*table.Hook, error) - FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.Hook, err error) - FindInBatches(result *[]*table.Hook, batchSize int, fc func(tx gen.Dao, batch int) error) error - Pluck(column field.Expr, dest interface{}) error - Delete(...*table.Hook) (info gen.ResultInfo, err error) - Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - Updates(value interface{}) (info gen.ResultInfo, err error) - UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - UpdateColumns(value interface{}) (info gen.ResultInfo, err error) - UpdateFrom(q gen.SubQuery) gen.Dao - Attrs(attrs ...field.AssignExpr) IHookDo - Assign(attrs ...field.AssignExpr) IHookDo - Joins(fields ...field.RelationField) IHookDo - Preload(fields ...field.RelationField) IHookDo - FirstOrInit() (*table.Hook, error) - FirstOrCreate() (*table.Hook, error) - FindByPage(offset int, limit int) (result []*table.Hook, count int64, err error) - ScanByPage(result interface{}, offset int, limit int) (count int64, err error) - Scan(result interface{}) (err error) - Returning(value interface{}, columns ...string) IHookDo - UnderlyingDB() *gorm.DB - schema.Tabler -} - -func (h hookDo) Debug() IHookDo { - return h.withDO(h.DO.Debug()) -} - -func (h hookDo) WithContext(ctx context.Context) IHookDo { - return h.withDO(h.DO.WithContext(ctx)) -} - -func (h hookDo) ReadDB() IHookDo { - return h.Clauses(dbresolver.Read) -} - -func (h hookDo) WriteDB() IHookDo { - return h.Clauses(dbresolver.Write) -} - -func (h hookDo) Session(config *gorm.Session) IHookDo { - return h.withDO(h.DO.Session(config)) -} - -func (h hookDo) Clauses(conds ...clause.Expression) IHookDo { - return h.withDO(h.DO.Clauses(conds...)) -} - -func (h hookDo) Returning(value interface{}, columns ...string) IHookDo { - return h.withDO(h.DO.Returning(value, columns...)) -} - -func (h hookDo) Not(conds ...gen.Condition) IHookDo { - return h.withDO(h.DO.Not(conds...)) -} - -func (h hookDo) Or(conds ...gen.Condition) IHookDo { - return h.withDO(h.DO.Or(conds...)) -} - -func (h hookDo) Select(conds ...field.Expr) IHookDo { - return h.withDO(h.DO.Select(conds...)) -} - -func (h hookDo) Where(conds ...gen.Condition) IHookDo { - return h.withDO(h.DO.Where(conds...)) -} - -func (h hookDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IHookDo { - return h.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - -func (h hookDo) Order(conds ...field.Expr) IHookDo { - return h.withDO(h.DO.Order(conds...)) -} - -func (h hookDo) Distinct(cols ...field.Expr) IHookDo { - return h.withDO(h.DO.Distinct(cols...)) -} - -func (h hookDo) Omit(cols ...field.Expr) IHookDo { - return h.withDO(h.DO.Omit(cols...)) -} - -func (h hookDo) Join(table schema.Tabler, on ...field.Expr) IHookDo { - return h.withDO(h.DO.Join(table, on...)) -} - -func (h hookDo) LeftJoin(table schema.Tabler, on ...field.Expr) IHookDo { - return h.withDO(h.DO.LeftJoin(table, on...)) -} - -func (h hookDo) RightJoin(table schema.Tabler, on ...field.Expr) IHookDo { - return h.withDO(h.DO.RightJoin(table, on...)) -} - -func (h hookDo) Group(cols ...field.Expr) IHookDo { - return h.withDO(h.DO.Group(cols...)) -} - -func (h hookDo) Having(conds ...gen.Condition) IHookDo { - return h.withDO(h.DO.Having(conds...)) -} - -func (h hookDo) Limit(limit int) IHookDo { - return h.withDO(h.DO.Limit(limit)) -} - -func (h hookDo) Offset(offset int) IHookDo { - return h.withDO(h.DO.Offset(offset)) -} - -func (h hookDo) Scopes(funcs ...func(gen.Dao) gen.Dao) IHookDo { - return h.withDO(h.DO.Scopes(funcs...)) -} - -func (h hookDo) Unscoped() IHookDo { - return h.withDO(h.DO.Unscoped()) -} - -func (h hookDo) Create(values ...*table.Hook) error { - if len(values) == 0 { - return nil - } - return h.DO.Create(values) -} - -func (h hookDo) CreateInBatches(values []*table.Hook, batchSize int) error { - return h.DO.CreateInBatches(values, batchSize) -} - -// Save : !!! underlying implementation is different with GORM -// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) -func (h hookDo) Save(values ...*table.Hook) error { - if len(values) == 0 { - return nil - } - return h.DO.Save(values) -} - -func (h hookDo) First() (*table.Hook, error) { - if result, err := h.DO.First(); err != nil { - return nil, err - } else { - return result.(*table.Hook), nil - } -} - -func (h hookDo) Take() (*table.Hook, error) { - if result, err := h.DO.Take(); err != nil { - return nil, err - } else { - return result.(*table.Hook), nil - } -} - -func (h hookDo) Last() (*table.Hook, error) { - if result, err := h.DO.Last(); err != nil { - return nil, err - } else { - return result.(*table.Hook), nil - } -} - -func (h hookDo) Find() ([]*table.Hook, error) { - result, err := h.DO.Find() - return result.([]*table.Hook), err -} - -func (h hookDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.Hook, err error) { - buf := make([]*table.Hook, 0, batchSize) - err = h.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { - defer func() { results = append(results, buf...) }() - return fc(tx, batch) - }) - return results, err -} - -func (h hookDo) FindInBatches(result *[]*table.Hook, batchSize int, fc func(tx gen.Dao, batch int) error) error { - return h.DO.FindInBatches(result, batchSize, fc) -} - -func (h hookDo) Attrs(attrs ...field.AssignExpr) IHookDo { - return h.withDO(h.DO.Attrs(attrs...)) -} - -func (h hookDo) Assign(attrs ...field.AssignExpr) IHookDo { - return h.withDO(h.DO.Assign(attrs...)) -} - -func (h hookDo) Joins(fields ...field.RelationField) IHookDo { - for _, _f := range fields { - h = *h.withDO(h.DO.Joins(_f)) - } - return &h -} - -func (h hookDo) Preload(fields ...field.RelationField) IHookDo { - for _, _f := range fields { - h = *h.withDO(h.DO.Preload(_f)) - } - return &h -} - -func (h hookDo) FirstOrInit() (*table.Hook, error) { - if result, err := h.DO.FirstOrInit(); err != nil { - return nil, err - } else { - return result.(*table.Hook), nil - } -} - -func (h hookDo) FirstOrCreate() (*table.Hook, error) { - if result, err := h.DO.FirstOrCreate(); err != nil { - return nil, err - } else { - return result.(*table.Hook), nil - } -} - -func (h hookDo) FindByPage(offset int, limit int) (result []*table.Hook, count int64, err error) { - result, err = h.Offset(offset).Limit(limit).Find() - if err != nil { - return - } - - if size := len(result); 0 < limit && 0 < size && size < limit { - count = int64(size + offset) - return - } - - count, err = h.Offset(-1).Limit(-1).Count() - return -} - -func (h hookDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { - count, err = h.Count() - if err != nil { - return - } - - err = h.Offset(offset).Limit(limit).Scan(result) - return -} - -func (h hookDo) Scan(result interface{}) (err error) { - return h.DO.Scan(result) -} - -func (h hookDo) Delete(models ...*table.Hook) (result gen.ResultInfo, err error) { - return h.DO.Delete(models) -} - -func (h *hookDo) withDO(do gen.Dao) *hookDo { - h.DO = *do.(*gen.DO) - return h -} diff --git a/bcs-services/bcs-bscp/pkg/dal/gen/released_config_items.gen.go b/bcs-services/bcs-bscp/pkg/dal/gen/released_config_items.gen.go deleted file mode 100644 index 0a9a4d317d..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/gen/released_config_items.gen.go +++ /dev/null @@ -1,472 +0,0 @@ -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. - -package gen - -import ( - "context" - - "gorm.io/gorm" - "gorm.io/gorm/clause" - "gorm.io/gorm/schema" - - "gorm.io/gen" - "gorm.io/gen/field" - - "gorm.io/plugin/dbresolver" - - "bscp.io/pkg/dal/table" -) - -func newReleasedConfigItem(db *gorm.DB, opts ...gen.DOOption) releasedConfigItem { - _releasedConfigItem := releasedConfigItem{} - - _releasedConfigItem.releasedConfigItemDo.UseDB(db, opts...) - _releasedConfigItem.releasedConfigItemDo.UseModel(&table.ReleasedConfigItem{}) - - tableName := _releasedConfigItem.releasedConfigItemDo.TableName() - _releasedConfigItem.ALL = field.NewAsterisk(tableName) - _releasedConfigItem.ID = field.NewUint32(tableName, "id") - _releasedConfigItem.ReleaseID = field.NewUint32(tableName, "release_id") - _releasedConfigItem.CommitID = field.NewUint32(tableName, "commit_id") - _releasedConfigItem.ConfigItemID = field.NewUint32(tableName, "config_item_id") - _releasedConfigItem.ContentID = field.NewUint32(tableName, "content_id") - _releasedConfigItem.Signature = field.NewString(tableName, "signature") - _releasedConfigItem.ByteSize = field.NewUint64(tableName, "byte_size") - _releasedConfigItem.Memo = field.NewString(tableName, "name") - _releasedConfigItem.Name = field.NewString(tableName, "name") - _releasedConfigItem.Path = field.NewString(tableName, "name") - _releasedConfigItem.FileType = field.NewString(tableName, "name") - _releasedConfigItem.FileMode = field.NewString(tableName, "name") - _releasedConfigItem.User = field.NewString(tableName, "user") - _releasedConfigItem.UserGroup = field.NewString(tableName, "user_group") - _releasedConfigItem.Privilege = field.NewString(tableName, "privilege") - _releasedConfigItem.BizID = field.NewUint32(tableName, "biz_id") - _releasedConfigItem.AppID = field.NewUint32(tableName, "app_id") - _releasedConfigItem.Creator = field.NewString(tableName, "creator") - _releasedConfigItem.Reviser = field.NewString(tableName, "reviser") - _releasedConfigItem.CreatedAt = field.NewTime(tableName, "created_at") - _releasedConfigItem.UpdatedAt = field.NewTime(tableName, "updated_at") - - _releasedConfigItem.fillFieldMap() - - return _releasedConfigItem -} - -type releasedConfigItem struct { - releasedConfigItemDo releasedConfigItemDo - - ALL field.Asterisk - ID field.Uint32 - ReleaseID field.Uint32 - CommitID field.Uint32 - ConfigItemID field.Uint32 - ContentID field.Uint32 - Signature field.String - ByteSize field.Uint64 - Memo field.String - Name field.String - Path field.String - FileType field.String - FileMode field.String - User field.String - UserGroup field.String - Privilege field.String - BizID field.Uint32 - AppID field.Uint32 - Creator field.String - Reviser field.String - CreatedAt field.Time - UpdatedAt field.Time - - fieldMap map[string]field.Expr -} - -func (r releasedConfigItem) Table(newTableName string) *releasedConfigItem { - r.releasedConfigItemDo.UseTable(newTableName) - return r.updateTableName(newTableName) -} - -func (r releasedConfigItem) As(alias string) *releasedConfigItem { - r.releasedConfigItemDo.DO = *(r.releasedConfigItemDo.As(alias).(*gen.DO)) - return r.updateTableName(alias) -} - -func (r *releasedConfigItem) updateTableName(table string) *releasedConfigItem { - r.ALL = field.NewAsterisk(table) - r.ID = field.NewUint32(table, "id") - r.ReleaseID = field.NewUint32(table, "release_id") - r.CommitID = field.NewUint32(table, "commit_id") - r.ConfigItemID = field.NewUint32(table, "config_item_id") - r.ContentID = field.NewUint32(table, "content_id") - r.Signature = field.NewString(table, "signature") - r.ByteSize = field.NewUint64(table, "byte_size") - r.Memo = field.NewString(table, "name") - r.Name = field.NewString(table, "name") - r.Path = field.NewString(table, "name") - r.FileType = field.NewString(table, "name") - r.FileMode = field.NewString(table, "name") - r.User = field.NewString(table, "user") - r.UserGroup = field.NewString(table, "user_group") - r.Privilege = field.NewString(table, "privilege") - r.BizID = field.NewUint32(table, "biz_id") - r.AppID = field.NewUint32(table, "app_id") - r.Creator = field.NewString(table, "creator") - r.Reviser = field.NewString(table, "reviser") - r.CreatedAt = field.NewTime(table, "created_at") - r.UpdatedAt = field.NewTime(table, "updated_at") - - r.fillFieldMap() - - return r -} - -func (r *releasedConfigItem) WithContext(ctx context.Context) IReleasedConfigItemDo { - return r.releasedConfigItemDo.WithContext(ctx) -} - -func (r releasedConfigItem) TableName() string { return r.releasedConfigItemDo.TableName() } - -func (r releasedConfigItem) Alias() string { return r.releasedConfigItemDo.Alias() } - -func (r *releasedConfigItem) GetFieldByName(fieldName string) (field.OrderExpr, bool) { - _f, ok := r.fieldMap[fieldName] - if !ok || _f == nil { - return nil, false - } - _oe, ok := _f.(field.OrderExpr) - return _oe, ok -} - -func (r *releasedConfigItem) fillFieldMap() { - r.fieldMap = make(map[string]field.Expr, 21) - r.fieldMap["id"] = r.ID - r.fieldMap["release_id"] = r.ReleaseID - r.fieldMap["commit_id"] = r.CommitID - r.fieldMap["config_item_id"] = r.ConfigItemID - r.fieldMap["content_id"] = r.ContentID - r.fieldMap["signature"] = r.Signature - r.fieldMap["byte_size"] = r.ByteSize - r.fieldMap["name"] = r.Memo - r.fieldMap["name"] = r.Name - r.fieldMap["name"] = r.Path - r.fieldMap["name"] = r.FileType - r.fieldMap["name"] = r.FileMode - r.fieldMap["user"] = r.User - r.fieldMap["user_group"] = r.UserGroup - r.fieldMap["privilege"] = r.Privilege - r.fieldMap["biz_id"] = r.BizID - r.fieldMap["app_id"] = r.AppID - r.fieldMap["creator"] = r.Creator - r.fieldMap["reviser"] = r.Reviser - r.fieldMap["created_at"] = r.CreatedAt - r.fieldMap["updated_at"] = r.UpdatedAt -} - -func (r releasedConfigItem) clone(db *gorm.DB) releasedConfigItem { - r.releasedConfigItemDo.ReplaceConnPool(db.Statement.ConnPool) - return r -} - -func (r releasedConfigItem) replaceDB(db *gorm.DB) releasedConfigItem { - r.releasedConfigItemDo.ReplaceDB(db) - return r -} - -type releasedConfigItemDo struct{ gen.DO } - -type IReleasedConfigItemDo interface { - gen.SubQuery - Debug() IReleasedConfigItemDo - WithContext(ctx context.Context) IReleasedConfigItemDo - WithResult(fc func(tx gen.Dao)) gen.ResultInfo - ReplaceDB(db *gorm.DB) - ReadDB() IReleasedConfigItemDo - WriteDB() IReleasedConfigItemDo - As(alias string) gen.Dao - Session(config *gorm.Session) IReleasedConfigItemDo - Columns(cols ...field.Expr) gen.Columns - Clauses(conds ...clause.Expression) IReleasedConfigItemDo - Not(conds ...gen.Condition) IReleasedConfigItemDo - Or(conds ...gen.Condition) IReleasedConfigItemDo - Select(conds ...field.Expr) IReleasedConfigItemDo - Where(conds ...gen.Condition) IReleasedConfigItemDo - Order(conds ...field.Expr) IReleasedConfigItemDo - Distinct(cols ...field.Expr) IReleasedConfigItemDo - Omit(cols ...field.Expr) IReleasedConfigItemDo - Join(table schema.Tabler, on ...field.Expr) IReleasedConfigItemDo - LeftJoin(table schema.Tabler, on ...field.Expr) IReleasedConfigItemDo - RightJoin(table schema.Tabler, on ...field.Expr) IReleasedConfigItemDo - Group(cols ...field.Expr) IReleasedConfigItemDo - Having(conds ...gen.Condition) IReleasedConfigItemDo - Limit(limit int) IReleasedConfigItemDo - Offset(offset int) IReleasedConfigItemDo - Count() (count int64, err error) - Scopes(funcs ...func(gen.Dao) gen.Dao) IReleasedConfigItemDo - Unscoped() IReleasedConfigItemDo - Create(values ...*table.ReleasedConfigItem) error - CreateInBatches(values []*table.ReleasedConfigItem, batchSize int) error - Save(values ...*table.ReleasedConfigItem) error - First() (*table.ReleasedConfigItem, error) - Take() (*table.ReleasedConfigItem, error) - Last() (*table.ReleasedConfigItem, error) - Find() ([]*table.ReleasedConfigItem, error) - FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.ReleasedConfigItem, err error) - FindInBatches(result *[]*table.ReleasedConfigItem, batchSize int, fc func(tx gen.Dao, batch int) error) error - Pluck(column field.Expr, dest interface{}) error - Delete(...*table.ReleasedConfigItem) (info gen.ResultInfo, err error) - Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - Updates(value interface{}) (info gen.ResultInfo, err error) - UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - UpdateColumns(value interface{}) (info gen.ResultInfo, err error) - UpdateFrom(q gen.SubQuery) gen.Dao - Attrs(attrs ...field.AssignExpr) IReleasedConfigItemDo - Assign(attrs ...field.AssignExpr) IReleasedConfigItemDo - Joins(fields ...field.RelationField) IReleasedConfigItemDo - Preload(fields ...field.RelationField) IReleasedConfigItemDo - FirstOrInit() (*table.ReleasedConfigItem, error) - FirstOrCreate() (*table.ReleasedConfigItem, error) - FindByPage(offset int, limit int) (result []*table.ReleasedConfigItem, count int64, err error) - ScanByPage(result interface{}, offset int, limit int) (count int64, err error) - Scan(result interface{}) (err error) - Returning(value interface{}, columns ...string) IReleasedConfigItemDo - UnderlyingDB() *gorm.DB - schema.Tabler -} - -func (r releasedConfigItemDo) Debug() IReleasedConfigItemDo { - return r.withDO(r.DO.Debug()) -} - -func (r releasedConfigItemDo) WithContext(ctx context.Context) IReleasedConfigItemDo { - return r.withDO(r.DO.WithContext(ctx)) -} - -func (r releasedConfigItemDo) ReadDB() IReleasedConfigItemDo { - return r.Clauses(dbresolver.Read) -} - -func (r releasedConfigItemDo) WriteDB() IReleasedConfigItemDo { - return r.Clauses(dbresolver.Write) -} - -func (r releasedConfigItemDo) Session(config *gorm.Session) IReleasedConfigItemDo { - return r.withDO(r.DO.Session(config)) -} - -func (r releasedConfigItemDo) Clauses(conds ...clause.Expression) IReleasedConfigItemDo { - return r.withDO(r.DO.Clauses(conds...)) -} - -func (r releasedConfigItemDo) Returning(value interface{}, columns ...string) IReleasedConfigItemDo { - return r.withDO(r.DO.Returning(value, columns...)) -} - -func (r releasedConfigItemDo) Not(conds ...gen.Condition) IReleasedConfigItemDo { - return r.withDO(r.DO.Not(conds...)) -} - -func (r releasedConfigItemDo) Or(conds ...gen.Condition) IReleasedConfigItemDo { - return r.withDO(r.DO.Or(conds...)) -} - -func (r releasedConfigItemDo) Select(conds ...field.Expr) IReleasedConfigItemDo { - return r.withDO(r.DO.Select(conds...)) -} - -func (r releasedConfigItemDo) Where(conds ...gen.Condition) IReleasedConfigItemDo { - return r.withDO(r.DO.Where(conds...)) -} - -func (r releasedConfigItemDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IReleasedConfigItemDo { - return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - -func (r releasedConfigItemDo) Order(conds ...field.Expr) IReleasedConfigItemDo { - return r.withDO(r.DO.Order(conds...)) -} - -func (r releasedConfigItemDo) Distinct(cols ...field.Expr) IReleasedConfigItemDo { - return r.withDO(r.DO.Distinct(cols...)) -} - -func (r releasedConfigItemDo) Omit(cols ...field.Expr) IReleasedConfigItemDo { - return r.withDO(r.DO.Omit(cols...)) -} - -func (r releasedConfigItemDo) Join(table schema.Tabler, on ...field.Expr) IReleasedConfigItemDo { - return r.withDO(r.DO.Join(table, on...)) -} - -func (r releasedConfigItemDo) LeftJoin(table schema.Tabler, on ...field.Expr) IReleasedConfigItemDo { - return r.withDO(r.DO.LeftJoin(table, on...)) -} - -func (r releasedConfigItemDo) RightJoin(table schema.Tabler, on ...field.Expr) IReleasedConfigItemDo { - return r.withDO(r.DO.RightJoin(table, on...)) -} - -func (r releasedConfigItemDo) Group(cols ...field.Expr) IReleasedConfigItemDo { - return r.withDO(r.DO.Group(cols...)) -} - -func (r releasedConfigItemDo) Having(conds ...gen.Condition) IReleasedConfigItemDo { - return r.withDO(r.DO.Having(conds...)) -} - -func (r releasedConfigItemDo) Limit(limit int) IReleasedConfigItemDo { - return r.withDO(r.DO.Limit(limit)) -} - -func (r releasedConfigItemDo) Offset(offset int) IReleasedConfigItemDo { - return r.withDO(r.DO.Offset(offset)) -} - -func (r releasedConfigItemDo) Scopes(funcs ...func(gen.Dao) gen.Dao) IReleasedConfigItemDo { - return r.withDO(r.DO.Scopes(funcs...)) -} - -func (r releasedConfigItemDo) Unscoped() IReleasedConfigItemDo { - return r.withDO(r.DO.Unscoped()) -} - -func (r releasedConfigItemDo) Create(values ...*table.ReleasedConfigItem) error { - if len(values) == 0 { - return nil - } - return r.DO.Create(values) -} - -func (r releasedConfigItemDo) CreateInBatches(values []*table.ReleasedConfigItem, batchSize int) error { - return r.DO.CreateInBatches(values, batchSize) -} - -// Save : !!! underlying implementation is different with GORM -// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) -func (r releasedConfigItemDo) Save(values ...*table.ReleasedConfigItem) error { - if len(values) == 0 { - return nil - } - return r.DO.Save(values) -} - -func (r releasedConfigItemDo) First() (*table.ReleasedConfigItem, error) { - if result, err := r.DO.First(); err != nil { - return nil, err - } else { - return result.(*table.ReleasedConfigItem), nil - } -} - -func (r releasedConfigItemDo) Take() (*table.ReleasedConfigItem, error) { - if result, err := r.DO.Take(); err != nil { - return nil, err - } else { - return result.(*table.ReleasedConfigItem), nil - } -} - -func (r releasedConfigItemDo) Last() (*table.ReleasedConfigItem, error) { - if result, err := r.DO.Last(); err != nil { - return nil, err - } else { - return result.(*table.ReleasedConfigItem), nil - } -} - -func (r releasedConfigItemDo) Find() ([]*table.ReleasedConfigItem, error) { - result, err := r.DO.Find() - return result.([]*table.ReleasedConfigItem), err -} - -func (r releasedConfigItemDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.ReleasedConfigItem, err error) { - buf := make([]*table.ReleasedConfigItem, 0, batchSize) - err = r.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { - defer func() { results = append(results, buf...) }() - return fc(tx, batch) - }) - return results, err -} - -func (r releasedConfigItemDo) FindInBatches(result *[]*table.ReleasedConfigItem, batchSize int, fc func(tx gen.Dao, batch int) error) error { - return r.DO.FindInBatches(result, batchSize, fc) -} - -func (r releasedConfigItemDo) Attrs(attrs ...field.AssignExpr) IReleasedConfigItemDo { - return r.withDO(r.DO.Attrs(attrs...)) -} - -func (r releasedConfigItemDo) Assign(attrs ...field.AssignExpr) IReleasedConfigItemDo { - return r.withDO(r.DO.Assign(attrs...)) -} - -func (r releasedConfigItemDo) Joins(fields ...field.RelationField) IReleasedConfigItemDo { - for _, _f := range fields { - r = *r.withDO(r.DO.Joins(_f)) - } - return &r -} - -func (r releasedConfigItemDo) Preload(fields ...field.RelationField) IReleasedConfigItemDo { - for _, _f := range fields { - r = *r.withDO(r.DO.Preload(_f)) - } - return &r -} - -func (r releasedConfigItemDo) FirstOrInit() (*table.ReleasedConfigItem, error) { - if result, err := r.DO.FirstOrInit(); err != nil { - return nil, err - } else { - return result.(*table.ReleasedConfigItem), nil - } -} - -func (r releasedConfigItemDo) FirstOrCreate() (*table.ReleasedConfigItem, error) { - if result, err := r.DO.FirstOrCreate(); err != nil { - return nil, err - } else { - return result.(*table.ReleasedConfigItem), nil - } -} - -func (r releasedConfigItemDo) FindByPage(offset int, limit int) (result []*table.ReleasedConfigItem, count int64, err error) { - result, err = r.Offset(offset).Limit(limit).Find() - if err != nil { - return - } - - if size := len(result); 0 < limit && 0 < size && size < limit { - count = int64(size + offset) - return - } - - count, err = r.Offset(-1).Limit(-1).Count() - return -} - -func (r releasedConfigItemDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { - count, err = r.Count() - if err != nil { - return - } - - err = r.Offset(offset).Limit(limit).Scan(result) - return -} - -func (r releasedConfigItemDo) Scan(result interface{}) (err error) { - return r.DO.Scan(result) -} - -func (r releasedConfigItemDo) Delete(models ...*table.ReleasedConfigItem) (result gen.ResultInfo, err error) { - return r.DO.Delete(models) -} - -func (r *releasedConfigItemDo) withDO(do gen.Dao) *releasedConfigItemDo { - r.DO = *do.(*gen.DO) - return r -} diff --git a/bcs-services/bcs-bscp/pkg/dal/gen/released_groups.gen.go b/bcs-services/bcs-bscp/pkg/dal/gen/released_groups.gen.go deleted file mode 100644 index 586ccf692c..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/gen/released_groups.gen.go +++ /dev/null @@ -1,436 +0,0 @@ -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. - -package gen - -import ( - "context" - - "gorm.io/gorm" - "gorm.io/gorm/clause" - "gorm.io/gorm/schema" - - "gorm.io/gen" - "gorm.io/gen/field" - - "gorm.io/plugin/dbresolver" - - "bscp.io/pkg/dal/table" -) - -func newReleasedGroup(db *gorm.DB, opts ...gen.DOOption) releasedGroup { - _releasedGroup := releasedGroup{} - - _releasedGroup.releasedGroupDo.UseDB(db, opts...) - _releasedGroup.releasedGroupDo.UseModel(&table.ReleasedGroup{}) - - tableName := _releasedGroup.releasedGroupDo.TableName() - _releasedGroup.ALL = field.NewAsterisk(tableName) - _releasedGroup.ID = field.NewUint32(tableName, "id") - _releasedGroup.GroupID = field.NewUint32(tableName, "group_id") - _releasedGroup.AppID = field.NewUint32(tableName, "app_id") - _releasedGroup.ReleaseID = field.NewUint32(tableName, "release_id") - _releasedGroup.StrategyID = field.NewUint32(tableName, "strategy_id") - _releasedGroup.Mode = field.NewString(tableName, "mode") - _releasedGroup.Selector = field.NewField(tableName, "selector") - _releasedGroup.UID = field.NewString(tableName, "uid") - _releasedGroup.Edited = field.NewBool(tableName, "edited") - _releasedGroup.BizID = field.NewUint32(tableName, "biz_id") - _releasedGroup.Reviser = field.NewString(tableName, "reviser") - _releasedGroup.UpdatedAt = field.NewTime(tableName, "updated_at") - - _releasedGroup.fillFieldMap() - - return _releasedGroup -} - -type releasedGroup struct { - releasedGroupDo releasedGroupDo - - ALL field.Asterisk - ID field.Uint32 - GroupID field.Uint32 - AppID field.Uint32 - ReleaseID field.Uint32 - StrategyID field.Uint32 - Mode field.String - Selector field.Field - UID field.String - Edited field.Bool - BizID field.Uint32 - Reviser field.String - UpdatedAt field.Time - - fieldMap map[string]field.Expr -} - -func (r releasedGroup) Table(newTableName string) *releasedGroup { - r.releasedGroupDo.UseTable(newTableName) - return r.updateTableName(newTableName) -} - -func (r releasedGroup) As(alias string) *releasedGroup { - r.releasedGroupDo.DO = *(r.releasedGroupDo.As(alias).(*gen.DO)) - return r.updateTableName(alias) -} - -func (r *releasedGroup) updateTableName(table string) *releasedGroup { - r.ALL = field.NewAsterisk(table) - r.ID = field.NewUint32(table, "id") - r.GroupID = field.NewUint32(table, "group_id") - r.AppID = field.NewUint32(table, "app_id") - r.ReleaseID = field.NewUint32(table, "release_id") - r.StrategyID = field.NewUint32(table, "strategy_id") - r.Mode = field.NewString(table, "mode") - r.Selector = field.NewField(table, "selector") - r.UID = field.NewString(table, "uid") - r.Edited = field.NewBool(table, "edited") - r.BizID = field.NewUint32(table, "biz_id") - r.Reviser = field.NewString(table, "reviser") - r.UpdatedAt = field.NewTime(table, "updated_at") - - r.fillFieldMap() - - return r -} - -func (r *releasedGroup) WithContext(ctx context.Context) IReleasedGroupDo { - return r.releasedGroupDo.WithContext(ctx) -} - -func (r releasedGroup) TableName() string { return r.releasedGroupDo.TableName() } - -func (r releasedGroup) Alias() string { return r.releasedGroupDo.Alias() } - -func (r *releasedGroup) GetFieldByName(fieldName string) (field.OrderExpr, bool) { - _f, ok := r.fieldMap[fieldName] - if !ok || _f == nil { - return nil, false - } - _oe, ok := _f.(field.OrderExpr) - return _oe, ok -} - -func (r *releasedGroup) fillFieldMap() { - r.fieldMap = make(map[string]field.Expr, 12) - r.fieldMap["id"] = r.ID - r.fieldMap["group_id"] = r.GroupID - r.fieldMap["app_id"] = r.AppID - r.fieldMap["release_id"] = r.ReleaseID - r.fieldMap["strategy_id"] = r.StrategyID - r.fieldMap["mode"] = r.Mode - r.fieldMap["selector"] = r.Selector - r.fieldMap["uid"] = r.UID - r.fieldMap["edited"] = r.Edited - r.fieldMap["biz_id"] = r.BizID - r.fieldMap["reviser"] = r.Reviser - r.fieldMap["updated_at"] = r.UpdatedAt -} - -func (r releasedGroup) clone(db *gorm.DB) releasedGroup { - r.releasedGroupDo.ReplaceConnPool(db.Statement.ConnPool) - return r -} - -func (r releasedGroup) replaceDB(db *gorm.DB) releasedGroup { - r.releasedGroupDo.ReplaceDB(db) - return r -} - -type releasedGroupDo struct{ gen.DO } - -type IReleasedGroupDo interface { - gen.SubQuery - Debug() IReleasedGroupDo - WithContext(ctx context.Context) IReleasedGroupDo - WithResult(fc func(tx gen.Dao)) gen.ResultInfo - ReplaceDB(db *gorm.DB) - ReadDB() IReleasedGroupDo - WriteDB() IReleasedGroupDo - As(alias string) gen.Dao - Session(config *gorm.Session) IReleasedGroupDo - Columns(cols ...field.Expr) gen.Columns - Clauses(conds ...clause.Expression) IReleasedGroupDo - Not(conds ...gen.Condition) IReleasedGroupDo - Or(conds ...gen.Condition) IReleasedGroupDo - Select(conds ...field.Expr) IReleasedGroupDo - Where(conds ...gen.Condition) IReleasedGroupDo - Order(conds ...field.Expr) IReleasedGroupDo - Distinct(cols ...field.Expr) IReleasedGroupDo - Omit(cols ...field.Expr) IReleasedGroupDo - Join(table schema.Tabler, on ...field.Expr) IReleasedGroupDo - LeftJoin(table schema.Tabler, on ...field.Expr) IReleasedGroupDo - RightJoin(table schema.Tabler, on ...field.Expr) IReleasedGroupDo - Group(cols ...field.Expr) IReleasedGroupDo - Having(conds ...gen.Condition) IReleasedGroupDo - Limit(limit int) IReleasedGroupDo - Offset(offset int) IReleasedGroupDo - Count() (count int64, err error) - Scopes(funcs ...func(gen.Dao) gen.Dao) IReleasedGroupDo - Unscoped() IReleasedGroupDo - Create(values ...*table.ReleasedGroup) error - CreateInBatches(values []*table.ReleasedGroup, batchSize int) error - Save(values ...*table.ReleasedGroup) error - First() (*table.ReleasedGroup, error) - Take() (*table.ReleasedGroup, error) - Last() (*table.ReleasedGroup, error) - Find() ([]*table.ReleasedGroup, error) - FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.ReleasedGroup, err error) - FindInBatches(result *[]*table.ReleasedGroup, batchSize int, fc func(tx gen.Dao, batch int) error) error - Pluck(column field.Expr, dest interface{}) error - Delete(...*table.ReleasedGroup) (info gen.ResultInfo, err error) - Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - Updates(value interface{}) (info gen.ResultInfo, err error) - UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - UpdateColumns(value interface{}) (info gen.ResultInfo, err error) - UpdateFrom(q gen.SubQuery) gen.Dao - Attrs(attrs ...field.AssignExpr) IReleasedGroupDo - Assign(attrs ...field.AssignExpr) IReleasedGroupDo - Joins(fields ...field.RelationField) IReleasedGroupDo - Preload(fields ...field.RelationField) IReleasedGroupDo - FirstOrInit() (*table.ReleasedGroup, error) - FirstOrCreate() (*table.ReleasedGroup, error) - FindByPage(offset int, limit int) (result []*table.ReleasedGroup, count int64, err error) - ScanByPage(result interface{}, offset int, limit int) (count int64, err error) - Scan(result interface{}) (err error) - Returning(value interface{}, columns ...string) IReleasedGroupDo - UnderlyingDB() *gorm.DB - schema.Tabler -} - -func (r releasedGroupDo) Debug() IReleasedGroupDo { - return r.withDO(r.DO.Debug()) -} - -func (r releasedGroupDo) WithContext(ctx context.Context) IReleasedGroupDo { - return r.withDO(r.DO.WithContext(ctx)) -} - -func (r releasedGroupDo) ReadDB() IReleasedGroupDo { - return r.Clauses(dbresolver.Read) -} - -func (r releasedGroupDo) WriteDB() IReleasedGroupDo { - return r.Clauses(dbresolver.Write) -} - -func (r releasedGroupDo) Session(config *gorm.Session) IReleasedGroupDo { - return r.withDO(r.DO.Session(config)) -} - -func (r releasedGroupDo) Clauses(conds ...clause.Expression) IReleasedGroupDo { - return r.withDO(r.DO.Clauses(conds...)) -} - -func (r releasedGroupDo) Returning(value interface{}, columns ...string) IReleasedGroupDo { - return r.withDO(r.DO.Returning(value, columns...)) -} - -func (r releasedGroupDo) Not(conds ...gen.Condition) IReleasedGroupDo { - return r.withDO(r.DO.Not(conds...)) -} - -func (r releasedGroupDo) Or(conds ...gen.Condition) IReleasedGroupDo { - return r.withDO(r.DO.Or(conds...)) -} - -func (r releasedGroupDo) Select(conds ...field.Expr) IReleasedGroupDo { - return r.withDO(r.DO.Select(conds...)) -} - -func (r releasedGroupDo) Where(conds ...gen.Condition) IReleasedGroupDo { - return r.withDO(r.DO.Where(conds...)) -} - -func (r releasedGroupDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IReleasedGroupDo { - return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - -func (r releasedGroupDo) Order(conds ...field.Expr) IReleasedGroupDo { - return r.withDO(r.DO.Order(conds...)) -} - -func (r releasedGroupDo) Distinct(cols ...field.Expr) IReleasedGroupDo { - return r.withDO(r.DO.Distinct(cols...)) -} - -func (r releasedGroupDo) Omit(cols ...field.Expr) IReleasedGroupDo { - return r.withDO(r.DO.Omit(cols...)) -} - -func (r releasedGroupDo) Join(table schema.Tabler, on ...field.Expr) IReleasedGroupDo { - return r.withDO(r.DO.Join(table, on...)) -} - -func (r releasedGroupDo) LeftJoin(table schema.Tabler, on ...field.Expr) IReleasedGroupDo { - return r.withDO(r.DO.LeftJoin(table, on...)) -} - -func (r releasedGroupDo) RightJoin(table schema.Tabler, on ...field.Expr) IReleasedGroupDo { - return r.withDO(r.DO.RightJoin(table, on...)) -} - -func (r releasedGroupDo) Group(cols ...field.Expr) IReleasedGroupDo { - return r.withDO(r.DO.Group(cols...)) -} - -func (r releasedGroupDo) Having(conds ...gen.Condition) IReleasedGroupDo { - return r.withDO(r.DO.Having(conds...)) -} - -func (r releasedGroupDo) Limit(limit int) IReleasedGroupDo { - return r.withDO(r.DO.Limit(limit)) -} - -func (r releasedGroupDo) Offset(offset int) IReleasedGroupDo { - return r.withDO(r.DO.Offset(offset)) -} - -func (r releasedGroupDo) Scopes(funcs ...func(gen.Dao) gen.Dao) IReleasedGroupDo { - return r.withDO(r.DO.Scopes(funcs...)) -} - -func (r releasedGroupDo) Unscoped() IReleasedGroupDo { - return r.withDO(r.DO.Unscoped()) -} - -func (r releasedGroupDo) Create(values ...*table.ReleasedGroup) error { - if len(values) == 0 { - return nil - } - return r.DO.Create(values) -} - -func (r releasedGroupDo) CreateInBatches(values []*table.ReleasedGroup, batchSize int) error { - return r.DO.CreateInBatches(values, batchSize) -} - -// Save : !!! underlying implementation is different with GORM -// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) -func (r releasedGroupDo) Save(values ...*table.ReleasedGroup) error { - if len(values) == 0 { - return nil - } - return r.DO.Save(values) -} - -func (r releasedGroupDo) First() (*table.ReleasedGroup, error) { - if result, err := r.DO.First(); err != nil { - return nil, err - } else { - return result.(*table.ReleasedGroup), nil - } -} - -func (r releasedGroupDo) Take() (*table.ReleasedGroup, error) { - if result, err := r.DO.Take(); err != nil { - return nil, err - } else { - return result.(*table.ReleasedGroup), nil - } -} - -func (r releasedGroupDo) Last() (*table.ReleasedGroup, error) { - if result, err := r.DO.Last(); err != nil { - return nil, err - } else { - return result.(*table.ReleasedGroup), nil - } -} - -func (r releasedGroupDo) Find() ([]*table.ReleasedGroup, error) { - result, err := r.DO.Find() - return result.([]*table.ReleasedGroup), err -} - -func (r releasedGroupDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.ReleasedGroup, err error) { - buf := make([]*table.ReleasedGroup, 0, batchSize) - err = r.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { - defer func() { results = append(results, buf...) }() - return fc(tx, batch) - }) - return results, err -} - -func (r releasedGroupDo) FindInBatches(result *[]*table.ReleasedGroup, batchSize int, fc func(tx gen.Dao, batch int) error) error { - return r.DO.FindInBatches(result, batchSize, fc) -} - -func (r releasedGroupDo) Attrs(attrs ...field.AssignExpr) IReleasedGroupDo { - return r.withDO(r.DO.Attrs(attrs...)) -} - -func (r releasedGroupDo) Assign(attrs ...field.AssignExpr) IReleasedGroupDo { - return r.withDO(r.DO.Assign(attrs...)) -} - -func (r releasedGroupDo) Joins(fields ...field.RelationField) IReleasedGroupDo { - for _, _f := range fields { - r = *r.withDO(r.DO.Joins(_f)) - } - return &r -} - -func (r releasedGroupDo) Preload(fields ...field.RelationField) IReleasedGroupDo { - for _, _f := range fields { - r = *r.withDO(r.DO.Preload(_f)) - } - return &r -} - -func (r releasedGroupDo) FirstOrInit() (*table.ReleasedGroup, error) { - if result, err := r.DO.FirstOrInit(); err != nil { - return nil, err - } else { - return result.(*table.ReleasedGroup), nil - } -} - -func (r releasedGroupDo) FirstOrCreate() (*table.ReleasedGroup, error) { - if result, err := r.DO.FirstOrCreate(); err != nil { - return nil, err - } else { - return result.(*table.ReleasedGroup), nil - } -} - -func (r releasedGroupDo) FindByPage(offset int, limit int) (result []*table.ReleasedGroup, count int64, err error) { - result, err = r.Offset(offset).Limit(limit).Find() - if err != nil { - return - } - - if size := len(result); 0 < limit && 0 < size && size < limit { - count = int64(size + offset) - return - } - - count, err = r.Offset(-1).Limit(-1).Count() - return -} - -func (r releasedGroupDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { - count, err = r.Count() - if err != nil { - return - } - - err = r.Offset(offset).Limit(limit).Scan(result) - return -} - -func (r releasedGroupDo) Scan(result interface{}) (err error) { - return r.DO.Scan(result) -} - -func (r releasedGroupDo) Delete(models ...*table.ReleasedGroup) (result gen.ResultInfo, err error) { - return r.DO.Delete(models) -} - -func (r *releasedGroupDo) withDO(do gen.Dao) *releasedGroupDo { - r.DO = *do.(*gen.DO) - return r -} diff --git a/bcs-services/bcs-bscp/pkg/dal/gen/releases.gen.go b/bcs-services/bcs-bscp/pkg/dal/gen/releases.gen.go deleted file mode 100644 index 098a638ff5..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/gen/releases.gen.go +++ /dev/null @@ -1,438 +0,0 @@ -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. - -package gen - -import ( - "context" - - "gorm.io/gorm" - "gorm.io/gorm/clause" - "gorm.io/gorm/schema" - - "gorm.io/gen" - "gorm.io/gen/field" - - "gorm.io/plugin/dbresolver" - - "bscp.io/pkg/dal/table" -) - -func newRelease(db *gorm.DB, opts ...gen.DOOption) release { - _release := release{} - - _release.releaseDo.UseDB(db, opts...) - _release.releaseDo.UseModel(&table.Release{}) - - tableName := _release.releaseDo.TableName() - _release.ALL = field.NewAsterisk(tableName) - _release.ID = field.NewUint32(tableName, "id") - _release.Name = field.NewString(tableName, "name") - _release.Memo = field.NewString(tableName, "memo") - _release.Deprecated = field.NewBool(tableName, "deprecated") - _release.PublishNum = field.NewUint32(tableName, "publish_num") - _release.PreHookID = field.NewUint32(tableName, "pre_hook_id") - _release.PreHookReleaseID = field.NewUint32(tableName, "pre_hook_release_id") - _release.PostHookID = field.NewUint32(tableName, "post_hook_id") - _release.PostHookReleaseID = field.NewUint32(tableName, "post_hook_release_id") - _release.BizID = field.NewUint32(tableName, "biz_id") - _release.AppID = field.NewUint32(tableName, "app_id") - _release.Creator = field.NewString(tableName, "creator") - _release.CreatedAt = field.NewTime(tableName, "created_at") - - _release.fillFieldMap() - - return _release -} - -type release struct { - releaseDo releaseDo - - ALL field.Asterisk - ID field.Uint32 - Name field.String - Memo field.String - Deprecated field.Bool - PublishNum field.Uint32 - PreHookID field.Uint32 - PreHookReleaseID field.Uint32 - PostHookID field.Uint32 - PostHookReleaseID field.Uint32 - BizID field.Uint32 - AppID field.Uint32 - Creator field.String - CreatedAt field.Time - - fieldMap map[string]field.Expr -} - -func (r release) Table(newTableName string) *release { - r.releaseDo.UseTable(newTableName) - return r.updateTableName(newTableName) -} - -func (r release) As(alias string) *release { - r.releaseDo.DO = *(r.releaseDo.As(alias).(*gen.DO)) - return r.updateTableName(alias) -} - -func (r *release) updateTableName(table string) *release { - r.ALL = field.NewAsterisk(table) - r.ID = field.NewUint32(table, "id") - r.Name = field.NewString(table, "name") - r.Memo = field.NewString(table, "memo") - r.Deprecated = field.NewBool(table, "deprecated") - r.PublishNum = field.NewUint32(table, "publish_num") - r.PreHookID = field.NewUint32(table, "pre_hook_id") - r.PreHookReleaseID = field.NewUint32(table, "pre_hook_release_id") - r.PostHookID = field.NewUint32(table, "post_hook_id") - r.PostHookReleaseID = field.NewUint32(table, "post_hook_release_id") - r.BizID = field.NewUint32(table, "biz_id") - r.AppID = field.NewUint32(table, "app_id") - r.Creator = field.NewString(table, "creator") - r.CreatedAt = field.NewTime(table, "created_at") - - r.fillFieldMap() - - return r -} - -func (r *release) WithContext(ctx context.Context) IReleaseDo { return r.releaseDo.WithContext(ctx) } - -func (r release) TableName() string { return r.releaseDo.TableName() } - -func (r release) Alias() string { return r.releaseDo.Alias() } - -func (r *release) GetFieldByName(fieldName string) (field.OrderExpr, bool) { - _f, ok := r.fieldMap[fieldName] - if !ok || _f == nil { - return nil, false - } - _oe, ok := _f.(field.OrderExpr) - return _oe, ok -} - -func (r *release) fillFieldMap() { - r.fieldMap = make(map[string]field.Expr, 13) - r.fieldMap["id"] = r.ID - r.fieldMap["name"] = r.Name - r.fieldMap["memo"] = r.Memo - r.fieldMap["deprecated"] = r.Deprecated - r.fieldMap["publish_num"] = r.PublishNum - r.fieldMap["pre_hook_id"] = r.PreHookID - r.fieldMap["pre_hook_release_id"] = r.PreHookReleaseID - r.fieldMap["post_hook_id"] = r.PostHookID - r.fieldMap["post_hook_release_id"] = r.PostHookReleaseID - r.fieldMap["biz_id"] = r.BizID - r.fieldMap["app_id"] = r.AppID - r.fieldMap["creator"] = r.Creator - r.fieldMap["created_at"] = r.CreatedAt -} - -func (r release) clone(db *gorm.DB) release { - r.releaseDo.ReplaceConnPool(db.Statement.ConnPool) - return r -} - -func (r release) replaceDB(db *gorm.DB) release { - r.releaseDo.ReplaceDB(db) - return r -} - -type releaseDo struct{ gen.DO } - -type IReleaseDo interface { - gen.SubQuery - Debug() IReleaseDo - WithContext(ctx context.Context) IReleaseDo - WithResult(fc func(tx gen.Dao)) gen.ResultInfo - ReplaceDB(db *gorm.DB) - ReadDB() IReleaseDo - WriteDB() IReleaseDo - As(alias string) gen.Dao - Session(config *gorm.Session) IReleaseDo - Columns(cols ...field.Expr) gen.Columns - Clauses(conds ...clause.Expression) IReleaseDo - Not(conds ...gen.Condition) IReleaseDo - Or(conds ...gen.Condition) IReleaseDo - Select(conds ...field.Expr) IReleaseDo - Where(conds ...gen.Condition) IReleaseDo - Order(conds ...field.Expr) IReleaseDo - Distinct(cols ...field.Expr) IReleaseDo - Omit(cols ...field.Expr) IReleaseDo - Join(table schema.Tabler, on ...field.Expr) IReleaseDo - LeftJoin(table schema.Tabler, on ...field.Expr) IReleaseDo - RightJoin(table schema.Tabler, on ...field.Expr) IReleaseDo - Group(cols ...field.Expr) IReleaseDo - Having(conds ...gen.Condition) IReleaseDo - Limit(limit int) IReleaseDo - Offset(offset int) IReleaseDo - Count() (count int64, err error) - Scopes(funcs ...func(gen.Dao) gen.Dao) IReleaseDo - Unscoped() IReleaseDo - Create(values ...*table.Release) error - CreateInBatches(values []*table.Release, batchSize int) error - Save(values ...*table.Release) error - First() (*table.Release, error) - Take() (*table.Release, error) - Last() (*table.Release, error) - Find() ([]*table.Release, error) - FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.Release, err error) - FindInBatches(result *[]*table.Release, batchSize int, fc func(tx gen.Dao, batch int) error) error - Pluck(column field.Expr, dest interface{}) error - Delete(...*table.Release) (info gen.ResultInfo, err error) - Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - Updates(value interface{}) (info gen.ResultInfo, err error) - UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - UpdateColumns(value interface{}) (info gen.ResultInfo, err error) - UpdateFrom(q gen.SubQuery) gen.Dao - Attrs(attrs ...field.AssignExpr) IReleaseDo - Assign(attrs ...field.AssignExpr) IReleaseDo - Joins(fields ...field.RelationField) IReleaseDo - Preload(fields ...field.RelationField) IReleaseDo - FirstOrInit() (*table.Release, error) - FirstOrCreate() (*table.Release, error) - FindByPage(offset int, limit int) (result []*table.Release, count int64, err error) - ScanByPage(result interface{}, offset int, limit int) (count int64, err error) - Scan(result interface{}) (err error) - Returning(value interface{}, columns ...string) IReleaseDo - UnderlyingDB() *gorm.DB - schema.Tabler -} - -func (r releaseDo) Debug() IReleaseDo { - return r.withDO(r.DO.Debug()) -} - -func (r releaseDo) WithContext(ctx context.Context) IReleaseDo { - return r.withDO(r.DO.WithContext(ctx)) -} - -func (r releaseDo) ReadDB() IReleaseDo { - return r.Clauses(dbresolver.Read) -} - -func (r releaseDo) WriteDB() IReleaseDo { - return r.Clauses(dbresolver.Write) -} - -func (r releaseDo) Session(config *gorm.Session) IReleaseDo { - return r.withDO(r.DO.Session(config)) -} - -func (r releaseDo) Clauses(conds ...clause.Expression) IReleaseDo { - return r.withDO(r.DO.Clauses(conds...)) -} - -func (r releaseDo) Returning(value interface{}, columns ...string) IReleaseDo { - return r.withDO(r.DO.Returning(value, columns...)) -} - -func (r releaseDo) Not(conds ...gen.Condition) IReleaseDo { - return r.withDO(r.DO.Not(conds...)) -} - -func (r releaseDo) Or(conds ...gen.Condition) IReleaseDo { - return r.withDO(r.DO.Or(conds...)) -} - -func (r releaseDo) Select(conds ...field.Expr) IReleaseDo { - return r.withDO(r.DO.Select(conds...)) -} - -func (r releaseDo) Where(conds ...gen.Condition) IReleaseDo { - return r.withDO(r.DO.Where(conds...)) -} - -func (r releaseDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IReleaseDo { - return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - -func (r releaseDo) Order(conds ...field.Expr) IReleaseDo { - return r.withDO(r.DO.Order(conds...)) -} - -func (r releaseDo) Distinct(cols ...field.Expr) IReleaseDo { - return r.withDO(r.DO.Distinct(cols...)) -} - -func (r releaseDo) Omit(cols ...field.Expr) IReleaseDo { - return r.withDO(r.DO.Omit(cols...)) -} - -func (r releaseDo) Join(table schema.Tabler, on ...field.Expr) IReleaseDo { - return r.withDO(r.DO.Join(table, on...)) -} - -func (r releaseDo) LeftJoin(table schema.Tabler, on ...field.Expr) IReleaseDo { - return r.withDO(r.DO.LeftJoin(table, on...)) -} - -func (r releaseDo) RightJoin(table schema.Tabler, on ...field.Expr) IReleaseDo { - return r.withDO(r.DO.RightJoin(table, on...)) -} - -func (r releaseDo) Group(cols ...field.Expr) IReleaseDo { - return r.withDO(r.DO.Group(cols...)) -} - -func (r releaseDo) Having(conds ...gen.Condition) IReleaseDo { - return r.withDO(r.DO.Having(conds...)) -} - -func (r releaseDo) Limit(limit int) IReleaseDo { - return r.withDO(r.DO.Limit(limit)) -} - -func (r releaseDo) Offset(offset int) IReleaseDo { - return r.withDO(r.DO.Offset(offset)) -} - -func (r releaseDo) Scopes(funcs ...func(gen.Dao) gen.Dao) IReleaseDo { - return r.withDO(r.DO.Scopes(funcs...)) -} - -func (r releaseDo) Unscoped() IReleaseDo { - return r.withDO(r.DO.Unscoped()) -} - -func (r releaseDo) Create(values ...*table.Release) error { - if len(values) == 0 { - return nil - } - return r.DO.Create(values) -} - -func (r releaseDo) CreateInBatches(values []*table.Release, batchSize int) error { - return r.DO.CreateInBatches(values, batchSize) -} - -// Save : !!! underlying implementation is different with GORM -// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) -func (r releaseDo) Save(values ...*table.Release) error { - if len(values) == 0 { - return nil - } - return r.DO.Save(values) -} - -func (r releaseDo) First() (*table.Release, error) { - if result, err := r.DO.First(); err != nil { - return nil, err - } else { - return result.(*table.Release), nil - } -} - -func (r releaseDo) Take() (*table.Release, error) { - if result, err := r.DO.Take(); err != nil { - return nil, err - } else { - return result.(*table.Release), nil - } -} - -func (r releaseDo) Last() (*table.Release, error) { - if result, err := r.DO.Last(); err != nil { - return nil, err - } else { - return result.(*table.Release), nil - } -} - -func (r releaseDo) Find() ([]*table.Release, error) { - result, err := r.DO.Find() - return result.([]*table.Release), err -} - -func (r releaseDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.Release, err error) { - buf := make([]*table.Release, 0, batchSize) - err = r.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { - defer func() { results = append(results, buf...) }() - return fc(tx, batch) - }) - return results, err -} - -func (r releaseDo) FindInBatches(result *[]*table.Release, batchSize int, fc func(tx gen.Dao, batch int) error) error { - return r.DO.FindInBatches(result, batchSize, fc) -} - -func (r releaseDo) Attrs(attrs ...field.AssignExpr) IReleaseDo { - return r.withDO(r.DO.Attrs(attrs...)) -} - -func (r releaseDo) Assign(attrs ...field.AssignExpr) IReleaseDo { - return r.withDO(r.DO.Assign(attrs...)) -} - -func (r releaseDo) Joins(fields ...field.RelationField) IReleaseDo { - for _, _f := range fields { - r = *r.withDO(r.DO.Joins(_f)) - } - return &r -} - -func (r releaseDo) Preload(fields ...field.RelationField) IReleaseDo { - for _, _f := range fields { - r = *r.withDO(r.DO.Preload(_f)) - } - return &r -} - -func (r releaseDo) FirstOrInit() (*table.Release, error) { - if result, err := r.DO.FirstOrInit(); err != nil { - return nil, err - } else { - return result.(*table.Release), nil - } -} - -func (r releaseDo) FirstOrCreate() (*table.Release, error) { - if result, err := r.DO.FirstOrCreate(); err != nil { - return nil, err - } else { - return result.(*table.Release), nil - } -} - -func (r releaseDo) FindByPage(offset int, limit int) (result []*table.Release, count int64, err error) { - result, err = r.Offset(offset).Limit(limit).Find() - if err != nil { - return - } - - if size := len(result); 0 < limit && 0 < size && size < limit { - count = int64(size + offset) - return - } - - count, err = r.Offset(-1).Limit(-1).Count() - return -} - -func (r releaseDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { - count, err = r.Count() - if err != nil { - return - } - - err = r.Offset(offset).Limit(limit).Scan(result) - return -} - -func (r releaseDo) Scan(result interface{}) (err error) { - return r.DO.Scan(result) -} - -func (r releaseDo) Delete(models ...*table.Release) (result gen.ResultInfo, err error) { - return r.DO.Delete(models) -} - -func (r *releaseDo) withDO(do gen.Dao) *releaseDo { - r.DO = *do.(*gen.DO) - return r -} diff --git a/bcs-services/bcs-bscp/pkg/dal/gen/strategies.gen.go b/bcs-services/bcs-bscp/pkg/dal/gen/strategies.gen.go deleted file mode 100644 index 48c931e9e7..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/gen/strategies.gen.go +++ /dev/null @@ -1,450 +0,0 @@ -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. -// Code generated by gorm.io/gen. DO NOT EDIT. - -package gen - -import ( - "context" - - "gorm.io/gorm" - "gorm.io/gorm/clause" - "gorm.io/gorm/schema" - - "gorm.io/gen" - "gorm.io/gen/field" - - "gorm.io/plugin/dbresolver" - - "bscp.io/pkg/dal/table" -) - -func newStrategy(db *gorm.DB, opts ...gen.DOOption) strategy { - _strategy := strategy{} - - _strategy.strategyDo.UseDB(db, opts...) - _strategy.strategyDo.UseModel(&table.Strategy{}) - - tableName := _strategy.strategyDo.TableName() - _strategy.ALL = field.NewAsterisk(tableName) - _strategy.ID = field.NewUint32(tableName, "id") - _strategy.Name = field.NewString(tableName, "name") - _strategy.ReleaseID = field.NewUint32(tableName, "release_id") - _strategy.AsDefault = field.NewBool(tableName, "as_default") - _strategy.Scope = field.NewField(tableName, "scope") - _strategy.Mode = field.NewString(tableName, "mode") - _strategy.Namespace = field.NewString(tableName, "namespace") - _strategy.Memo = field.NewString(tableName, "memo") - _strategy.PubState = field.NewString(tableName, "pub_state") - _strategy.BizID = field.NewUint32(tableName, "biz_id") - _strategy.AppID = field.NewUint32(tableName, "app_id") - _strategy.StrategySetID = field.NewUint32(tableName, "strategy_set_id") - _strategy.Creator = field.NewString(tableName, "creator") - _strategy.Reviser = field.NewString(tableName, "reviser") - _strategy.CreatedAt = field.NewTime(tableName, "created_at") - _strategy.UpdatedAt = field.NewTime(tableName, "updated_at") - - _strategy.fillFieldMap() - - return _strategy -} - -type strategy struct { - strategyDo strategyDo - - ALL field.Asterisk - ID field.Uint32 - Name field.String - ReleaseID field.Uint32 - AsDefault field.Bool - Scope field.Field - Mode field.String - Namespace field.String - Memo field.String - PubState field.String - BizID field.Uint32 - AppID field.Uint32 - StrategySetID field.Uint32 - Creator field.String - Reviser field.String - CreatedAt field.Time - UpdatedAt field.Time - - fieldMap map[string]field.Expr -} - -func (s strategy) Table(newTableName string) *strategy { - s.strategyDo.UseTable(newTableName) - return s.updateTableName(newTableName) -} - -func (s strategy) As(alias string) *strategy { - s.strategyDo.DO = *(s.strategyDo.As(alias).(*gen.DO)) - return s.updateTableName(alias) -} - -func (s *strategy) updateTableName(table string) *strategy { - s.ALL = field.NewAsterisk(table) - s.ID = field.NewUint32(table, "id") - s.Name = field.NewString(table, "name") - s.ReleaseID = field.NewUint32(table, "release_id") - s.AsDefault = field.NewBool(table, "as_default") - s.Scope = field.NewField(table, "scope") - s.Mode = field.NewString(table, "mode") - s.Namespace = field.NewString(table, "namespace") - s.Memo = field.NewString(table, "memo") - s.PubState = field.NewString(table, "pub_state") - s.BizID = field.NewUint32(table, "biz_id") - s.AppID = field.NewUint32(table, "app_id") - s.StrategySetID = field.NewUint32(table, "strategy_set_id") - s.Creator = field.NewString(table, "creator") - s.Reviser = field.NewString(table, "reviser") - s.CreatedAt = field.NewTime(table, "created_at") - s.UpdatedAt = field.NewTime(table, "updated_at") - - s.fillFieldMap() - - return s -} - -func (s *strategy) WithContext(ctx context.Context) IStrategyDo { return s.strategyDo.WithContext(ctx) } - -func (s strategy) TableName() string { return s.strategyDo.TableName() } - -func (s strategy) Alias() string { return s.strategyDo.Alias() } - -func (s *strategy) GetFieldByName(fieldName string) (field.OrderExpr, bool) { - _f, ok := s.fieldMap[fieldName] - if !ok || _f == nil { - return nil, false - } - _oe, ok := _f.(field.OrderExpr) - return _oe, ok -} - -func (s *strategy) fillFieldMap() { - s.fieldMap = make(map[string]field.Expr, 16) - s.fieldMap["id"] = s.ID - s.fieldMap["name"] = s.Name - s.fieldMap["release_id"] = s.ReleaseID - s.fieldMap["as_default"] = s.AsDefault - s.fieldMap["scope"] = s.Scope - s.fieldMap["mode"] = s.Mode - s.fieldMap["namespace"] = s.Namespace - s.fieldMap["memo"] = s.Memo - s.fieldMap["pub_state"] = s.PubState - s.fieldMap["biz_id"] = s.BizID - s.fieldMap["app_id"] = s.AppID - s.fieldMap["strategy_set_id"] = s.StrategySetID - s.fieldMap["creator"] = s.Creator - s.fieldMap["reviser"] = s.Reviser - s.fieldMap["created_at"] = s.CreatedAt - s.fieldMap["updated_at"] = s.UpdatedAt -} - -func (s strategy) clone(db *gorm.DB) strategy { - s.strategyDo.ReplaceConnPool(db.Statement.ConnPool) - return s -} - -func (s strategy) replaceDB(db *gorm.DB) strategy { - s.strategyDo.ReplaceDB(db) - return s -} - -type strategyDo struct{ gen.DO } - -type IStrategyDo interface { - gen.SubQuery - Debug() IStrategyDo - WithContext(ctx context.Context) IStrategyDo - WithResult(fc func(tx gen.Dao)) gen.ResultInfo - ReplaceDB(db *gorm.DB) - ReadDB() IStrategyDo - WriteDB() IStrategyDo - As(alias string) gen.Dao - Session(config *gorm.Session) IStrategyDo - Columns(cols ...field.Expr) gen.Columns - Clauses(conds ...clause.Expression) IStrategyDo - Not(conds ...gen.Condition) IStrategyDo - Or(conds ...gen.Condition) IStrategyDo - Select(conds ...field.Expr) IStrategyDo - Where(conds ...gen.Condition) IStrategyDo - Order(conds ...field.Expr) IStrategyDo - Distinct(cols ...field.Expr) IStrategyDo - Omit(cols ...field.Expr) IStrategyDo - Join(table schema.Tabler, on ...field.Expr) IStrategyDo - LeftJoin(table schema.Tabler, on ...field.Expr) IStrategyDo - RightJoin(table schema.Tabler, on ...field.Expr) IStrategyDo - Group(cols ...field.Expr) IStrategyDo - Having(conds ...gen.Condition) IStrategyDo - Limit(limit int) IStrategyDo - Offset(offset int) IStrategyDo - Count() (count int64, err error) - Scopes(funcs ...func(gen.Dao) gen.Dao) IStrategyDo - Unscoped() IStrategyDo - Create(values ...*table.Strategy) error - CreateInBatches(values []*table.Strategy, batchSize int) error - Save(values ...*table.Strategy) error - First() (*table.Strategy, error) - Take() (*table.Strategy, error) - Last() (*table.Strategy, error) - Find() ([]*table.Strategy, error) - FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.Strategy, err error) - FindInBatches(result *[]*table.Strategy, batchSize int, fc func(tx gen.Dao, batch int) error) error - Pluck(column field.Expr, dest interface{}) error - Delete(...*table.Strategy) (info gen.ResultInfo, err error) - Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - Updates(value interface{}) (info gen.ResultInfo, err error) - UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) - UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) - UpdateColumns(value interface{}) (info gen.ResultInfo, err error) - UpdateFrom(q gen.SubQuery) gen.Dao - Attrs(attrs ...field.AssignExpr) IStrategyDo - Assign(attrs ...field.AssignExpr) IStrategyDo - Joins(fields ...field.RelationField) IStrategyDo - Preload(fields ...field.RelationField) IStrategyDo - FirstOrInit() (*table.Strategy, error) - FirstOrCreate() (*table.Strategy, error) - FindByPage(offset int, limit int) (result []*table.Strategy, count int64, err error) - ScanByPage(result interface{}, offset int, limit int) (count int64, err error) - Scan(result interface{}) (err error) - Returning(value interface{}, columns ...string) IStrategyDo - UnderlyingDB() *gorm.DB - schema.Tabler -} - -func (s strategyDo) Debug() IStrategyDo { - return s.withDO(s.DO.Debug()) -} - -func (s strategyDo) WithContext(ctx context.Context) IStrategyDo { - return s.withDO(s.DO.WithContext(ctx)) -} - -func (s strategyDo) ReadDB() IStrategyDo { - return s.Clauses(dbresolver.Read) -} - -func (s strategyDo) WriteDB() IStrategyDo { - return s.Clauses(dbresolver.Write) -} - -func (s strategyDo) Session(config *gorm.Session) IStrategyDo { - return s.withDO(s.DO.Session(config)) -} - -func (s strategyDo) Clauses(conds ...clause.Expression) IStrategyDo { - return s.withDO(s.DO.Clauses(conds...)) -} - -func (s strategyDo) Returning(value interface{}, columns ...string) IStrategyDo { - return s.withDO(s.DO.Returning(value, columns...)) -} - -func (s strategyDo) Not(conds ...gen.Condition) IStrategyDo { - return s.withDO(s.DO.Not(conds...)) -} - -func (s strategyDo) Or(conds ...gen.Condition) IStrategyDo { - return s.withDO(s.DO.Or(conds...)) -} - -func (s strategyDo) Select(conds ...field.Expr) IStrategyDo { - return s.withDO(s.DO.Select(conds...)) -} - -func (s strategyDo) Where(conds ...gen.Condition) IStrategyDo { - return s.withDO(s.DO.Where(conds...)) -} - -func (s strategyDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IStrategyDo { - return s.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - -func (s strategyDo) Order(conds ...field.Expr) IStrategyDo { - return s.withDO(s.DO.Order(conds...)) -} - -func (s strategyDo) Distinct(cols ...field.Expr) IStrategyDo { - return s.withDO(s.DO.Distinct(cols...)) -} - -func (s strategyDo) Omit(cols ...field.Expr) IStrategyDo { - return s.withDO(s.DO.Omit(cols...)) -} - -func (s strategyDo) Join(table schema.Tabler, on ...field.Expr) IStrategyDo { - return s.withDO(s.DO.Join(table, on...)) -} - -func (s strategyDo) LeftJoin(table schema.Tabler, on ...field.Expr) IStrategyDo { - return s.withDO(s.DO.LeftJoin(table, on...)) -} - -func (s strategyDo) RightJoin(table schema.Tabler, on ...field.Expr) IStrategyDo { - return s.withDO(s.DO.RightJoin(table, on...)) -} - -func (s strategyDo) Group(cols ...field.Expr) IStrategyDo { - return s.withDO(s.DO.Group(cols...)) -} - -func (s strategyDo) Having(conds ...gen.Condition) IStrategyDo { - return s.withDO(s.DO.Having(conds...)) -} - -func (s strategyDo) Limit(limit int) IStrategyDo { - return s.withDO(s.DO.Limit(limit)) -} - -func (s strategyDo) Offset(offset int) IStrategyDo { - return s.withDO(s.DO.Offset(offset)) -} - -func (s strategyDo) Scopes(funcs ...func(gen.Dao) gen.Dao) IStrategyDo { - return s.withDO(s.DO.Scopes(funcs...)) -} - -func (s strategyDo) Unscoped() IStrategyDo { - return s.withDO(s.DO.Unscoped()) -} - -func (s strategyDo) Create(values ...*table.Strategy) error { - if len(values) == 0 { - return nil - } - return s.DO.Create(values) -} - -func (s strategyDo) CreateInBatches(values []*table.Strategy, batchSize int) error { - return s.DO.CreateInBatches(values, batchSize) -} - -// Save : !!! underlying implementation is different with GORM -// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) -func (s strategyDo) Save(values ...*table.Strategy) error { - if len(values) == 0 { - return nil - } - return s.DO.Save(values) -} - -func (s strategyDo) First() (*table.Strategy, error) { - if result, err := s.DO.First(); err != nil { - return nil, err - } else { - return result.(*table.Strategy), nil - } -} - -func (s strategyDo) Take() (*table.Strategy, error) { - if result, err := s.DO.Take(); err != nil { - return nil, err - } else { - return result.(*table.Strategy), nil - } -} - -func (s strategyDo) Last() (*table.Strategy, error) { - if result, err := s.DO.Last(); err != nil { - return nil, err - } else { - return result.(*table.Strategy), nil - } -} - -func (s strategyDo) Find() ([]*table.Strategy, error) { - result, err := s.DO.Find() - return result.([]*table.Strategy), err -} - -func (s strategyDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*table.Strategy, err error) { - buf := make([]*table.Strategy, 0, batchSize) - err = s.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { - defer func() { results = append(results, buf...) }() - return fc(tx, batch) - }) - return results, err -} - -func (s strategyDo) FindInBatches(result *[]*table.Strategy, batchSize int, fc func(tx gen.Dao, batch int) error) error { - return s.DO.FindInBatches(result, batchSize, fc) -} - -func (s strategyDo) Attrs(attrs ...field.AssignExpr) IStrategyDo { - return s.withDO(s.DO.Attrs(attrs...)) -} - -func (s strategyDo) Assign(attrs ...field.AssignExpr) IStrategyDo { - return s.withDO(s.DO.Assign(attrs...)) -} - -func (s strategyDo) Joins(fields ...field.RelationField) IStrategyDo { - for _, _f := range fields { - s = *s.withDO(s.DO.Joins(_f)) - } - return &s -} - -func (s strategyDo) Preload(fields ...field.RelationField) IStrategyDo { - for _, _f := range fields { - s = *s.withDO(s.DO.Preload(_f)) - } - return &s -} - -func (s strategyDo) FirstOrInit() (*table.Strategy, error) { - if result, err := s.DO.FirstOrInit(); err != nil { - return nil, err - } else { - return result.(*table.Strategy), nil - } -} - -func (s strategyDo) FirstOrCreate() (*table.Strategy, error) { - if result, err := s.DO.FirstOrCreate(); err != nil { - return nil, err - } else { - return result.(*table.Strategy), nil - } -} - -func (s strategyDo) FindByPage(offset int, limit int) (result []*table.Strategy, count int64, err error) { - result, err = s.Offset(offset).Limit(limit).Find() - if err != nil { - return - } - - if size := len(result); 0 < limit && 0 < size && size < limit { - count = int64(size + offset) - return - } - - count, err = s.Offset(-1).Limit(-1).Count() - return -} - -func (s strategyDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { - count, err = s.Count() - if err != nil { - return - } - - err = s.Offset(offset).Limit(limit).Scan(result) - return -} - -func (s strategyDo) Scan(result interface{}) (err error) { - return s.DO.Scan(result) -} - -func (s strategyDo) Delete(models ...*table.Strategy) (result gen.ResultInfo, err error) { - return s.DO.Delete(models) -} - -func (s *strategyDo) withDO(do gen.Dao) *strategyDo { - s.DO = *do.(*gen.DO) - return s -} diff --git a/bcs-services/bcs-bscp/pkg/dal/orm/orm.go b/bcs-services/bcs-bscp/pkg/dal/orm/orm.go index dedfd0511c..a76f1e46eb 100644 --- a/bcs-services/bcs-bscp/pkg/dal/orm/orm.go +++ b/bcs-services/bcs-bscp/pkg/dal/orm/orm.go @@ -65,7 +65,7 @@ func Do(opt cc.Sharding) Interface { type runtimeOrm struct { // ingressLimiter the limiter to limit the incoming request frequency. - // Note: test the accept for each sharding, but not for all the sharding with one limiter. + // TODO: test the accept for each sharding, but not for all the sharding with one limiter. ingressLimiter *rate.Limiter logLimiter *rate.Limiter mc *metric @@ -89,7 +89,7 @@ func (o *runtimeOrm) logSlowCmd(ctx context.Context, sql string, latency time.Du } // tryAccept is used to test if the incoming orm request can be accepted. -// Note: test the accept for each sharding, but not for all the sharding with one limiter. +// TODO: test the accept for each sharding, but not for all the sharding with one limiter. func (o *runtimeOrm) tryAccept() error { if o.ingressLimiter.Allow() { return nil diff --git a/bcs-services/bcs-bscp/pkg/dal/orm/tools.go b/bcs-services/bcs-bscp/pkg/dal/orm/tools.go index 48f32f85ff..72493d0381 100644 --- a/bcs-services/bcs-bscp/pkg/dal/orm/tools.go +++ b/bcs-services/bcs-bscp/pkg/dal/orm/tools.go @@ -24,14 +24,14 @@ import ( // RearrangeSQLDataWithOption parse a *struct into a sql expression, and // returned with the update sql expression and the to be updated data. -// 1. the input FieldOption only works for the returned 'expr', not controls -// the returned 'toUpdate', so the returned 'toUpdate' contains all the -// flatted tagged 'db' field and value. -// 2. Obviously, a data field need to be updated if the field value -// is not blank(as is not "ZERO"), -// 3. If the field is defined in the blank options deliberately, then -// update it to blank value as required. -// 4. see the test case to know the exact data returned. +// 1. the input FieldOption only works for the returned 'expr', not controls +// the returned 'toUpdate', so the returned 'toUpdate' contains all the +// flatted tagged 'db' field and value. +// 2. Obviously, a data field need to be updated if the field value +// is not blank(as is not "ZERO"), +// 3. If the field is defined in the blank options deliberately, then +// update it to blank value as required. +// 4. see the test case to know the exact data returned. func RearrangeSQLDataWithOption(data interface{}, opts *FieldOption) ( expr string, toUpdate map[string]interface{}, err error) { @@ -74,10 +74,10 @@ func RearrangeSQLDataWithOption(data interface{}, opts *FieldOption) ( // RecursiveGetTaggedFieldValues get all the tagged db kv // in the struct to a flat map except ptr and struct tag. // Note: -// 1. if the embedded tag is same, then it will be overlapped. -// 2. use this function carefully, it not supports all the type, -// such as array, slice, map is not supported. -// 3. see the test case to know the output data example. +// 1. if the embedded tag is same, then it will be overlapped. +// 2. use this function carefully, it not supports all the type, +// such as array, slice, map is not supported. +// 3. see the test case to know the output data example. func RecursiveGetTaggedFieldValues(v interface{}) (map[string]interface{}, error) { if v == nil { return map[string]interface{}{}, nil @@ -169,10 +169,9 @@ func isBlank(value reflect.Value) bool { } // FieldOption is to define which field need to be: -// 1. updated to blank(as is ZERO) value. -// 2. be ignored, which means not be updated even its value -// is not blank(as is not ZERO). -// +// 1. updated to blank(as is ZERO) value. +// 2. be ignored, which means not be updated even its value +// is not blank(as is not ZERO). // NOTE: // 1. A field can not in the blanked and ignore fields at the // same time. if a field does, then it will be ignored without @@ -227,7 +226,7 @@ func (f *FieldOption) AddIgnoredFields(fields ...string) *FieldOption { // embedded if it's an embedded struct. // Use table.App as an example, the returned expr should as follows: // id, biz_id, name as 'spec.name', memo as 'spec.memo' -// Note: define the embedded columns in the table.go manually. +// TODO: define the embedded columns in the table.go manually. // Deprecated: GetNamedSelectColumns will panic if there is a nil value. func GetNamedSelectColumns(table interface{}) (expr string, err error) { if table == nil { diff --git a/bcs-services/bcs-bscp/pkg/dal/repository/bkrepo.go b/bcs-services/bcs-bscp/pkg/dal/repository/bkrepo.go deleted file mode 100644 index 0b2780d165..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/repository/bkrepo.go +++ /dev/null @@ -1,294 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 repository - -import ( - "encoding/json" - "fmt" - "io" - "net/http" - "strconv" - - "github.com/pkg/errors" - - "bscp.io/pkg/cc" - "bscp.io/pkg/criteria/constant" - "bscp.io/pkg/kit" - "bscp.io/pkg/metrics" - "bscp.io/pkg/thirdparty/repo" - "bscp.io/pkg/tools" -) - -// bkrepoAuthTransport 给请求增加 Authorization header -type bkrepoAuthTransport struct { - Username string - Password string - Transport http.RoundTripper -} - -// RoundTrip Transport -func (t *bkrepoAuthTransport) RoundTrip(req *http.Request) (*http.Response, error) { - req.SetBasicAuth(t.Username, t.Password) - resp, err := t.transport(req).RoundTrip(req) - return resp, err -} - -func (t *bkrepoAuthTransport) transport(req *http.Request) http.RoundTripper { - if t.Transport != nil { - return t.Transport - } - return http.DefaultTransport -} - -// bkrepoClient client struct -type bkrepoClient struct { - host string - project string - client *http.Client - cli *repo.Client - repoCreated map[string]struct{} -} - -func (c *bkrepoClient) ensureRepo(kt *kit.Kit) error { - repoName, err := repo.GenRepoName(kt.BizID) - if err != nil { - return err - } - if _, ok := c.repoCreated[repoName]; ok { - return nil - } - repoReq := &repo.CreateRepoReq{ - ProjectID: cc.ApiServer().Repo.BkRepo.Project, - Name: repoName, - Type: repo.RepositoryType, - Category: repo.CategoryType, - Configuration: repo.Configuration{Type: repo.RepositoryCfgType}, - Description: fmt.Sprintf("bscp %d business repository", kt.BizID), - } - if err := c.cli.CreateRepo(kt.Ctx, repoReq); err != nil { - return err - } - - c.repoCreated[repoName] = struct{}{} - return nil -} - -// getNodeMetadata If the node already exists, this appID will be added to the metadata of the current node. -// If not exist, will create new metadata with this bizID and appID. -func getNodeMetadata(kt *kit.Kit, cli *repo.Client, opt *repo.NodeOption, appID uint32) (string, error) { - metadata, err := cli.QueryMetadata(kt.Ctx, opt) - if err != nil { - return "", err - } - - if len(metadata) == 0 { - meta := repo.NodeMeta{ - BizID: opt.BizID, - AppID: []uint32{appID}, - } - - return meta.String() - } - - // validate already node metadata. - bizID, exist := metadata["biz_id"] - if !exist { - return "", errors.New("node metadata not has biz id") - } - - if bizID != strconv.Itoa(int(opt.BizID)) { - return "", fmt.Errorf("node metadata %s biz id is different from the request %d biz id", bizID, opt.BizID) - } - - appIDStr, exist := metadata["app_id"] - if !exist { - return "", errors.New("node metadata not has app id") - } - - appIDs := make([]uint32, 0) - if err = json.Unmarshal([]byte(appIDStr), &appIDs); err != nil { - return "", fmt.Errorf("unmarshal node metadata appID failed, err: %v", err) - } - - // judge current app if already upload this node. - var idExist bool - for index := range appIDs { - if appIDs[index] == appID { - idExist = true - break - } - } - - if !idExist { - appIDs = append(appIDs, appID) - } - - meta := &repo.NodeMeta{ - BizID: opt.BizID, - AppID: appIDs, - } - return meta.String() -} - -// Upload file to bkrepo -func (c *bkrepoClient) Upload(kt *kit.Kit, fileContentID string, body io.Reader, contentLength int64) (*ObjectMetadata, error) { - if err := c.ensureRepo(kt); err != nil { - return nil, errors.Wrap(err, "ensure repo failed") - } - - opt := &repo.NodeOption{Project: c.project, BizID: kt.BizID, Sign: fileContentID} - nodeMeta, err := getNodeMetadata(kt, c.cli, opt, kt.AppID) - if err != nil { - return nil, errors.Wrap(err, "get node metadata") - } - - node, err := repo.GenNodePath(opt) - if err != nil { - return nil, err - } - - rawURL := fmt.Sprintf("%s%s", c.host, node) - req, err := http.NewRequestWithContext(kt.Ctx, http.MethodPut, rawURL, body) - if err != nil { - return nil, err - } - - req.Header.Set("Content-Length", strconv.FormatInt(contentLength, 10)) - req.Header.Set("Content-Type", "application/octet-stream") - req.Header.Set(constant.RidKey, kt.Rid) - req.Header.Set(repo.HeaderKeyMETA, nodeMeta) - req.Header.Set(repo.HeaderKeyOverwrite, "true") - - resp, err := c.client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - if resp.StatusCode != 200 { - return nil, errors.Errorf("upload status %d != 200", resp.StatusCode) - } - - uploadResp := new(repo.UploadResp) - if err := json.NewDecoder(resp.Body).Decode(uploadResp); err != nil { - return nil, errors.Wrap(err, "upload response") - } - - if uploadResp.Code != 0 { - return nil, errors.Errorf("upload code %d != 0", uploadResp.Code) - } - - // cos return not have metadata - metadata := &ObjectMetadata{ - Sha256: uploadResp.Data.Sha256, - ByteSize: uploadResp.Data.Size, - } - - return metadata, nil -} - -// Download download file from bkrepo -func (c *bkrepoClient) Download(kt *kit.Kit, fileContentID string) (io.ReadCloser, int64, error) { - node, err := repo.GenNodePath(&repo.NodeOption{Project: c.project, BizID: kt.BizID, Sign: fileContentID}) - if err != nil { - return nil, 0, err - } - - rawURL := fmt.Sprintf("%s%s", c.host, node) - req, err := http.NewRequestWithContext(kt.Ctx, http.MethodGet, rawURL, nil) - if err != nil { - return nil, 0, err - } - req.Header.Set(constant.RidKey, kt.Rid) - - resp, err := c.client.Do(req) - if err != nil { - return nil, 0, err - } - - if resp.StatusCode == http.StatusNotFound { - resp.Body.Close() - return nil, 0, errors.New("config item not found") - } - - if resp.StatusCode != 200 { - resp.Body.Close() - return nil, 0, errors.Errorf("download status %d != 200", resp.StatusCode) - } - - return resp.Body, resp.ContentLength, nil -} - -// Metadata bkrepo file metadata -func (c *bkrepoClient) Metadata(kt *kit.Kit, fileContentID string) (*ObjectMetadata, error) { - node, err := repo.GenNodePath(&repo.NodeOption{Project: c.project, BizID: kt.BizID, Sign: fileContentID}) - if err != nil { - return nil, err - } - - rawURL := fmt.Sprintf("%s%s", c.host, node) - req, err := http.NewRequestWithContext(kt.Ctx, http.MethodHead, rawURL, nil) - if err != nil { - return nil, err - } - req.Header.Set(constant.RidKey, kt.Rid) - - resp, err := c.client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - if resp.StatusCode == http.StatusNotFound { - return nil, errors.New("config item not found") - } - - if resp.StatusCode != 200 { - return nil, errors.Errorf("download status %d != 200", resp.StatusCode) - } - - // cos only have etag, not for validate - metadata := &ObjectMetadata{ - ByteSize: 0, - Sha256: resp.Header.Get("Etag"), - } - - return metadata, nil -} - -// NewBKRepoProvider new bkrepo provider -func NewBKRepoProvider(settings cc.Repository) (Provider, error) { - cli, err := repo.NewClient(settings, metrics.Register()) - if err != nil { - return nil, err - } - - host := settings.BkRepo.Endpoints[0] - - p := &bkrepoClient{ - cli: cli, - host: host, - project: settings.BkRepo.Project, - repoCreated: map[string]struct{}{}, - } - - transport := &bkrepoAuthTransport{ - Username: settings.BkRepo.Username, - Password: settings.BkRepo.Password, - Transport: tools.NewCurlLogTransport(defaultTransport), - } - - p.client = &http.Client{Transport: transport} - - return p, nil -} diff --git a/bcs-services/bcs-bscp/pkg/dal/repository/cos.go b/bcs-services/bcs-bscp/pkg/dal/repository/cos.go deleted file mode 100644 index 112df7d84d..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/repository/cos.go +++ /dev/null @@ -1,164 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 repository - -import ( - "fmt" - "io" - "net/http" - "strconv" - - "github.com/pkg/errors" - cos "github.com/tencentyun/cos-go-sdk-v5" - - "bscp.io/pkg/cc" - "bscp.io/pkg/criteria/constant" - "bscp.io/pkg/kit" - "bscp.io/pkg/thirdparty/repo" - "bscp.io/pkg/tools" -) - -const ( - // cosSchema 请求使用 https 协议 - cosSchema = "https" -) - -// cosClient tencentcloud cos client struct -type cosClient struct { - host string - client *http.Client -} - -// Upload upload file to cos -func (c *cosClient) Upload(kt *kit.Kit, fileContentID string, body io.Reader, contentLength int64) (*ObjectMetadata, error) { - node, err := repo.GenS3NodeFullPath(kt.BizID, fileContentID) - if err != nil { - return nil, err - } - - rawURL := fmt.Sprintf("%s%s", c.host, node) - req, err := http.NewRequestWithContext(kt.Ctx, http.MethodPut, rawURL, body) - if err != nil { - return nil, err - } - req.Header.Set("Content-Length", strconv.FormatInt(contentLength, 10)) - req.Header.Set("Content-Type", "application/octet-stream") - req.Header.Set(constant.RidKey, kt.Rid) - - resp, err := c.client.Do(req) - if err != nil { - return nil, err - } - - defer resp.Body.Close() - io.Copy(io.Discard, resp.Body) - - if resp.StatusCode != 200 { - return nil, errors.Errorf("upload status %d != 200", resp.StatusCode) - } - - // cos return not have metadata - metadata := &ObjectMetadata{ - Sha256: fileContentID, - } - - return metadata, nil -} - -// Download download file from cos -func (c *cosClient) Download(kt *kit.Kit, fileContentID string) (io.ReadCloser, int64, error) { - node, err := repo.GenS3NodeFullPath(kt.BizID, fileContentID) - if err != nil { - return nil, 0, err - } - - rawURL := fmt.Sprintf("%s%s", c.host, node) - req, err := http.NewRequestWithContext(kt.Ctx, http.MethodGet, rawURL, nil) - if err != nil { - return nil, 0, err - } - req.Header.Set(constant.RidKey, kt.Rid) - - resp, err := c.client.Do(req) - if err != nil { - return nil, 0, err - } - - if resp.StatusCode == http.StatusNotFound { - resp.Body.Close() - return nil, 0, errors.New("config item not found") - } - - if resp.StatusCode != 200 { - resp.Body.Close() - return nil, 0, errors.Errorf("download status %d != 200", resp.StatusCode) - } - - return resp.Body, resp.ContentLength, nil -} - -// Metadata cos file metadata -func (c *cosClient) Metadata(kt *kit.Kit, fileContentID string) (*ObjectMetadata, error) { - node, err := repo.GenS3NodeFullPath(kt.BizID, fileContentID) - if err != nil { - return nil, err - } - - rawURL := fmt.Sprintf("%s%s", c.host, node) - req, err := http.NewRequestWithContext(kt.Ctx, http.MethodHead, rawURL, nil) - if err != nil { - return nil, err - } - req.Header.Set(constant.RidKey, kt.Rid) - - resp, err := c.client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - if resp.StatusCode == http.StatusNotFound { - return nil, errors.New("config item not found") - } - - if resp.StatusCode != 200 { - return nil, errors.Errorf("download status %d != 200", resp.StatusCode) - } - - // cos only have etag, not for validate - metadata := &ObjectMetadata{ - ByteSize: 0, - Sha256: fileContentID, - } - - return metadata, nil -} - -// newCosProvider new cos provider -func newCosProvider(conf cc.S3Storage) (Provider, error) { - host := fmt.Sprintf("%s://%s.%s", cosSchema, conf.BucketName, conf.Endpoint) - - // cos 鉴权签名 - transport := &cos.AuthorizationTransport{ - SecretID: conf.AccessKeyID, - SecretKey: conf.SecretAccessKey, - Transport: tools.NewCurlLogTransport(defaultTransport), - } - - p := &cosClient{ - host: host, - client: &http.Client{Transport: transport}, - } - - return p, nil -} diff --git a/bcs-services/bcs-bscp/pkg/dal/repository/repository.go b/bcs-services/bcs-bscp/pkg/dal/repository/repository.go index ce6de753c2..0cd13f7690 100644 --- a/bcs-services/bcs-bscp/pkg/dal/repository/repository.go +++ b/bcs-services/bcs-bscp/pkg/dal/repository/repository.go @@ -1,91 +1,283 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 repository import ( + "encoding/json" "fmt" "io" - "net" "net/http" + "strconv" "strings" "time" - "github.com/pkg/errors" + "github.com/bluele/gcache" + "github.com/go-chi/chi/v5" + "github.com/minio/minio-go/v7" "bscp.io/pkg/cc" "bscp.io/pkg/criteria/constant" + "bscp.io/pkg/criteria/errf" + "bscp.io/pkg/iam/auth" + "bscp.io/pkg/iam/meta" "bscp.io/pkg/kit" + "bscp.io/pkg/logs" + "bscp.io/pkg/metrics" + pbas "bscp.io/pkg/protocol/auth-server" + "bscp.io/pkg/thirdparty/repo" ) const ( - // defaultWriteBufferSize is default write buffer size, 4KB. - defaultWriteBufferSize = 4 << 10 - - // defaultReadBufferSize is default read buffer size, 4KB. - defaultReadBufferSize = 4 << 10 + // repoRecordCacheExpiration repo created record cache expiration. + RepoRecordCacheExpiration = time.Hour ) -var ( - // The transport used to perform proxy requests. If nil, - // http.DefaultTransport is used. - defaultTransport http.RoundTripper = &http.Transport{ - Proxy: http.ProxyFromEnvironment, - Dial: (&net.Dialer{Timeout: 10 * time.Second}).Dial, - MaxConnsPerHost: 200, - MaxIdleConnsPerHost: 10, - IdleConnTimeout: time.Minute, - WriteBufferSize: defaultWriteBufferSize, - ReadBufferSize: defaultReadBufferSize, +// FileApiType file api type +type FileApiType interface { + DownloadFile(w http.ResponseWriter, r *http.Request) + FileMetadata(w http.ResponseWriter, r *http.Request) + UploadFile(w http.ResponseWriter, r *http.Request) +} + +// DownloadFile download file +func (s S3Client) DownloadFile(w http.ResponseWriter, r *http.Request) { + kt := kit.MustGetKit(r.Context()) + + authRes, needReturn := s.authorize(kt, r) + if needReturn { + fmt.Fprintf(w, authRes) + return + } + + bizIDStr := chi.URLParam(r, "biz_id") + bizID, err := strconv.ParseUint(bizIDStr, 10, 64) + if err != nil { + logs.Errorf("biz_id parse uint failed, err: %v, rid: %s", err, kt.Rid) + fmt.Fprintf(w, errf.New(errf.InvalidParameter, err.Error()).Error()) + return + } + + if bizID == 0 { + fmt.Fprintf(w, errf.New(errf.InvalidParameter, "biz_id should > 0").Error()) + return + } + repoName := s.s3Cli.Config.S3.BucketName + s3PathName, err := repo.GenRepoName(uint32(bizID)) + if err != nil { + logs.Errorf("generate S3 repository name failed, err: %v, rid: %s", err, kt.Rid) + fmt.Fprintf(w, errf.Error(err).Error()) + return + } + sha256 := strings.ToLower(r.Header.Get(constant.ContentIDHeaderKey)) + fullPath, err := repo.GenS3NodeFullPath(s3PathName, sha256) + if err != nil { + logs.Errorf("create S3 FullPath failed, err: %v, err") + fmt.Fprintf(w, errf.Error(err).Error()) + return + } + reader, err := s.s3Cli.Client.GetObject(r.Context(), repoName, fullPath, minio.GetObjectOptions{}) + if err != nil { + logs.Errorf("download S3 file failed, err: %v, err") + fmt.Fprintf(w, errf.Error(err).Error()) + return + } + io.Copy(w, reader) +} + +// UploadFile upload file +func (s S3Client) UploadFile(w http.ResponseWriter, r *http.Request) { + kt := kit.MustGetKit(r.Context()) + + authRes, needReturn := s.authorize(kt, r) + if needReturn { + fmt.Fprintf(w, authRes) + return + } + + bizIDStr := chi.URLParam(r, "biz_id") + bizID, err := strconv.ParseUint(bizIDStr, 10, 64) + if err != nil { + logs.Errorf("biz_id parse uint failed, err: %v, rid: %s", err, kt.Rid) + fmt.Fprintf(w, errf.New(errf.InvalidParameter, err.Error()).Error()) + return + } + + if bizID == 0 { + fmt.Fprintf(w, errf.New(errf.InvalidParameter, "biz_id should > 0").Error()) + return + } + repoName := s.s3Cli.Config.S3.BucketName + + if record, err := s.s3CreatedRecords.Get(repoName); err != nil || record == nil { + + req := &repo.CreateRepoReq{ + Name: repoName, + Description: fmt.Sprintf("bscp %d business repository", bizID), + } + if err = s.s3Cli.CreateRepo(r.Context(), req); err != nil { + logs.Errorf("create repository failed, err: %v, rid: %s", err, kt.Rid) + fmt.Fprintf(w, errf.Error(err).Error()) + return + } + + // set cache, to flag this biz repository already created. + s.s3CreatedRecords.SetWithExpire(repoName, true, RepoRecordCacheExpiration) + } + s3pathName, err := repo.GenRepoName(uint32(bizID)) + if err != nil { + logs.Errorf("generate s3 path name failed, err: %v, rid: %s", err, kt.Rid) + fmt.Fprintf(w, errf.Error(err).Error()) + return + } + sha256 := strings.ToLower(r.Header.Get(constant.ContentIDHeaderKey)) + fullPath, err := repo.GenS3NodeFullPath(s3pathName, sha256) + if err != nil { + logs.Errorf("create S3 FullPath failed, err: %v, err") + fmt.Fprintf(w, errf.Error(err).Error()) + return + } + _, err = s.s3Cli.Client.PutObject(r.Context(), repoName, fullPath, r.Body, r.ContentLength, minio.PutObjectOptions{}) + if err != nil { + logs.Errorf("uploader S3 file failed, err: %v, err") + fmt.Fprintf(w, errf.Error(err).Error()) + return + } + ok, _ := s.s3Cli.IsNodeExist(r.Context(), repoName, fullPath) + if !ok { + logs.Errorf("Failed to check artifact sha256 digest") + fmt.Fprintf(w, errf.Error(err).Error()) + return + } + msg, _ := json.Marshal(ResponseBody{Code: 200, Message: "success"}) + w.Write(msg) +} + +// FileMetadata get s3 head data +func (s S3Client) FileMetadata(w http.ResponseWriter, r *http.Request) { + kt := kit.MustGetKit(r.Context()) + + authRes, needReturn := s.authorize(kt, r) + if needReturn { + fmt.Fprintf(w, authRes) + return + } + config := cc.ApiServer().Repo + + bizID, _, err := GetBizIDAndAppID(nil, r) + if err != nil { + logs.Errorf("get biz_id and app_id from request failed, err: %v, rid: %s", err, kt.Rid) + return } -) -// ObjectMetadata 文件元数据 -type ObjectMetadata struct { - ByteSize int64 `json:"byte_size"` - Sha256 string `json:"sha256"` + s3PathName, err := repo.GenRepoName(bizID) + if err != nil { + logs.Errorf("generate S3 repository name failed, err: %v, rid: %s", err, kt.Rid) + fmt.Fprintf(w, errf.Error(err).Error()) + return + } + sha256 := strings.ToLower(r.Header.Get(constant.ContentIDHeaderKey)) + fullPath, err := repo.GenS3NodeFullPath(s3PathName, sha256) + if err != nil { + logs.Errorf("create S3 FullPath failed, err: %v, err") + fmt.Fprintf(w, errf.Error(err).Error()) + return + } + + fileMetadata, err := s.s3Cli.FileMetadataHead(kt.Ctx, config.S3.BucketName, fullPath) + if err != nil { + logs.Errorf("get file metadata information failed, err: %v, rid: %s", err) + return + } + fileMetadata.Sha256 = sha256 + msg, _ := json.Marshal(fileMetadata) + w.Write(msg) } -// ObjectDownload 文件下载 -type ObjectDownload interface { - DownloadLink(kt *kit.Kit, fileContentID string) (string, error) - AsyncDownload(kt *kit.Kit, fileContentID string) (string, error) - AsyncDownloadStatus(kt *kit.Kit, fileContentID string, taskID string) (bool, error) +type ResponseBody struct { + Code int + Message string } -// Provider repo provider interface -type Provider interface { - Upload(kt *kit.Kit, fileContentID string, body io.Reader, contentLength int64) (*ObjectMetadata, error) - Download(kt *kit.Kit, fileContentID string) (io.ReadCloser, int64, error) - Metadata(kt *kit.Kit, fileContentID string) (*ObjectMetadata, error) +// S3Client s3 client struct +type S3Client struct { + // repoCli s3 client. + s3Cli *repo.ClientS3 + // s3CreatedRecords memory LRU cache used for re-create repo repository. + s3CreatedRecords gcache.Cache + // authorizer auth related operations. + authorizer auth.Authorizer } -// GetFileContentID get file sha256 -func GetFileContentID(r *http.Request) (string, error) { - fileContentID := strings.ToLower(r.Header.Get(constant.ContentIDHeaderKey)) - if len(fileContentID) != 64 { - return "", errors.New("not valid X-Bkapi-File-Content-Id in header") +// authorize the request, returns error response and if the response needs return. +func (s S3Client) authorize(kt *kit.Kit, r *http.Request) (string, bool) { + bizID, appID, err := GetBizIDAndAppID(kt, r) + if err != nil { + logs.Errorf("get biz_id and app_id from request failed, err: %v, rid: %s", err, kt.Rid) + return errf.New(errf.InvalidParameter, err.Error()).Error(), true + } + + var authRes *meta.ResourceAttribute + switch r.Method { + case http.MethodPut: + authRes = &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.Content, Action: meta.Upload, + ResourceID: appID}, BizID: bizID} + case http.MethodGet: + authRes = &meta.ResourceAttribute{Basic: &meta.Basic{Type: meta.Content, Action: meta.Download, + ResourceID: appID}, BizID: bizID} + } + + resp := new(AuthResp) + err = s.authorizer.AuthorizeWithResp(kt, resp, authRes) + if err != nil { + respJson, _ := json.Marshal(resp) + return string(respJson), true } - return fileContentID, nil + return "", false +} + +// AuthResp http response with need apply permission. +type AuthResp struct { + Code int32 `json:"code"` + Message string `json:"message"` + Permission *pbas.IamPermission `json:"permission,omitempty"` +} + +// NewS3Service new s3 service +func NewS3Service(settings cc.Repository, authorizer auth.Authorizer) (FileApiType, error) { + s3Client, err := repo.NewClientS3(&settings, metrics.Register()) + if err != nil { + return nil, err + } + p := &S3Client{ + s3Cli: s3Client, + s3CreatedRecords: gcache.New(1000).EvictType(gcache.TYPE_LRU).Build(), // total size < 8k + authorizer: authorizer, + } + return p, nil } -// NewProvider init provider factory by storage type -func NewProvider(conf cc.Repository) (Provider, error) { - switch strings.ToUpper(string(conf.StorageType)) { - case string(cc.S3): - return newCosProvider(conf.S3) - case string(cc.BkRepo): - return NewBKRepoProvider(conf) +// GetBizIDAndAppID get biz_id and app_id from req path. +func GetBizIDAndAppID(kt *kit.Kit, req *http.Request) (uint32, uint32, error) { + bizIDStr := chi.URLParam(req, "biz_id") + bizID, err := strconv.ParseUint(bizIDStr, 10, 64) + if err != nil { + logs.Errorf("biz id parse uint failed, err: %v, rid: %s", err, kt.Rid) + return 0, 0, err } - return nil, fmt.Errorf("store with type %s is not supported", conf.StorageType) + + if bizID == 0 { + return 0, 0, errf.New(errf.InvalidParameter, "biz_id should > 0") + } + + appIDStr := chi.URLParam(req, "app_id") + appID, err := strconv.ParseUint(appIDStr, 10, 64) + if err != nil { + logs.Errorf("app id parse uint failed, err: %v, rid: %s", err, kt.Rid) + return 0, 0, err + } + + if appID == 0 { + return 0, 0, errf.New(errf.InvalidParameter, "app_id should > 0") + } + + return uint32(bizID), uint32(appID), nil } diff --git a/bcs-services/bcs-bscp/pkg/dal/sharding/sharding.go b/bcs-services/bcs-bscp/pkg/dal/sharding/sharding.go index 18b8bd16d2..0f99b41977 100644 --- a/bcs-services/bcs-bscp/pkg/dal/sharding/sharding.go +++ b/bcs-services/bcs-bscp/pkg/dal/sharding/sharding.go @@ -53,7 +53,7 @@ func InitSharding(sd *cc.Sharding) (*Sharding, error) { // which works for all the biz and admin resources. type Sharding struct { // we support only one db just for now. - // Note: support sharding management later. + // TODO: support sharding management later. one *One // db pool, like a connection pool } diff --git a/bcs-services/bcs-bscp/pkg/dal/table/app.go b/bcs-services/bcs-bscp/pkg/dal/table/app.go index 2af79584b7..d78cb33587 100644 --- a/bcs-services/bcs-bscp/pkg/dal/table/app.go +++ b/bcs-services/bcs-bscp/pkg/dal/table/app.go @@ -17,44 +17,42 @@ import ( "fmt" "time" + "bscp.io/pkg/criteria/enumor" "bscp.io/pkg/criteria/validator" ) +// AppColumns defines all the app table's columns. +var AppColumns = mergeColumns(AppColumnDescriptor) + +// AppColumnDescriptor is App's column descriptors. +var AppColumnDescriptor = mergeColumnDescriptors("", + ColumnDescriptors{ + {Column: "id", NamedC: "id", Type: enumor.Numeric}, + {Column: "biz_id", NamedC: "biz_id", Type: enumor.Numeric}, + }, + mergeColumnDescriptors("spec", AppSpecColumnDescriptor), + mergeColumnDescriptors("revision", RevisionColumnDescriptor)) + // App defines an application's detail information type App struct { // ID is an auto-increased value, which is an application's // unique identity. - ID uint32 `json:"id" gorm:"primaryKey"` + ID uint32 `db:"id" json:"id"` // BizID is the business is which this app belongs to - BizID uint32 `json:"biz_id" gorm:"column:biz_id"` + BizID uint32 `db:"biz_id" json:"biz_id"` // Spec is a collection of app's specifics defined with user - Spec *AppSpec `json:"spec" gorm:"embedded"` + Spec *AppSpec `db:"spec" json:"spec"` // Revision record this app's revision information - Revision *Revision `json:"revision" gorm:"embedded"` + Revision *Revision `db:"revision" json:"revision"` } // TableName is the app's database table name. -func (a *App) TableName() string { - return "applications" -} - -// AppID AuditRes interface -func (a *App) AppID() uint32 { - return a.ID -} - -// ResID AuditRes interface -func (a *App) ResID() uint32 { - return a.ID -} - -// ResType AuditRes interface -func (a *App) ResType() string { - return "app" +func (a App) TableName() Name { + return AppTable } // ValidateCreate validate app's info when created. -func (a *App) ValidateCreate() error { +func (a App) ValidateCreate() error { if a.ID != 0 { return errors.New("id can not be set") } @@ -83,7 +81,7 @@ func (a *App) ValidateCreate() error { } // ValidateUpdate validate app's info when update. -func (a *App) ValidateUpdate(configType ConfigType) error { +func (a App) ValidateUpdate(configType ConfigType) error { if a.ID <= 0 { return errors.New("id is not set") } @@ -112,7 +110,7 @@ func (a *App) ValidateUpdate(configType ConfigType) error { } // ValidateDelete validate app's info when delete. -func (a *App) ValidateDelete() error { +func (a App) ValidateDelete() error { if a.ID <= 0 { return errors.New("app id not set") } @@ -124,18 +122,31 @@ func (a *App) ValidateDelete() error { return nil } +// AppSpecColumns defines all the app spec's columns. +var AppSpecColumns = mergeColumns(AppSpecColumnDescriptor) + +// AppSpecColumnDescriptor is AppSpec's column descriptors. +var AppSpecColumnDescriptor = mergeColumnDescriptors("", + ColumnDescriptors{ + {Column: "name", NamedC: "name", Type: enumor.String}, + {Column: "config_type", NamedC: "config_type", Type: enumor.String}, + {Column: "mode", NamedC: "mode", Type: enumor.String}, + {Column: "memo", NamedC: "memo", Type: enumor.String}, + }, + mergeColumnDescriptors("reload", ReloadColumnDescriptor)) + // AppSpec is a collection of app's specifics defined with user type AppSpec struct { // Name is application's name - Name string `json:"name" gorm:"column:name"` + Name string `db:"name" json:"name"` // ConfigType defines which type is this configuration, different type has the // different ways to be consumed. - ConfigType ConfigType `json:"config_type" gorm:"column:config_type"` + ConfigType ConfigType `db:"config_type" json:"config_type"` // Mode defines what mode of this app works at. // Mode can not be updated once it is created. - Mode AppMode `json:"mode" gorm:"column:mode"` - Memo string `json:"memo" gorm:"column:memo"` - Reload *Reload `json:"reload" gorm:"embedded"` + Mode AppMode `db:"mode" json:"mode"` + Memo string `db:"memo" json:"memo"` + Reload *Reload `db:"reload" json:"reload"` } const ( @@ -245,11 +256,21 @@ func (as *AppSpec) ValidateUpdate(configType ConfigType) error { return nil } +// ReloadColumns defines all the app reload spec's columns. +var ReloadColumns = mergeColumns(ReloadColumnDescriptor) + +// ReloadColumnDescriptor is Reload's column descriptors. +var ReloadColumnDescriptor = mergeColumnDescriptors("", + ColumnDescriptors{ + {Column: "reload_type", NamedC: "reload_type", Type: enumor.String}, + }, + mergeColumnDescriptors("file_reload_spec", FileReloadSpecColumnDescriptor)) + // Reload is a collection of app reload specifics defined with user. only is used when this app is file config type. // Reload is used to control how bscp sidecar notifies applications to go to reload config files. type Reload struct { - ReloadType AppReloadType `json:"reload_type" gorm:"column:reload_type"` - FileReloadSpec *FileReloadSpec `json:"file_reload_spec" gorm:"embedded"` + ReloadType AppReloadType `db:"reload_type" json:"reload_type"` + FileReloadSpec *FileReloadSpec `db:"file_reload_spec" json:"file_reload_spec"` } // IsEmpty reload. @@ -323,9 +344,17 @@ func (r *Reload) ValidateUpdate() error { return nil } +// FileReloadSpecColumns defines all the app file reload spec's columns. +var FileReloadSpecColumns = mergeColumns(FileReloadSpecColumnDescriptor) + +// FileReloadSpecColumnDescriptor is Reload's column descriptors. +var FileReloadSpecColumnDescriptor = ColumnDescriptors{ + {Column: "reload_file_path", NamedC: "reload_file_path", Type: enumor.String}, +} + // FileReloadSpec is a collection of file reload spec's specifics defined with user. type FileReloadSpec struct { - ReloadFilePath string `json:"reload_file_path" gorm:"column:reload_file_path"` + ReloadFilePath string `db:"reload_file_path" json:"reload_file_path"` } // IsEmpty file reload spec. @@ -402,17 +431,27 @@ func (rt AppReloadType) Validate() error { return nil } +// ArchivedAppColumns defines ArchivedApp's columns +var ArchivedAppColumns = mergeColumns(ArchivedAppColumnDescriptor) + +// ArchivedAppColumnDescriptor is ArchivedApp's column descriptors. +var ArchivedAppColumnDescriptor = ColumnDescriptors{ + {Column: "id", NamedC: "id", Type: enumor.Numeric}, + {Column: "biz_id", NamedC: "biz_id", Type: enumor.Numeric}, + {Column: "app_id", NamedC: "app_id", Type: enumor.Numeric}, + {Column: "created_at", NamedC: "created_at", Type: enumor.Time}} + // ArchivedApp is used to record applications basic information // which is used to purge resources related with this application // asynchronously. type ArchivedApp struct { - ID uint32 `json:"id" gorm:"primaryKey"` - BizID uint32 `json:"biz_id" gorm:"column:biz_id"` - AppID uint32 `json:"app_id" gorm:"column:app_id"` - CreatedAt time.Time `json:"created_at" gorm:"column:created_at"` + ID uint32 `db:"id" json:"id"` + BizID uint32 `db:"biz_id" json:"biz_id"` + AppID uint32 `db:"app_id" json:"app_id"` + CreatedAt time.Time `db:"created_at" json:"created_at"` } // TableName is the archived app's database table name. -func (a *ArchivedApp) TableName() string { - return "archived_apps" +func (a ArchivedApp) TableName() Name { + return ArchivedAppTable } diff --git a/bcs-services/bcs-bscp/pkg/dal/table/commit.go b/bcs-services/bcs-bscp/pkg/dal/table/commit.go index 7e4a6de155..e0f0237610 100644 --- a/bcs-services/bcs-bscp/pkg/dal/table/commit.go +++ b/bcs-services/bcs-bscp/pkg/dal/table/commit.go @@ -90,9 +90,9 @@ var CommitSpecColumnDescriptor = mergeColumnDescriptors("", ColumnDescriptors{ // CommitSpec is the specifics of this committed configuration file. type CommitSpec struct { // ContentID is the identity id of a content. - ContentID uint32 `db:"content_id" json:"content_id" gorm:"column:content_id"` - Content *ContentSpec `db:"content" json:"content" gorm:"embedded"` - Memo string `db:"memo" json:"memo" gorm:"column:memo"` + ContentID uint32 `db:"content_id" json:"content_id"` + Content *ContentSpec `db:"content" json:"content"` + Memo string `db:"memo" json:"memo"` } // Validate commit specifics. diff --git a/bcs-services/bcs-bscp/pkg/dal/table/config_hook.go b/bcs-services/bcs-bscp/pkg/dal/table/config_hook.go deleted file mode 100644 index 6037dca885..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/table/config_hook.go +++ /dev/null @@ -1,143 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 table - -import ( - "errors" -) - -// ConfigHook 配置脚本 -type ConfigHook struct { - // ID is an auto-increased value, which is a unique identity of a hook. - ID uint32 `json:"id" gorm:"primaryKey"` - Spec *ConfigHookSpec `json:"spec" gorm:"embedded"` - Attachment *ConfigHookAttachment `json:"attachment" gorm:"embedded"` - Revision *Revision `json:"revision" gorm:"embedded"` -} - -// TableName is the ConfigHook's database table name. -func (s *ConfigHook) TableName() string { - return "config_hooks" -} - -// AppID AuditRes interface -func (s *ConfigHook) AppID() uint32 { - return s.Attachment.AppID -} - -// ResID AuditRes interface -func (s *ConfigHook) ResID() uint32 { - return s.ID -} - -// ResType AuditRes interface -func (s *ConfigHook) ResType() string { - return "config_hook" -} - -// ConfigHookSpec defines all the specifics for ConfigHook set by user. -type ConfigHookSpec struct { - PreHookID uint32 `json:"pre_hook_id" gorm:"pre_hook_id"` - PreHookReleaseID uint32 `json:"pre_hook_release_id" gorm:"pre_hook_release_id"` - PostHookID uint32 `json:"post_hook_id" gorm:"post_hook_id"` - PostHookReleaseID uint32 `json:"post_hook_release_id" gorm:"post_hook_release_id"` -} - -// ConfigHookAttachment defines the ConfigHook attachments. -type ConfigHookAttachment struct { - BizID uint32 `json:"biz_id" gorm:"column:biz_id"` - AppID uint32 `json:"app_id" gorm:"column:app_id"` -} - -// ValidateCreate validate ConfigHook is valid or not when create it. -func (s ConfigHook) ValidateCreate() error { - if s.ID > 0 { - return errors.New("id should not be set") - } - - if s.Spec == nil { - return errors.New("spec not set") - } - - if err := s.Spec.ValidateCreate(); err != nil { - return err - } - - if s.Attachment == nil { - return errors.New("attachment not set") - } - - if err := s.Attachment.Validate(); err != nil { - return err - } - - if s.Revision == nil { - return errors.New("revision not set") - } - - if err := s.Revision.ValidateCreate(); err != nil { - return err - } - - return nil -} - -// ValidateCreate validate ConfigHook spec when it is created. -func (s ConfigHookSpec) ValidateCreate() error { - - if (s.PostHookID <= 0) && (s.PreHookID <= 0) { - return errors.New("preHookID and postHookID should not be set") - - } - - return nil -} - -// Validate whether ConfigHook attachment is valid or not. -func (s ConfigHookAttachment) Validate() error { - if s.BizID <= 0 { - return errors.New("invalid attachment biz id") - } - - if s.AppID <= 0 { - return errors.New("invalid attachment app id") - } - - return nil -} - -// ValidateUpdate validate ConfigHook is valid or not when update it. -func (s ConfigHook) ValidateUpdate() error { - - if s.Attachment == nil { - return errors.New("attachment should be set") - } - - if s.Attachment.AppID <= 0 { - return errors.New("app id should be set") - } - - if s.Attachment.BizID <= 0 { - return errors.New("biz id should be set") - } - - if s.Revision == nil { - return errors.New("revision not set") - } - - if err := s.Revision.ValidateUpdate(); err != nil { - return err - } - - return nil -} diff --git a/bcs-services/bcs-bscp/pkg/dal/table/config_item.go b/bcs-services/bcs-bscp/pkg/dal/table/config_item.go index 20de9f4c5d..c25a663d61 100644 --- a/bcs-services/bcs-bscp/pkg/dal/table/config_item.go +++ b/bcs-services/bcs-bscp/pkg/dal/table/config_item.go @@ -165,19 +165,19 @@ var CISpecColumnDescriptor = mergeColumnDescriptors("", // by user. type ConfigItemSpec struct { // Name is the name of this config item - Name string `db:"name" json:"name" gorm:"column:name"` + Name string `db:"name" json:"name"` // Path is where these configurations to save. // Note: // 1. KV config type do not need path. // 2. this path is a relevant path to the sidecar's system workspace path. // 3. this path is the absolute path for user's workspace path. - Path string `db:"path" json:"path" gorm:"column:name"` + Path string `db:"path" json:"path"` // FileType is the file type of this configuration. - FileType FileFormat `db:"file_type" json:"file_type" gorm:"column:name"` - FileMode FileMode `db:"file_mode" json:"file_mode" gorm:"column:name"` - Memo string `db:"memo" json:"memo" gorm:"column:name"` + FileType FileFormat `db:"file_type" json:"file_type"` + FileMode FileMode `db:"file_mode" json:"file_mode"` + Memo string `db:"memo" json:"memo"` // KV类型,不能有Permission - Permission *FilePermission `db:"permission" json:"permission" gorm:"embedded"` + Permission *FilePermission `db:"permission" json:"permission"` } // ValidateCreate validate the config item's specifics @@ -310,8 +310,8 @@ var CIAttachmentColumnDescriptor = ColumnDescriptors{ // ConfigItemAttachment is a configuration item attachment type ConfigItemAttachment struct { - BizID uint32 `db:"biz_id" json:"biz_id" gorm:"column:biz_id"` - AppID uint32 `db:"app_id" json:"app_id" gorm:"column:app_id"` + BizID uint32 `db:"biz_id" json:"biz_id"` + AppID uint32 `db:"app_id" json:"app_id"` } // Validate config item attachment. diff --git a/bcs-services/bcs-bscp/pkg/dal/table/credential.go b/bcs-services/bcs-bscp/pkg/dal/table/credential.go index 9c815c62ca..494e9316a4 100644 --- a/bcs-services/bcs-bscp/pkg/dal/table/credential.go +++ b/bcs-services/bcs-bscp/pkg/dal/table/credential.go @@ -1,94 +1,94 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 table import ( "errors" "fmt" "time" + + "bscp.io/pkg/criteria/enumor" +) + +// CredentialColumns defines credential's columns +var CredentialColumns = mergeColumns(CredentialColumnDescriptor) + +// CredentialColumnDescriptor is Credential's column descriptors. +var CredentialColumnDescriptor = mergeColumnDescriptors("", + ColumnDescriptors{{Column: "id", NamedC: "id", Type: enumor.Numeric}}, + mergeColumnDescriptors("spec", CredentialSpecColumnDescriptor), + mergeColumnDescriptors("attachment", CredentialAttachmentColumnDescriptor), + mergeColumnDescriptors("revision", RevisionColumnDescriptor), ) -// Credential defines a credential's detail information +// Credential defines a hook for an app to publish. +// it contains the selector to define the scope of the matched instances. type Credential struct { // ID is an auto-increased value, which is a unique identity of a Credential. - ID uint32 `json:"id" gorm:"primaryKey"` - Spec *CredentialSpec `json:"spec" gorm:"embedded"` - Attachment *CredentialAttachment `json:"attachment" gorm:"embedded"` - Revision *Revision `json:"revision" gorm:"embedded"` + ID uint32 `db:"id" json:"id"` + Spec *CredentialSpec `db:"spec" json:"spec"` + Attachment *CredentialAttachment `db:"attachment" json:"attachment"` + Revision *Revision `db:"revision" json:"revision"` } // TableName is the Credential's database table name. -func (c *Credential) TableName() string { - return "credentials" -} - -// AppID AuditRes interface -func (c *Credential) AppID() uint32 { - return 0 -} - -// ResID AuditRes interface -func (c *Credential) ResID() uint32 { - return c.ID -} - -// ResType AuditRes interface -func (c *Credential) ResType() string { - return "credential" +func (s Credential) TableName() Name { + return CredentialTable } // ValidateCreate validate Credential is valid or not when create it. -func (c *Credential) ValidateCreate() error { +func (s Credential) ValidateCreate() error { - if c.ID > 0 { + if s.ID > 0 { return errors.New("id should not be set") } - if c.Spec == nil { + if s.Spec == nil { return errors.New("spec not set") } - if err := c.Spec.ValidateCreate(); err != nil { + if err := s.Spec.ValidateCreate(); err != nil { return err } - if c.Attachment == nil { + if s.Attachment == nil { return errors.New("attachment not set") } - if err := c.Attachment.Validate(); err != nil { + if err := s.Attachment.Validate(); err != nil { return err } - if c.Revision == nil { + if s.Revision == nil { return errors.New("revision not set") } - if err := c.Revision.ValidateCreate(); err != nil { + if err := s.Revision.ValidateCreate(); err != nil { return err } return nil } +// CredentialSpecColumns defines CredentialSpec's columns +var CredentialSpecColumns = mergeColumns(CredentialSpecColumnDescriptor) + +// CredentialSpecColumnDescriptor is CredentialSpec's column descriptors. +var CredentialSpecColumnDescriptor = ColumnDescriptors{ + {Column: "credential_type", NamedC: "credential_type", Type: enumor.String}, + {Column: "enc_credential", NamedC: "enc_credential", Type: enumor.String}, + {Column: "enc_algorithm", NamedC: "enc_algorithm", Type: enumor.String}, + {Column: "memo", NamedC: "memo", Type: enumor.String}, + {Column: "enable", NamedC: "enable", Type: enumor.Boolean}, + {Column: "expired_at", NamedC: "expired_at", Type: enumor.Time}, +} + // CredentialSpec defines all the specifics for credential set by user. type CredentialSpec struct { - CredentialType CredentialType `json:"credential_type" gorm:"column:credential_type"` - EncCredential string `json:"enc_credential" gorm:"column:enc_credential"` - EncAlgorithm string `json:"enc_algorithm" gorm:"column:enc_algorithm"` - Memo string `json:"memo" gorm:"column:memo"` - Enable bool `json:"enable" gorm:"column:enable"` - ExpiredAt time.Time `json:"expired_at" gorm:"column:expired_at"` + CredentialType CredentialType `db:"credential_type" json:"credential_type"` + EncCredential string `db:"enc_credential" json:"enc_credential"` + EncAlgorithm string `db:"enc_algorithm" json:"enc_algorithm"` + Memo string `db:"memo" json:"memo"` + Enable bool `db:"enable" json:"enable"` + ExpiredAt time.Time `db:"expired_at" json:"expired_at"` } const ( @@ -119,7 +119,7 @@ func (s CredentialType) String() string { } // ValidateCreate validate credential spec when it is created. -func (c *CredentialSpec) ValidateCreate() error { +func (c CredentialSpec) ValidateCreate() error { if err := c.CredentialType.Validate(); err != nil { return err } @@ -127,7 +127,7 @@ func (c *CredentialSpec) ValidateCreate() error { } // ValidateUpdate validate credential spec when it is updated. -func (c *CredentialSpec) ValidateUpdate() error { +func (c CredentialSpec) ValidateUpdate() error { if c.CredentialType != "" { return errors.New("credential type cannot be updated once created") } @@ -142,16 +142,21 @@ func (c *CredentialSpec) ValidateUpdate() error { // CredentialAttachment defines the credential attachments. type CredentialAttachment struct { - BizID uint32 `json:"biz_id" gorm:"column:biz_id"` + BizID uint32 `db:"biz_id" json:"biz_id"` +} + +// CredentialAttachmentColumnDescriptor is CredentialAttachment's column descriptors. +var CredentialAttachmentColumnDescriptor = ColumnDescriptors{ + {Column: "biz_id", NamedC: "biz_id", Type: enumor.Numeric}, } // IsEmpty test whether credential attachment is empty or not. -func (c *CredentialAttachment) IsEmpty() bool { +func (c CredentialAttachment) IsEmpty() bool { return c.BizID == 0 } // Validate whether credential attachment is valid or not. -func (c *CredentialAttachment) Validate() error { +func (c CredentialAttachment) Validate() error { if c.BizID <= 0 { return errors.New("invalid attachment biz id") } @@ -159,13 +164,25 @@ func (c *CredentialAttachment) Validate() error { return nil } +// CredentialRevisionColumns defines all the Revision table's columns. +var CredentialRevisionColumns = mergeColumns(CredentialRevisionColumnDescriptor) + +// CredentialRevisionColumnDescriptor is Revision's column descriptors. +var CredentialRevisionColumnDescriptor = ColumnDescriptors{ + {Column: "creator", NamedC: "creator", Type: enumor.String}, + {Column: "reviser", NamedC: "reviser", Type: enumor.String}, + {Column: "created_at", NamedC: "created_at", Type: enumor.Time}, + {Column: "updated_at", NamedC: "updated_at", Type: enumor.Time}, + {Column: "expired_at", NamedC: "expired_at", Type: enumor.Time}, +} + // ValidateDelete validate the credential's info when delete it. -func (c *Credential) ValidateDelete() error { - if c.ID <= 0 { +func (s Credential) ValidateDelete() error { + if s.ID <= 0 { return errors.New("credential id should be set") } - if c.Attachment.BizID <= 0 { + if s.Attachment.BizID <= 0 { return errors.New("biz id should be set") } @@ -173,29 +190,29 @@ func (c *Credential) ValidateDelete() error { } // ValidateUpdate validate Credential is valid or not when update it. -func (c *Credential) ValidateUpdate() error { +func (s Credential) ValidateUpdate() error { - if c.ID <= 0 { + if s.ID <= 0 { return errors.New("id should be set") } - if c.Spec == nil { + if s.Spec == nil { return errors.New("spec should be set") } - if err := c.Spec.ValidateUpdate(); err != nil { + if err := s.Spec.ValidateUpdate(); err != nil { return err } - if c.Attachment == nil { + if s.Attachment == nil { return errors.New("attachment should be set") } - if c.Attachment.BizID <= 0 { + if s.Attachment.BizID <= 0 { return errors.New("biz id should be set") } - if c.Revision == nil { + if s.Revision == nil { return errors.New("revision not set") } diff --git a/bcs-services/bcs-bscp/pkg/dal/table/credential_scope.go b/bcs-services/bcs-bscp/pkg/dal/table/credential_scope.go index ae0eaf8228..b83b9c402d 100644 --- a/bcs-services/bcs-bscp/pkg/dal/table/credential_scope.go +++ b/bcs-services/bcs-bscp/pkg/dal/table/credential_scope.go @@ -1,102 +1,102 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 table import ( "errors" "time" + "bscp.io/pkg/criteria/enumor" "bscp.io/pkg/runtime/credential" ) +// CredentialColumns defines credential's columns +var CredentialScopeColumns = mergeColumns(CredentialScopeColumnDescriptor) + +// CredentialScopeColumnDescriptor is mergeColumnDescriptors +var CredentialScopeColumnDescriptor = mergeColumnDescriptors("", + ColumnDescriptors{{Column: "id", NamedC: "id", Type: enumor.Numeric}}, + mergeColumnDescriptors("spec", CredentialScopeSpecColumnDescriptor), + mergeColumnDescriptors("attachment", CredentialScopeAttachmentColumnDescriptor), + mergeColumnDescriptors("revision", RevisionColumnDescriptor), +) + // CredentialScope defines CredentialScope's columns type CredentialScope struct { // ID is an auto-increased value, which is a unique identity of a Credential. - ID uint32 `json:"id" gorm:"primaryKey"` - Spec *CredentialScopeSpec `json:"spec" gorm:"embedded"` - Attachment *CredentialScopeAttachment `json:"attachment" gorm:"embedded"` - Revision *Revision `json:"revision" gorm:"embedded"` + ID uint32 `db:"id" json:"id"` + Spec *CredentialScopeSpec `db:"spec" json:"spec"` + Attachment *CredentialScopeAttachment `db:"attachment" json:"attachment"` + Revision *Revision `db:"revision" json:"revision"` } // TableName is the CredentialScope's database table name. -func (c *CredentialScope) TableName() string { - return "credential_scopes" -} - -// AppID AuditRes interface -func (c *CredentialScope) AppID() uint32 { - return 0 -} - -// ResID AuditRes interface -func (c *CredentialScope) ResID() uint32 { - return c.ID -} - -// ResType AuditRes interface -func (c *CredentialScope) ResType() string { - return "credential_scope" +func (s CredentialScope) TableName() Name { + return CredentialScopeTable } // ValidateCreate validate Credential is valid or not when create it. -func (c *CredentialScope) ValidateCreate() error { +func (s CredentialScope) ValidateCreate() error { - if c.ID > 0 { + if s.ID > 0 { return errors.New("id should not be set") } - if c.Spec == nil { + if s.Spec == nil { return errors.New("spec not set") } - if err := c.Spec.CredentialScope.Validate(); err != nil { + if err := s.Spec.CredentialScope.Validate(); err != nil { return err } - if c.Attachment == nil { + if s.Attachment == nil { return errors.New("attachment not set") } - if c.Revision == nil { + if s.Revision == nil { return errors.New("revision not set") } - if err := c.Revision.ValidateCreate(); err != nil { + if err := s.Revision.ValidateCreate(); err != nil { return err } return nil } +// CredentialScopeSpecColumns defines credential scope's columns +var CredentialScopeSpecColumns = mergeColumns(CredentialScopeSpecColumnDescriptor) + +// CredentialScopeSpecColumnDescriptor defines credential scope's descriptor +var CredentialScopeSpecColumnDescriptor = ColumnDescriptors{ + {Column: "credential_scope", NamedC: "credential_scope", Type: enumor.String}, + {Column: "expired_at", NamedC: "expired_at", Type: enumor.Time}, +} + // CredentialScopeSpec defines credential scope's Spec type CredentialScopeSpec struct { - CredentialScope credential.CredentialScope `json:"credential_scope" gorm:"column:credential_scope"` - ExpiredAt time.Time `json:"expired_at" gorm:"column:expired_at"` + CredentialScope credential.CredentialScope `db:"credential_scope" json:"credential_scope"` + ExpiredAt time.Time `db:"expired_at" json:"expired_at"` +} + +// CredentialScopeAttachmentColumnDescriptor defines credential scope's ColumnDescriptors +var CredentialScopeAttachmentColumnDescriptor = ColumnDescriptors{ + {Column: "biz_id", NamedC: "biz_id", Type: enumor.Numeric}, + {Column: "credential_id", NamedC: "credential_id", Type: enumor.Numeric}, } // CredentialScopeAttachment defines the credential scope attachments. type CredentialScopeAttachment struct { - BizID uint32 `json:"biz_id" gorm:"column:biz_id"` - CredentialId uint32 `json:"credential_id" gorm:"column:credential_id"` + BizID uint32 `db:"biz_id" json:"biz_id"` + CredentialId uint32 `db:"credential_id" json:"credential_id"` } // ValidateDelete credential scope validate -func (c *CredentialScope) ValidateDelete() error { - if c.ID <= 0 { +func (s CredentialScope) ValidateDelete() error { + if s.ID <= 0 { return errors.New("credential scope id should be set") } - if c.Attachment.BizID <= 0 { + if s.Attachment.BizID <= 0 { return errors.New("biz id should be set") } @@ -104,25 +104,25 @@ func (c *CredentialScope) ValidateDelete() error { } // ValidateUpdate validate Credential is valid or not when update it. -func (c *CredentialScope) ValidateUpdate() error { +func (s CredentialScope) ValidateUpdate() error { - if c.ID <= 0 { + if s.ID <= 0 { return errors.New("credential scope id should be set") } - if c.Spec == nil { + if s.Spec == nil { return errors.New("spec not set") } - if err := c.Spec.CredentialScope.Validate(); err != nil { + if err := s.Spec.CredentialScope.Validate(); err != nil { return err } - if c.Attachment == nil { + if s.Attachment == nil { return errors.New("attachment not set") } - if c.Revision == nil { + if s.Revision == nil { return errors.New("revision not set") } diff --git a/bcs-services/bcs-bscp/pkg/dal/table/event.go b/bcs-services/bcs-bscp/pkg/dal/table/event.go index 22dd97e52c..cefd5c6c0a 100644 --- a/bcs-services/bcs-bscp/pkg/dal/table/event.go +++ b/bcs-services/bcs-bscp/pkg/dal/table/event.go @@ -15,6 +15,8 @@ package table import ( "errors" "fmt" + + "bscp.io/pkg/criteria/enumor" ) // Event table's primary key reserved 500(as is [1, 500]) ids as @@ -26,41 +28,37 @@ import ( // the cursor reminder's record. const EventCursorReminderPrimaryID = 1 +// EventColumns defines Event's columns +var EventColumns = mergeColumns(EventColumnDescriptor) + +// EventColumnDescriptor is Event's column descriptors. +var EventColumnDescriptor = mergeColumnDescriptors("", + ColumnDescriptors{{Column: "id", NamedC: "id", Type: enumor.Numeric}}, + mergeColumnDescriptors("spec", EventSpecColumnDescriptor), + mergeColumnDescriptors("attachment", EventAttachmentColumnDescriptor), + mergeColumnDescriptors("state", EventStateColumnDescriptor), + mergeColumnDescriptors("revision", CreatedRevisionColumnDescriptor)) + // Event defines a resource's changes details, which is used to // do caching operations periodically. // an event can not be edited after created. type Event struct { // ID is an auto-increased value, which is a unique identity // of an event. - ID uint32 `json:"id" gorm:"primaryKey"` - Spec *EventSpec `json:"spec" gorm:"embedded"` - Attachment *EventAttachment `json:"attachment" gorm:"embedded"` - State *EventState `json:"state" gorm:"embedded"` - Revision *CreatedRevision `json:"revision" gorm:"embedded"` + ID uint32 `db:"id" json:"id"` + Spec *EventSpec `db:"spec" json:"spec"` + Attachment *EventAttachment `db:"attachment" json:"attachment"` + State *EventState `db:"state" json:"state"` + Revision *CreatedRevision `db:"revision" json:"revision"` } // TableName is resource change event's database table name. -func (e *Event) TableName() string { - return "events" -} - -// AppID AuditRes interface -func (e *Event) AppID() uint32 { - return 0 -} - -// ResID AuditRes interface -func (e *Event) ResID() uint32 { - return e.ID -} - -// ResType AuditRes interface -func (e *Event) ResType() string { - return "event" +func (e Event) TableName() Name { + return EventTable } // ValidateCreate the event is valid or not when create it. -func (e *Event) ValidateCreate() error { +func (e Event) ValidateCreate() error { if e.ID > 0 { return errors.New("id should not be set") } @@ -146,19 +144,29 @@ const ( CredentialEvent EventResource = "credential" ) +// EventSpecColumns defines EventSpec's columns +var EventSpecColumns = mergeColumns(EventSpecColumnDescriptor) + +// EventSpecColumnDescriptor is EventSpec's column descriptors. +var EventSpecColumnDescriptor = ColumnDescriptors{ + {Column: "resource", NamedC: "resource", Type: enumor.String}, + {Column: "resource_id", NamedC: "resource_id", Type: enumor.Numeric}, + {Column: "resource_uid", NamedC: "resource_uid", Type: enumor.String}, + {Column: "op_type", NamedC: "op_type", Type: enumor.String}} + // EventSpec defines the specifics of event type EventSpec struct { // Resource defines what kind of resource an event belongs to - Resource EventResource `json:"resource" gorm:"column:resource"` + Resource EventResource `db:"resource" json:"resource"` // ResourceID is the identity of this changed resource with uint32 type. - ResourceID uint32 `json:"resource_id" gorm:"column:resource_id"` + ResourceID uint32 `db:"resource_id" json:"resource_id"` // ResourceUid is the identity of this changed resource with string type. - ResourceUid string `json:"resource_uid" gorm:"column:resource_uid"` - OpType EventType `json:"op_type" gorm:"column:op_type"` + ResourceUid string `db:"resource_uid" json:"resource_uid"` + OpType EventType `db:"op_type" json:"op_type"` } // Validate event specifics -func (e *EventSpec) Validate() error { +func (e EventSpec) Validate() error { if err := e.Resource.Validate(); err != nil { return fmt.Errorf("validate resource failed, err: %v", err) } @@ -175,14 +183,22 @@ func (e *EventSpec) Validate() error { return nil } +// EventAttachmentColumns defines EventAttachment's columns +var EventAttachmentColumns = mergeColumns(EventAttachmentColumnDescriptor) + +// EventAttachmentColumnDescriptor is EventAttachment's column descriptors. +var EventAttachmentColumnDescriptor = ColumnDescriptors{ + {Column: "biz_id", NamedC: "biz_id", Type: enumor.Numeric}, + {Column: "app_id", NamedC: "app_id", Type: enumor.Numeric}} + // EventAttachment is the attachment of an event. type EventAttachment struct { - BizID uint32 `json:"biz_id" gorm:"column:biz_id"` - AppID uint32 `json:"app_id" gorm:"column:app_id"` + BizID uint32 `db:"biz_id" json:"biz_id"` + AppID uint32 `db:"app_id" json:"app_id"` } // Validate the event attachment is valid or not. -func (ea *EventAttachment) Validate() error { +func (ea EventAttachment) Validate() error { if ea.BizID <= 0 { return errors.New("invalid biz id") } @@ -209,6 +225,13 @@ const ( FailedFS EventFinalStatus = 2 ) +// EventStateColumns defines EventState's columns +var EventStateColumns = mergeColumns(EventStateColumnDescriptor) + +// EventStateColumnDescriptor is EventState's column descriptors. +var EventStateColumnDescriptor = ColumnDescriptors{ + {Column: "final_status", NamedC: "final_status", Type: enumor.Numeric}} + // EventState defines the generated event's related state infos. type EventState struct { // As is known, event is inserted before the previous business logic @@ -219,5 +242,5 @@ type EventState struct { // real published release can be rollback(failed) on another db sharding). // This status is updated after the sharding transaction is finished with // a success or failed state. - FinalStatus EventFinalStatus `json:"final_status" gorm:"column:final_status"` + FinalStatus EventFinalStatus `db:"final_status" json:"final_status"` } diff --git a/bcs-services/bcs-bscp/pkg/dal/table/group.go b/bcs-services/bcs-bscp/pkg/dal/table/group.go index 59d757ed90..4336c9dc7b 100644 --- a/bcs-services/bcs-bscp/pkg/dal/table/group.go +++ b/bcs-services/bcs-bscp/pkg/dal/table/group.go @@ -35,15 +35,15 @@ var GroupColumnDescriptor = mergeColumnDescriptors("", // it contains the selector to define the scope of the matched instances. type Group struct { // ID is an auto-increased value, which is a unique identity of a group. - ID uint32 `db:"id" json:"id" gorm:"primaryKey"` - Spec *GroupSpec `db:"spec" json:"spec" gorm:"embedded"` - Attachment *GroupAttachment `db:"attachment" json:"attachment" gorm:"embedded"` - Revision *Revision `db:"revision" json:"revision" gorm:"embedded"` + ID uint32 `db:"id" json:"id"` + Spec *GroupSpec `db:"spec" json:"spec"` + Attachment *GroupAttachment `db:"attachment" json:"attachment"` + Revision *Revision `db:"revision" json:"revision"` } // TableName is the group's database table name. -func (s Group) TableName() string { - return "groups" +func (s Group) TableName() Name { + return GroupTable } // ValidateCreate validate group is valid or not when create it. @@ -148,10 +148,10 @@ type GroupSpec struct { Name string `db:"name" json:"name"` // Public defines weather group can be used by all apps. // It can not be updated once it is created. - Public bool `db:"public" json:"public" gorm:"column:public"` - Mode GroupMode `db:"mode" json:"mode" gorm:"column:mode"` - Selector *selector.Selector `db:"selector" json:"selector" gorm:"column:selector;type:json"` - UID string `db:"uid" json:"uid" gorm:"column:uid"` + Public bool `db:"public" json:"public"` + Mode GroupMode `db:"mode" json:"mode"` + Selector *selector.Selector `db:"selector" json:"selector"` + UID string `db:"uid" json:"uid"` } const ( @@ -163,7 +163,7 @@ const ( // Default will select instances that won't be selected by any other released groups Default GroupMode = "default" // BuiltIn define bscp built-in group,eg. ClusterID, Namespace, CMDBModuleID... - // Note: BuiltIn define bscp built-in group,eg. ClusterID, Namespace, CMDBModuleID... + // TODO: BuiltIn define bscp built-in group,eg. ClusterID, Namespace, CMDBModuleID... BuiltIn GroupMode = "builtin" ) @@ -231,7 +231,7 @@ var GroupAttachmentColumnDescriptor = ColumnDescriptors{ // GroupAttachment defines the group attachments. type GroupAttachment struct { - BizID uint32 `db:"biz_id" json:"biz_id" gorm:"column:biz_id"` + BizID uint32 `db:"biz_id" json:"biz_id"` } // IsEmpty test whether group attachment is empty or not. diff --git a/bcs-services/bcs-bscp/pkg/dal/table/group_app_bind.go b/bcs-services/bcs-bscp/pkg/dal/table/group_app_bind.go index 52dd703fac..15e31db78b 100644 --- a/bcs-services/bcs-bscp/pkg/dal/table/group_app_bind.go +++ b/bcs-services/bcs-bscp/pkg/dal/table/group_app_bind.go @@ -34,15 +34,15 @@ var GroupAppBindColumnDescriptor = mergeColumnDescriptors("", type GroupAppBind struct { // ID is an auto-increased value, which is a group app's // unique identity. - ID uint32 `db:"id" json:"id" gorm:"primaryKey"` - GroupID uint32 `db:"group_id" json:"group_id" gorm:"column:group_id"` - AppID uint32 `db:"app_id" json:"app_id" gorm:"column:app_id"` - BizID uint32 `db:"biz_id" json:"biz_id" gorm:"column:biz_id"` + ID uint32 `db:"id" json:"id"` + GroupID uint32 `db:"group_id" json:"group_id"` + AppID uint32 `db:"app_id" json:"app_id"` + BizID uint32 `db:"biz_id" json:"biz_id"` } // TableName is the group app's database table name. -func (c GroupAppBind) TableName() string { - return "group_app_binds" +func (c GroupAppBind) TableName() Name { + return GroupAppBindTable } // ValidateCreate validate the group app's specific when create it. diff --git a/bcs-services/bcs-bscp/pkg/dal/table/hook.go b/bcs-services/bcs-bscp/pkg/dal/table/hook.go index 88637cb950..121fb2583b 100644 --- a/bcs-services/bcs-bscp/pkg/dal/table/hook.go +++ b/bcs-services/bcs-bscp/pkg/dal/table/hook.go @@ -20,64 +20,101 @@ import ( "bscp.io/pkg/criteria/validator" ) +// HookColumns defines Hook's columns +var HookColumns = mergeColumns(HookColumnDescriptor) + +// HookColumnDescriptor is Hook's column descriptors. +var HookColumnDescriptor = mergeColumnDescriptors("", + ColumnDescriptors{{Column: "id", NamedC: "id", Type: enumor.Numeric}}, + mergeColumnDescriptors("spec", HookSpecColumnDescriptor), + mergeColumnDescriptors("attachment", HookAttachmentColumnDescriptor), + mergeColumnDescriptors("revision", RevisionColumnDescriptor)) + // Hook defines a hook for an app to publish. // it contains the selector to define the scope of the matched instances. type Hook struct { // ID is an auto-increased value, which is a unique identity of a hook. - ID uint32 `json:"id" gorm:"primaryKey"` - Spec *HookSpec `json:"spec" gorm:"embedded"` - Attachment *HookAttachment `json:"attachment" gorm:"embedded"` - Revision *Revision `json:"revision" gorm:"embedded"` -} - -// TableName is the Hook's database table name. -func (h *Hook) TableName() string { - return "hooks" -} - -// AppID HookRes interface -func (h *Hook) AppID() uint32 { - return 0 -} - -// ResID HookRes interface -func (h *Hook) ResID() uint32 { - return h.ID + ID uint32 `db:"id" json:"id"` + Spec *HookSpec `db:"spec" json:"spec"` + Attachment *HookAttachment `db:"attachment" json:"attachment"` + Revision *Revision `db:"revision" json:"revision"` } -// ResType HookRes interface -func (h *Hook) ResType() string { - return "hook" +// TableName is the hook's database table name. +func (s Hook) TableName() Name { + return HookTable } // ValidateCreate validate hook is valid or not when create it. -func (h Hook) ValidateCreate() error { +func (s Hook) ValidateCreate() error { - if h.ID > 0 { + if s.ID > 0 { return errors.New("id should not be set") } - if h.Spec == nil { + if s.Spec == nil { return errors.New("spec not set") } - if err := h.Spec.ValidateCreate(); err != nil { + if err := s.Spec.ValidateCreate(); err != nil { return err } - if h.Attachment == nil { + if s.Attachment == nil { return errors.New("attachment not set") } - if err := h.Attachment.Validate(); err != nil { + if err := s.Attachment.Validate(); err != nil { return err } - if h.Revision == nil { + if s.Revision == nil { + return errors.New("revision not set") + } + + if err := s.Revision.ValidateCreate(); err != nil { + return err + } + + return nil +} + +// ValidateUpdate validate hook is valid or not when update it. +func (s Hook) ValidateUpdate() error { + + if s.ID <= 0 { + return errors.New("id should be set") + } + + changed := false + if s.Spec != nil { + changed = true + if err := s.Spec.ValidateUpdate(); err != nil { + return err + } + } + + if s.Attachment == nil { + return errors.New("attachment should be set") + } + + if s.Attachment.BizID <= 0 { + return errors.New("biz id should be set") + } + + if s.Attachment.AppID <= 0 { + return errors.New("app id should be set") + } + + if !changed { + return errors.New("nothing is found to be change") + } + + if s.Revision == nil { return errors.New("revision not set") } - if err := h.Revision.ValidateCreate(); err != nil { + if err := s.Revision.ValidateUpdate(); err != nil { return err } @@ -85,27 +122,41 @@ func (h Hook) ValidateCreate() error { } // ValidateDelete validate the hook's info when delete it. -func (h Hook) ValidateDelete() error { - if h.ID <= 0 { +func (s Hook) ValidateDelete() error { + if s.ID <= 0 { return errors.New("hook id should be set") } - if h.Attachment.BizID <= 0 { + if s.Attachment.BizID <= 0 { return errors.New("biz id should be set") } return nil } +// HookSpecColumns defines HookSpec's columns +var HookSpecColumns = mergeColumns(HookSpecColumnDescriptor) + +// HookSpecColumnDescriptor is HookSpec's column descriptors. +var HookSpecColumnDescriptor = ColumnDescriptors{ + {Column: "name", NamedC: "name", Type: enumor.String}, + {Column: "pre_type", NamedC: "pre_type", Type: enumor.String}, + {Column: "pre_hook", NamedC: "pre_hook", Type: enumor.String}, + {Column: "post_type", NamedC: "post_type", Type: enumor.String}, + {Column: "post_hook", NamedC: "post_hook", Type: enumor.String}, +} + // HookSpec defines all the specifics for hook set by user. type HookSpec struct { - Name string `json:"name" gorm:"column:name"` - // Type is the hook type of hook - Type HookType `json:"type" gorm:"column:type"` - PublishNum uint32 `json:"publish_num" gorm:"column:publish_num"` - // Tag - Tag string `json:"tag" gorm:"column:tag"` - Memo string `json:"memo" gorm:"column:memo"` + Name string `db:"name" json:"name"` + // PreType is the hook type of pre hook + PreType HookType `db:"pre_type" json:"pre_type"` + // PreHook is the content of pre hook + PreHook string `db:"pre_hook" json:"pre_hook"` + // PostType is the hook type of post hook + PostType HookType `db:"post_type" json:"post_type"` + // PostHook is the content of post hook + PostHook string `db:"post_hook" json:"post_hook"` } const ( @@ -139,30 +190,99 @@ func (s HookSpec) ValidateCreate() error { if err := validator.ValidateName(s.Name); err != nil { return err } + if err := s.PreType.Validate(); err != nil { + return err + } + if err := s.PostType.Validate(); err != nil { + return err + } + + if err := s.ValidateHookContentSecurity(); err != nil { + return err + } + + return nil +} + +// ValidateUpdate validate hook spec when it is updated. +func (s HookSpec) ValidateUpdate() error { + if err := validator.ValidateName(s.Name); err != nil { + return err + } - if err := s.Type.Validate(); err != nil { + if err := s.ValidateHookContentSecurity(); err != nil { return err } return nil } +// ValidateHookContentSecurity validate security of hook content +func (s HookSpec) ValidateHookContentSecurity() error { + if s.PreHook != "" { + switch s.PreType { + case Shell: + if err := s.ValidateShellHookSecurity(s.PreHook); err != nil { + return err + } + case Python: + if err := s.ValidatePythonHookSecurity(s.PreHook); err != nil { + return err + } + case "": + return fmt.Errorf("pre hook must set a hook type") + } + } + + if s.PostHook != "" { + switch s.PostType { + case Shell: + if err := s.ValidateShellHookSecurity(s.PostHook); err != nil { + return err + } + case Python: + if err := s.ValidatePythonHookSecurity(s.PostHook); err != nil { + return err + } + case "": + return fmt.Errorf("post hook must set a hook type") + } + } + + return nil +} + +// ValidateShellHookSecurity validate security of shell hook content +func (s HookSpec) ValidateShellHookSecurity(hookContent string) error { + // TODO implement this + return nil +} + +// ValidatePythonHookSecurity validate security of python hook content +func (s HookSpec) ValidatePythonHookSecurity(hookContent string) error { + // TODO implement this + return nil +} + // HookAttachmentColumns defines HookAttachment's columns var HookAttachmentColumns = mergeColumns(HookAttachmentColumnDescriptor) // HookAttachmentColumnDescriptor is HookAttachment's column descriptors. var HookAttachmentColumnDescriptor = ColumnDescriptors{ {Column: "biz_id", NamedC: "biz_id", Type: enumor.Numeric}, -} + {Column: "app_id", NamedC: "app_id", Type: enumor.Numeric}, + {Column: "release_id", NamedC: "release_id", Type: enumor.Numeric}} // HookAttachment defines the hook attachments. type HookAttachment struct { - BizID uint32 `db:"biz_id" gorm:"column:biz_id"` + BizID uint32 `db:"biz_id" json:"biz_id"` + AppID uint32 `db:"app_id" json:"app_id"` + ReleaseID uint32 `db:"release_id" json:"release_id"` } // IsEmpty test whether hook attachment is empty or not. func (s HookAttachment) IsEmpty() bool { - return s.BizID == 0 + return s.BizID == 0 && s.AppID == 0 } // Validate whether hook attachment is valid or not. @@ -171,5 +291,9 @@ func (s HookAttachment) Validate() error { return errors.New("invalid attachment biz id") } + if s.AppID <= 0 { + return errors.New("invalid attachment app id") + } + return nil } diff --git a/bcs-services/bcs-bscp/pkg/dal/table/hook_release.go b/bcs-services/bcs-bscp/pkg/dal/table/hook_release.go deleted file mode 100644 index 14cf08e369..0000000000 --- a/bcs-services/bcs-bscp/pkg/dal/table/hook_release.go +++ /dev/null @@ -1,252 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 table - -import ( - "errors" - "fmt" - - "bscp.io/pkg/criteria/validator" -) - -// HookRelease 脚本版本 -type HookRelease struct { - // ID is an auto-increased value, which is a unique identity of a hook. - ID uint32 `db:"id" json:"id"` - - Spec *HookReleaseSpec `json:"spec" gorm:"embedded"` - Attachment *HookReleaseAttachment `json:"attachment" gorm:"embedded"` - Revision *Revision `json:"revision" gorm:"embedded"` -} - -// HookReleaseSpec defines all the specifics for hook set by user. -type HookReleaseSpec struct { - Name string `json:"name" gorm:"column:name"` - PublishNum uint32 `json:"publish_num" gorm:"column:publish_num"` - State HookReleaseStatus `json:"state" gorm:"column:state"` - Content string `json:"content" gorm:"column:content"` - Memo string `json:"memo" gorm:"column:memo"` -} - -// HookReleaseAttachment defines the hook attachments. -type HookReleaseAttachment struct { - BizID uint32 `json:"biz_id" gorm:"column:biz_id"` - HookID uint32 `json:"hook_id" gorm:"column:hook_id"` -} - -// TableName is the hook's database table name. -func (r *HookRelease) TableName() Name { - return "hook_releases" -} - -// AppID AuditRes interface -func (r *HookRelease) AppID() uint32 { - return 0 -} - -// ResID AuditRes interface -func (r *HookRelease) ResID() uint32 { - return r.ID -} - -// ResType AuditRes interface -func (r *HookRelease) ResType() string { - return "hook_releases" -} - -// ValidateCreate validate hook is valid or not when create it. -func (r *HookRelease) ValidateCreate() error { - - if r.Spec == nil { - return errors.New("spec not set") - } - - if err := r.Spec.ValidateCreate(); err != nil { - return err - } - - if r.Attachment == nil { - return errors.New("attachment not set") - } - - if err := r.Attachment.Validate(); err != nil { - return err - } - - if r.Revision == nil { - return errors.New("revision not set") - } - - if err := r.Revision.ValidateCreate(); err != nil { - return err - } - - return nil -} - -// ValidateCreate validate spec when created. -func (s *HookReleaseSpec) ValidateCreate() error { - - if err := validator.ValidateName(s.Name); err != nil { - return err - } - - if err := validator.ValidateMemo(s.Memo, false); err != nil { - return err - } - - return nil -} - -// ValidateUpdate validate spec when updated. -func (s *HookReleaseSpec) ValidateUpdate() error { - - if err := validator.ValidateName(s.Name); err != nil { - return err - } - - if err := validator.ValidateMemo(s.Memo, false); err != nil { - return err - } - - return nil -} - -// Validate validate Attachment. -func (a HookReleaseAttachment) Validate() error { - - if a.BizID <= 0 { - return errors.New("biz id should be set") - } - - if a.HookID <= 0 { - return errors.New("hook id should be set") - } - - return nil -} - -// ValidateDelete validate the hook release info when delete it. -func (r HookRelease) ValidateDelete() error { - if r.ID <= 0 { - return errors.New("hook release id should be set") - } - - if r.Attachment.BizID <= 0 { - return errors.New("biz id should be set") - } - - if r.Attachment.HookID <= 0 { - return errors.New("hook id should be set") - } - - return nil -} - -// ValidateDeleteByHookID validate the hook release info when delete it. -func (r HookRelease) ValidateDeleteByHookID() error { - - if r.Attachment.BizID <= 0 { - return errors.New("biz id should be set") - } - - if r.Attachment.HookID <= 0 { - return errors.New("hook id should be set") - } - - return nil -} - -// ValidatePublish validate the Publish -func (r HookRelease) ValidatePublish() error { - - if r.ID <= 0 { - return errors.New("hook release id should be set") - } - - if r.Attachment.BizID <= 0 { - return errors.New("biz id should be set") - } - - if r.Attachment.HookID <= 0 { - return errors.New("hook id should be set") - } - - return nil -} - -// ValidateUpdate validate the update -func (r HookRelease) ValidateUpdate() error { - - if r.ID <= 0 { - return errors.New("hook release id should be set") - } - - if r.Attachment.BizID <= 0 { - return errors.New("biz id should be set") - } - - if r.Attachment.HookID <= 0 { - return errors.New("hook id should be set") - } - - if r.Spec == nil { - return errors.New("spec not set") - } - - if err := r.Spec.ValidateUpdate(); err != nil { - return err - } - - if r.Revision == nil { - return errors.New("revision not set") - } - - if err := r.Revision.ValidateUpdate(); err != nil { - return err - } - - return nil -} - -const ( - // NotDeployedHookReleased .... - NotDeployedHookReleased HookReleaseStatus = "not_deployed" - - // DeployedHookReleased ... - DeployedHookReleased HookReleaseStatus = "deployed" - - // ShutdownHookReleased ... - ShutdownHookReleased HookReleaseStatus = "shutdown" -) - -// HookReleaseStatus defines hook release status. -type HookReleaseStatus string - -// String returns hook release status string. -func (s HookReleaseStatus) String() string { - return string(s) -} - -// Validate strategy set type. -func (s HookReleaseStatus) Validate() error { - switch s { - case ShutdownHookReleased: - case NotDeployedHookReleased: - case DeployedHookReleased: - default: - return fmt.Errorf("unsupported hook release released status: %s", s) - } - - return nil -} diff --git a/bcs-services/bcs-bscp/pkg/dal/table/release.go b/bcs-services/bcs-bscp/pkg/dal/table/release.go index 9f7712133d..eaa2fbaeab 100644 --- a/bcs-services/bcs-bscp/pkg/dal/table/release.go +++ b/bcs-services/bcs-bscp/pkg/dal/table/release.go @@ -36,9 +36,9 @@ type Release struct { // ID is an auto-increased value, which is a unique identity // of a commit. ID uint32 `db:"id" json:"id"` - Spec *ReleaseSpec `db:"spec" json:"spec" gorm:"embedded"` - Attachment *ReleaseAttachment `db:"attachment" json:"attachment" gorm:"embedded"` - Revision *CreatedRevision `db:"revision" json:"revision" gorm:"embedded"` + Spec *ReleaseSpec `db:"spec" json:"spec"` + Attachment *ReleaseAttachment `db:"attachment" json:"attachment"` + Revision *CreatedRevision `db:"revision" json:"revision"` } // TableName is the release's database table name. @@ -46,21 +46,6 @@ func (r Release) TableName() Name { return ReleaseTable } -// AppID AuditRes interface -func (r *Release) AppID() uint32 { - return r.Attachment.AppID -} - -// ResID AuditRes interface -func (r *Release) ResID() uint32 { - return r.ID -} - -// ResType AuditRes interface -func (r *Release) ResType() string { - return "release" -} - // ValidateCreate a release's information func (r Release) ValidateCreate() error { if r.ID != 0 { @@ -98,37 +83,19 @@ func (r Release) ValidateCreate() error { var ReleaseSpecColumns = mergeColumns(ReleaseSpecColumnDescriptor) // ReleaseSpecColumnDescriptor is ReleaseSpec's column descriptors. -var ReleaseSpecColumnDescriptor = mergeColumnDescriptors("", - ColumnDescriptors{ - {Column: "name", NamedC: "name", Type: enumor.String}, - {Column: "memo", NamedC: "memo", Type: enumor.String}, - {Column: "deprecated", NamedC: "deprecated", Type: enumor.Boolean}, - {Column: "publish_num", NamedC: "publish_num", Type: enumor.Numeric}, - }, - mergeColumnDescriptors("hook", HookColumnDescriptor)) - -var HookColumnDescriptor = ColumnDescriptors{ - {Column: "pre_hook_id", NamedC: "pre_hook_id", Type: enumor.Numeric}, - {Column: "pre_hook_release_id", NamedC: "pre_hook_release_id", Type: enumor.Numeric}, - {Column: "post_hook_id", NamedC: "post_hook_id", Type: enumor.Numeric}, - {Column: "post_hook_release_id", NamedC: "post_hook_release_id", Type: enumor.Numeric}, -} - -// ReleaseSpec defines all the specifics related with a release, which is set by user. +var ReleaseSpecColumnDescriptor = ColumnDescriptors{ + {Column: "name", NamedC: "name", Type: enumor.String}, + {Column: "memo", NamedC: "memo", Type: enumor.String}, + {Column: "deprecated", NamedC: "deprecated", Type: enumor.Boolean}, + {Column: "publish_num", NamedC: "publish_num", Type: enumor.Numeric}} + +// ReleaseSpec defines all the specifics related with a release, which is +// set by user. type ReleaseSpec struct { - Name string `db:"name" json:"name"` - Memo string `db:"memo" json:"memo"` - Deprecated bool `db:"deprecated" json:"deprecated"` - PublishNum uint32 `db:"publish_num" json:"publish_num"` - Hook *ReleaseHook `db:"hook" json:"hook" gorm:"embedded"` -} - -// ReleaseHook is a resource's resource hook -type ReleaseHook struct { - PreHookID uint32 `db:"pre_hook_id" json:"pre_hook_id" gorm:"pre_hook_id"` - PreHookReleaseID uint32 `db:"pre_hook_release_id" json:"pre_hook_release_id" gorm:"pre_hook_release_id"` - PostHookID uint32 `db:"post_hook_id" json:"post_hook_id" gorm:"post_hook_id"` - PostHookReleaseID uint32 `db:"post_hook_release_id" json:"post_hook_release_id" gorm:"post_hook_release_id"` + Name string `db:"name" json:"name"` + Memo string `db:"memo" json:"memo"` + Deprecated bool `db:"deprecated" json:"deprecated"` + PublishNum uint32 `db:"publish_num" json:"publish_num"` } // Validate a release specifics when it is created. @@ -186,8 +153,8 @@ var ReleaseAttachmentColumnDescriptor = ColumnDescriptors{ // ReleaseAttachment defines release related information. type ReleaseAttachment struct { - BizID uint32 `db:"biz_id" json:"biz_id" gorm:"column:biz_id"` - AppID uint32 `db:"app_id" json:"app_id" gorm:"column:app_id"` + BizID uint32 `db:"biz_id" json:"biz_id"` + AppID uint32 `db:"app_id" json:"app_id"` } // IsEmpty test whether this release attachment is empty or not. diff --git a/bcs-services/bcs-bscp/pkg/dal/table/released_ci.go b/bcs-services/bcs-bscp/pkg/dal/table/released_ci.go index 3e79cea072..c9342c6b18 100644 --- a/bcs-services/bcs-bscp/pkg/dal/table/released_ci.go +++ b/bcs-services/bcs-bscp/pkg/dal/table/released_ci.go @@ -39,75 +39,37 @@ var ReleasedCIColumnDescriptor = mergeColumnDescriptors("", type ReleasedConfigItem struct { // ID is an auto-increased value, which is a unique identity // of a released app config items. - ID uint32 `db:"id" json:"id" gorm:"primaryKey"` + ID uint32 `db:"id" json:"id"` // ReleaseID is this app's config item's release id - ReleaseID uint32 `db:"release_id" json:"release_id" gorm:"column:release_id"` + ReleaseID uint32 `db:"release_id" json:"release_id"` // CommitID is this config item's commit id when it is released. - CommitID uint32 `db:"commit_id" json:"commit_id" gorm:"column:commit_id"` + CommitID uint32 `db:"commit_id" json:"commit_id"` // ConfigItemID is the config item's origin id when it is released. - ConfigItemID uint32 `db:"config_item_id" json:"config_item_id" gorm:"column:config_item_id"` + ConfigItemID uint32 `db:"config_item_id" json:"config_item_id"` // CommitSpec is this config item's commit spec when it is released. // which is same with the commits' spec information with the upper // CommitID - CommitSpec *CommitSpec `db:"commit_spec" json:"commit_spec" gorm:"embedded"` + CommitSpec *CommitSpec `db:"commit_spec" json:"commit_spec"` // ConfigItemSpec is this config item's spec when it is released, which // means it is same with the config item's spec information when it is // released. - ConfigItemSpec *ConfigItemSpec `db:"config_item_spec" json:"config_item_spec" gorm:"embedded"` - Attachment *ConfigItemAttachment `db:"attachment" json:"attachment" gorm:"embedded"` - Revision *Revision `db:"revision" json:"revision" gorm:"embedded"` + ConfigItemSpec *ConfigItemSpec `db:"config_item_spec" json:"config_item_spec"` + Attachment *ConfigItemAttachment `db:"attachment" json:"attachment"` + Revision *Revision `db:"revision" json:"revision"` } // TableName is the released app config's database table name. -func (r *ReleasedConfigItem) TableName() string { - return "released_config_items" -} - -// AppID AuditRes interface -func (r *ReleasedConfigItem) AppID() uint32 { - return r.Attachment.AppID -} - -// ResID AuditRes interface -func (r *ReleasedConfigItem) ResID() uint32 { - return r.ID -} - -// ResType AuditRes interface -func (r *ReleasedConfigItem) ResType() string { - return "released_config_item" -} - -type RciList []*ReleasedConfigItem - -// AppID AuditRes interface -func (rs RciList) AppID() uint32 { - if len(rs) > 0 { - return rs[0].Attachment.AppID - } - return 0 -} - -// ResID AuditRes interface -func (rs RciList) ResID() uint32 { - if len(rs) > 0 { - return rs[0].ID - } - return 0 -} - -// ResType AuditRes interface -func (rs RciList) ResType() string { - return "released_config_item" +func (r ReleasedConfigItem) TableName() Name { + return ReleasedConfigItemTable } // Validate the released config item information. -func (r *ReleasedConfigItem) Validate() error { +func (r ReleasedConfigItem) Validate() error { if r.ID != 0 { return errors.New("id should not set") } diff --git a/bcs-services/bcs-bscp/pkg/dal/table/released_group.go b/bcs-services/bcs-bscp/pkg/dal/table/released_group.go index 8973751944..b805d69201 100644 --- a/bcs-services/bcs-bscp/pkg/dal/table/released_group.go +++ b/bcs-services/bcs-bscp/pkg/dal/table/released_group.go @@ -44,23 +44,23 @@ var ReleasedGroupColumnDescriptor = mergeColumnDescriptors("", type ReleasedGroup struct { // ID is an auto-increased value, which is a group app's // unique identity. - ID uint32 `db:"id" json:"id" gorm:"primaryKey"` - GroupID uint32 `db:"group_id" json:"group_id" gorm:"column:group_id"` - AppID uint32 `db:"app_id" json:"app_id" gorm:"column:app_id"` - ReleaseID uint32 `db:"release_id" json:"release_id" gorm:"column:release_id"` - StrategyID uint32 `db:"strategy_id" json:"strategy_id" gorm:"column:strategy_id"` - Mode GroupMode `db:"mode" json:"mode" gorm:"column:mode"` - Selector *selector.Selector `db:"selector" json:"selector" gorm:"column:selector;type:json"` - UID string `db:"uid" json:"uid" gorm:"column:uid"` - Edited bool `db:"edited" json:"edited" gorm:"column:edited"` - BizID uint32 `db:"biz_id" json:"biz_id" gorm:"column:biz_id"` - Reviser string `db:"reviser" json:"reviser" gorm:"column:reviser"` - UpdatedAt time.Time `db:"updated_at" json:"updated_at" gorm:"column:updated_at"` + ID uint32 `db:"id" json:"id"` + GroupID uint32 `db:"group_id" json:"group_id"` + AppID uint32 `db:"app_id" json:"app_id"` + ReleaseID uint32 `db:"release_id" json:"release_id"` + StrategyID uint32 `db:"strategy_id" json:"strategy_id"` + Mode GroupMode `db:"mode" json:"mode"` + Selector *selector.Selector `db:"selector" json:"selector"` + UID string `db:"uid" json:"uid"` + Edited bool `db:"edited" json:"edited"` + BizID uint32 `db:"biz_id" json:"biz_id"` + Reviser string `db:"reviser" json:"reviser"` + UpdatedAt time.Time `db:"updated_at" json:"updated_at"` } -// TableName is the released group's database table name. -func (c ReleasedGroup) TableName() string { - return "released_groups" +// TableName is the group app's database table name. +func (c ReleasedGroup) TableName() Name { + return ReleasedGroupTable } // ValidateCreate validate the group app's specific when create it. diff --git a/bcs-services/bcs-bscp/pkg/dal/table/strategy.go b/bcs-services/bcs-bscp/pkg/dal/table/strategy.go index 20fe5a4532..108810d6db 100644 --- a/bcs-services/bcs-bscp/pkg/dal/table/strategy.go +++ b/bcs-services/bcs-bscp/pkg/dal/table/strategy.go @@ -19,11 +19,23 @@ import ( "fmt" "strings" + "bscp.io/pkg/criteria/enumor" "bscp.io/pkg/criteria/errf" "bscp.io/pkg/criteria/validator" "bscp.io/pkg/runtime/selector" ) +// StrategyColumns defines Strategy's columns +var StrategyColumns = mergeColumns(StrategyColumnDescriptor) + +// StrategyColumnDescriptor is Strategy's column descriptors. +var StrategyColumnDescriptor = mergeColumnDescriptors("", + ColumnDescriptors{{Column: "id", NamedC: "id", Type: enumor.Numeric}}, + mergeColumnDescriptors("spec", StrategySpecColumnDescriptor), + mergeColumnDescriptors("state", StrategyStateColumnDescriptor), + mergeColumnDescriptors("attachment", StrategyAttachmentColumnDescriptor), + mergeColumnDescriptors("revision", RevisionColumnDescriptor)) + const ( // maxNormalStrategiesLimitForApp defines the max limit of normal type strategy for an app for user to create. maxNormalStrategiesLimitForApp = 5 @@ -56,35 +68,20 @@ func ValidateAppStrategyNumber(count uint32, mode AppMode) error { type Strategy struct { // ID is an auto-increased value, which is a unique identity // of a strategy. - ID uint32 `db:"id" json:"id" gorm:"primaryKey"` - Spec *StrategySpec `db:"spec" json:"spec" gorm:"embedded"` - State *StrategyState `db:"state" json:"state" gorm:"embedded"` - Attachment *StrategyAttachment `db:"attachment" json:"attachment" gorm:"embedded"` - Revision *Revision `db:"revision" json:"revision" gorm:"embedded"` + ID uint32 `db:"id" json:"id"` + Spec *StrategySpec `db:"spec" json:"spec"` + State *StrategyState `db:"state" json:"state"` + Attachment *StrategyAttachment `db:"attachment" json:"attachment"` + Revision *Revision `db:"revision" json:"revision"` } // TableName is the strategy's database table name. -func (s *Strategy) TableName() string { - return "strategies" -} - -// AppID AuditRes interface -func (s *Strategy) AppID() uint32 { - return s.Attachment.AppID -} - -// ResID AuditRes interface -func (s *Strategy) ResID() uint32 { - return s.ID -} - -// ResType AuditRes interface -func (s *Strategy) ResType() string { - return "strategy" +func (s Strategy) TableName() Name { + return StrategyTable } // ValidateCreate validate strategy is valid or not when create it. -func (s *Strategy) ValidateCreate() error { +func (s Strategy) ValidateCreate() error { if s.ID > 0 { return errors.New("id should not be set") @@ -126,7 +123,7 @@ func (s *Strategy) ValidateCreate() error { } // ValidateUpdate validate strategy is valid or not when update it. -func (s *Strategy) ValidateUpdate(asDefault bool, namespaced bool) error { +func (s Strategy) ValidateUpdate(asDefault bool, namespaced bool) error { if s.ID <= 0 { return errors.New("id should be set") @@ -175,7 +172,7 @@ func (s *Strategy) ValidateUpdate(asDefault bool, namespaced bool) error { } // ValidateDelete validate the strategy's info when delete it. -func (s *Strategy) ValidateDelete() error { +func (s Strategy) ValidateDelete() error { if s.ID <= 0 { return errors.New("strategy id should be set") } @@ -187,6 +184,19 @@ func (s *Strategy) ValidateDelete() error { return nil } +// StrategySpecColumns defines StrategySpec's columns +var StrategySpecColumns = mergeColumns(StrategySpecColumnDescriptor) + +// StrategySpecColumnDescriptor is StrategySpec's column descriptors. +var StrategySpecColumnDescriptor = ColumnDescriptors{ + {Column: "name", NamedC: "name", Type: enumor.String}, + {Column: "release_id", NamedC: "release_id", Type: enumor.Numeric}, + {Column: "as_default", NamedC: "as_default", Type: enumor.Boolean}, + {Column: "scope", NamedC: "scope", Type: enumor.String}, + {Column: "mode", NamedC: "mode", Type: enumor.String}, + {Column: "namespace", NamedC: "namespace", Type: enumor.String}, + {Column: "memo", NamedC: "memo", Type: enumor.String}} + const ( // ReservedNamespacePrefix defines the reserved namespaces which // is prefixed with 'bscp'. @@ -200,20 +210,20 @@ const ( // StrategySpec defines all the specifics for strategy set by user. type StrategySpec struct { - Name string `db:"name" json:"name" gorm:"column:name"` - ReleaseID uint32 `db:"release_id" json:"release_id" gorm:"column:release_id"` + Name string `db:"name" json:"name"` + ReleaseID uint32 `db:"release_id" json:"release_id"` // AsDefault(=true) describes this strategy works as full release, // which means any instance can match this strategies - AsDefault bool `db:"as_default" json:"as_default" gorm:"column:as_default"` + AsDefault bool `db:"as_default" json:"as_default"` // Scope must be empty when this strategy is a default strategy. // Scope must not be empty when this strategy is not a default strategy. - Scope *Scope `db:"scope" json:"scope" gorm:"column:scope;type:json"` + Scope *Scope `db:"scope" json:"scope"` // Mode defines what mode of this strategy works at, it is succeeded from // this strategy's app's mode. // it can not be updated once it is created. - Mode AppMode `db:"mode" json:"mode" gorm:"column:mode"` + Mode AppMode `db:"mode" json:"mode"` // Namespace defines which namespace this strategy works at. // It has the following features: @@ -226,8 +236,8 @@ type StrategySpec struct { // 3. if this strategy is set to default strategy and works at namespace mode, // then its namespace should be the reserved namespace DefaultNamespace( // 'bscp_default_ns') - Namespace string `db:"namespace" json:"namespace" gorm:"column:namespace"` - Memo string `db:"memo" json:"memo" gorm:"column:memo"` + Namespace string `db:"namespace" json:"namespace"` + Memo string `db:"memo" json:"memo"` } // ValidateCreate validate strategy spec when it is created. @@ -357,9 +367,15 @@ func (p PublishState) Validate() error { return nil } +// StrategyStateColumns defines StrategyState's columns +var StrategyStateColumns = mergeColumns(StrategyStateColumnDescriptor) + +// StrategyStateColumnDescriptor is StrategyState's column descriptors. +var StrategyStateColumnDescriptor = ColumnDescriptors{{Column: "pub_state", NamedC: "pub_state", Type: enumor.String}} + // StrategyState defines the strategy's state type StrategyState struct { - PubState PublishState `db:"pub_state" json:"pub_state" gorm:"column:pub_state"` + PubState PublishState `db:"pub_state" json:"pub_state"` } // Validate whether strategy state is valid or not. @@ -371,11 +387,20 @@ func (s StrategyState) Validate() error { return nil } +// StrategyAttachmentColumns defines StrategyAttachment's columns +var StrategyAttachmentColumns = mergeColumns(StrategyAttachmentColumnDescriptor) + +// StrategyAttachmentColumnDescriptor is StrategyAttachment's column descriptors. +var StrategyAttachmentColumnDescriptor = ColumnDescriptors{ + {Column: "biz_id", NamedC: "biz_id", Type: enumor.Numeric}, + {Column: "app_id", NamedC: "app_id", Type: enumor.Numeric}, + {Column: "strategy_set_id", NamedC: "strategy_set_id", Type: enumor.Numeric}} + // StrategyAttachment defines the strategy attachments. type StrategyAttachment struct { - BizID uint32 `db:"biz_id" json:"biz_id" gorm:"column:biz_id"` - AppID uint32 `db:"app_id" json:"app_id" gorm:"column:app_id"` - StrategySetID uint32 `db:"strategy_set_id" json:"strategy_set_id" gorm:"column:strategy_set_id"` + BizID uint32 `db:"biz_id" json:"biz_id"` + AppID uint32 `db:"app_id" json:"app_id"` + StrategySetID uint32 `db:"strategy_set_id" json:"strategy_set_id"` } // IsEmpty test whether strategy attachment is empty or not. @@ -471,7 +496,7 @@ func (s Scope) ValidateUpdate(asDefault bool, namespaced bool) error { // SubStrategy is the sub-strategy of its parent strategy, it can not be // used independently. type SubStrategy struct { - Spec *SubStrategySpec `db:"spec" json:"spec" gorm:"column:name"` + Spec *SubStrategySpec `db:"spec" json:"spec"` } // IsEmpty test whether a sub-strategy is empty or not. @@ -517,11 +542,11 @@ func (s SubStrategy) ValidateUpdate() error { // SubStrategySpec is the sub-strategy's specifics defined by user. type SubStrategySpec struct { - Name string `db:"name" json:"name" gorm:"column:name"` + Name string `db:"name" json:"name"` // ReleaseID this sub strategy's released version id. - ReleaseID uint32 `db:"release_id" json:"release_id" gorm:"column:release_id"` - Scope *SubScopeSelector `db:"scope" json:"scope" gorm:"embedded"` - Memo string `db:"memo" json:"memo" gorm:"column:memo"` + ReleaseID uint32 `db:"release_id" json:"release_id"` + Scope *SubScopeSelector `db:"scope" json:"scope"` + Memo string `db:"memo" json:"memo"` } // IsEmpty test whether a sub-strategy specific is empty or not. @@ -578,7 +603,7 @@ type SubScopeSelector struct { // this select should not be matched all policy. and this selector // is required, should not be empty. // this selector has a max size limit, as is MaxScopeSelectorByteSize byte. - Selector *selector.Selector `db:"selector" json:"selector" gorm:"column:selector;type:json"` + Selector *selector.Selector `db:"selector" json:"selector"` } // IsEmpty test whether a sub-scope selector is empty or not. diff --git a/bcs-services/bcs-bscp/pkg/dal/table/table.go b/bcs-services/bcs-bscp/pkg/dal/table/table.go index c3a607188c..6bcd574f8c 100644 --- a/bcs-services/bcs-bscp/pkg/dal/table/table.go +++ b/bcs-services/bcs-bscp/pkg/dal/table/table.go @@ -223,8 +223,8 @@ const ( GroupAppBindTable Name = "group_app_binds" // ReleasedGroupTable is current release table's name ReleasedGroupTable Name = "released_groups" - // StrategySetTable is strategy set table's name - StrategySetTable Name = "strategy_sets" + // HookTable is hook table's name + HookTable Name = "hooks" // StrategyTable is strategy table's name StrategyTable Name = "strategies" // EventTable is event table's name @@ -305,6 +305,10 @@ func (r Revision) ValidateUpdate() error { return errors.New("reviser can not be empty") } + if len(r.Creator) != 0 { + return errors.New("creator can not be updated") + } + return nil } @@ -318,17 +322,21 @@ var CreatedRevisionColumnDescriptor = ColumnDescriptors{ // CreatedRevision is a resource's reversion information being created. type CreatedRevision struct { - Creator string `db:"creator" json:"creator" gorm:"column:creator"` - CreatedAt time.Time `db:"created_at" json:"created_at" gorm:"column:created_at"` + Creator string `db:"creator" json:"creator"` + CreatedAt time.Time `db:"created_at" json:"created_at"` } // Validate revision when created -// no need to validate time here, because the time is injected by gorm automatically func (r CreatedRevision) Validate() error { if len(r.Creator) == 0 { return errors.New("creator can not be empty") } + now := time.Now().Unix() + if (r.CreatedAt.Unix() <= (now - lagSeconds)) || (r.CreatedAt.Unix() >= (now + lagSeconds)) { + return errors.New("invalid create time") + } + return nil } diff --git a/bcs-services/bcs-bscp/pkg/iam/auth/middleware.go b/bcs-services/bcs-bscp/pkg/iam/auth/middleware.go index e93f27c317..98e1061be9 100644 --- a/bcs-services/bcs-bscp/pkg/iam/auth/middleware.go +++ b/bcs-services/bcs-bscp/pkg/iam/auth/middleware.go @@ -15,7 +15,6 @@ package auth import ( "net/http" - "os" "path/filepath" "strconv" "strings" @@ -87,15 +86,6 @@ func (a authorizer) initKitWithCookie(r *http.Request, k *kit.Kit, multiErr *mul // initKitWithDevEnv Dev环境, 可以设置环境变量鉴权 func (a authorizer) initKitWithDevEnv(r *http.Request, k *kit.Kit, multiErr *multierror.Error) bool { - user := os.Getenv("BK_USER_FOR_TEST") - appCode := os.Getenv("BK_APP_CODE_FOR_TEST") - - if user != "" && appCode != "" { - k.User = user - k.AppCode = appCode - return true - } - return false } @@ -197,7 +187,6 @@ func (a authorizer) AppVerified(next http.Handler) http.Handler { return } - kt.AppID = uint32(appID) kt.SpaceID = space.SpaceId kt.SpaceTypeID = space.SpaceTypeId ctx := kit.WithKit(r.Context(), kt) @@ -279,7 +268,7 @@ func dummyVerified(next http.Handler) http.Handler { Ctx: r.Context(), User: "", Rid: components.RequestIDValue(r.Context()), - AppID: 0, + AppId: "", AppCode: "dummyApp", // 测试 App SpaceID: "", SpaceTypeID: "", diff --git a/bcs-services/bcs-bscp/pkg/iam/sdk/auth/count.go b/bcs-services/bcs-bscp/pkg/iam/sdk/auth/count.go index 138ab35aae..4686a3116a 100644 --- a/bcs-services/bcs-bscp/pkg/iam/sdk/auth/count.go +++ b/bcs-services/bcs-bscp/pkg/iam/sdk/auth/count.go @@ -63,7 +63,7 @@ func (a *Authorize) countPolicy(ctx context.Context, p *operator.Policy, resourc return &client.AuthorizeList{Ids: ids}, nil } else { - // Note: cause we do not support _bk_iam_path_ field for now + // TODO: cause we do not support _bk_iam_path_ field for now // So we only need to get resource's other attribute policy. opts := &client.ListWithAttributes{ Operator: p.Operator, @@ -135,7 +135,7 @@ func preAnalyzeContent(op operator.OpType, content *operator.Content) error { // the same level do not support multiple fields. if len(fieldMap) > 1 { - return errors.New("do not support different field in the same policy level") + return errors.New(fmt.Sprintf("do not support different field in the same policy level")) } return nil } @@ -185,7 +185,7 @@ func (a *Authorize) countContent(ctx context.Context, op operator.OpType, conten allList = append(allList, client.AuthorizeList{Ids: list}) } else { - // Note: cause we do not support _bk_iam_path_ field for now + // TODO: cause we do not support _bk_iam_path_ field for now // So we only need to get resource's other attribute policy. allAttrPolicies = append(allAttrPolicies, policy) } diff --git a/bcs-services/bcs-bscp/pkg/iam/sys/sys.go b/bcs-services/bcs-bscp/pkg/iam/sys/sys.go index 544dc9799d..c0cc74f095 100644 --- a/bcs-services/bcs-bscp/pkg/iam/sys/sys.go +++ b/bcs-services/bcs-bscp/pkg/iam/sys/sys.go @@ -50,7 +50,7 @@ func (s *Sys) Register(ctx context.Context, host string) error { return err } - // Note: 如果更新的资源依赖新增的其他资源,会存在问题。如更新的实例视图,依赖新增的资源类型。 + // TODO: 如果更新的资源依赖新增的其他资源,会存在问题。如更新的实例视图,依赖新增的资源类型。 removedResTypeMap, newResTypes, err := s.classResType(ctx, system.ResourceTypes) if err != nil { return err diff --git a/bcs-services/bcs-bscp/pkg/kit/kit.go b/bcs-services/bcs-bscp/pkg/kit/kit.go index e0b44805a9..9788f722d0 100644 --- a/bcs-services/bcs-bscp/pkg/kit/kit.go +++ b/bcs-services/bcs-bscp/pkg/kit/kit.go @@ -92,7 +92,7 @@ func FromGrpcContext(ctx context.Context) *Kit { kit.Ctx = context.WithValue(kit.Ctx, constant.RidKey, rid) - // Note: need to add supplier id and authorization field. + // TODO: need to add supplier id and authorization field. return kit } @@ -115,7 +115,7 @@ type Kit struct { // AppCode is app code. AppCode string - AppID uint32 // 对应的应用ID + AppId string // 对应的应用ID BizID uint32 // 对应的业务ID SpaceID string // 应用对应的SpaceID SpaceTypeID string // 应用对应的SpaceTypeID diff --git a/bcs-services/bcs-bscp/pkg/logs/glog/glog.go b/bcs-services/bcs-bscp/pkg/logs/glog/glog.go index 07cee04460..6170f5df4c 100644 --- a/bcs-services/bcs-bscp/pkg/logs/glog/glog.go +++ b/bcs-services/bcs-bscp/pkg/logs/glog/glog.go @@ -79,6 +79,7 @@ limitations under the License. // "glob" pattern and N is a V level. For instance, // -vmodule=gopher*=3 // sets the V level to 3 in all Go files whose names begin "gopher". +// package glog import ( @@ -322,7 +323,7 @@ func (m *moduleSpec) Set(value string) error { if v == 0 { continue // Ignore. It's harmless but no point in paying the overhead. } - // Note: check syntax of filter? + // TODO: check syntax of filter? filter = append(filter, modulePat{pattern, isLiteral(pattern), Level(v)}) } logging.mu.Lock() @@ -596,7 +597,7 @@ func (l *loggingT) formatHeader(s severity, file string, line int) *buffer { buf.tmp[14] = '.' buf.nDigits(6, 15, now.Nanosecond()/1000, '0') buf.tmp[21] = ' ' - buf.nDigits(7, 22, pid, ' ') // Note: should be TID + buf.nDigits(7, 22, pid, ' ') // TODO: should be TID buf.tmp[29] = ' ' buf.Write(buf.tmp[:30]) buf.WriteString(file) @@ -1039,13 +1040,9 @@ type Verbose bool // The returned value is a boolean of type Verbose, which implements Info, Infoln // and Infof. These methods will write to the Info log if called. // Thus, one may write either -// // if glog.V(2) { glog.Info("log this") } -// // or -// // glog.V(2).Info("log this") -// // The second form is shorter but the first is cheaper if logging is off because it does // not evaluate its arguments. // diff --git a/bcs-services/bcs-bscp/pkg/logs/glog/glog_file.go b/bcs-services/bcs-bscp/pkg/logs/glog/glog_file.go index 8ff9d61538..f16a02d0ab 100644 --- a/bcs-services/bcs-bscp/pkg/logs/glog/glog_file.go +++ b/bcs-services/bcs-bscp/pkg/logs/glog/glog_file.go @@ -337,12 +337,12 @@ func create(t time.Time) (f *os.File, filename string, filesize uint32, err erro f, err = os.Create(fname) if err == nil { symlink := filepath.Join(lk.dir, link) - if e := os.Remove(symlink); e != nil { - fmt.Fprintf(os.Stderr, "log: create remove: %v\n", e) + if err := os.Remove(symlink); err != nil { + fmt.Fprintf(os.Stderr, "log: create remove: %v\n", err) } - if e := os.Symlink(name, symlink); e != nil { - fmt.Fprintf(os.Stderr, "log: create symlink: %v\n", e) + if err := os.Symlink(name, symlink); err != nil { + fmt.Fprintf(os.Stderr, "log: create symlink: %v\n", err) } lk.add(&fileBlock{fileInfo: fileInfo{name: name, timestamp: ""}, next: nil}) diff --git a/bcs-services/bcs-bscp/pkg/protocol/cache-service/cache_service.pb.go b/bcs-services/bcs-bscp/pkg/protocol/cache-service/cache_service.pb.go index ac476b4498..deee2dd916 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/cache-service/cache_service.pb.go +++ b/bcs-services/bcs-bscp/pkg/protocol/cache-service/cache_service.pb.go @@ -14,6 +14,7 @@ import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" reflect "reflect" sync "sync" ) @@ -777,7 +778,7 @@ type ListEventsReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - StartCursor uint32 `protobuf:"varint,1,opt,name=startCursor,proto3" json:"startCursor,omitempty"` + Filter *structpb.Struct `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` // max page limit is 200 Page *base.BasePage `protobuf:"bytes,2,opt,name=page,proto3" json:"page,omitempty"` } @@ -814,11 +815,11 @@ func (*ListEventsReq) Descriptor() ([]byte, []int) { return file_cache_service_proto_rawDescGZIP(), []int{14} } -func (x *ListEventsReq) GetStartCursor() uint32 { +func (x *ListEventsReq) GetFilter() *structpb.Struct { if x != nil { - return x.StartCursor + return x.Filter } - return 0 + return nil } func (x *ListEventsReq) GetPage() *base.BasePage { @@ -1066,170 +1067,173 @@ var file_cache_service_proto_rawDesc = []byte{ 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x28, 0x0a, 0x0b, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x61, 0x77, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x77, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x73, 0x6f, 0x6e, 0x52, 0x61, 0x77, 0x22, 0x3f, 0x0a, - 0x0b, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x49, 0x44, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, - 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, - 0x7a, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x25, - 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x12, 0x15, - 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x3d, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x4d, - 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, - 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, - 0x70, 0x70, 0x49, 0x64, 0x22, 0x48, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x64, 0x43, 0x49, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, - 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x22, 0x48, - 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, - 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, - 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x2d, 0x0a, 0x10, 0x4a, 0x73, 0x6f, 0x6e, - 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x12, 0x19, 0x0a, 0x08, - 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x77, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, - 0x6a, 0x73, 0x6f, 0x6e, 0x52, 0x61, 0x77, 0x22, 0x41, 0x0a, 0x0f, 0x42, 0x65, 0x6e, 0x63, 0x68, - 0x41, 0x70, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, + 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x28, 0x0a, 0x0b, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x77, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6a, 0x73, 0x6f, 0x6e, 0x52, 0x61, 0x77, 0x22, 0x3f, 0x0a, 0x0b, 0x47, + 0x65, 0x74, 0x41, 0x70, 0x70, 0x49, 0x44, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, - 0x64, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0d, 0x52, 0x06, 0x61, 0x70, 0x70, 0x49, 0x64, 0x73, 0x22, 0x90, 0x01, 0x0a, 0x10, 0x42, - 0x65, 0x6e, 0x63, 0x68, 0x41, 0x70, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x34, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, - 0x70, 0x62, 0x63, 0x73, 0x2e, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x41, 0x70, 0x70, 0x4d, 0x65, 0x74, - 0x61, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x04, 0x6d, 0x65, 0x74, 0x61, 0x1a, 0x46, 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x41, 0x70, 0x70, 0x4d, 0x65, - 0x74, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x7a, 0x0a, - 0x07, 0x41, 0x70, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, - 0x63, 0x66, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x66, 0x74, 0x12, 0x10, - 0x0a, 0x03, 0x64, 0x70, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x70, 0x74, - 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, - 0x6f, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x61, 0x70, 0x70, 0x2e, 0x52, 0x65, 0x6c, 0x6f, 0x61, - 0x64, 0x52, 0x06, 0x72, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x3d, 0x0a, 0x0a, 0x41, 0x70, 0x70, - 0x43, 0x52, 0x49, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x22, 0x4a, 0x0a, 0x12, 0x42, 0x65, 0x6e, 0x63, - 0x68, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x49, 0x52, 0x65, 0x71, 0x12, 0x15, - 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x49, 0x64, 0x22, 0x44, 0x0a, 0x13, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x49, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x04, 0x6d, - 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x62, 0x72, 0x63, - 0x69, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x33, 0x0a, 0x19, 0x43, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x52, 0x65, 0x6d, 0x69, 0x6e, - 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x22, - 0x57, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, - 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x43, 0x75, 0x72, 0x73, - 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, - 0x67, 0x65, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x35, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x04, 0x6c, 0x69, - 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, - 0x7d, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x04, - 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, - 0x73, 0x70, 0x65, 0x63, 0x12, 0x38, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, - 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x53, - 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, - 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x43, 0x49, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, + 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x25, 0x0a, 0x0c, + 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x12, 0x15, 0x0a, 0x06, + 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, + 0x70, 0x49, 0x64, 0x22, 0x3d, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x4d, 0x65, 0x74, + 0x61, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, + 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, + 0x49, 0x64, 0x22, 0x48, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x64, 0x43, 0x49, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x1d, 0x0a, + 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x22, 0x48, 0x0a, 0x18, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, + 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x2d, 0x0a, 0x10, 0x4a, 0x73, 0x6f, 0x6e, 0x41, 0x72, + 0x72, 0x61, 0x79, 0x52, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x6a, 0x73, + 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x77, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x73, + 0x6f, 0x6e, 0x52, 0x61, 0x77, 0x22, 0x41, 0x0a, 0x0f, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x41, 0x70, + 0x70, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, + 0x17, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, + 0x52, 0x06, 0x61, 0x70, 0x70, 0x49, 0x64, 0x73, 0x22, 0x90, 0x01, 0x0a, 0x10, 0x42, 0x65, 0x6e, + 0x63, 0x68, 0x41, 0x70, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x34, 0x0a, + 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x62, + 0x63, 0x73, 0x2e, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x41, 0x70, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x52, + 0x65, 0x73, 0x70, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6d, + 0x65, 0x74, 0x61, 0x1a, 0x46, 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x23, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x41, 0x70, 0x70, 0x4d, 0x65, 0x74, 0x61, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x7a, 0x0a, 0x07, 0x41, + 0x70, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x66, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x66, 0x74, 0x12, 0x10, 0x0a, 0x03, + 0x64, 0x70, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x70, 0x74, 0x12, 0x10, + 0x0a, 0x03, 0x6d, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x6f, 0x64, + 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x61, 0x70, 0x70, 0x2e, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x52, + 0x06, 0x72, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x3d, 0x0a, 0x0a, 0x41, 0x70, 0x70, 0x43, 0x52, + 0x49, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x22, 0x4a, 0x0a, 0x12, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x52, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x49, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, - 0x7a, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, - 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x22, 0x49, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x1e, - 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x32, 0xe7, - 0x08, 0x0a, 0x05, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x6c, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x41, - 0x70, 0x70, 0x49, 0x44, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, - 0x70, 0x70, 0x49, 0x44, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, - 0x65, 0x74, 0x41, 0x70, 0x70, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x22, 0x39, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x33, 0x12, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x61, 0x63, - 0x68, 0x65, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, - 0x61, 0x70, 0x70, 0x73, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, - 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x12, 0x6b, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, - 0x4d, 0x65, 0x74, 0x61, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, - 0x70, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x63, 0x73, - 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x22, 0x35, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x2f, 0x22, 0x2a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x61, - 0x63, 0x68, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6d, 0x65, 0x74, 0x61, - 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, - 0x3a, 0x01, 0x2a, 0x12, 0x70, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x64, 0x43, 0x49, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x49, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, - 0x62, 0x63, 0x73, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x22, 0x29, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, - 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x63, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x64, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, - 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x8c, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, - 0x70, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, - 0x1e, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x1a, - 0x11, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x61, 0x77, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, - 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x7b, 0x61, 0x70, 0x70, - 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x5f, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x73, 0x12, 0x83, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, + 0x7a, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x49, 0x64, 0x22, 0x44, 0x0a, 0x13, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x64, 0x43, 0x49, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x04, 0x6d, 0x65, 0x74, + 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x62, 0x72, 0x63, 0x69, 0x2e, + 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, + 0x65, 0x6d, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x33, 0x0a, 0x19, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x65, - 0x72, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x22, 0x29, 0x2f, 0x61, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x22, 0x66, 0x0a, + 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x12, 0x2f, + 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, + 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, + 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x35, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x7d, 0x0a, 0x09, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x04, 0x73, 0x70, 0x65, + 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, + 0x63, 0x12, 0x38, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x53, 0x0a, 0x1a, 0x4c, + 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x64, 0x43, 0x49, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, + 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x22, 0x49, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x32, 0xe7, 0x08, 0x0a, 0x05, + 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x6c, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x49, + 0x44, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x49, + 0x44, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, + 0x70, 0x70, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, + 0x12, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2f, + 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, + 0x73, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x61, 0x70, 0x70, + 0x5f, 0x69, 0x64, 0x12, 0x6b, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x4d, 0x65, 0x74, + 0x61, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x4d, + 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4a, 0x73, + 0x6f, 0x6e, 0x52, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2f, 0x22, 0x2a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, + 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x2f, 0x62, 0x69, + 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, + 0x12, 0x70, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, + 0x49, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x64, 0x43, 0x49, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x63, 0x73, + 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x22, 0x34, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x2e, 0x22, 0x29, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x61, + 0x63, 0x68, 0x65, 0x2f, 0x63, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x2f, + 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x3a, + 0x01, 0x2a, 0x12, 0x8c, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x52, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x1e, 0x2e, 0x70, + 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x52, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, + 0x62, 0x63, 0x73, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, + 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, + 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, + 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x73, 0x12, 0x83, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, + 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x10, + 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, + 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x43, + 0x75, 0x72, 0x73, 0x6f, 0x72, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x22, 0x29, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x76, 0x31, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x2f, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x2f, 0x72, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x6b, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x63, 0x73, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x14, + 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x22, 0x23, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x6c, 0x69, 0x73, 0x74, - 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2f, 0x72, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x2f, - 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x6b, 0x0a, 0x0e, 0x4c, 0x69, - 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x13, 0x2e, 0x70, - 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x22, - 0x23, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x6c, - 0x69, 0x73, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2f, - 0x6d, 0x65, 0x74, 0x61, 0x3a, 0x01, 0x2a, 0x12, 0x76, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, - 0x47, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, - 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x61, 0x77, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, - 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x2f, 0x7b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x7d, 0x12, - 0x8b, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x43, 0x49, 0x12, 0x20, 0x2e, 0x70, 0x62, - 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, - 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x43, 0x49, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, + 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2f, 0x6d, 0x65, 0x74, + 0x61, 0x3a, 0x01, 0x2a, 0x12, 0x76, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, + 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x12, 0x33, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x31, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x7d, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x3f, 0x0a, - 0x0c, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x41, 0x70, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x15, 0x2e, - 0x70, 0x62, 0x63, 0x73, 0x2e, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x41, 0x70, 0x70, 0x4d, 0x65, 0x74, - 0x61, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x42, 0x65, 0x6e, 0x63, - 0x68, 0x41, 0x70, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x48, - 0x0a, 0x0f, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, - 0x49, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x49, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x70, 0x62, - 0x63, 0x73, 0x2e, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, - 0x43, 0x49, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x29, 0x5a, 0x27, 0x62, 0x73, 0x63, 0x70, - 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3b, 0x70, - 0x62, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x31, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, + 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2f, + 0x7b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x7d, 0x12, 0x8b, 0x01, 0x0a, + 0x17, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x43, 0x49, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x64, 0x43, 0x49, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x63, + 0x73, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x22, 0x3b, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x12, 0x33, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, + 0x61, 0x63, 0x68, 0x65, 0x2f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, + 0x2f, 0x7b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x7d, 0x2f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x42, 0x65, + 0x6e, 0x63, 0x68, 0x41, 0x70, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x63, + 0x73, 0x2e, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x41, 0x70, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, + 0x71, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x41, 0x70, + 0x70, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0f, 0x42, + 0x65, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x49, 0x12, 0x18, + 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x64, 0x43, 0x49, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, + 0x42, 0x65, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x49, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x29, 0x5a, 0x27, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, + 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x61, + 0x63, 0x68, 0x65, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3b, 0x70, 0x62, 0x63, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1268,45 +1272,47 @@ var file_cache_service_proto_goTypes = []interface{}{ nil, // 19: pbcs.BenchAppMetaResp.MetaEntry (*app.Reload)(nil), // 20: pbapp.Reload (*released_ci.ReleasedConfigItem)(nil), // 21: pbrci.ReleasedConfigItem - (*base.BasePage)(nil), // 22: pbbase.BasePage - (*event.EventSpec)(nil), // 23: pbevent.EventSpec - (*event.EventAttachment)(nil), // 24: pbevent.EventAttachment - (*base.EmptyReq)(nil), // 25: pbbase.EmptyReq + (*structpb.Struct)(nil), // 22: google.protobuf.Struct + (*base.BasePage)(nil), // 23: pbbase.BasePage + (*event.EventSpec)(nil), // 24: pbevent.EventSpec + (*event.EventAttachment)(nil), // 25: pbevent.EventAttachment + (*base.EmptyReq)(nil), // 26: pbbase.EmptyReq } var file_cache_service_proto_depIdxs = []int32{ 19, // 0: pbcs.BenchAppMetaResp.meta:type_name -> pbcs.BenchAppMetaResp.MetaEntry 20, // 1: pbcs.AppMeta.reload:type_name -> pbapp.Reload 21, // 2: pbcs.BenchReleasedCIResp.meta:type_name -> pbrci.ReleasedConfigItem - 22, // 3: pbcs.ListEventsReq.page:type_name -> pbbase.BasePage - 16, // 4: pbcs.ListEventsResp.list:type_name -> pbcs.EventMeta - 23, // 5: pbcs.EventMeta.spec:type_name -> pbevent.EventSpec - 24, // 6: pbcs.EventMeta.attachment:type_name -> pbevent.EventAttachment - 9, // 7: pbcs.BenchAppMetaResp.MetaEntry.value:type_name -> pbcs.AppMeta - 1, // 8: pbcs.Cache.GetAppID:input_type -> pbcs.GetAppIDReq - 3, // 9: pbcs.Cache.GetAppMeta:input_type -> pbcs.GetAppMetaReq - 4, // 10: pbcs.Cache.GetReleasedCI:input_type -> pbcs.GetReleasedCIReq - 5, // 11: pbcs.Cache.ListAppReleasedGroups:input_type -> pbcs.ListAppReleasedGroupsReq - 25, // 12: pbcs.Cache.GetCurrentCursorReminder:input_type -> pbbase.EmptyReq - 14, // 13: pbcs.Cache.ListEventsMeta:input_type -> pbcs.ListEventsReq - 18, // 14: pbcs.Cache.GetCredential:input_type -> pbcs.GetCredentialReq - 17, // 15: pbcs.Cache.ListCredentialMatchedCI:input_type -> pbcs.ListCredentialMatchedCIReq - 7, // 16: pbcs.Cache.BenchAppMeta:input_type -> pbcs.BenchAppMetaReq - 11, // 17: pbcs.Cache.BenchReleasedCI:input_type -> pbcs.BenchReleasedCIReq - 2, // 18: pbcs.Cache.GetAppID:output_type -> pbcs.GetAppIDResp - 0, // 19: pbcs.Cache.GetAppMeta:output_type -> pbcs.JsonRawResp - 0, // 20: pbcs.Cache.GetReleasedCI:output_type -> pbcs.JsonRawResp - 0, // 21: pbcs.Cache.ListAppReleasedGroups:output_type -> pbcs.JsonRawResp - 13, // 22: pbcs.Cache.GetCurrentCursorReminder:output_type -> pbcs.CurrentCursorReminderResp - 15, // 23: pbcs.Cache.ListEventsMeta:output_type -> pbcs.ListEventsResp - 0, // 24: pbcs.Cache.GetCredential:output_type -> pbcs.JsonRawResp - 0, // 25: pbcs.Cache.ListCredentialMatchedCI:output_type -> pbcs.JsonRawResp - 8, // 26: pbcs.Cache.BenchAppMeta:output_type -> pbcs.BenchAppMetaResp - 12, // 27: pbcs.Cache.BenchReleasedCI:output_type -> pbcs.BenchReleasedCIResp - 18, // [18:28] is the sub-list for method output_type - 8, // [8:18] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 22, // 3: pbcs.ListEventsReq.filter:type_name -> google.protobuf.Struct + 23, // 4: pbcs.ListEventsReq.page:type_name -> pbbase.BasePage + 16, // 5: pbcs.ListEventsResp.list:type_name -> pbcs.EventMeta + 24, // 6: pbcs.EventMeta.spec:type_name -> pbevent.EventSpec + 25, // 7: pbcs.EventMeta.attachment:type_name -> pbevent.EventAttachment + 9, // 8: pbcs.BenchAppMetaResp.MetaEntry.value:type_name -> pbcs.AppMeta + 1, // 9: pbcs.Cache.GetAppID:input_type -> pbcs.GetAppIDReq + 3, // 10: pbcs.Cache.GetAppMeta:input_type -> pbcs.GetAppMetaReq + 4, // 11: pbcs.Cache.GetReleasedCI:input_type -> pbcs.GetReleasedCIReq + 5, // 12: pbcs.Cache.ListAppReleasedGroups:input_type -> pbcs.ListAppReleasedGroupsReq + 26, // 13: pbcs.Cache.GetCurrentCursorReminder:input_type -> pbbase.EmptyReq + 14, // 14: pbcs.Cache.ListEventsMeta:input_type -> pbcs.ListEventsReq + 18, // 15: pbcs.Cache.GetCredential:input_type -> pbcs.GetCredentialReq + 17, // 16: pbcs.Cache.ListCredentialMatchedCI:input_type -> pbcs.ListCredentialMatchedCIReq + 7, // 17: pbcs.Cache.BenchAppMeta:input_type -> pbcs.BenchAppMetaReq + 11, // 18: pbcs.Cache.BenchReleasedCI:input_type -> pbcs.BenchReleasedCIReq + 2, // 19: pbcs.Cache.GetAppID:output_type -> pbcs.GetAppIDResp + 0, // 20: pbcs.Cache.GetAppMeta:output_type -> pbcs.JsonRawResp + 0, // 21: pbcs.Cache.GetReleasedCI:output_type -> pbcs.JsonRawResp + 0, // 22: pbcs.Cache.ListAppReleasedGroups:output_type -> pbcs.JsonRawResp + 13, // 23: pbcs.Cache.GetCurrentCursorReminder:output_type -> pbcs.CurrentCursorReminderResp + 15, // 24: pbcs.Cache.ListEventsMeta:output_type -> pbcs.ListEventsResp + 0, // 25: pbcs.Cache.GetCredential:output_type -> pbcs.JsonRawResp + 0, // 26: pbcs.Cache.ListCredentialMatchedCI:output_type -> pbcs.JsonRawResp + 8, // 27: pbcs.Cache.BenchAppMeta:output_type -> pbcs.BenchAppMetaResp + 12, // 28: pbcs.Cache.BenchReleasedCI:output_type -> pbcs.BenchReleasedCIResp + 19, // [19:29] is the sub-list for method output_type + 9, // [9:19] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_cache_service_proto_init() } diff --git a/bcs-services/bcs-bscp/pkg/protocol/cache-service/cache_service.proto b/bcs-services/bcs-bscp/pkg/protocol/cache-service/cache_service.proto index ef929c4708..5d2414c3c9 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/cache-service/cache_service.proto +++ b/bcs-services/bcs-bscp/pkg/protocol/cache-service/cache_service.proto @@ -5,6 +5,7 @@ import "bscp.io/pkg/protocol/core/event/event.proto"; import "bscp.io/pkg/protocol/core/base/base.proto"; import "bscp.io/pkg/protocol/core/app/app.proto"; import "google/api/annotations.proto"; +import "google/protobuf/struct.proto"; package pbcs; @@ -143,9 +144,9 @@ message CurrentCursorReminderResp { } message ListEventsReq { - uint32 startCursor = 1; + google.protobuf.Struct filter = 1; // max page limit is 200 - pbbase.BasePage page = 2; + pbbase.BasePage page = 2; } message ListEventsResp { diff --git a/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service.pb.go b/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service.pb.go index 2919d44e4f..586f54f553 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service.pb.go +++ b/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service.pb.go @@ -10,13 +10,11 @@ import ( app "bscp.io/pkg/protocol/core/app" base "bscp.io/pkg/protocol/core/base" commit "bscp.io/pkg/protocol/core/commit" - config_hook "bscp.io/pkg/protocol/core/config-hook" config_item "bscp.io/pkg/protocol/core/config-item" content "bscp.io/pkg/protocol/core/content" credential "bscp.io/pkg/protocol/core/credential" credential_scope "bscp.io/pkg/protocol/core/credential-scope" hook "bscp.io/pkg/protocol/core/hook" - hook_release "bscp.io/pkg/protocol/core/hook-release" release "bscp.io/pkg/protocol/core/release" released_ci "bscp.io/pkg/protocol/core/released-ci" template "bscp.io/pkg/protocol/core/template" @@ -1273,6 +1271,69 @@ func (x *GetAppByNameReq) GetAppName() string { return "" } +type ListAppsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + Filter *structpb.Struct `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"` + Page *base.BasePage `protobuf:"bytes,3,opt,name=page,proto3" json:"page,omitempty"` +} + +func (x *ListAppsReq) Reset() { + *x = ListAppsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAppsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAppsReq) ProtoMessage() {} + +func (x *ListAppsReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_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 ListAppsReq.ProtoReflect.Descriptor instead. +func (*ListAppsReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{22} +} + +func (x *ListAppsReq) GetBizId() uint32 { + if x != nil { + return x.BizId + } + return 0 +} + +func (x *ListAppsReq) GetFilter() *structpb.Struct { + if x != nil { + return x.Filter + } + return nil +} + +func (x *ListAppsReq) GetPage() *base.BasePage { + if x != nil { + return x.Page + } + return nil +} + type ListAppsRestReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1288,7 +1349,7 @@ type ListAppsRestReq struct { func (x *ListAppsRestReq) Reset() { *x = ListAppsRestReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[22] + mi := &file_config_service_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1301,7 +1362,7 @@ func (x *ListAppsRestReq) String() string { func (*ListAppsRestReq) ProtoMessage() {} func (x *ListAppsRestReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[22] + mi := &file_config_service_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1314,7 +1375,7 @@ func (x *ListAppsRestReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListAppsRestReq.ProtoReflect.Descriptor instead. func (*ListAppsRestReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{22} + return file_config_service_proto_rawDescGZIP(), []int{23} } func (x *ListAppsRestReq) GetBizId() uint32 { @@ -1367,7 +1428,7 @@ type ListAppsBySpaceRestReq struct { func (x *ListAppsBySpaceRestReq) Reset() { *x = ListAppsBySpaceRestReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[23] + mi := &file_config_service_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1380,7 +1441,7 @@ func (x *ListAppsBySpaceRestReq) String() string { func (*ListAppsBySpaceRestReq) ProtoMessage() {} func (x *ListAppsBySpaceRestReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[23] + mi := &file_config_service_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1393,7 +1454,7 @@ func (x *ListAppsBySpaceRestReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListAppsBySpaceRestReq.ProtoReflect.Descriptor instead. func (*ListAppsBySpaceRestReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{23} + return file_config_service_proto_rawDescGZIP(), []int{24} } func (x *ListAppsBySpaceRestReq) GetBizId() uint32 { @@ -1443,7 +1504,7 @@ type ListAppsResp struct { func (x *ListAppsResp) Reset() { *x = ListAppsResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[24] + mi := &file_config_service_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1456,7 +1517,7 @@ func (x *ListAppsResp) String() string { func (*ListAppsResp) ProtoMessage() {} func (x *ListAppsResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[24] + mi := &file_config_service_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1469,7 +1530,7 @@ func (x *ListAppsResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListAppsResp.ProtoReflect.Descriptor instead. func (*ListAppsResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{24} + return file_config_service_proto_rawDescGZIP(), []int{25} } func (x *ListAppsResp) GetCount() uint32 { @@ -1508,7 +1569,7 @@ type CreateConfigItemReq struct { func (x *CreateConfigItemReq) Reset() { *x = CreateConfigItemReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[25] + mi := &file_config_service_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1521,7 +1582,7 @@ func (x *CreateConfigItemReq) String() string { func (*CreateConfigItemReq) ProtoMessage() {} func (x *CreateConfigItemReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[25] + mi := &file_config_service_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1534,7 +1595,7 @@ func (x *CreateConfigItemReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateConfigItemReq.ProtoReflect.Descriptor instead. func (*CreateConfigItemReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{25} + return file_config_service_proto_rawDescGZIP(), []int{26} } func (x *CreateConfigItemReq) GetBizId() uint32 { @@ -1634,7 +1695,7 @@ type BatchUpsertConfigItemsReq struct { func (x *BatchUpsertConfigItemsReq) Reset() { *x = BatchUpsertConfigItemsReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[26] + mi := &file_config_service_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1647,7 +1708,7 @@ func (x *BatchUpsertConfigItemsReq) String() string { func (*BatchUpsertConfigItemsReq) ProtoMessage() {} func (x *BatchUpsertConfigItemsReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[26] + mi := &file_config_service_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1660,7 +1721,7 @@ func (x *BatchUpsertConfigItemsReq) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchUpsertConfigItemsReq.ProtoReflect.Descriptor instead. func (*BatchUpsertConfigItemsReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{26} + return file_config_service_proto_rawDescGZIP(), []int{27} } func (x *BatchUpsertConfigItemsReq) GetBizId() uint32 { @@ -1693,7 +1754,7 @@ type BatchUpsertConfigItemsResp struct { func (x *BatchUpsertConfigItemsResp) Reset() { *x = BatchUpsertConfigItemsResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[27] + mi := &file_config_service_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1706,7 +1767,7 @@ func (x *BatchUpsertConfigItemsResp) String() string { func (*BatchUpsertConfigItemsResp) ProtoMessage() {} func (x *BatchUpsertConfigItemsResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[27] + mi := &file_config_service_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1719,7 +1780,7 @@ func (x *BatchUpsertConfigItemsResp) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchUpsertConfigItemsResp.ProtoReflect.Descriptor instead. func (*BatchUpsertConfigItemsResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{27} + return file_config_service_proto_rawDescGZIP(), []int{28} } type CreateConfigItemResp struct { @@ -1733,7 +1794,7 @@ type CreateConfigItemResp struct { func (x *CreateConfigItemResp) Reset() { *x = CreateConfigItemResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[28] + mi := &file_config_service_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1746,7 +1807,7 @@ func (x *CreateConfigItemResp) String() string { func (*CreateConfigItemResp) ProtoMessage() {} func (x *CreateConfigItemResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[28] + mi := &file_config_service_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1759,7 +1820,7 @@ func (x *CreateConfigItemResp) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateConfigItemResp.ProtoReflect.Descriptor instead. func (*CreateConfigItemResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{28} + return file_config_service_proto_rawDescGZIP(), []int{29} } func (x *CreateConfigItemResp) GetId() uint32 { @@ -1792,7 +1853,7 @@ type UpdateConfigItemReq struct { func (x *UpdateConfigItemReq) Reset() { *x = UpdateConfigItemReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[29] + mi := &file_config_service_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1805,7 +1866,7 @@ func (x *UpdateConfigItemReq) String() string { func (*UpdateConfigItemReq) ProtoMessage() {} func (x *UpdateConfigItemReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[29] + mi := &file_config_service_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1818,7 +1879,7 @@ func (x *UpdateConfigItemReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateConfigItemReq.ProtoReflect.Descriptor instead. func (*UpdateConfigItemReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{29} + return file_config_service_proto_rawDescGZIP(), []int{30} } func (x *UpdateConfigItemReq) GetId() uint32 { @@ -1921,7 +1982,7 @@ type UpdateConfigItemResp struct { func (x *UpdateConfigItemResp) Reset() { *x = UpdateConfigItemResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[30] + mi := &file_config_service_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1934,7 +1995,7 @@ func (x *UpdateConfigItemResp) String() string { func (*UpdateConfigItemResp) ProtoMessage() {} func (x *UpdateConfigItemResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[30] + mi := &file_config_service_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1947,7 +2008,7 @@ func (x *UpdateConfigItemResp) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateConfigItemResp.ProtoReflect.Descriptor instead. func (*UpdateConfigItemResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{30} + return file_config_service_proto_rawDescGZIP(), []int{31} } type DeleteConfigItemReq struct { @@ -1963,7 +2024,7 @@ type DeleteConfigItemReq struct { func (x *DeleteConfigItemReq) Reset() { *x = DeleteConfigItemReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[31] + mi := &file_config_service_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1976,7 +2037,7 @@ func (x *DeleteConfigItemReq) String() string { func (*DeleteConfigItemReq) ProtoMessage() {} func (x *DeleteConfigItemReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[31] + mi := &file_config_service_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1989,7 +2050,7 @@ func (x *DeleteConfigItemReq) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteConfigItemReq.ProtoReflect.Descriptor instead. func (*DeleteConfigItemReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{31} + return file_config_service_proto_rawDescGZIP(), []int{32} } func (x *DeleteConfigItemReq) GetId() uint32 { @@ -2022,7 +2083,7 @@ type DeleteConfigItemResp struct { func (x *DeleteConfigItemResp) Reset() { *x = DeleteConfigItemResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[32] + mi := &file_config_service_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2035,7 +2096,7 @@ func (x *DeleteConfigItemResp) String() string { func (*DeleteConfigItemResp) ProtoMessage() {} func (x *DeleteConfigItemResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[32] + mi := &file_config_service_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2048,7 +2109,7 @@ func (x *DeleteConfigItemResp) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteConfigItemResp.ProtoReflect.Descriptor instead. func (*DeleteConfigItemResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{32} + return file_config_service_proto_rawDescGZIP(), []int{33} } type GetConfigItemReq struct { @@ -2065,7 +2126,7 @@ type GetConfigItemReq struct { func (x *GetConfigItemReq) Reset() { *x = GetConfigItemReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[33] + mi := &file_config_service_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2078,7 +2139,7 @@ func (x *GetConfigItemReq) String() string { func (*GetConfigItemReq) ProtoMessage() {} func (x *GetConfigItemReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[33] + mi := &file_config_service_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2091,7 +2152,7 @@ func (x *GetConfigItemReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetConfigItemReq.ProtoReflect.Descriptor instead. func (*GetConfigItemReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{33} + return file_config_service_proto_rawDescGZIP(), []int{34} } func (x *GetConfigItemReq) GetBizId() uint32 { @@ -2134,7 +2195,7 @@ type GetConfigItemResp struct { func (x *GetConfigItemResp) Reset() { *x = GetConfigItemResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[34] + mi := &file_config_service_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2147,7 +2208,7 @@ func (x *GetConfigItemResp) String() string { func (*GetConfigItemResp) ProtoMessage() {} func (x *GetConfigItemResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[34] + mi := &file_config_service_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2160,7 +2221,7 @@ func (x *GetConfigItemResp) ProtoReflect() protoreflect.Message { // Deprecated: Use GetConfigItemResp.ProtoReflect.Descriptor instead. func (*GetConfigItemResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{34} + return file_config_service_proto_rawDescGZIP(), []int{35} } func (x *GetConfigItemResp) GetConfigItem() *config_item.ConfigItem { @@ -2194,7 +2255,7 @@ type ListConfigItemsReq struct { func (x *ListConfigItemsReq) Reset() { *x = ListConfigItemsReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[35] + mi := &file_config_service_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2207,7 +2268,7 @@ func (x *ListConfigItemsReq) String() string { func (*ListConfigItemsReq) ProtoMessage() {} func (x *ListConfigItemsReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[35] + mi := &file_config_service_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2220,7 +2281,7 @@ func (x *ListConfigItemsReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListConfigItemsReq.ProtoReflect.Descriptor instead. func (*ListConfigItemsReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{35} + return file_config_service_proto_rawDescGZIP(), []int{36} } func (x *ListConfigItemsReq) GetBizId() uint32 { @@ -2284,7 +2345,7 @@ type ListConfigItemsResp struct { func (x *ListConfigItemsResp) Reset() { *x = ListConfigItemsResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[36] + mi := &file_config_service_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2297,7 +2358,7 @@ func (x *ListConfigItemsResp) String() string { func (*ListConfigItemsResp) ProtoMessage() {} func (x *ListConfigItemsResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[36] + mi := &file_config_service_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2310,7 +2371,7 @@ func (x *ListConfigItemsResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListConfigItemsResp.ProtoReflect.Descriptor instead. func (*ListConfigItemsResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{36} + return file_config_service_proto_rawDescGZIP(), []int{37} } func (x *ListConfigItemsResp) GetCount() uint32 { @@ -2339,7 +2400,7 @@ type ListConfigItemCountReq struct { func (x *ListConfigItemCountReq) Reset() { *x = ListConfigItemCountReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[37] + mi := &file_config_service_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2352,7 +2413,7 @@ func (x *ListConfigItemCountReq) String() string { func (*ListConfigItemCountReq) ProtoMessage() {} func (x *ListConfigItemCountReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[37] + mi := &file_config_service_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2365,7 +2426,7 @@ func (x *ListConfigItemCountReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListConfigItemCountReq.ProtoReflect.Descriptor instead. func (*ListConfigItemCountReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{37} + return file_config_service_proto_rawDescGZIP(), []int{38} } func (x *ListConfigItemCountReq) GetBizId() uint32 { @@ -2393,7 +2454,7 @@ type ListConfigItemCountResp struct { func (x *ListConfigItemCountResp) Reset() { *x = ListConfigItemCountResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[38] + mi := &file_config_service_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2406,7 +2467,7 @@ func (x *ListConfigItemCountResp) String() string { func (*ListConfigItemCountResp) ProtoMessage() {} func (x *ListConfigItemCountResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[38] + mi := &file_config_service_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2419,7 +2480,7 @@ func (x *ListConfigItemCountResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListConfigItemCountResp.ProtoReflect.Descriptor instead. func (*ListConfigItemCountResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{38} + return file_config_service_proto_rawDescGZIP(), []int{39} } func (x *ListConfigItemCountResp) GetDetails() []*config_item.ListConfigItemCounts { @@ -2444,7 +2505,7 @@ type CreateContentReq struct { func (x *CreateContentReq) Reset() { *x = CreateContentReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[39] + mi := &file_config_service_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2457,7 +2518,7 @@ func (x *CreateContentReq) String() string { func (*CreateContentReq) ProtoMessage() {} func (x *CreateContentReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[39] + mi := &file_config_service_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2470,7 +2531,7 @@ func (x *CreateContentReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateContentReq.ProtoReflect.Descriptor instead. func (*CreateContentReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{39} + return file_config_service_proto_rawDescGZIP(), []int{40} } func (x *CreateContentReq) GetBizId() uint32 { @@ -2519,7 +2580,7 @@ type CreateContentResp struct { func (x *CreateContentResp) Reset() { *x = CreateContentResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[40] + mi := &file_config_service_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2532,7 +2593,7 @@ func (x *CreateContentResp) String() string { func (*CreateContentResp) ProtoMessage() {} func (x *CreateContentResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[40] + mi := &file_config_service_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2545,7 +2606,7 @@ func (x *CreateContentResp) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateContentResp.ProtoReflect.Descriptor instead. func (*CreateContentResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{40} + return file_config_service_proto_rawDescGZIP(), []int{41} } func (x *CreateContentResp) GetId() uint32 { @@ -2569,7 +2630,7 @@ type ListContentsReq struct { func (x *ListContentsReq) Reset() { *x = ListContentsReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[41] + mi := &file_config_service_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2582,7 +2643,7 @@ func (x *ListContentsReq) String() string { func (*ListContentsReq) ProtoMessage() {} func (x *ListContentsReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[41] + mi := &file_config_service_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2595,7 +2656,7 @@ func (x *ListContentsReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListContentsReq.ProtoReflect.Descriptor instead. func (*ListContentsReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{41} + return file_config_service_proto_rawDescGZIP(), []int{42} } func (x *ListContentsReq) GetBizId() uint32 { @@ -2638,7 +2699,7 @@ type ListContentsResp struct { func (x *ListContentsResp) Reset() { *x = ListContentsResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[42] + mi := &file_config_service_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2651,7 +2712,7 @@ func (x *ListContentsResp) String() string { func (*ListContentsResp) ProtoMessage() {} func (x *ListContentsResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[42] + mi := &file_config_service_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2664,7 +2725,7 @@ func (x *ListContentsResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListContentsResp.ProtoReflect.Descriptor instead. func (*ListContentsResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{42} + return file_config_service_proto_rawDescGZIP(), []int{43} } func (x *ListContentsResp) GetCount() uint32 { @@ -2681,34 +2742,35 @@ func (x *ListContentsResp) GetDetails() []*content.Content { return nil } -type CreateConfigHookReq struct { +type CreateCommitReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - PreHookId uint32 `protobuf:"varint,3,opt,name=pre_hook_id,json=preHookId,proto3" json:"pre_hook_id,omitempty"` - PostHookId uint32 `protobuf:"varint,4,opt,name=post_hook_id,json=postHookId,proto3" json:"post_hook_id,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + ConfigItemId uint32 `protobuf:"varint,3,opt,name=config_item_id,json=configItemId,proto3" json:"config_item_id,omitempty"` + ContentId uint32 `protobuf:"varint,4,opt,name=content_id,json=contentId,proto3" json:"content_id,omitempty"` + Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` } -func (x *CreateConfigHookReq) Reset() { - *x = CreateConfigHookReq{} +func (x *CreateCommitReq) Reset() { + *x = CreateCommitReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[43] + mi := &file_config_service_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateConfigHookReq) String() string { +func (x *CreateCommitReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateConfigHookReq) ProtoMessage() {} +func (*CreateCommitReq) ProtoMessage() {} -func (x *CreateConfigHookReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[43] +func (x *CreateCommitReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2719,40 +2781,47 @@ func (x *CreateConfigHookReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateConfigHookReq.ProtoReflect.Descriptor instead. -func (*CreateConfigHookReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{43} +// Deprecated: Use CreateCommitReq.ProtoReflect.Descriptor instead. +func (*CreateCommitReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{44} } -func (x *CreateConfigHookReq) GetBizId() uint32 { +func (x *CreateCommitReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *CreateConfigHookReq) GetAppId() uint32 { +func (x *CreateCommitReq) GetAppId() uint32 { if x != nil { return x.AppId } return 0 } -func (x *CreateConfigHookReq) GetPreHookId() uint32 { +func (x *CreateCommitReq) GetConfigItemId() uint32 { if x != nil { - return x.PreHookId + return x.ConfigItemId } return 0 } -func (x *CreateConfigHookReq) GetPostHookId() uint32 { +func (x *CreateCommitReq) GetContentId() uint32 { if x != nil { - return x.PostHookId + return x.ContentId } return 0 } -type CreateConfigHookResp struct { +func (x *CreateCommitReq) GetMemo() string { + if x != nil { + return x.Memo + } + return "" +} + +type CreateCommitResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2760,23 +2829,23 @@ type CreateConfigHookResp struct { Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (x *CreateConfigHookResp) Reset() { - *x = CreateConfigHookResp{} +func (x *CreateCommitResp) Reset() { + *x = CreateCommitResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[44] + mi := &file_config_service_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateConfigHookResp) String() string { +func (x *CreateCommitResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateConfigHookResp) ProtoMessage() {} +func (*CreateCommitResp) ProtoMessage() {} -func (x *CreateConfigHookResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[44] +func (x *CreateCommitResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2787,47 +2856,46 @@ func (x *CreateConfigHookResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateConfigHookResp.ProtoReflect.Descriptor instead. -func (*CreateConfigHookResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{44} +// Deprecated: Use CreateCommitResp.ProtoReflect.Descriptor instead. +func (*CreateCommitResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{45} } -func (x *CreateConfigHookResp) GetId() uint32 { +func (x *CreateCommitResp) GetId() uint32 { if x != nil { return x.Id } return 0 } -type UpdateConfigHookReq struct { +type ListCommitsReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - PreHookId uint32 `protobuf:"varint,3,opt,name=pre_hook_id,json=preHookId,proto3" json:"pre_hook_id,omitempty"` - PostHookId uint32 `protobuf:"varint,4,opt,name=post_hook_id,json=postHookId,proto3" json:"post_hook_id,omitempty"` - Enable bool `protobuf:"varint,5,opt,name=enable,proto3" json:"enable,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + Filter *structpb.Struct `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"` + Page *base.BasePage `protobuf:"bytes,4,opt,name=page,proto3" json:"page,omitempty"` } -func (x *UpdateConfigHookReq) Reset() { - *x = UpdateConfigHookReq{} +func (x *ListCommitsReq) Reset() { + *x = ListCommitsReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[45] + mi := &file_config_service_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *UpdateConfigHookReq) String() string { +func (x *ListCommitsReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateConfigHookReq) ProtoMessage() {} +func (*ListCommitsReq) ProtoMessage() {} -func (x *UpdateConfigHookReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[45] +func (x *ListCommitsReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2838,69 +2906,65 @@ func (x *UpdateConfigHookReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateConfigHookReq.ProtoReflect.Descriptor instead. -func (*UpdateConfigHookReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{45} +// Deprecated: Use ListCommitsReq.ProtoReflect.Descriptor instead. +func (*ListCommitsReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{46} } -func (x *UpdateConfigHookReq) GetBizId() uint32 { +func (x *ListCommitsReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *UpdateConfigHookReq) GetAppId() uint32 { +func (x *ListCommitsReq) GetAppId() uint32 { if x != nil { return x.AppId } return 0 } -func (x *UpdateConfigHookReq) GetPreHookId() uint32 { +func (x *ListCommitsReq) GetFilter() *structpb.Struct { if x != nil { - return x.PreHookId + return x.Filter } - return 0 + return nil } -func (x *UpdateConfigHookReq) GetPostHookId() uint32 { +func (x *ListCommitsReq) GetPage() *base.BasePage { if x != nil { - return x.PostHookId + return x.Page } - return 0 + return nil } -func (x *UpdateConfigHookReq) GetEnable() bool { - if x != nil { - return x.Enable - } - return false -} - -type UpdateConfigHookResp struct { +type ListCommitsResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Details []*commit.Commit `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *UpdateConfigHookResp) Reset() { - *x = UpdateConfigHookResp{} +func (x *ListCommitsResp) Reset() { + *x = ListCommitsResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[46] + mi := &file_config_service_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *UpdateConfigHookResp) String() string { +func (x *ListCommitsResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateConfigHookResp) ProtoMessage() {} +func (*ListCommitsResp) ProtoMessage() {} -func (x *UpdateConfigHookResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[46] +func (x *ListCommitsResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2911,37 +2975,53 @@ func (x *UpdateConfigHookResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateConfigHookResp.ProtoReflect.Descriptor instead. -func (*UpdateConfigHookResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{46} +// Deprecated: Use ListCommitsResp.ProtoReflect.Descriptor instead. +func (*ListCommitsResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{47} +} + +func (x *ListCommitsResp) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *ListCommitsResp) GetDetails() []*commit.Commit { + if x != nil { + return x.Details + } + return nil } -type GetConfigHookReq struct { +type CreateReleaseReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Memo string `protobuf:"bytes,4,opt,name=memo,proto3" json:"memo,omitempty"` } -func (x *GetConfigHookReq) Reset() { - *x = GetConfigHookReq{} +func (x *CreateReleaseReq) Reset() { + *x = CreateReleaseReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[47] + mi := &file_config_service_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetConfigHookReq) String() string { +func (x *CreateReleaseReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetConfigHookReq) ProtoMessage() {} +func (*CreateReleaseReq) ProtoMessage() {} -func (x *GetConfigHookReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[47] +func (x *CreateReleaseReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2952,50 +3032,64 @@ func (x *GetConfigHookReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetConfigHookReq.ProtoReflect.Descriptor instead. -func (*GetConfigHookReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{47} +// Deprecated: Use CreateReleaseReq.ProtoReflect.Descriptor instead. +func (*CreateReleaseReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{48} } -func (x *GetConfigHookReq) GetBizId() uint32 { +func (x *CreateReleaseReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *GetConfigHookReq) GetAppId() uint32 { +func (x *CreateReleaseReq) GetAppId() uint32 { if x != nil { return x.AppId } return 0 } -type GetConfigHookResp struct { +func (x *CreateReleaseReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateReleaseReq) GetMemo() string { + if x != nil { + return x.Memo + } + return "" +} + +type CreateReleaseResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ConfigHook *config_hook.ConfigHook `protobuf:"bytes,1,opt,name=config_hook,json=configHook,proto3" json:"config_hook,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (x *GetConfigHookResp) Reset() { - *x = GetConfigHookResp{} +func (x *CreateReleaseResp) Reset() { + *x = CreateReleaseResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[48] + mi := &file_config_service_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetConfigHookResp) String() string { +func (x *CreateReleaseResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetConfigHookResp) ProtoMessage() {} +func (*CreateReleaseResp) ProtoMessage() {} -func (x *GetConfigHookResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[48] +func (x *CreateReleaseResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3006,47 +3100,49 @@ func (x *GetConfigHookResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetConfigHookResp.ProtoReflect.Descriptor instead. -func (*GetConfigHookResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{48} +// Deprecated: Use CreateReleaseResp.ProtoReflect.Descriptor instead. +func (*CreateReleaseResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{49} } -func (x *GetConfigHookResp) GetConfigHook() *config_hook.ConfigHook { +func (x *CreateReleaseResp) GetId() uint32 { if x != nil { - return x.ConfigHook + return x.Id } - return nil + return 0 } -type CreateCommitReq struct { +type ListReleasesReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - ConfigItemId uint32 `protobuf:"varint,3,opt,name=config_item_id,json=configItemId,proto3" json:"config_item_id,omitempty"` - ContentId uint32 `protobuf:"varint,4,opt,name=content_id,json=contentId,proto3" json:"content_id,omitempty"` - Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + SearchKey string `protobuf:"bytes,3,opt,name=searchKey,proto3" json:"searchKey,omitempty"` + Start uint32 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"` + Limit uint32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` + All bool `protobuf:"varint,6,opt,name=all,proto3" json:"all,omitempty"` + Deprecated bool `protobuf:"varint,7,opt,name=deprecated,proto3" json:"deprecated,omitempty"` } -func (x *CreateCommitReq) Reset() { - *x = CreateCommitReq{} +func (x *ListReleasesReq) Reset() { + *x = ListReleasesReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[49] + mi := &file_config_service_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateCommitReq) String() string { +func (x *ListReleasesReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateCommitReq) ProtoMessage() {} +func (*ListReleasesReq) ProtoMessage() {} -func (x *CreateCommitReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[49] +func (x *ListReleasesReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3057,71 +3153,86 @@ func (x *CreateCommitReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateCommitReq.ProtoReflect.Descriptor instead. -func (*CreateCommitReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{49} +// Deprecated: Use ListReleasesReq.ProtoReflect.Descriptor instead. +func (*ListReleasesReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{50} } -func (x *CreateCommitReq) GetBizId() uint32 { +func (x *ListReleasesReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *CreateCommitReq) GetAppId() uint32 { +func (x *ListReleasesReq) GetAppId() uint32 { if x != nil { return x.AppId } return 0 } -func (x *CreateCommitReq) GetConfigItemId() uint32 { +func (x *ListReleasesReq) GetSearchKey() string { if x != nil { - return x.ConfigItemId + return x.SearchKey + } + return "" +} + +func (x *ListReleasesReq) GetStart() uint32 { + if x != nil { + return x.Start } return 0 } -func (x *CreateCommitReq) GetContentId() uint32 { +func (x *ListReleasesReq) GetLimit() uint32 { if x != nil { - return x.ContentId + return x.Limit } return 0 } -func (x *CreateCommitReq) GetMemo() string { +func (x *ListReleasesReq) GetAll() bool { if x != nil { - return x.Memo + return x.All } - return "" + return false } -type CreateCommitResp struct { +func (x *ListReleasesReq) GetDeprecated() bool { + if x != nil { + return x.Deprecated + } + return false +} + +type ListReleasesResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Details []*release.Release `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *CreateCommitResp) Reset() { - *x = CreateCommitResp{} +func (x *ListReleasesResp) Reset() { + *x = ListReleasesResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[50] + mi := &file_config_service_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateCommitResp) String() string { +func (x *ListReleasesResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateCommitResp) ProtoMessage() {} +func (*ListReleasesResp) ProtoMessage() {} -func (x *CreateCommitResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[50] +func (x *ListReleasesResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3132,46 +3243,53 @@ func (x *CreateCommitResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateCommitResp.ProtoReflect.Descriptor instead. -func (*CreateCommitResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{50} +// Deprecated: Use ListReleasesResp.ProtoReflect.Descriptor instead. +func (*ListReleasesResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{51} } -func (x *CreateCommitResp) GetId() uint32 { +func (x *ListReleasesResp) GetCount() uint32 { if x != nil { - return x.Id + return x.Count } return 0 } -type ListCommitsReq struct { +func (x *ListReleasesResp) GetDetails() []*release.Release { + if x != nil { + return x.Details + } + return nil +} + +type ListReleasedConfigItemsReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - Filter *structpb.Struct `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"` - Page *base.BasePage `protobuf:"bytes,4,opt,name=page,proto3" json:"page,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + ReleaseId uint32 `protobuf:"varint,2,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` + // serial number 3 is reserved for later added filter fields + Page *base.BasePage `protobuf:"bytes,4,opt,name=page,proto3" json:"page,omitempty"` } -func (x *ListCommitsReq) Reset() { - *x = ListCommitsReq{} +func (x *ListReleasedConfigItemsReq) Reset() { + *x = ListReleasedConfigItemsReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[51] + mi := &file_config_service_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListCommitsReq) String() string { +func (x *ListReleasedConfigItemsReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListCommitsReq) ProtoMessage() {} +func (*ListReleasedConfigItemsReq) ProtoMessage() {} -func (x *ListCommitsReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[51] +func (x *ListReleasedConfigItemsReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3182,65 +3300,58 @@ func (x *ListCommitsReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListCommitsReq.ProtoReflect.Descriptor instead. -func (*ListCommitsReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{51} +// Deprecated: Use ListReleasedConfigItemsReq.ProtoReflect.Descriptor instead. +func (*ListReleasedConfigItemsReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{52} } -func (x *ListCommitsReq) GetBizId() uint32 { +func (x *ListReleasedConfigItemsReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *ListCommitsReq) GetAppId() uint32 { +func (x *ListReleasedConfigItemsReq) GetReleaseId() uint32 { if x != nil { - return x.AppId + return x.ReleaseId } return 0 } -func (x *ListCommitsReq) GetFilter() *structpb.Struct { - if x != nil { - return x.Filter - } - return nil -} - -func (x *ListCommitsReq) GetPage() *base.BasePage { +func (x *ListReleasedConfigItemsReq) GetPage() *base.BasePage { if x != nil { return x.Page } return nil } -type ListCommitsResp struct { +type ListReleasedConfigItemsResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*commit.Commit `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Details []*released_ci.ReleasedConfigItem `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *ListCommitsResp) Reset() { - *x = ListCommitsResp{} +func (x *ListReleasedConfigItemsResp) Reset() { + *x = ListReleasedConfigItemsResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[52] + mi := &file_config_service_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListCommitsResp) String() string { +func (x *ListReleasedConfigItemsResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListCommitsResp) ProtoMessage() {} +func (*ListReleasedConfigItemsResp) ProtoMessage() {} -func (x *ListCommitsResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[52] +func (x *ListReleasedConfigItemsResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3251,53 +3362,57 @@ func (x *ListCommitsResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListCommitsResp.ProtoReflect.Descriptor instead. -func (*ListCommitsResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{52} +// Deprecated: Use ListReleasedConfigItemsResp.ProtoReflect.Descriptor instead. +func (*ListReleasedConfigItemsResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{53} } -func (x *ListCommitsResp) GetCount() uint32 { +func (x *ListReleasedConfigItemsResp) GetCount() uint32 { if x != nil { return x.Count } return 0 } -func (x *ListCommitsResp) GetDetails() []*commit.Commit { +func (x *ListReleasedConfigItemsResp) GetDetails() []*released_ci.ReleasedConfigItem { if x != nil { return x.Details } return nil } -type CreateReleaseReq struct { +type CreateHookReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Memo string `protobuf:"bytes,4,opt,name=memo,proto3" json:"memo,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + PreType string `protobuf:"bytes,5,opt,name=pre_type,json=preType,proto3" json:"pre_type,omitempty"` + PreHook string `protobuf:"bytes,6,opt,name=pre_hook,json=preHook,proto3" json:"pre_hook,omitempty"` + PostType string `protobuf:"bytes,7,opt,name=post_type,json=postType,proto3" json:"post_type,omitempty"` + PostHook string `protobuf:"bytes,8,opt,name=post_hook,json=postHook,proto3" json:"post_hook,omitempty"` } -func (x *CreateReleaseReq) Reset() { - *x = CreateReleaseReq{} +func (x *CreateHookReq) Reset() { + *x = CreateHookReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[53] + mi := &file_config_service_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateReleaseReq) String() string { +func (x *CreateHookReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateReleaseReq) ProtoMessage() {} +func (*CreateHookReq) ProtoMessage() {} -func (x *CreateReleaseReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[53] +func (x *CreateHookReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3308,40 +3423,68 @@ func (x *CreateReleaseReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateReleaseReq.ProtoReflect.Descriptor instead. -func (*CreateReleaseReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{53} +// Deprecated: Use CreateHookReq.ProtoReflect.Descriptor instead. +func (*CreateHookReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{54} } -func (x *CreateReleaseReq) GetBizId() uint32 { +func (x *CreateHookReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *CreateReleaseReq) GetAppId() uint32 { +func (x *CreateHookReq) GetAppId() uint32 { if x != nil { return x.AppId } return 0 } -func (x *CreateReleaseReq) GetName() string { +func (x *CreateHookReq) GetReleaseId() uint32 { + if x != nil { + return x.ReleaseId + } + return 0 +} + +func (x *CreateHookReq) GetName() string { if x != nil { return x.Name } return "" } -func (x *CreateReleaseReq) GetMemo() string { +func (x *CreateHookReq) GetPreType() string { if x != nil { - return x.Memo + return x.PreType } return "" } -type CreateReleaseResp struct { +func (x *CreateHookReq) GetPreHook() string { + if x != nil { + return x.PreHook + } + return "" +} + +func (x *CreateHookReq) GetPostType() string { + if x != nil { + return x.PostType + } + return "" +} + +func (x *CreateHookReq) GetPostHook() string { + if x != nil { + return x.PostHook + } + return "" +} + +type CreateHookResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -3349,23 +3492,23 @@ type CreateReleaseResp struct { Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (x *CreateReleaseResp) Reset() { - *x = CreateReleaseResp{} +func (x *CreateHookResp) Reset() { + *x = CreateHookResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[54] + mi := &file_config_service_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateReleaseResp) String() string { +func (x *CreateHookResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateReleaseResp) ProtoMessage() {} +func (*CreateHookResp) ProtoMessage() {} -func (x *CreateReleaseResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[54] +func (x *CreateHookResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3376,49 +3519,51 @@ func (x *CreateReleaseResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateReleaseResp.ProtoReflect.Descriptor instead. -func (*CreateReleaseResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{54} +// Deprecated: Use CreateHookResp.ProtoReflect.Descriptor instead. +func (*CreateHookResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{55} } -func (x *CreateReleaseResp) GetId() uint32 { +func (x *CreateHookResp) GetId() uint32 { if x != nil { return x.Id } return 0 } -type ListReleasesReq struct { +type UpdateHookReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - SearchKey string `protobuf:"bytes,3,opt,name=searchKey,proto3" json:"searchKey,omitempty"` - Start uint32 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"` - Limit uint32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` - All bool `protobuf:"varint,6,opt,name=all,proto3" json:"all,omitempty"` - Deprecated bool `protobuf:"varint,7,opt,name=deprecated,proto3" json:"deprecated,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + HookId uint32 `protobuf:"varint,3,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` + ReleaseId uint32 `protobuf:"varint,4,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + PreType string `protobuf:"bytes,6,opt,name=pre_type,json=preType,proto3" json:"pre_type,omitempty"` + PreHook string `protobuf:"bytes,7,opt,name=pre_hook,json=preHook,proto3" json:"pre_hook,omitempty"` + PostType string `protobuf:"bytes,8,opt,name=post_type,json=postType,proto3" json:"post_type,omitempty"` + PostHook string `protobuf:"bytes,9,opt,name=post_hook,json=postHook,proto3" json:"post_hook,omitempty"` } -func (x *ListReleasesReq) Reset() { - *x = ListReleasesReq{} +func (x *UpdateHookReq) Reset() { + *x = UpdateHookReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[55] + mi := &file_config_service_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListReleasesReq) String() string { +func (x *UpdateHookReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListReleasesReq) ProtoMessage() {} +func (*UpdateHookReq) ProtoMessage() {} -func (x *ListReleasesReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[55] +func (x *UpdateHookReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3429,86 +3574,97 @@ func (x *ListReleasesReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListReleasesReq.ProtoReflect.Descriptor instead. -func (*ListReleasesReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{55} +// Deprecated: Use UpdateHookReq.ProtoReflect.Descriptor instead. +func (*UpdateHookReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{56} } -func (x *ListReleasesReq) GetBizId() uint32 { +func (x *UpdateHookReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *ListReleasesReq) GetAppId() uint32 { +func (x *UpdateHookReq) GetAppId() uint32 { if x != nil { return x.AppId } return 0 } -func (x *ListReleasesReq) GetSearchKey() string { +func (x *UpdateHookReq) GetHookId() uint32 { if x != nil { - return x.SearchKey + return x.HookId } - return "" + return 0 } -func (x *ListReleasesReq) GetStart() uint32 { +func (x *UpdateHookReq) GetReleaseId() uint32 { if x != nil { - return x.Start + return x.ReleaseId } return 0 } -func (x *ListReleasesReq) GetLimit() uint32 { +func (x *UpdateHookReq) GetName() string { if x != nil { - return x.Limit + return x.Name } - return 0 + return "" } -func (x *ListReleasesReq) GetAll() bool { +func (x *UpdateHookReq) GetPreType() string { if x != nil { - return x.All + return x.PreType } - return false + return "" } -func (x *ListReleasesReq) GetDeprecated() bool { +func (x *UpdateHookReq) GetPreHook() string { if x != nil { - return x.Deprecated + return x.PreHook } - return false + return "" } -type ListReleasesResp struct { +func (x *UpdateHookReq) GetPostType() string { + if x != nil { + return x.PostType + } + return "" +} + +func (x *UpdateHookReq) GetPostHook() string { + if x != nil { + return x.PostHook + } + return "" +} + +type UpdateHookResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*release.Release `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *ListReleasesResp) Reset() { - *x = ListReleasesResp{} +func (x *UpdateHookResp) Reset() { + *x = UpdateHookResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[56] + mi := &file_config_service_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListReleasesResp) String() string { +func (x *UpdateHookResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListReleasesResp) ProtoMessage() {} +func (*UpdateHookResp) ProtoMessage() {} -func (x *ListReleasesResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[56] +func (x *UpdateHookResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3519,53 +3675,38 @@ func (x *ListReleasesResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListReleasesResp.ProtoReflect.Descriptor instead. -func (*ListReleasesResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{56} -} - -func (x *ListReleasesResp) GetCount() uint32 { - if x != nil { - return x.Count - } - return 0 -} - -func (x *ListReleasesResp) GetDetails() []*release.Release { - if x != nil { - return x.Details - } - return nil +// Deprecated: Use UpdateHookResp.ProtoReflect.Descriptor instead. +func (*UpdateHookResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{57} } -type ListReleasedConfigItemsReq struct { +type DeleteHookReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - ReleaseId uint32 `protobuf:"varint,2,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` - // serial number 3 is reserved for later added filter fields - Page *base.BasePage `protobuf:"bytes,4,opt,name=page,proto3" json:"page,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + HookId uint32 `protobuf:"varint,3,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` } -func (x *ListReleasedConfigItemsReq) Reset() { - *x = ListReleasedConfigItemsReq{} +func (x *DeleteHookReq) Reset() { + *x = DeleteHookReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[57] + mi := &file_config_service_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListReleasedConfigItemsReq) String() string { +func (x *DeleteHookReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListReleasedConfigItemsReq) ProtoMessage() {} +func (*DeleteHookReq) ProtoMessage() {} -func (x *ListReleasedConfigItemsReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[57] +func (x *DeleteHookReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3576,58 +3717,55 @@ func (x *ListReleasedConfigItemsReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListReleasedConfigItemsReq.ProtoReflect.Descriptor instead. -func (*ListReleasedConfigItemsReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{57} +// Deprecated: Use DeleteHookReq.ProtoReflect.Descriptor instead. +func (*DeleteHookReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{58} } -func (x *ListReleasedConfigItemsReq) GetBizId() uint32 { +func (x *DeleteHookReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *ListReleasedConfigItemsReq) GetReleaseId() uint32 { +func (x *DeleteHookReq) GetAppId() uint32 { if x != nil { - return x.ReleaseId + return x.AppId } return 0 } -func (x *ListReleasedConfigItemsReq) GetPage() *base.BasePage { +func (x *DeleteHookReq) GetHookId() uint32 { if x != nil { - return x.Page + return x.HookId } - return nil + return 0 } -type ListReleasedConfigItemsResp struct { +type DeleteHookResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*released_ci.ReleasedConfigItem `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *ListReleasedConfigItemsResp) Reset() { - *x = ListReleasedConfigItemsResp{} +func (x *DeleteHookResp) Reset() { + *x = DeleteHookResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[58] + mi := &file_config_service_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListReleasedConfigItemsResp) String() string { +func (x *DeleteHookResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListReleasedConfigItemsResp) ProtoMessage() {} +func (*DeleteHookResp) ProtoMessage() {} -func (x *ListReleasedConfigItemsResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[58] +func (x *DeleteHookResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3638,56 +3776,39 @@ func (x *ListReleasedConfigItemsResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListReleasedConfigItemsResp.ProtoReflect.Descriptor instead. -func (*ListReleasedConfigItemsResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{58} -} - -func (x *ListReleasedConfigItemsResp) GetCount() uint32 { - if x != nil { - return x.Count - } - return 0 -} - -func (x *ListReleasedConfigItemsResp) GetDetails() []*released_ci.ReleasedConfigItem { - if x != nil { - return x.Details - } - return nil +// Deprecated: Use DeleteHookResp.ProtoReflect.Descriptor instead. +func (*DeleteHookResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{59} } -type CreateHookReq struct { +type ListHooksReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - ReleaseName string `protobuf:"bytes,3,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` - Tag string `protobuf:"bytes,5,opt,name=tag,proto3" json:"tag,omitempty"` - Memo string `protobuf:"bytes,6,opt,name=memo,proto3" json:"memo,omitempty"` - Content string `protobuf:"bytes,7,opt,name=content,proto3" json:"content,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + Filter *structpb.Struct `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"` + Page *base.BasePage `protobuf:"bytes,4,opt,name=page,proto3" json:"page,omitempty"` } -func (x *CreateHookReq) Reset() { - *x = CreateHookReq{} +func (x *ListHooksReq) Reset() { + *x = ListHooksReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[59] + mi := &file_config_service_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateHookReq) String() string { +func (x *ListHooksReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateHookReq) ProtoMessage() {} +func (*ListHooksReq) ProtoMessage() {} -func (x *CreateHookReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[59] +func (x *ListHooksReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3698,85 +3819,65 @@ func (x *CreateHookReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateHookReq.ProtoReflect.Descriptor instead. -func (*CreateHookReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{59} +// Deprecated: Use ListHooksReq.ProtoReflect.Descriptor instead. +func (*ListHooksReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{60} } -func (x *CreateHookReq) GetBizId() uint32 { +func (x *ListHooksReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *CreateHookReq) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateHookReq) GetReleaseName() string { - if x != nil { - return x.ReleaseName - } - return "" -} - -func (x *CreateHookReq) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *CreateHookReq) GetTag() string { +func (x *ListHooksReq) GetAppId() uint32 { if x != nil { - return x.Tag + return x.AppId } - return "" + return 0 } -func (x *CreateHookReq) GetMemo() string { +func (x *ListHooksReq) GetFilter() *structpb.Struct { if x != nil { - return x.Memo + return x.Filter } - return "" + return nil } -func (x *CreateHookReq) GetContent() string { +func (x *ListHooksReq) GetPage() *base.BasePage { if x != nil { - return x.Content + return x.Page } - return "" + return nil } -type CreateHookResp struct { +type ListHooksResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Details []*hook.Hook `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *CreateHookResp) Reset() { - *x = CreateHookResp{} +func (x *ListHooksResp) Reset() { + *x = ListHooksResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[60] + mi := &file_config_service_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateHookResp) String() string { +func (x *ListHooksResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateHookResp) ProtoMessage() {} +func (*ListHooksResp) ProtoMessage() {} -func (x *CreateHookResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[60] +func (x *ListHooksResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3787,44 +3888,52 @@ func (x *CreateHookResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateHookResp.ProtoReflect.Descriptor instead. -func (*CreateHookResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{60} +// Deprecated: Use ListHooksResp.ProtoReflect.Descriptor instead. +func (*ListHooksResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{61} } -func (x *CreateHookResp) GetId() uint32 { +func (x *ListHooksResp) GetCount() uint32 { if x != nil { - return x.Id + return x.Count } return 0 } -type DeleteHookReq struct { +func (x *ListHooksResp) GetDetails() []*hook.Hook { + if x != nil { + return x.Details + } + return nil +} + +type CreateTemplateSpaceReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Memo string `protobuf:"bytes,3,opt,name=memo,proto3" json:"memo,omitempty"` } -func (x *DeleteHookReq) Reset() { - *x = DeleteHookReq{} +func (x *CreateTemplateSpaceReq) Reset() { + *x = CreateTemplateSpaceReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[61] + mi := &file_config_service_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *DeleteHookReq) String() string { +func (x *CreateTemplateSpaceReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteHookReq) ProtoMessage() {} +func (*CreateTemplateSpaceReq) ProtoMessage() {} -func (x *DeleteHookReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[61] +func (x *CreateTemplateSpaceReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[62] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3835,48 +3944,57 @@ func (x *DeleteHookReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteHookReq.ProtoReflect.Descriptor instead. -func (*DeleteHookReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{61} +// Deprecated: Use CreateTemplateSpaceReq.ProtoReflect.Descriptor instead. +func (*CreateTemplateSpaceReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{62} } -func (x *DeleteHookReq) GetBizId() uint32 { +func (x *CreateTemplateSpaceReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *DeleteHookReq) GetHookId() uint32 { +func (x *CreateTemplateSpaceReq) GetName() string { if x != nil { - return x.HookId + return x.Name } - return 0 + return "" } -type DeleteHookResp struct { +func (x *CreateTemplateSpaceReq) GetMemo() string { + if x != nil { + return x.Memo + } + return "" +} + +type CreateTemplateSpaceResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (x *DeleteHookResp) Reset() { - *x = DeleteHookResp{} +func (x *CreateTemplateSpaceResp) Reset() { + *x = CreateTemplateSpaceResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[62] + mi := &file_config_service_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *DeleteHookResp) String() string { +func (x *CreateTemplateSpaceResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteHookResp) ProtoMessage() {} +func (*CreateTemplateSpaceResp) ProtoMessage() {} -func (x *DeleteHookResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[62] +func (x *CreateTemplateSpaceResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[63] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3887,42 +4005,46 @@ func (x *DeleteHookResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteHookResp.ProtoReflect.Descriptor instead. -func (*DeleteHookResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{62} +// Deprecated: Use CreateTemplateSpaceResp.ProtoReflect.Descriptor instead. +func (*CreateTemplateSpaceResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{63} } -type ListHooksReq struct { +func (x *CreateTemplateSpaceResp) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +type UpdateTemplateSpaceReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Tag string `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"` - All bool `protobuf:"varint,4,opt,name=all,proto3" json:"all,omitempty"` - NotTag bool `protobuf:"varint,5,opt,name=not_tag,json=notTag,proto3" json:"not_tag,omitempty"` - Start uint32 `protobuf:"varint,6,opt,name=start,proto3" json:"start,omitempty"` - Limit uint32 `protobuf:"varint,7,opt,name=limit,proto3" json:"limit,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Memo string `protobuf:"bytes,4,opt,name=memo,proto3" json:"memo,omitempty"` } -func (x *ListHooksReq) Reset() { - *x = ListHooksReq{} +func (x *UpdateTemplateSpaceReq) Reset() { + *x = UpdateTemplateSpaceReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[63] + mi := &file_config_service_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListHooksReq) String() string { +func (x *UpdateTemplateSpaceReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListHooksReq) ProtoMessage() {} +func (*UpdateTemplateSpaceReq) ProtoMessage() {} -func (x *ListHooksReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[63] +func (x *UpdateTemplateSpaceReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[64] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3933,86 +4055,62 @@ func (x *ListHooksReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListHooksReq.ProtoReflect.Descriptor instead. -func (*ListHooksReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{63} +// Deprecated: Use UpdateTemplateSpaceReq.ProtoReflect.Descriptor instead. +func (*UpdateTemplateSpaceReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{64} } -func (x *ListHooksReq) GetBizId() uint32 { +func (x *UpdateTemplateSpaceReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *ListHooksReq) GetName() string { +func (x *UpdateTemplateSpaceReq) GetTemplateSpaceId() uint32 { if x != nil { - return x.Name + return x.TemplateSpaceId } - return "" + return 0 } -func (x *ListHooksReq) GetTag() string { +func (x *UpdateTemplateSpaceReq) GetName() string { if x != nil { - return x.Tag + return x.Name } return "" } -func (x *ListHooksReq) GetAll() bool { - if x != nil { - return x.All - } - return false -} - -func (x *ListHooksReq) GetNotTag() bool { - if x != nil { - return x.NotTag - } - return false -} - -func (x *ListHooksReq) GetStart() uint32 { - if x != nil { - return x.Start - } - return 0 -} - -func (x *ListHooksReq) GetLimit() uint32 { +func (x *UpdateTemplateSpaceReq) GetMemo() string { if x != nil { - return x.Limit + return x.Memo } - return 0 + return "" } -type ListHooksResp struct { +type UpdateTemplateSpaceResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*hook.Hook `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *ListHooksResp) Reset() { - *x = ListHooksResp{} +func (x *UpdateTemplateSpaceResp) Reset() { + *x = UpdateTemplateSpaceResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[64] + mi := &file_config_service_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListHooksResp) String() string { +func (x *UpdateTemplateSpaceResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListHooksResp) ProtoMessage() {} +func (*UpdateTemplateSpaceResp) ProtoMessage() {} -func (x *ListHooksResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[64] +func (x *UpdateTemplateSpaceResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[65] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4023,50 +4121,37 @@ func (x *ListHooksResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListHooksResp.ProtoReflect.Descriptor instead. -func (*ListHooksResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{64} +// Deprecated: Use UpdateTemplateSpaceResp.ProtoReflect.Descriptor instead. +func (*UpdateTemplateSpaceResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{65} } -func (x *ListHooksResp) GetCount() uint32 { - if x != nil { - return x.Count - } - return 0 -} +type DeleteTemplateSpaceReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (x *ListHooksResp) GetDetails() []*hook.Hook { - if x != nil { - return x.Details - } - return nil -} - -type ListHookTagsReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` } -func (x *ListHookTagsReq) Reset() { - *x = ListHookTagsReq{} +func (x *DeleteTemplateSpaceReq) Reset() { + *x = DeleteTemplateSpaceReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[65] + mi := &file_config_service_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListHookTagsReq) String() string { +func (x *DeleteTemplateSpaceReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListHookTagsReq) ProtoMessage() {} +func (*DeleteTemplateSpaceReq) ProtoMessage() {} -func (x *ListHookTagsReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[65] +func (x *DeleteTemplateSpaceReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[66] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4077,43 +4162,48 @@ func (x *ListHookTagsReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListHookTagsReq.ProtoReflect.Descriptor instead. -func (*ListHookTagsReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{65} +// Deprecated: Use DeleteTemplateSpaceReq.ProtoReflect.Descriptor instead. +func (*DeleteTemplateSpaceReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{66} } -func (x *ListHookTagsReq) GetBizId() uint32 { +func (x *DeleteTemplateSpaceReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -type ListHookTagsResp struct { +func (x *DeleteTemplateSpaceReq) GetTemplateSpaceId() uint32 { + if x != nil { + return x.TemplateSpaceId + } + return 0 +} + +type DeleteTemplateSpaceResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Details []*hook.CountHookTags `protobuf:"bytes,1,rep,name=details,proto3" json:"details,omitempty"` } -func (x *ListHookTagsResp) Reset() { - *x = ListHookTagsResp{} +func (x *DeleteTemplateSpaceResp) Reset() { + *x = DeleteTemplateSpaceResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[66] + mi := &file_config_service_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListHookTagsResp) String() string { +func (x *DeleteTemplateSpaceResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListHookTagsResp) ProtoMessage() {} +func (*DeleteTemplateSpaceResp) ProtoMessage() {} -func (x *ListHookTagsResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[66] +func (x *DeleteTemplateSpaceResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[67] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4124,47 +4214,38 @@ func (x *ListHookTagsResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListHookTagsResp.ProtoReflect.Descriptor instead. -func (*ListHookTagsResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{66} -} - -func (x *ListHookTagsResp) GetDetails() []*hook.CountHookTags { - if x != nil { - return x.Details - } - return nil +// Deprecated: Use DeleteTemplateSpaceResp.ProtoReflect.Descriptor instead. +func (*DeleteTemplateSpaceResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{67} } -type CreateHookReleaseReq struct { +type ListTemplateSpacesReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Memo string `protobuf:"bytes,4,opt,name=memo,proto3" json:"memo,omitempty"` - Content string `protobuf:"bytes,7,opt,name=content,proto3" json:"content,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + Start uint32 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"` + Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` } -func (x *CreateHookReleaseReq) Reset() { - *x = CreateHookReleaseReq{} +func (x *ListTemplateSpacesReq) Reset() { + *x = ListTemplateSpacesReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[67] + mi := &file_config_service_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateHookReleaseReq) String() string { +func (x *ListTemplateSpacesReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateHookReleaseReq) ProtoMessage() {} +func (*ListTemplateSpacesReq) ProtoMessage() {} -func (x *CreateHookReleaseReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[67] +func (x *ListTemplateSpacesReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[68] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4175,71 +4256,58 @@ func (x *CreateHookReleaseReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateHookReleaseReq.ProtoReflect.Descriptor instead. -func (*CreateHookReleaseReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{67} +// Deprecated: Use ListTemplateSpacesReq.ProtoReflect.Descriptor instead. +func (*ListTemplateSpacesReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{68} } -func (x *CreateHookReleaseReq) GetBizId() uint32 { +func (x *ListTemplateSpacesReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *CreateHookReleaseReq) GetHookId() uint32 { +func (x *ListTemplateSpacesReq) GetStart() uint32 { if x != nil { - return x.HookId + return x.Start } return 0 } -func (x *CreateHookReleaseReq) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateHookReleaseReq) GetMemo() string { - if x != nil { - return x.Memo - } - return "" -} - -func (x *CreateHookReleaseReq) GetContent() string { +func (x *ListTemplateSpacesReq) GetLimit() uint32 { if x != nil { - return x.Content + return x.Limit } - return "" + return 0 } -type CreateHookReleaseResp struct { +type ListTemplateSpacesResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Details []*template_space.TemplateSpace `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *CreateHookReleaseResp) Reset() { - *x = CreateHookReleaseResp{} +func (x *ListTemplateSpacesResp) Reset() { + *x = ListTemplateSpacesResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[68] + mi := &file_config_service_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateHookReleaseResp) String() string { +func (x *ListTemplateSpacesResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateHookReleaseResp) ProtoMessage() {} +func (*ListTemplateSpacesResp) ProtoMessage() {} -func (x *CreateHookReleaseResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[68] +func (x *ListTemplateSpacesResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[69] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4250,49 +4318,63 @@ func (x *CreateHookReleaseResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateHookReleaseResp.ProtoReflect.Descriptor instead. -func (*CreateHookReleaseResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{68} +// Deprecated: Use ListTemplateSpacesResp.ProtoReflect.Descriptor instead. +func (*ListTemplateSpacesResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{69} } -func (x *CreateHookReleaseResp) GetId() uint32 { +func (x *ListTemplateSpacesResp) GetCount() uint32 { if x != nil { - return x.Id + return x.Count } return 0 } -type ListHookReleaseReq struct { +func (x *ListTemplateSpacesResp) GetDetails() []*template_space.TemplateSpace { + if x != nil { + return x.Details + } + return nil +} + +type CreateTemplateReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` - SearchKey string `protobuf:"bytes,3,opt,name=search_key,json=searchKey,proto3" json:"search_key,omitempty"` - Start uint32 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"` - Limit uint32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` - All bool `protobuf:"varint,6,opt,name=all,proto3" json:"all,omitempty"` - State string `protobuf:"bytes,7,opt,name=state,proto3" json:"state,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` + Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` + ReleaseName string `protobuf:"bytes,6,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` + ReleaseMemo string `protobuf:"bytes,7,opt,name=release_memo,json=releaseMemo,proto3" json:"release_memo,omitempty"` + FileType string `protobuf:"bytes,8,opt,name=file_type,json=fileType,proto3" json:"file_type,omitempty"` // file_type is enum type + FileMode string `protobuf:"bytes,9,opt,name=file_mode,json=fileMode,proto3" json:"file_mode,omitempty"` // file_mode is enum type + User string `protobuf:"bytes,10,opt,name=user,proto3" json:"user,omitempty"` + UserGroup string `protobuf:"bytes,11,opt,name=user_group,json=userGroup,proto3" json:"user_group,omitempty"` + Privilege string `protobuf:"bytes,12,opt,name=privilege,proto3" json:"privilege,omitempty"` + Sign string `protobuf:"bytes,13,opt,name=sign,proto3" json:"sign,omitempty"` + ByteSize uint64 `protobuf:"varint,14,opt,name=byte_size,json=byteSize,proto3" json:"byte_size,omitempty"` } -func (x *ListHookReleaseReq) Reset() { - *x = ListHookReleaseReq{} +func (x *CreateTemplateReq) Reset() { + *x = CreateTemplateReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[69] + mi := &file_config_service_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListHookReleaseReq) String() string { +func (x *CreateTemplateReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListHookReleaseReq) ProtoMessage() {} +func (*CreateTemplateReq) ProtoMessage() {} -func (x *ListHookReleaseReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[69] +func (x *CreateTemplateReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[70] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4303,127 +4385,119 @@ func (x *ListHookReleaseReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListHookReleaseReq.ProtoReflect.Descriptor instead. -func (*ListHookReleaseReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{69} +// Deprecated: Use CreateTemplateReq.ProtoReflect.Descriptor instead. +func (*CreateTemplateReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{70} } -func (x *ListHookReleaseReq) GetBizId() uint32 { +func (x *CreateTemplateReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *ListHookReleaseReq) GetHookId() uint32 { +func (x *CreateTemplateReq) GetTemplateSpaceId() uint32 { if x != nil { - return x.HookId + return x.TemplateSpaceId } return 0 } -func (x *ListHookReleaseReq) GetSearchKey() string { +func (x *CreateTemplateReq) GetName() string { if x != nil { - return x.SearchKey + return x.Name } return "" } -func (x *ListHookReleaseReq) GetStart() uint32 { +func (x *CreateTemplateReq) GetPath() string { if x != nil { - return x.Start + return x.Path } - return 0 + return "" } -func (x *ListHookReleaseReq) GetLimit() uint32 { +func (x *CreateTemplateReq) GetMemo() string { if x != nil { - return x.Limit + return x.Memo } - return 0 + return "" } -func (x *ListHookReleaseReq) GetAll() bool { +func (x *CreateTemplateReq) GetReleaseName() string { if x != nil { - return x.All + return x.ReleaseName } - return false + return "" } -func (x *ListHookReleaseReq) GetState() string { +func (x *CreateTemplateReq) GetReleaseMemo() string { if x != nil { - return x.State + return x.ReleaseMemo } return "" } -type ListHookReleaseResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*hook_release.HookRelease `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` +func (x *CreateTemplateReq) GetFileType() string { + if x != nil { + return x.FileType + } + return "" } -func (x *ListHookReleaseResp) Reset() { - *x = ListHookReleaseResp{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[70] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func (x *CreateTemplateReq) GetFileMode() string { + if x != nil { + return x.FileMode } + return "" } -func (x *ListHookReleaseResp) String() string { - return protoimpl.X.MessageStringOf(x) +func (x *CreateTemplateReq) GetUser() string { + if x != nil { + return x.User + } + return "" } -func (*ListHookReleaseResp) ProtoMessage() {} - -func (x *ListHookReleaseResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[70] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms +func (x *CreateTemplateReq) GetUserGroup() string { + if x != nil { + return x.UserGroup } - return mi.MessageOf(x) + return "" } -// Deprecated: Use ListHookReleaseResp.ProtoReflect.Descriptor instead. -func (*ListHookReleaseResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{70} +func (x *CreateTemplateReq) GetPrivilege() string { + if x != nil { + return x.Privilege + } + return "" } -func (x *ListHookReleaseResp) GetCount() uint32 { +func (x *CreateTemplateReq) GetSign() string { if x != nil { - return x.Count + return x.Sign } - return 0 + return "" } -func (x *ListHookReleaseResp) GetDetails() []*hook_release.HookRelease { +func (x *CreateTemplateReq) GetByteSize() uint64 { if x != nil { - return x.Details + return x.ByteSize } - return nil + return 0 } -type DeleteHookReleaseReq struct { +type CreateTemplateResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` - ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (x *DeleteHookReleaseReq) Reset() { - *x = DeleteHookReleaseReq{} +func (x *CreateTemplateResp) Reset() { + *x = CreateTemplateResp{} if protoimpl.UnsafeEnabled { mi := &file_config_service_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4431,13 +4505,13 @@ func (x *DeleteHookReleaseReq) Reset() { } } -func (x *DeleteHookReleaseReq) String() string { +func (x *CreateTemplateResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteHookReleaseReq) ProtoMessage() {} +func (*CreateTemplateResp) ProtoMessage() {} -func (x *DeleteHookReleaseReq) ProtoReflect() protoreflect.Message { +func (x *CreateTemplateResp) ProtoReflect() protoreflect.Message { mi := &file_config_service_proto_msgTypes[71] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4449,40 +4523,31 @@ func (x *DeleteHookReleaseReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteHookReleaseReq.ProtoReflect.Descriptor instead. -func (*DeleteHookReleaseReq) Descriptor() ([]byte, []int) { +// Deprecated: Use CreateTemplateResp.ProtoReflect.Descriptor instead. +func (*CreateTemplateResp) Descriptor() ([]byte, []int) { return file_config_service_proto_rawDescGZIP(), []int{71} } -func (x *DeleteHookReleaseReq) GetBizId() uint32 { +func (x *CreateTemplateResp) GetId() uint32 { if x != nil { - return x.BizId + return x.Id } return 0 } -func (x *DeleteHookReleaseReq) GetHookId() uint32 { - if x != nil { - return x.HookId - } - return 0 -} +type UpdateTemplateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (x *DeleteHookReleaseReq) GetReleaseId() uint32 { - if x != nil { - return x.ReleaseId - } - return 0 -} - -type DeleteHookReleaseResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` + TemplateId uint32 `protobuf:"varint,3,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"` + Memo string `protobuf:"bytes,4,opt,name=memo,proto3" json:"memo,omitempty"` } -func (x *DeleteHookReleaseResp) Reset() { - *x = DeleteHookReleaseResp{} +func (x *UpdateTemplateReq) Reset() { + *x = UpdateTemplateReq{} if protoimpl.UnsafeEnabled { mi := &file_config_service_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4490,13 +4555,13 @@ func (x *DeleteHookReleaseResp) Reset() { } } -func (x *DeleteHookReleaseResp) String() string { +func (x *UpdateTemplateReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteHookReleaseResp) ProtoMessage() {} +func (*UpdateTemplateReq) ProtoMessage() {} -func (x *DeleteHookReleaseResp) ProtoReflect() protoreflect.Message { +func (x *UpdateTemplateReq) ProtoReflect() protoreflect.Message { mi := &file_config_service_proto_msgTypes[72] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4508,97 +4573,62 @@ func (x *DeleteHookReleaseResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteHookReleaseResp.ProtoReflect.Descriptor instead. -func (*DeleteHookReleaseResp) Descriptor() ([]byte, []int) { +// Deprecated: Use UpdateTemplateReq.ProtoReflect.Descriptor instead. +func (*UpdateTemplateReq) Descriptor() ([]byte, []int) { return file_config_service_proto_rawDescGZIP(), []int{72} } -type PublishHookReleaseReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` - ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` -} - -func (x *PublishHookReleaseReq) Reset() { - *x = PublishHookReleaseReq{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[73] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PublishHookReleaseReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PublishHookReleaseReq) ProtoMessage() {} - -func (x *PublishHookReleaseReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[73] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms +func (x *UpdateTemplateReq) GetBizId() uint32 { + if x != nil { + return x.BizId } - return mi.MessageOf(x) -} - -// Deprecated: Use PublishHookReleaseReq.ProtoReflect.Descriptor instead. -func (*PublishHookReleaseReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{73} + return 0 } -func (x *PublishHookReleaseReq) GetBizId() uint32 { +func (x *UpdateTemplateReq) GetTemplateSpaceId() uint32 { if x != nil { - return x.BizId + return x.TemplateSpaceId } return 0 } -func (x *PublishHookReleaseReq) GetHookId() uint32 { +func (x *UpdateTemplateReq) GetTemplateId() uint32 { if x != nil { - return x.HookId + return x.TemplateId } return 0 } -func (x *PublishHookReleaseReq) GetReleaseId() uint32 { +func (x *UpdateTemplateReq) GetMemo() string { if x != nil { - return x.ReleaseId + return x.Memo } - return 0 + return "" } -type PublishHookReleaseResp struct { +type UpdateTemplateResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *PublishHookReleaseResp) Reset() { - *x = PublishHookReleaseResp{} +func (x *UpdateTemplateResp) Reset() { + *x = UpdateTemplateResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[74] + mi := &file_config_service_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *PublishHookReleaseResp) String() string { +func (x *UpdateTemplateResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PublishHookReleaseResp) ProtoMessage() {} +func (*UpdateTemplateResp) ProtoMessage() {} -func (x *PublishHookReleaseResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[74] +func (x *UpdateTemplateResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[73] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4609,37 +4639,38 @@ func (x *PublishHookReleaseResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PublishHookReleaseResp.ProtoReflect.Descriptor instead. -func (*PublishHookReleaseResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{74} +// Deprecated: Use UpdateTemplateResp.ProtoReflect.Descriptor instead. +func (*UpdateTemplateResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{73} } -type GetHookReq struct { +type DeleteTemplateReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` + TemplateId uint32 `protobuf:"varint,3,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"` } -func (x *GetHookReq) Reset() { - *x = GetHookReq{} +func (x *DeleteTemplateReq) Reset() { + *x = DeleteTemplateReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[75] + mi := &file_config_service_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetHookReq) String() string { +func (x *DeleteTemplateReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetHookReq) ProtoMessage() {} +func (*DeleteTemplateReq) ProtoMessage() {} -func (x *GetHookReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[75] +func (x *DeleteTemplateReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[74] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4650,53 +4681,55 @@ func (x *GetHookReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetHookReq.ProtoReflect.Descriptor instead. -func (*GetHookReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{75} +// Deprecated: Use DeleteTemplateReq.ProtoReflect.Descriptor instead. +func (*DeleteTemplateReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{74} } -func (x *GetHookReq) GetBizId() uint32 { +func (x *DeleteTemplateReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *GetHookReq) GetHookId() uint32 { +func (x *DeleteTemplateReq) GetTemplateSpaceId() uint32 { + if x != nil { + return x.TemplateSpaceId + } + return 0 +} + +func (x *DeleteTemplateReq) GetTemplateId() uint32 { if x != nil { - return x.HookId + return x.TemplateId } return 0 } -type GetHookResp struct { +type DeleteTemplateResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Spec *GetHookInfoSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` - Attachment *hook.HookAttachment `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"` - Revision *base.Revision `protobuf:"bytes,4,opt,name=revision,proto3" json:"revision,omitempty"` } -func (x *GetHookResp) Reset() { - *x = GetHookResp{} +func (x *DeleteTemplateResp) Reset() { + *x = DeleteTemplateResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[76] + mi := &file_config_service_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetHookResp) String() string { +func (x *DeleteTemplateResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetHookResp) ProtoMessage() {} +func (*DeleteTemplateResp) ProtoMessage() {} -func (x *GetHookResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[76] +func (x *DeleteTemplateResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[75] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4707,69 +4740,39 @@ func (x *GetHookResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetHookResp.ProtoReflect.Descriptor instead. -func (*GetHookResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{76} -} - -func (x *GetHookResp) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *GetHookResp) GetSpec() *GetHookInfoSpec { - if x != nil { - return x.Spec - } - return nil -} - -func (x *GetHookResp) GetAttachment() *hook.HookAttachment { - if x != nil { - return x.Attachment - } - return nil -} - -func (x *GetHookResp) GetRevision() *base.Revision { - if x != nil { - return x.Revision - } - return nil +// Deprecated: Use DeleteTemplateResp.ProtoReflect.Descriptor instead. +func (*DeleteTemplateResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{75} } -type GetHookInfoSpec struct { +type ListTemplatesReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` - Tag string `protobuf:"bytes,4,opt,name=tag,proto3" json:"tag,omitempty"` - Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` - PublishNum uint32 `protobuf:"varint,7,opt,name=publish_num,json=publishNum,proto3" json:"publish_num,omitempty"` - Releases *GetHookInfoSpec_Releases `protobuf:"bytes,8,opt,name=releases,proto3" json:"releases,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` + Start uint32 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` + Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` } -func (x *GetHookInfoSpec) Reset() { - *x = GetHookInfoSpec{} +func (x *ListTemplatesReq) Reset() { + *x = ListTemplatesReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[77] + mi := &file_config_service_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetHookInfoSpec) String() string { +func (x *ListTemplatesReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetHookInfoSpec) ProtoMessage() {} +func (*ListTemplatesReq) ProtoMessage() {} -func (x *GetHookInfoSpec) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[77] +func (x *ListTemplatesReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[76] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4780,80 +4783,65 @@ func (x *GetHookInfoSpec) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetHookInfoSpec.ProtoReflect.Descriptor instead. -func (*GetHookInfoSpec) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{77} -} - -func (x *GetHookInfoSpec) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *GetHookInfoSpec) GetType() string { - if x != nil { - return x.Type - } - return "" +// Deprecated: Use ListTemplatesReq.ProtoReflect.Descriptor instead. +func (*ListTemplatesReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{76} } -func (x *GetHookInfoSpec) GetTag() string { +func (x *ListTemplatesReq) GetBizId() uint32 { if x != nil { - return x.Tag + return x.BizId } - return "" + return 0 } -func (x *GetHookInfoSpec) GetMemo() string { +func (x *ListTemplatesReq) GetTemplateSpaceId() uint32 { if x != nil { - return x.Memo + return x.TemplateSpaceId } - return "" + return 0 } -func (x *GetHookInfoSpec) GetPublishNum() uint32 { +func (x *ListTemplatesReq) GetStart() uint32 { if x != nil { - return x.PublishNum + return x.Start } return 0 } -func (x *GetHookInfoSpec) GetReleases() *GetHookInfoSpec_Releases { +func (x *ListTemplatesReq) GetLimit() uint32 { if x != nil { - return x.Releases + return x.Limit } - return nil + return 0 } -type GetHookReleaseReq struct { +type ListTemplatesResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` - ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Details []*template.Template `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *GetHookReleaseReq) Reset() { - *x = GetHookReleaseReq{} +func (x *ListTemplatesResp) Reset() { + *x = ListTemplatesResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[78] + mi := &file_config_service_proto_msgTypes[77] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetHookReleaseReq) String() string { +func (x *ListTemplatesResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetHookReleaseReq) ProtoMessage() {} +func (*ListTemplatesResp) ProtoMessage() {} -func (x *GetHookReleaseReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[78] +func (x *ListTemplatesResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[77] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4864,62 +4852,63 @@ func (x *GetHookReleaseReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetHookReleaseReq.ProtoReflect.Descriptor instead. -func (*GetHookReleaseReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{78} -} - -func (x *GetHookReleaseReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 +// Deprecated: Use ListTemplatesResp.ProtoReflect.Descriptor instead. +func (*ListTemplatesResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{77} } -func (x *GetHookReleaseReq) GetHookId() uint32 { +func (x *ListTemplatesResp) GetCount() uint32 { if x != nil { - return x.HookId + return x.Count } return 0 } -func (x *GetHookReleaseReq) GetReleaseId() uint32 { +func (x *ListTemplatesResp) GetDetails() []*template.Template { if x != nil { - return x.ReleaseId + return x.Details } - return 0 + return nil } -type UpdateHookReleaseReq struct { +type CreateTemplateReleaseReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` - ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` - Memo string `protobuf:"bytes,6,opt,name=memo,proto3" json:"memo,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` + TemplateId uint32 `protobuf:"varint,3,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"` + ReleaseName string `protobuf:"bytes,4,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` + ReleaseMemo string `protobuf:"bytes,5,opt,name=release_memo,json=releaseMemo,proto3" json:"release_memo,omitempty"` + Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` + Path string `protobuf:"bytes,7,opt,name=path,proto3" json:"path,omitempty"` + FileType string `protobuf:"bytes,8,opt,name=file_type,json=fileType,proto3" json:"file_type,omitempty"` // file_type is enum type + FileMode string `protobuf:"bytes,9,opt,name=file_mode,json=fileMode,proto3" json:"file_mode,omitempty"` // file_mode is enum type + User string `protobuf:"bytes,10,opt,name=user,proto3" json:"user,omitempty"` + UserGroup string `protobuf:"bytes,11,opt,name=user_group,json=userGroup,proto3" json:"user_group,omitempty"` + Privilege string `protobuf:"bytes,12,opt,name=privilege,proto3" json:"privilege,omitempty"` + Sign string `protobuf:"bytes,13,opt,name=sign,proto3" json:"sign,omitempty"` + ByteSize uint64 `protobuf:"varint,14,opt,name=byte_size,json=byteSize,proto3" json:"byte_size,omitempty"` } -func (x *UpdateHookReleaseReq) Reset() { - *x = UpdateHookReleaseReq{} +func (x *CreateTemplateReleaseReq) Reset() { + *x = CreateTemplateReleaseReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[79] + mi := &file_config_service_proto_msgTypes[78] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *UpdateHookReleaseReq) String() string { +func (x *CreateTemplateReleaseReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateHookReleaseReq) ProtoMessage() {} +func (*CreateTemplateReleaseReq) ProtoMessage() {} -func (x *UpdateHookReleaseReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[79] +func (x *CreateTemplateReleaseReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[78] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4930,76 +4919,134 @@ func (x *UpdateHookReleaseReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateHookReleaseReq.ProtoReflect.Descriptor instead. -func (*UpdateHookReleaseReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{79} +// Deprecated: Use CreateTemplateReleaseReq.ProtoReflect.Descriptor instead. +func (*CreateTemplateReleaseReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{78} } -func (x *UpdateHookReleaseReq) GetBizId() uint32 { +func (x *CreateTemplateReleaseReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *UpdateHookReleaseReq) GetHookId() uint32 { +func (x *CreateTemplateReleaseReq) GetTemplateSpaceId() uint32 { if x != nil { - return x.HookId + return x.TemplateSpaceId } return 0 } -func (x *UpdateHookReleaseReq) GetReleaseId() uint32 { +func (x *CreateTemplateReleaseReq) GetTemplateId() uint32 { if x != nil { - return x.ReleaseId + return x.TemplateId } return 0 } -func (x *UpdateHookReleaseReq) GetName() string { +func (x *CreateTemplateReleaseReq) GetReleaseName() string { + if x != nil { + return x.ReleaseName + } + return "" +} + +func (x *CreateTemplateReleaseReq) GetReleaseMemo() string { + if x != nil { + return x.ReleaseMemo + } + return "" +} + +func (x *CreateTemplateReleaseReq) GetName() string { if x != nil { return x.Name } return "" } -func (x *UpdateHookReleaseReq) GetContent() string { +func (x *CreateTemplateReleaseReq) GetPath() string { if x != nil { - return x.Content + return x.Path } return "" } -func (x *UpdateHookReleaseReq) GetMemo() string { +func (x *CreateTemplateReleaseReq) GetFileType() string { if x != nil { - return x.Memo + return x.FileType + } + return "" +} + +func (x *CreateTemplateReleaseReq) GetFileMode() string { + if x != nil { + return x.FileMode + } + return "" +} + +func (x *CreateTemplateReleaseReq) GetUser() string { + if x != nil { + return x.User + } + return "" +} + +func (x *CreateTemplateReleaseReq) GetUserGroup() string { + if x != nil { + return x.UserGroup + } + return "" +} + +func (x *CreateTemplateReleaseReq) GetPrivilege() string { + if x != nil { + return x.Privilege } return "" } -type UpdateHookReleaseResp struct { +func (x *CreateTemplateReleaseReq) GetSign() string { + if x != nil { + return x.Sign + } + return "" +} + +func (x *CreateTemplateReleaseReq) GetByteSize() uint64 { + if x != nil { + return x.ByteSize + } + return 0 +} + +type CreateTemplateReleaseResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (x *UpdateHookReleaseResp) Reset() { - *x = UpdateHookReleaseResp{} +func (x *CreateTemplateReleaseResp) Reset() { + *x = CreateTemplateReleaseResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[80] + mi := &file_config_service_proto_msgTypes[79] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *UpdateHookReleaseResp) String() string { +func (x *CreateTemplateReleaseResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateHookReleaseResp) ProtoMessage() {} +func (*CreateTemplateReleaseResp) ProtoMessage() {} -func (x *UpdateHookReleaseResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[80] +func (x *CreateTemplateReleaseResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[79] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5010,40 +5057,47 @@ func (x *UpdateHookReleaseResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateHookReleaseResp.ProtoReflect.Descriptor instead. -func (*UpdateHookReleaseResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{80} +// Deprecated: Use CreateTemplateReleaseResp.ProtoReflect.Descriptor instead. +func (*CreateTemplateReleaseResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{79} +} + +func (x *CreateTemplateReleaseResp) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 } -type ListHookReleasesReferencesReq struct { +type ListTemplateReleasesReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` - ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` - Start uint32 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"` - Limit uint32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` + TemplateId uint32 `protobuf:"varint,3,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"` + Start uint32 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"` + Limit uint32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` } -func (x *ListHookReleasesReferencesReq) Reset() { - *x = ListHookReleasesReferencesReq{} +func (x *ListTemplateReleasesReq) Reset() { + *x = ListTemplateReleasesReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[81] + mi := &file_config_service_proto_msgTypes[80] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListHookReleasesReferencesReq) String() string { +func (x *ListTemplateReleasesReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListHookReleasesReferencesReq) ProtoMessage() {} +func (*ListTemplateReleasesReq) ProtoMessage() {} -func (x *ListHookReleasesReferencesReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[81] +func (x *ListTemplateReleasesReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[80] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5054,72 +5108,72 @@ func (x *ListHookReleasesReferencesReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListHookReleasesReferencesReq.ProtoReflect.Descriptor instead. -func (*ListHookReleasesReferencesReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{81} +// Deprecated: Use ListTemplateReleasesReq.ProtoReflect.Descriptor instead. +func (*ListTemplateReleasesReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{80} } -func (x *ListHookReleasesReferencesReq) GetBizId() uint32 { +func (x *ListTemplateReleasesReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *ListHookReleasesReferencesReq) GetHookId() uint32 { +func (x *ListTemplateReleasesReq) GetTemplateSpaceId() uint32 { if x != nil { - return x.HookId + return x.TemplateSpaceId } return 0 } -func (x *ListHookReleasesReferencesReq) GetReleaseId() uint32 { +func (x *ListTemplateReleasesReq) GetTemplateId() uint32 { if x != nil { - return x.ReleaseId + return x.TemplateId } return 0 } -func (x *ListHookReleasesReferencesReq) GetStart() uint32 { +func (x *ListTemplateReleasesReq) GetStart() uint32 { if x != nil { return x.Start } return 0 } -func (x *ListHookReleasesReferencesReq) GetLimit() uint32 { +func (x *ListTemplateReleasesReq) GetLimit() uint32 { if x != nil { return x.Limit } return 0 } -type ListHookReleasesReferencesResp struct { +type ListTemplateReleasesResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*hook_release.ListHookReleasesReferencesDetails `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Details []*template_release.TemplateRelease `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *ListHookReleasesReferencesResp) Reset() { - *x = ListHookReleasesReferencesResp{} +func (x *ListTemplateReleasesResp) Reset() { + *x = ListTemplateReleasesResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[82] + mi := &file_config_service_proto_msgTypes[81] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListHookReleasesReferencesResp) String() string { +func (x *ListTemplateReleasesResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListHookReleasesReferencesResp) ProtoMessage() {} +func (*ListTemplateReleasesResp) ProtoMessage() {} -func (x *ListHookReleasesReferencesResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[82] +func (x *ListTemplateReleasesResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[81] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5130,52 +5184,53 @@ func (x *ListHookReleasesReferencesResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListHookReleasesReferencesResp.ProtoReflect.Descriptor instead. -func (*ListHookReleasesReferencesResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{82} +// Deprecated: Use ListTemplateReleasesResp.ProtoReflect.Descriptor instead. +func (*ListTemplateReleasesResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{81} } -func (x *ListHookReleasesReferencesResp) GetCount() uint32 { +func (x *ListTemplateReleasesResp) GetCount() uint32 { if x != nil { return x.Count } return 0 } -func (x *ListHookReleasesReferencesResp) GetDetails() []*hook_release.ListHookReleasesReferencesDetails { +func (x *ListTemplateReleasesResp) GetDetails() []*template_release.TemplateRelease { if x != nil { return x.Details } return nil } -type CreateTemplateSpaceReq struct { +type DeleteTemplateReleaseReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Memo string `protobuf:"bytes,3,opt,name=memo,proto3" json:"memo,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` + TemplateId uint32 `protobuf:"varint,3,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"` + TemplateReleaseId uint32 `protobuf:"varint,4,opt,name=template_release_id,json=templateReleaseId,proto3" json:"template_release_id,omitempty"` } -func (x *CreateTemplateSpaceReq) Reset() { - *x = CreateTemplateSpaceReq{} +func (x *DeleteTemplateReleaseReq) Reset() { + *x = DeleteTemplateReleaseReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[83] + mi := &file_config_service_proto_msgTypes[82] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateTemplateSpaceReq) String() string { +func (x *DeleteTemplateReleaseReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateTemplateSpaceReq) ProtoMessage() {} +func (*DeleteTemplateReleaseReq) ProtoMessage() {} -func (x *CreateTemplateSpaceReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[83] +func (x *DeleteTemplateReleaseReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[82] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5186,57 +5241,62 @@ func (x *CreateTemplateSpaceReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateTemplateSpaceReq.ProtoReflect.Descriptor instead. -func (*CreateTemplateSpaceReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{83} +// Deprecated: Use DeleteTemplateReleaseReq.ProtoReflect.Descriptor instead. +func (*DeleteTemplateReleaseReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{82} } -func (x *CreateTemplateSpaceReq) GetBizId() uint32 { +func (x *DeleteTemplateReleaseReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *CreateTemplateSpaceReq) GetName() string { +func (x *DeleteTemplateReleaseReq) GetTemplateSpaceId() uint32 { if x != nil { - return x.Name + return x.TemplateSpaceId } - return "" + return 0 } -func (x *CreateTemplateSpaceReq) GetMemo() string { +func (x *DeleteTemplateReleaseReq) GetTemplateId() uint32 { if x != nil { - return x.Memo + return x.TemplateId } - return "" + return 0 } -type CreateTemplateSpaceResp struct { +func (x *DeleteTemplateReleaseReq) GetTemplateReleaseId() uint32 { + if x != nil { + return x.TemplateReleaseId + } + return 0 +} + +type DeleteTemplateReleaseResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (x *CreateTemplateSpaceResp) Reset() { - *x = CreateTemplateSpaceResp{} +func (x *DeleteTemplateReleaseResp) Reset() { + *x = DeleteTemplateReleaseResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[84] + mi := &file_config_service_proto_msgTypes[83] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateTemplateSpaceResp) String() string { +func (x *DeleteTemplateReleaseResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateTemplateSpaceResp) ProtoMessage() {} +func (*DeleteTemplateReleaseResp) ProtoMessage() {} -func (x *CreateTemplateSpaceResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[84] +func (x *DeleteTemplateReleaseResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[83] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5247,46 +5307,42 @@ func (x *CreateTemplateSpaceResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateTemplateSpaceResp.ProtoReflect.Descriptor instead. -func (*CreateTemplateSpaceResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{84} -} - -func (x *CreateTemplateSpaceResp) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 +// Deprecated: Use DeleteTemplateReleaseResp.ProtoReflect.Descriptor instead. +func (*DeleteTemplateReleaseResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{83} } -type UpdateTemplateSpaceReq struct { +type CreateGroupReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Memo string `protobuf:"bytes,4,opt,name=memo,proto3" json:"memo,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Public bool `protobuf:"varint,3,opt,name=public,proto3" json:"public,omitempty"` + BindApps []uint32 `protobuf:"varint,4,rep,packed,name=bind_apps,json=bindApps,proto3" json:"bind_apps,omitempty"` + Mode string `protobuf:"bytes,5,opt,name=mode,proto3" json:"mode,omitempty"` + Selector *structpb.Struct `protobuf:"bytes,6,opt,name=selector,proto3" json:"selector,omitempty"` + Uid string `protobuf:"bytes,7,opt,name=uid,proto3" json:"uid,omitempty"` } -func (x *UpdateTemplateSpaceReq) Reset() { - *x = UpdateTemplateSpaceReq{} +func (x *CreateGroupReq) Reset() { + *x = CreateGroupReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[85] + mi := &file_config_service_proto_msgTypes[84] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *UpdateTemplateSpaceReq) String() string { +func (x *CreateGroupReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateTemplateSpaceReq) ProtoMessage() {} +func (*CreateGroupReq) ProtoMessage() {} -func (x *UpdateTemplateSpaceReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[85] +func (x *CreateGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[84] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5297,62 +5353,85 @@ func (x *UpdateTemplateSpaceReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateTemplateSpaceReq.ProtoReflect.Descriptor instead. -func (*UpdateTemplateSpaceReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{85} +// Deprecated: Use CreateGroupReq.ProtoReflect.Descriptor instead. +func (*CreateGroupReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{84} } -func (x *UpdateTemplateSpaceReq) GetBizId() uint32 { +func (x *CreateGroupReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *UpdateTemplateSpaceReq) GetTemplateSpaceId() uint32 { +func (x *CreateGroupReq) GetName() string { if x != nil { - return x.TemplateSpaceId + return x.Name } - return 0 + return "" } -func (x *UpdateTemplateSpaceReq) GetName() string { +func (x *CreateGroupReq) GetPublic() bool { if x != nil { - return x.Name + return x.Public + } + return false +} + +func (x *CreateGroupReq) GetBindApps() []uint32 { + if x != nil { + return x.BindApps + } + return nil +} + +func (x *CreateGroupReq) GetMode() string { + if x != nil { + return x.Mode } return "" } -func (x *UpdateTemplateSpaceReq) GetMemo() string { +func (x *CreateGroupReq) GetSelector() *structpb.Struct { if x != nil { - return x.Memo + return x.Selector + } + return nil +} + +func (x *CreateGroupReq) GetUid() string { + if x != nil { + return x.Uid } return "" } -type UpdateTemplateSpaceResp struct { +type CreateGroupResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (x *UpdateTemplateSpaceResp) Reset() { - *x = UpdateTemplateSpaceResp{} +func (x *CreateGroupResp) Reset() { + *x = CreateGroupResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[86] + mi := &file_config_service_proto_msgTypes[85] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *UpdateTemplateSpaceResp) String() string { +func (x *CreateGroupResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateTemplateSpaceResp) ProtoMessage() {} +func (*CreateGroupResp) ProtoMessage() {} -func (x *UpdateTemplateSpaceResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[86] +func (x *CreateGroupResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[85] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5363,37 +5442,50 @@ func (x *UpdateTemplateSpaceResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateTemplateSpaceResp.ProtoReflect.Descriptor instead. -func (*UpdateTemplateSpaceResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{86} +// Deprecated: Use CreateGroupResp.ProtoReflect.Descriptor instead. +func (*CreateGroupResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{85} } -type DeleteTemplateSpaceReq struct { +func (x *CreateGroupResp) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +type UpdateGroupReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + GroupId uint32 `protobuf:"varint,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Public bool `protobuf:"varint,4,opt,name=public,proto3" json:"public,omitempty"` + BindApps []uint32 `protobuf:"varint,5,rep,packed,name=bind_apps,json=bindApps,proto3" json:"bind_apps,omitempty"` + Mode string `protobuf:"bytes,6,opt,name=mode,proto3" json:"mode,omitempty"` + Selector *structpb.Struct `protobuf:"bytes,7,opt,name=selector,proto3" json:"selector,omitempty"` + Uid string `protobuf:"bytes,8,opt,name=uid,proto3" json:"uid,omitempty"` } -func (x *DeleteTemplateSpaceReq) Reset() { - *x = DeleteTemplateSpaceReq{} +func (x *UpdateGroupReq) Reset() { + *x = UpdateGroupReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[87] + mi := &file_config_service_proto_msgTypes[86] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *DeleteTemplateSpaceReq) String() string { +func (x *UpdateGroupReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteTemplateSpaceReq) ProtoMessage() {} +func (*UpdateGroupReq) ProtoMessage() {} -func (x *DeleteTemplateSpaceReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[87] +func (x *UpdateGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[86] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5404,48 +5496,90 @@ func (x *DeleteTemplateSpaceReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteTemplateSpaceReq.ProtoReflect.Descriptor instead. -func (*DeleteTemplateSpaceReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{87} +// Deprecated: Use UpdateGroupReq.ProtoReflect.Descriptor instead. +func (*UpdateGroupReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{86} } -func (x *DeleteTemplateSpaceReq) GetBizId() uint32 { +func (x *UpdateGroupReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *DeleteTemplateSpaceReq) GetTemplateSpaceId() uint32 { +func (x *UpdateGroupReq) GetGroupId() uint32 { if x != nil { - return x.TemplateSpaceId + return x.GroupId } return 0 } -type DeleteTemplateSpaceResp struct { +func (x *UpdateGroupReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateGroupReq) GetPublic() bool { + if x != nil { + return x.Public + } + return false +} + +func (x *UpdateGroupReq) GetBindApps() []uint32 { + if x != nil { + return x.BindApps + } + return nil +} + +func (x *UpdateGroupReq) GetMode() string { + if x != nil { + return x.Mode + } + return "" +} + +func (x *UpdateGroupReq) GetSelector() *structpb.Struct { + if x != nil { + return x.Selector + } + return nil +} + +func (x *UpdateGroupReq) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +type UpdateGroupResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *DeleteTemplateSpaceResp) Reset() { - *x = DeleteTemplateSpaceResp{} +func (x *UpdateGroupResp) Reset() { + *x = UpdateGroupResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[88] + mi := &file_config_service_proto_msgTypes[87] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *DeleteTemplateSpaceResp) String() string { +func (x *UpdateGroupResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteTemplateSpaceResp) ProtoMessage() {} +func (*UpdateGroupResp) ProtoMessage() {} -func (x *DeleteTemplateSpaceResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[88] +func (x *UpdateGroupResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[87] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5456,38 +5590,37 @@ func (x *DeleteTemplateSpaceResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteTemplateSpaceResp.ProtoReflect.Descriptor instead. -func (*DeleteTemplateSpaceResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{88} +// Deprecated: Use UpdateGroupResp.ProtoReflect.Descriptor instead. +func (*UpdateGroupResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{87} } -type ListTemplateSpacesReq struct { +type DeleteGroupReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - Start uint32 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"` - Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + GroupId uint32 `protobuf:"varint,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` } -func (x *ListTemplateSpacesReq) Reset() { - *x = ListTemplateSpacesReq{} +func (x *DeleteGroupReq) Reset() { + *x = DeleteGroupReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[89] + mi := &file_config_service_proto_msgTypes[88] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListTemplateSpacesReq) String() string { +func (x *DeleteGroupReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListTemplateSpacesReq) ProtoMessage() {} +func (*DeleteGroupReq) ProtoMessage() {} -func (x *ListTemplateSpacesReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[89] +func (x *DeleteGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[88] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5498,43 +5631,73 @@ func (x *ListTemplateSpacesReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListTemplateSpacesReq.ProtoReflect.Descriptor instead. -func (*ListTemplateSpacesReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{89} +// Deprecated: Use DeleteGroupReq.ProtoReflect.Descriptor instead. +func (*DeleteGroupReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{88} } -func (x *ListTemplateSpacesReq) GetBizId() uint32 { +func (x *DeleteGroupReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *ListTemplateSpacesReq) GetStart() uint32 { +func (x *DeleteGroupReq) GetGroupId() uint32 { if x != nil { - return x.Start + return x.GroupId } return 0 } -func (x *ListTemplateSpacesReq) GetLimit() uint32 { - if x != nil { - return x.Limit +type DeleteGroupResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteGroupResp) Reset() { + *x = DeleteGroupResp{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_proto_msgTypes[89] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return 0 } -type ListTemplateSpacesResp struct { +func (x *DeleteGroupResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteGroupResp) ProtoMessage() {} + +func (x *DeleteGroupResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[89] + 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 DeleteGroupResp.ProtoReflect.Descriptor instead. +func (*DeleteGroupResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{89} +} + +type ListAllGroupsReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*template_space.TemplateSpace `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` } -func (x *ListTemplateSpacesResp) Reset() { - *x = ListTemplateSpacesResp{} +func (x *ListAllGroupsReq) Reset() { + *x = ListAllGroupsReq{} if protoimpl.UnsafeEnabled { mi := &file_config_service_proto_msgTypes[90] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -5542,13 +5705,13 @@ func (x *ListTemplateSpacesResp) Reset() { } } -func (x *ListTemplateSpacesResp) String() string { +func (x *ListAllGroupsReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListTemplateSpacesResp) ProtoMessage() {} +func (*ListAllGroupsReq) ProtoMessage() {} -func (x *ListTemplateSpacesResp) ProtoReflect() protoreflect.Message { +func (x *ListAllGroupsReq) ProtoReflect() protoreflect.Message { mi := &file_config_service_proto_msgTypes[90] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -5560,48 +5723,28 @@ func (x *ListTemplateSpacesResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListTemplateSpacesResp.ProtoReflect.Descriptor instead. -func (*ListTemplateSpacesResp) Descriptor() ([]byte, []int) { +// Deprecated: Use ListAllGroupsReq.ProtoReflect.Descriptor instead. +func (*ListAllGroupsReq) Descriptor() ([]byte, []int) { return file_config_service_proto_rawDescGZIP(), []int{90} } -func (x *ListTemplateSpacesResp) GetCount() uint32 { +func (x *ListAllGroupsReq) GetBizId() uint32 { if x != nil { - return x.Count + return x.BizId } return 0 } -func (x *ListTemplateSpacesResp) GetDetails() []*template_space.TemplateSpace { - if x != nil { - return x.Details - } - return nil -} - -type CreateTemplateReq struct { +type ListAllGroupsResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` - Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` - ReleaseName string `protobuf:"bytes,6,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - ReleaseMemo string `protobuf:"bytes,7,opt,name=release_memo,json=releaseMemo,proto3" json:"release_memo,omitempty"` - FileType string `protobuf:"bytes,8,opt,name=file_type,json=fileType,proto3" json:"file_type,omitempty"` // file_type is enum type - FileMode string `protobuf:"bytes,9,opt,name=file_mode,json=fileMode,proto3" json:"file_mode,omitempty"` // file_mode is enum type - User string `protobuf:"bytes,10,opt,name=user,proto3" json:"user,omitempty"` - UserGroup string `protobuf:"bytes,11,opt,name=user_group,json=userGroup,proto3" json:"user_group,omitempty"` - Privilege string `protobuf:"bytes,12,opt,name=privilege,proto3" json:"privilege,omitempty"` - Sign string `protobuf:"bytes,13,opt,name=sign,proto3" json:"sign,omitempty"` - ByteSize uint64 `protobuf:"varint,14,opt,name=byte_size,json=byteSize,proto3" json:"byte_size,omitempty"` + Details []*ListAllGroupsResp_ListAllGroupsData `protobuf:"bytes,1,rep,name=details,proto3" json:"details,omitempty"` } -func (x *CreateTemplateReq) Reset() { - *x = CreateTemplateReq{} +func (x *ListAllGroupsResp) Reset() { + *x = ListAllGroupsResp{} if protoimpl.UnsafeEnabled { mi := &file_config_service_proto_msgTypes[91] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -5609,13 +5752,13 @@ func (x *CreateTemplateReq) Reset() { } } -func (x *CreateTemplateReq) String() string { +func (x *ListAllGroupsResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateTemplateReq) ProtoMessage() {} +func (*ListAllGroupsResp) ProtoMessage() {} -func (x *CreateTemplateReq) ProtoReflect() protoreflect.Message { +func (x *ListAllGroupsResp) ProtoReflect() protoreflect.Message { mi := &file_config_service_proto_msgTypes[91] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -5627,134 +5770,98 @@ func (x *CreateTemplateReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateTemplateReq.ProtoReflect.Descriptor instead. -func (*CreateTemplateReq) Descriptor() ([]byte, []int) { +// Deprecated: Use ListAllGroupsResp.ProtoReflect.Descriptor instead. +func (*ListAllGroupsResp) Descriptor() ([]byte, []int) { return file_config_service_proto_rawDescGZIP(), []int{91} } -func (x *CreateTemplateReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -func (x *CreateTemplateReq) GetTemplateSpaceId() uint32 { - if x != nil { - return x.TemplateSpaceId - } - return 0 -} - -func (x *CreateTemplateReq) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateTemplateReq) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *CreateTemplateReq) GetMemo() string { +func (x *ListAllGroupsResp) GetDetails() []*ListAllGroupsResp_ListAllGroupsData { if x != nil { - return x.Memo + return x.Details } - return "" + return nil } -func (x *CreateTemplateReq) GetReleaseName() string { - if x != nil { - return x.ReleaseName - } - return "" -} +type ListAppGroupsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (x *CreateTemplateReq) GetReleaseMemo() string { - if x != nil { - return x.ReleaseMemo - } - return "" + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` } -func (x *CreateTemplateReq) GetFileType() string { - if x != nil { - return x.FileType +func (x *ListAppGroupsReq) Reset() { + *x = ListAppGroupsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_proto_msgTypes[92] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return "" } -func (x *CreateTemplateReq) GetFileMode() string { - if x != nil { - return x.FileMode - } - return "" +func (x *ListAppGroupsReq) String() string { + return protoimpl.X.MessageStringOf(x) } -func (x *CreateTemplateReq) GetUser() string { - if x != nil { - return x.User - } - return "" -} +func (*ListAppGroupsReq) ProtoMessage() {} -func (x *CreateTemplateReq) GetUserGroup() string { - if x != nil { - return x.UserGroup +func (x *ListAppGroupsReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[92] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return "" + return mi.MessageOf(x) } -func (x *CreateTemplateReq) GetPrivilege() string { - if x != nil { - return x.Privilege - } - return "" +// Deprecated: Use ListAppGroupsReq.ProtoReflect.Descriptor instead. +func (*ListAppGroupsReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{92} } -func (x *CreateTemplateReq) GetSign() string { +func (x *ListAppGroupsReq) GetBizId() uint32 { if x != nil { - return x.Sign + return x.BizId } - return "" + return 0 } -func (x *CreateTemplateReq) GetByteSize() uint64 { +func (x *ListAppGroupsReq) GetAppId() uint32 { if x != nil { - return x.ByteSize + return x.AppId } return 0 } -type CreateTemplateResp struct { +type ListAppGroupsResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Details []*ListAppGroupsResp_ListAppGroupsData `protobuf:"bytes,1,rep,name=details,proto3" json:"details,omitempty"` } -func (x *CreateTemplateResp) Reset() { - *x = CreateTemplateResp{} +func (x *ListAppGroupsResp) Reset() { + *x = ListAppGroupsResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[92] + mi := &file_config_service_proto_msgTypes[93] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateTemplateResp) String() string { +func (x *ListAppGroupsResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateTemplateResp) ProtoMessage() {} +func (*ListAppGroupsResp) ProtoMessage() {} -func (x *CreateTemplateResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[92] +func (x *ListAppGroupsResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[93] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5765,46 +5872,46 @@ func (x *CreateTemplateResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateTemplateResp.ProtoReflect.Descriptor instead. -func (*CreateTemplateResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{92} +// Deprecated: Use ListAppGroupsResp.ProtoReflect.Descriptor instead. +func (*ListAppGroupsResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{93} } -func (x *CreateTemplateResp) GetId() uint32 { +func (x *ListAppGroupsResp) GetDetails() []*ListAppGroupsResp_ListAppGroupsData { if x != nil { - return x.Id + return x.Details } - return 0 + return nil } -type UpdateTemplateReq struct { +type ListGroupReleasedAppsReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` - TemplateId uint32 `protobuf:"varint,3,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"` - Memo string `protobuf:"bytes,4,opt,name=memo,proto3" json:"memo,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + GroupId uint32 `protobuf:"varint,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + Start uint32 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` + Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` } -func (x *UpdateTemplateReq) Reset() { - *x = UpdateTemplateReq{} +func (x *ListGroupReleasedAppsReq) Reset() { + *x = ListGroupReleasedAppsReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[93] + mi := &file_config_service_proto_msgTypes[94] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *UpdateTemplateReq) String() string { +func (x *ListGroupReleasedAppsReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateTemplateReq) ProtoMessage() {} +func (*ListGroupReleasedAppsReq) ProtoMessage() {} -func (x *UpdateTemplateReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[93] +func (x *ListGroupReleasedAppsReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[94] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5815,62 +5922,65 @@ func (x *UpdateTemplateReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateTemplateReq.ProtoReflect.Descriptor instead. -func (*UpdateTemplateReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{93} +// Deprecated: Use ListGroupReleasedAppsReq.ProtoReflect.Descriptor instead. +func (*ListGroupReleasedAppsReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{94} } -func (x *UpdateTemplateReq) GetBizId() uint32 { +func (x *ListGroupReleasedAppsReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *UpdateTemplateReq) GetTemplateSpaceId() uint32 { +func (x *ListGroupReleasedAppsReq) GetGroupId() uint32 { if x != nil { - return x.TemplateSpaceId + return x.GroupId } return 0 } -func (x *UpdateTemplateReq) GetTemplateId() uint32 { +func (x *ListGroupReleasedAppsReq) GetStart() uint32 { if x != nil { - return x.TemplateId + return x.Start } return 0 } -func (x *UpdateTemplateReq) GetMemo() string { +func (x *ListGroupReleasedAppsReq) GetLimit() uint32 { if x != nil { - return x.Memo + return x.Limit } - return "" + return 0 } -type UpdateTemplateResp struct { +type ListGroupReleasedAppsResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Details []*ListGroupReleasedAppsResp_ListGroupReleasedAppsData `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *UpdateTemplateResp) Reset() { - *x = UpdateTemplateResp{} +func (x *ListGroupReleasedAppsResp) Reset() { + *x = ListGroupReleasedAppsResp{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[94] + mi := &file_config_service_proto_msgTypes[95] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *UpdateTemplateResp) String() string { +func (x *ListGroupReleasedAppsResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateTemplateResp) ProtoMessage() {} +func (*ListGroupReleasedAppsResp) ProtoMessage() {} -func (x *UpdateTemplateResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[94] +func (x *ListGroupReleasedAppsResp) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[95] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5881,38 +5991,56 @@ func (x *UpdateTemplateResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateTemplateResp.ProtoReflect.Descriptor instead. -func (*UpdateTemplateResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{94} +// Deprecated: Use ListGroupReleasedAppsResp.ProtoReflect.Descriptor instead. +func (*ListGroupReleasedAppsResp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{95} } -type DeleteTemplateReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` - TemplateId uint32 `protobuf:"varint,3,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"` -} +func (x *ListGroupReleasedAppsResp) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} -func (x *DeleteTemplateReq) Reset() { - *x = DeleteTemplateReq{} +func (x *ListGroupReleasedAppsResp) GetDetails() []*ListGroupReleasedAppsResp_ListGroupReleasedAppsData { + if x != nil { + return x.Details + } + return nil +} + +type PublishReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` + Memo string `protobuf:"bytes,4,opt,name=memo,proto3" json:"memo,omitempty"` + All bool `protobuf:"varint,5,opt,name=all,proto3" json:"all,omitempty"` + Default bool `protobuf:"varint,6,opt,name=default,proto3" json:"default,omitempty"` + Groups []uint32 `protobuf:"varint,7,rep,packed,name=groups,proto3" json:"groups,omitempty"` +} + +func (x *PublishReq) Reset() { + *x = PublishReq{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[95] + mi := &file_config_service_proto_msgTypes[96] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *DeleteTemplateReq) String() string { +func (x *PublishReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteTemplateReq) ProtoMessage() {} +func (*PublishReq) ProtoMessage() {} -func (x *DeleteTemplateReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[95] +func (x *PublishReq) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[96] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5923,83 +6051,75 @@ func (x *DeleteTemplateReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteTemplateReq.ProtoReflect.Descriptor instead. -func (*DeleteTemplateReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{95} +// Deprecated: Use PublishReq.ProtoReflect.Descriptor instead. +func (*PublishReq) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{96} } -func (x *DeleteTemplateReq) GetBizId() uint32 { +func (x *PublishReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *DeleteTemplateReq) GetTemplateSpaceId() uint32 { +func (x *PublishReq) GetAppId() uint32 { if x != nil { - return x.TemplateSpaceId + return x.AppId } return 0 } -func (x *DeleteTemplateReq) GetTemplateId() uint32 { +func (x *PublishReq) GetReleaseId() uint32 { if x != nil { - return x.TemplateId + return x.ReleaseId } return 0 } -type DeleteTemplateResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteTemplateResp) Reset() { - *x = DeleteTemplateResp{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[96] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func (x *PublishReq) GetMemo() string { + if x != nil { + return x.Memo } + return "" } -func (x *DeleteTemplateResp) String() string { - return protoimpl.X.MessageStringOf(x) +func (x *PublishReq) GetAll() bool { + if x != nil { + return x.All + } + return false } -func (*DeleteTemplateResp) ProtoMessage() {} - -func (x *DeleteTemplateResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[96] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms +func (x *PublishReq) GetDefault() bool { + if x != nil { + return x.Default } - return mi.MessageOf(x) + return false } -// Deprecated: Use DeleteTemplateResp.ProtoReflect.Descriptor instead. -func (*DeleteTemplateResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{96} +func (x *PublishReq) GetGroups() []uint32 { + if x != nil { + return x.Groups + } + return nil } -type ListTemplatesReq struct { +type GenerateReleaseAndPublishReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` - Start uint32 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + ReleaseName string `protobuf:"bytes,3,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` + ReleaseMemo string `protobuf:"bytes,4,opt,name=release_memo,json=releaseMemo,proto3" json:"release_memo,omitempty"` + All bool `protobuf:"varint,5,opt,name=all,proto3" json:"all,omitempty"` + Groups []string `protobuf:"bytes,6,rep,name=groups,proto3" json:"groups,omitempty"` } -func (x *ListTemplatesReq) Reset() { - *x = ListTemplatesReq{} +func (x *GenerateReleaseAndPublishReq) Reset() { + *x = GenerateReleaseAndPublishReq{} if protoimpl.UnsafeEnabled { mi := &file_config_service_proto_msgTypes[97] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6007,13 +6127,13 @@ func (x *ListTemplatesReq) Reset() { } } -func (x *ListTemplatesReq) String() string { +func (x *GenerateReleaseAndPublishReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListTemplatesReq) ProtoMessage() {} +func (*GenerateReleaseAndPublishReq) ProtoMessage() {} -func (x *ListTemplatesReq) ProtoReflect() protoreflect.Message { +func (x *GenerateReleaseAndPublishReq) ProtoReflect() protoreflect.Message { mi := &file_config_service_proto_msgTypes[97] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6025,50 +6145,63 @@ func (x *ListTemplatesReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListTemplatesReq.ProtoReflect.Descriptor instead. -func (*ListTemplatesReq) Descriptor() ([]byte, []int) { +// Deprecated: Use GenerateReleaseAndPublishReq.ProtoReflect.Descriptor instead. +func (*GenerateReleaseAndPublishReq) Descriptor() ([]byte, []int) { return file_config_service_proto_rawDescGZIP(), []int{97} } -func (x *ListTemplatesReq) GetBizId() uint32 { +func (x *GenerateReleaseAndPublishReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *ListTemplatesReq) GetTemplateSpaceId() uint32 { +func (x *GenerateReleaseAndPublishReq) GetAppId() uint32 { if x != nil { - return x.TemplateSpaceId + return x.AppId } return 0 } -func (x *ListTemplatesReq) GetStart() uint32 { +func (x *GenerateReleaseAndPublishReq) GetReleaseName() string { if x != nil { - return x.Start + return x.ReleaseName } - return 0 + return "" } -func (x *ListTemplatesReq) GetLimit() uint32 { +func (x *GenerateReleaseAndPublishReq) GetReleaseMemo() string { if x != nil { - return x.Limit + return x.ReleaseMemo } - return 0 + return "" } -type ListTemplatesResp struct { +func (x *GenerateReleaseAndPublishReq) GetAll() bool { + if x != nil { + return x.All + } + return false +} + +func (x *GenerateReleaseAndPublishReq) GetGroups() []string { + if x != nil { + return x.Groups + } + return nil +} + +type GenerateReleaseAndPublishResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*template.Template `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (x *ListTemplatesResp) Reset() { - *x = ListTemplatesResp{} +func (x *GenerateReleaseAndPublishResp) Reset() { + *x = GenerateReleaseAndPublishResp{} if protoimpl.UnsafeEnabled { mi := &file_config_service_proto_msgTypes[98] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6076,13 +6209,13 @@ func (x *ListTemplatesResp) Reset() { } } -func (x *ListTemplatesResp) String() string { +func (x *GenerateReleaseAndPublishResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListTemplatesResp) ProtoMessage() {} +func (*GenerateReleaseAndPublishResp) ProtoMessage() {} -func (x *ListTemplatesResp) ProtoReflect() protoreflect.Message { +func (x *GenerateReleaseAndPublishResp) ProtoReflect() protoreflect.Message { mi := &file_config_service_proto_msgTypes[98] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6094,48 +6227,28 @@ func (x *ListTemplatesResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListTemplatesResp.ProtoReflect.Descriptor instead. -func (*ListTemplatesResp) Descriptor() ([]byte, []int) { +// Deprecated: Use GenerateReleaseAndPublishResp.ProtoReflect.Descriptor instead. +func (*GenerateReleaseAndPublishResp) Descriptor() ([]byte, []int) { return file_config_service_proto_rawDescGZIP(), []int{98} } -func (x *ListTemplatesResp) GetCount() uint32 { +func (x *GenerateReleaseAndPublishResp) GetId() uint32 { if x != nil { - return x.Count + return x.Id } return 0 } -func (x *ListTemplatesResp) GetDetails() []*template.Template { - if x != nil { - return x.Details - } - return nil -} - -type CreateTemplateReleaseReq struct { +type PublishResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` - TemplateId uint32 `protobuf:"varint,3,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"` - ReleaseName string `protobuf:"bytes,4,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - ReleaseMemo string `protobuf:"bytes,5,opt,name=release_memo,json=releaseMemo,proto3" json:"release_memo,omitempty"` - Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` - Path string `protobuf:"bytes,7,opt,name=path,proto3" json:"path,omitempty"` - FileType string `protobuf:"bytes,8,opt,name=file_type,json=fileType,proto3" json:"file_type,omitempty"` // file_type is enum type - FileMode string `protobuf:"bytes,9,opt,name=file_mode,json=fileMode,proto3" json:"file_mode,omitempty"` // file_mode is enum type - User string `protobuf:"bytes,10,opt,name=user,proto3" json:"user,omitempty"` - UserGroup string `protobuf:"bytes,11,opt,name=user_group,json=userGroup,proto3" json:"user_group,omitempty"` - Privilege string `protobuf:"bytes,12,opt,name=privilege,proto3" json:"privilege,omitempty"` - Sign string `protobuf:"bytes,13,opt,name=sign,proto3" json:"sign,omitempty"` - ByteSize uint64 `protobuf:"varint,14,opt,name=byte_size,json=byteSize,proto3" json:"byte_size,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (x *CreateTemplateReleaseReq) Reset() { - *x = CreateTemplateReleaseReq{} +func (x *PublishResp) Reset() { + *x = PublishResp{} if protoimpl.UnsafeEnabled { mi := &file_config_service_proto_msgTypes[99] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6143,13 +6256,13 @@ func (x *CreateTemplateReleaseReq) Reset() { } } -func (x *CreateTemplateReleaseReq) String() string { +func (x *PublishResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateTemplateReleaseReq) ProtoMessage() {} +func (*PublishResp) ProtoMessage() {} -func (x *CreateTemplateReleaseReq) ProtoReflect() protoreflect.Message { +func (x *PublishResp) ProtoReflect() protoreflect.Message { mi := &file_config_service_proto_msgTypes[99] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6161,134 +6274,168 @@ func (x *CreateTemplateReleaseReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateTemplateReleaseReq.ProtoReflect.Descriptor instead. -func (*CreateTemplateReleaseReq) Descriptor() ([]byte, []int) { +// Deprecated: Use PublishResp.ProtoReflect.Descriptor instead. +func (*PublishResp) Descriptor() ([]byte, []int) { return file_config_service_proto_rawDescGZIP(), []int{99} } -func (x *CreateTemplateReleaseReq) GetBizId() uint32 { +func (x *PublishResp) GetId() uint32 { if x != nil { - return x.BizId + return x.Id } return 0 } -func (x *CreateTemplateReleaseReq) GetTemplateSpaceId() uint32 { - if x != nil { - return x.TemplateSpaceId - } - return 0 +type BatchUpsertConfigItemsReq_ConfigItem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + FileType string `protobuf:"bytes,3,opt,name=file_type,json=fileType,proto3" json:"file_type,omitempty"` // file_type is enum type, source resource reference: pkg/dal/table/config_item.go + FileMode string `protobuf:"bytes,4,opt,name=file_mode,json=fileMode,proto3" json:"file_mode,omitempty"` // file_mode is enum type, source resource reference: pkg/dal/table/config_item.go + Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` + User string `protobuf:"bytes,6,opt,name=user,proto3" json:"user,omitempty"` + UserGroup string `protobuf:"bytes,7,opt,name=user_group,json=userGroup,proto3" json:"user_group,omitempty"` + Privilege string `protobuf:"bytes,8,opt,name=privilege,proto3" json:"privilege,omitempty"` + Sign string `protobuf:"bytes,9,opt,name=sign,proto3" json:"sign,omitempty"` + ByteSize uint64 `protobuf:"varint,10,opt,name=byte_size,json=byteSize,proto3" json:"byte_size,omitempty"` } -func (x *CreateTemplateReleaseReq) GetTemplateId() uint32 { - if x != nil { - return x.TemplateId +func (x *BatchUpsertConfigItemsReq_ConfigItem) Reset() { + *x = BatchUpsertConfigItemsReq_ConfigItem{} + if protoimpl.UnsafeEnabled { + mi := &file_config_service_proto_msgTypes[100] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return 0 } -func (x *CreateTemplateReleaseReq) GetReleaseName() string { - if x != nil { - return x.ReleaseName - } - return "" +func (x *BatchUpsertConfigItemsReq_ConfigItem) String() string { + return protoimpl.X.MessageStringOf(x) } -func (x *CreateTemplateReleaseReq) GetReleaseMemo() string { - if x != nil { - return x.ReleaseMemo +func (*BatchUpsertConfigItemsReq_ConfigItem) ProtoMessage() {} + +func (x *BatchUpsertConfigItemsReq_ConfigItem) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[100] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return "" + return mi.MessageOf(x) } -func (x *CreateTemplateReleaseReq) GetName() string { +// Deprecated: Use BatchUpsertConfigItemsReq_ConfigItem.ProtoReflect.Descriptor instead. +func (*BatchUpsertConfigItemsReq_ConfigItem) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{27, 0} +} + +func (x *BatchUpsertConfigItemsReq_ConfigItem) GetName() string { if x != nil { return x.Name } return "" } -func (x *CreateTemplateReleaseReq) GetPath() string { +func (x *BatchUpsertConfigItemsReq_ConfigItem) GetPath() string { if x != nil { return x.Path } return "" } -func (x *CreateTemplateReleaseReq) GetFileType() string { +func (x *BatchUpsertConfigItemsReq_ConfigItem) GetFileType() string { if x != nil { return x.FileType } return "" } -func (x *CreateTemplateReleaseReq) GetFileMode() string { +func (x *BatchUpsertConfigItemsReq_ConfigItem) GetFileMode() string { if x != nil { return x.FileMode } return "" } -func (x *CreateTemplateReleaseReq) GetUser() string { +func (x *BatchUpsertConfigItemsReq_ConfigItem) GetMemo() string { + if x != nil { + return x.Memo + } + return "" +} + +func (x *BatchUpsertConfigItemsReq_ConfigItem) GetUser() string { if x != nil { return x.User } return "" } -func (x *CreateTemplateReleaseReq) GetUserGroup() string { +func (x *BatchUpsertConfigItemsReq_ConfigItem) GetUserGroup() string { if x != nil { return x.UserGroup } return "" } -func (x *CreateTemplateReleaseReq) GetPrivilege() string { +func (x *BatchUpsertConfigItemsReq_ConfigItem) GetPrivilege() string { if x != nil { return x.Privilege } return "" } -func (x *CreateTemplateReleaseReq) GetSign() string { +func (x *BatchUpsertConfigItemsReq_ConfigItem) GetSign() string { if x != nil { return x.Sign } return "" } -func (x *CreateTemplateReleaseReq) GetByteSize() uint64 { +func (x *BatchUpsertConfigItemsReq_ConfigItem) GetByteSize() uint64 { if x != nil { return x.ByteSize } return 0 } -type CreateTemplateReleaseResp struct { +type ListAllGroupsResp_ListAllGroupsData struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Public bool `protobuf:"varint,3,opt,name=public,proto3" json:"public,omitempty"` + BindApps []*ListAllGroupsResp_ListAllGroupsData_BindApp `protobuf:"bytes,4,rep,name=bind_apps,json=bindApps,proto3" json:"bind_apps,omitempty"` + Selector *structpb.Struct `protobuf:"bytes,5,opt,name=selector,proto3" json:"selector,omitempty"` + ReleasedAppsNum uint32 `protobuf:"varint,6,opt,name=released_apps_num,json=releasedAppsNum,proto3" json:"released_apps_num,omitempty"` + Edited bool `protobuf:"varint,7,opt,name=edited,proto3" json:"edited,omitempty"` } -func (x *CreateTemplateReleaseResp) Reset() { - *x = CreateTemplateReleaseResp{} +func (x *ListAllGroupsResp_ListAllGroupsData) Reset() { + *x = ListAllGroupsResp_ListAllGroupsData{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[100] + mi := &file_config_service_proto_msgTypes[101] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateTemplateReleaseResp) String() string { +func (x *ListAllGroupsResp_ListAllGroupsData) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateTemplateReleaseResp) ProtoMessage() {} +func (*ListAllGroupsResp_ListAllGroupsData) ProtoMessage() {} -func (x *CreateTemplateReleaseResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[100] +func (x *ListAllGroupsResp_ListAllGroupsData) ProtoReflect() protoreflect.Message { + mi := &file_config_service_proto_msgTypes[101] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6299,108 +6446,71 @@ func (x *CreateTemplateReleaseResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateTemplateReleaseResp.ProtoReflect.Descriptor instead. -func (*CreateTemplateReleaseResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{100} +// Deprecated: Use ListAllGroupsResp_ListAllGroupsData.ProtoReflect.Descriptor instead. +func (*ListAllGroupsResp_ListAllGroupsData) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{91, 0} } -func (x *CreateTemplateReleaseResp) GetId() uint32 { +func (x *ListAllGroupsResp_ListAllGroupsData) GetId() uint32 { if x != nil { return x.Id } return 0 } -type ListTemplateReleasesReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` - TemplateId uint32 `protobuf:"varint,3,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"` - Start uint32 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"` - Limit uint32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` -} - -func (x *ListTemplateReleasesReq) Reset() { - *x = ListTemplateReleasesReq{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[101] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListTemplateReleasesReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTemplateReleasesReq) ProtoMessage() {} - -func (x *ListTemplateReleasesReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[101] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms +func (x *ListAllGroupsResp_ListAllGroupsData) GetName() string { + if x != nil { + return x.Name } - return mi.MessageOf(x) -} - -// Deprecated: Use ListTemplateReleasesReq.ProtoReflect.Descriptor instead. -func (*ListTemplateReleasesReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{101} + return "" } -func (x *ListTemplateReleasesReq) GetBizId() uint32 { +func (x *ListAllGroupsResp_ListAllGroupsData) GetPublic() bool { if x != nil { - return x.BizId + return x.Public } - return 0 + return false } -func (x *ListTemplateReleasesReq) GetTemplateSpaceId() uint32 { +func (x *ListAllGroupsResp_ListAllGroupsData) GetBindApps() []*ListAllGroupsResp_ListAllGroupsData_BindApp { if x != nil { - return x.TemplateSpaceId + return x.BindApps } - return 0 + return nil } -func (x *ListTemplateReleasesReq) GetTemplateId() uint32 { +func (x *ListAllGroupsResp_ListAllGroupsData) GetSelector() *structpb.Struct { if x != nil { - return x.TemplateId + return x.Selector } - return 0 + return nil } -func (x *ListTemplateReleasesReq) GetStart() uint32 { +func (x *ListAllGroupsResp_ListAllGroupsData) GetReleasedAppsNum() uint32 { if x != nil { - return x.Start + return x.ReleasedAppsNum } return 0 } -func (x *ListTemplateReleasesReq) GetLimit() uint32 { +func (x *ListAllGroupsResp_ListAllGroupsData) GetEdited() bool { if x != nil { - return x.Limit + return x.Edited } - return 0 + return false } -type ListTemplateReleasesResp struct { +type ListAllGroupsResp_ListAllGroupsData_BindApp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*template_release.TemplateRelease `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` } -func (x *ListTemplateReleasesResp) Reset() { - *x = ListTemplateReleasesResp{} +func (x *ListAllGroupsResp_ListAllGroupsData_BindApp) Reset() { + *x = ListAllGroupsResp_ListAllGroupsData_BindApp{} if protoimpl.UnsafeEnabled { mi := &file_config_service_proto_msgTypes[102] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6408,13 +6518,13 @@ func (x *ListTemplateReleasesResp) Reset() { } } -func (x *ListTemplateReleasesResp) String() string { +func (x *ListAllGroupsResp_ListAllGroupsData_BindApp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListTemplateReleasesResp) ProtoMessage() {} +func (*ListAllGroupsResp_ListAllGroupsData_BindApp) ProtoMessage() {} -func (x *ListTemplateReleasesResp) ProtoReflect() protoreflect.Message { +func (x *ListAllGroupsResp_ListAllGroupsData_BindApp) ProtoReflect() protoreflect.Message { mi := &file_config_service_proto_msgTypes[102] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6426,38 +6536,41 @@ func (x *ListTemplateReleasesResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListTemplateReleasesResp.ProtoReflect.Descriptor instead. -func (*ListTemplateReleasesResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{102} +// Deprecated: Use ListAllGroupsResp_ListAllGroupsData_BindApp.ProtoReflect.Descriptor instead. +func (*ListAllGroupsResp_ListAllGroupsData_BindApp) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{91, 0, 0} } -func (x *ListTemplateReleasesResp) GetCount() uint32 { +func (x *ListAllGroupsResp_ListAllGroupsData_BindApp) GetId() uint32 { if x != nil { - return x.Count + return x.Id } return 0 } -func (x *ListTemplateReleasesResp) GetDetails() []*template_release.TemplateRelease { +func (x *ListAllGroupsResp_ListAllGroupsData_BindApp) GetName() string { if x != nil { - return x.Details + return x.Name } - return nil + return "" } -type DeleteTemplateReleaseReq struct { +type ListAppGroupsResp_ListAppGroupsData struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` - TemplateId uint32 `protobuf:"varint,3,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"` - TemplateReleaseId uint32 `protobuf:"varint,4,opt,name=template_release_id,json=templateReleaseId,proto3" json:"template_release_id,omitempty"` + GroupId uint32 `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + GroupName string `protobuf:"bytes,2,opt,name=group_name,json=groupName,proto3" json:"group_name,omitempty"` + ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` + ReleaseName string `protobuf:"bytes,4,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` + OldSelector *structpb.Struct `protobuf:"bytes,5,opt,name=old_selector,json=oldSelector,proto3" json:"old_selector,omitempty"` + NewSelector *structpb.Struct `protobuf:"bytes,6,opt,name=new_selector,json=newSelector,proto3" json:"new_selector,omitempty"` + Edited bool `protobuf:"varint,7,opt,name=edited,proto3" json:"edited,omitempty"` } -func (x *DeleteTemplateReleaseReq) Reset() { - *x = DeleteTemplateReleaseReq{} +func (x *ListAppGroupsResp_ListAppGroupsData) Reset() { + *x = ListAppGroupsResp_ListAppGroupsData{} if protoimpl.UnsafeEnabled { mi := &file_config_service_proto_msgTypes[103] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6465,13 +6578,13 @@ func (x *DeleteTemplateReleaseReq) Reset() { } } -func (x *DeleteTemplateReleaseReq) String() string { +func (x *ListAppGroupsResp_ListAppGroupsData) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteTemplateReleaseReq) ProtoMessage() {} +func (*ListAppGroupsResp_ListAppGroupsData) ProtoMessage() {} -func (x *DeleteTemplateReleaseReq) ProtoReflect() protoreflect.Message { +func (x *ListAppGroupsResp_ListAppGroupsData) ProtoReflect() protoreflect.Message { mi := &file_config_service_proto_msgTypes[103] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6483,1460 +6596,58 @@ func (x *DeleteTemplateReleaseReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteTemplateReleaseReq.ProtoReflect.Descriptor instead. -func (*DeleteTemplateReleaseReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{103} +// Deprecated: Use ListAppGroupsResp_ListAppGroupsData.ProtoReflect.Descriptor instead. +func (*ListAppGroupsResp_ListAppGroupsData) Descriptor() ([]byte, []int) { + return file_config_service_proto_rawDescGZIP(), []int{93, 0} } -func (x *DeleteTemplateReleaseReq) GetBizId() uint32 { +func (x *ListAppGroupsResp_ListAppGroupsData) GetGroupId() uint32 { if x != nil { - return x.BizId + return x.GroupId } return 0 } -func (x *DeleteTemplateReleaseReq) GetTemplateSpaceId() uint32 { +func (x *ListAppGroupsResp_ListAppGroupsData) GetGroupName() string { if x != nil { - return x.TemplateSpaceId + return x.GroupName } - return 0 + return "" } -func (x *DeleteTemplateReleaseReq) GetTemplateId() uint32 { +func (x *ListAppGroupsResp_ListAppGroupsData) GetReleaseId() uint32 { if x != nil { - return x.TemplateId + return x.ReleaseId } return 0 } -func (x *DeleteTemplateReleaseReq) GetTemplateReleaseId() uint32 { +func (x *ListAppGroupsResp_ListAppGroupsData) GetReleaseName() string { if x != nil { - return x.TemplateReleaseId + return x.ReleaseName } - return 0 + return "" } -type DeleteTemplateReleaseResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +func (x *ListAppGroupsResp_ListAppGroupsData) GetOldSelector() *structpb.Struct { + if x != nil { + return x.OldSelector + } + return nil } -func (x *DeleteTemplateReleaseResp) Reset() { - *x = DeleteTemplateReleaseResp{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[104] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func (x *ListAppGroupsResp_ListAppGroupsData) GetNewSelector() *structpb.Struct { + if x != nil { + return x.NewSelector } + return nil } -func (x *DeleteTemplateReleaseResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteTemplateReleaseResp) ProtoMessage() {} - -func (x *DeleteTemplateReleaseResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[104] - 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 DeleteTemplateReleaseResp.ProtoReflect.Descriptor instead. -func (*DeleteTemplateReleaseResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{104} -} - -type CreateGroupReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Public bool `protobuf:"varint,3,opt,name=public,proto3" json:"public,omitempty"` - BindApps []uint32 `protobuf:"varint,4,rep,packed,name=bind_apps,json=bindApps,proto3" json:"bind_apps,omitempty"` - Mode string `protobuf:"bytes,5,opt,name=mode,proto3" json:"mode,omitempty"` - Selector *structpb.Struct `protobuf:"bytes,6,opt,name=selector,proto3" json:"selector,omitempty"` - Uid string `protobuf:"bytes,7,opt,name=uid,proto3" json:"uid,omitempty"` -} - -func (x *CreateGroupReq) Reset() { - *x = CreateGroupReq{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[105] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateGroupReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateGroupReq) ProtoMessage() {} - -func (x *CreateGroupReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[105] - 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 CreateGroupReq.ProtoReflect.Descriptor instead. -func (*CreateGroupReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{105} -} - -func (x *CreateGroupReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -func (x *CreateGroupReq) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateGroupReq) GetPublic() bool { - if x != nil { - return x.Public - } - return false -} - -func (x *CreateGroupReq) GetBindApps() []uint32 { - if x != nil { - return x.BindApps - } - return nil -} - -func (x *CreateGroupReq) GetMode() string { - if x != nil { - return x.Mode - } - return "" -} - -func (x *CreateGroupReq) GetSelector() *structpb.Struct { - if x != nil { - return x.Selector - } - return nil -} - -func (x *CreateGroupReq) GetUid() string { - if x != nil { - return x.Uid - } - return "" -} - -type CreateGroupResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *CreateGroupResp) Reset() { - *x = CreateGroupResp{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[106] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateGroupResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateGroupResp) ProtoMessage() {} - -func (x *CreateGroupResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[106] - 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 CreateGroupResp.ProtoReflect.Descriptor instead. -func (*CreateGroupResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{106} -} - -func (x *CreateGroupResp) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -type UpdateGroupReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - GroupId uint32 `protobuf:"varint,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Public bool `protobuf:"varint,4,opt,name=public,proto3" json:"public,omitempty"` - BindApps []uint32 `protobuf:"varint,5,rep,packed,name=bind_apps,json=bindApps,proto3" json:"bind_apps,omitempty"` - Mode string `protobuf:"bytes,6,opt,name=mode,proto3" json:"mode,omitempty"` - Selector *structpb.Struct `protobuf:"bytes,7,opt,name=selector,proto3" json:"selector,omitempty"` - Uid string `protobuf:"bytes,8,opt,name=uid,proto3" json:"uid,omitempty"` -} - -func (x *UpdateGroupReq) Reset() { - *x = UpdateGroupReq{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[107] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateGroupReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateGroupReq) ProtoMessage() {} - -func (x *UpdateGroupReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[107] - 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 UpdateGroupReq.ProtoReflect.Descriptor instead. -func (*UpdateGroupReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{107} -} - -func (x *UpdateGroupReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -func (x *UpdateGroupReq) GetGroupId() uint32 { - if x != nil { - return x.GroupId - } - return 0 -} - -func (x *UpdateGroupReq) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *UpdateGroupReq) GetPublic() bool { - if x != nil { - return x.Public - } - return false -} - -func (x *UpdateGroupReq) GetBindApps() []uint32 { - if x != nil { - return x.BindApps - } - return nil -} - -func (x *UpdateGroupReq) GetMode() string { - if x != nil { - return x.Mode - } - return "" -} - -func (x *UpdateGroupReq) GetSelector() *structpb.Struct { - if x != nil { - return x.Selector - } - return nil -} - -func (x *UpdateGroupReq) GetUid() string { - if x != nil { - return x.Uid - } - return "" -} - -type UpdateGroupResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateGroupResp) Reset() { - *x = UpdateGroupResp{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[108] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateGroupResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateGroupResp) ProtoMessage() {} - -func (x *UpdateGroupResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[108] - 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 UpdateGroupResp.ProtoReflect.Descriptor instead. -func (*UpdateGroupResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{108} -} - -type DeleteGroupReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - GroupId uint32 `protobuf:"varint,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` -} - -func (x *DeleteGroupReq) Reset() { - *x = DeleteGroupReq{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[109] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteGroupReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteGroupReq) ProtoMessage() {} - -func (x *DeleteGroupReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[109] - 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 DeleteGroupReq.ProtoReflect.Descriptor instead. -func (*DeleteGroupReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{109} -} - -func (x *DeleteGroupReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -func (x *DeleteGroupReq) GetGroupId() uint32 { - if x != nil { - return x.GroupId - } - return 0 -} - -type DeleteGroupResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteGroupResp) Reset() { - *x = DeleteGroupResp{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[110] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteGroupResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteGroupResp) ProtoMessage() {} - -func (x *DeleteGroupResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[110] - 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 DeleteGroupResp.ProtoReflect.Descriptor instead. -func (*DeleteGroupResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{110} -} - -type ListAllGroupsReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` -} - -func (x *ListAllGroupsReq) Reset() { - *x = ListAllGroupsReq{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[111] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAllGroupsReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAllGroupsReq) ProtoMessage() {} - -func (x *ListAllGroupsReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[111] - 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 ListAllGroupsReq.ProtoReflect.Descriptor instead. -func (*ListAllGroupsReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{111} -} - -func (x *ListAllGroupsReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -type ListAllGroupsResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Details []*ListAllGroupsResp_ListAllGroupsData `protobuf:"bytes,1,rep,name=details,proto3" json:"details,omitempty"` -} - -func (x *ListAllGroupsResp) Reset() { - *x = ListAllGroupsResp{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[112] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAllGroupsResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAllGroupsResp) ProtoMessage() {} - -func (x *ListAllGroupsResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[112] - 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 ListAllGroupsResp.ProtoReflect.Descriptor instead. -func (*ListAllGroupsResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{112} -} - -func (x *ListAllGroupsResp) GetDetails() []*ListAllGroupsResp_ListAllGroupsData { - if x != nil { - return x.Details - } - return nil -} - -type ListAppGroupsReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` -} - -func (x *ListAppGroupsReq) Reset() { - *x = ListAppGroupsReq{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[113] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAppGroupsReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAppGroupsReq) ProtoMessage() {} - -func (x *ListAppGroupsReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[113] - 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 ListAppGroupsReq.ProtoReflect.Descriptor instead. -func (*ListAppGroupsReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{113} -} - -func (x *ListAppGroupsReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -func (x *ListAppGroupsReq) GetAppId() uint32 { - if x != nil { - return x.AppId - } - return 0 -} - -type ListAppGroupsResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Details []*ListAppGroupsResp_ListAppGroupsData `protobuf:"bytes,1,rep,name=details,proto3" json:"details,omitempty"` -} - -func (x *ListAppGroupsResp) Reset() { - *x = ListAppGroupsResp{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[114] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAppGroupsResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAppGroupsResp) ProtoMessage() {} - -func (x *ListAppGroupsResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[114] - 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 ListAppGroupsResp.ProtoReflect.Descriptor instead. -func (*ListAppGroupsResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{114} -} - -func (x *ListAppGroupsResp) GetDetails() []*ListAppGroupsResp_ListAppGroupsData { - if x != nil { - return x.Details - } - return nil -} - -type ListGroupReleasedAppsReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - GroupId uint32 `protobuf:"varint,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - Start uint32 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` -} - -func (x *ListGroupReleasedAppsReq) Reset() { - *x = ListGroupReleasedAppsReq{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[115] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListGroupReleasedAppsReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListGroupReleasedAppsReq) ProtoMessage() {} - -func (x *ListGroupReleasedAppsReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[115] - 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 ListGroupReleasedAppsReq.ProtoReflect.Descriptor instead. -func (*ListGroupReleasedAppsReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{115} -} - -func (x *ListGroupReleasedAppsReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -func (x *ListGroupReleasedAppsReq) GetGroupId() uint32 { - if x != nil { - return x.GroupId - } - return 0 -} - -func (x *ListGroupReleasedAppsReq) GetStart() uint32 { - if x != nil { - return x.Start - } - return 0 -} - -func (x *ListGroupReleasedAppsReq) GetLimit() uint32 { - if x != nil { - return x.Limit - } - return 0 -} - -type ListGroupReleasedAppsResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*ListGroupReleasedAppsResp_ListGroupReleasedAppsData `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` -} - -func (x *ListGroupReleasedAppsResp) Reset() { - *x = ListGroupReleasedAppsResp{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[116] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListGroupReleasedAppsResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListGroupReleasedAppsResp) ProtoMessage() {} - -func (x *ListGroupReleasedAppsResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[116] - 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 ListGroupReleasedAppsResp.ProtoReflect.Descriptor instead. -func (*ListGroupReleasedAppsResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{116} -} - -func (x *ListGroupReleasedAppsResp) GetCount() uint32 { - if x != nil { - return x.Count - } - return 0 -} - -func (x *ListGroupReleasedAppsResp) GetDetails() []*ListGroupReleasedAppsResp_ListGroupReleasedAppsData { - if x != nil { - return x.Details - } - return nil -} - -type PublishReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` - Memo string `protobuf:"bytes,4,opt,name=memo,proto3" json:"memo,omitempty"` - All bool `protobuf:"varint,5,opt,name=all,proto3" json:"all,omitempty"` - Default bool `protobuf:"varint,6,opt,name=default,proto3" json:"default,omitempty"` - Groups []uint32 `protobuf:"varint,7,rep,packed,name=groups,proto3" json:"groups,omitempty"` -} - -func (x *PublishReq) Reset() { - *x = PublishReq{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[117] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PublishReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PublishReq) ProtoMessage() {} - -func (x *PublishReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[117] - 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 PublishReq.ProtoReflect.Descriptor instead. -func (*PublishReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{117} -} - -func (x *PublishReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -func (x *PublishReq) GetAppId() uint32 { - if x != nil { - return x.AppId - } - return 0 -} - -func (x *PublishReq) GetReleaseId() uint32 { - if x != nil { - return x.ReleaseId - } - return 0 -} - -func (x *PublishReq) GetMemo() string { - if x != nil { - return x.Memo - } - return "" -} - -func (x *PublishReq) GetAll() bool { - if x != nil { - return x.All - } - return false -} - -func (x *PublishReq) GetDefault() bool { - if x != nil { - return x.Default - } - return false -} - -func (x *PublishReq) GetGroups() []uint32 { - if x != nil { - return x.Groups - } - return nil -} - -type GenerateReleaseAndPublishReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - ReleaseName string `protobuf:"bytes,3,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - ReleaseMemo string `protobuf:"bytes,4,opt,name=release_memo,json=releaseMemo,proto3" json:"release_memo,omitempty"` - All bool `protobuf:"varint,5,opt,name=all,proto3" json:"all,omitempty"` - Groups []string `protobuf:"bytes,6,rep,name=groups,proto3" json:"groups,omitempty"` -} - -func (x *GenerateReleaseAndPublishReq) Reset() { - *x = GenerateReleaseAndPublishReq{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[118] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenerateReleaseAndPublishReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateReleaseAndPublishReq) ProtoMessage() {} - -func (x *GenerateReleaseAndPublishReq) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[118] - 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 GenerateReleaseAndPublishReq.ProtoReflect.Descriptor instead. -func (*GenerateReleaseAndPublishReq) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{118} -} - -func (x *GenerateReleaseAndPublishReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -func (x *GenerateReleaseAndPublishReq) GetAppId() uint32 { - if x != nil { - return x.AppId - } - return 0 -} - -func (x *GenerateReleaseAndPublishReq) GetReleaseName() string { - if x != nil { - return x.ReleaseName - } - return "" -} - -func (x *GenerateReleaseAndPublishReq) GetReleaseMemo() string { - if x != nil { - return x.ReleaseMemo - } - return "" -} - -func (x *GenerateReleaseAndPublishReq) GetAll() bool { - if x != nil { - return x.All - } - return false -} - -func (x *GenerateReleaseAndPublishReq) GetGroups() []string { - if x != nil { - return x.Groups - } - return nil -} - -type GenerateReleaseAndPublishResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GenerateReleaseAndPublishResp) Reset() { - *x = GenerateReleaseAndPublishResp{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[119] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenerateReleaseAndPublishResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateReleaseAndPublishResp) ProtoMessage() {} - -func (x *GenerateReleaseAndPublishResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[119] - 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 GenerateReleaseAndPublishResp.ProtoReflect.Descriptor instead. -func (*GenerateReleaseAndPublishResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{119} -} - -func (x *GenerateReleaseAndPublishResp) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -type PublishResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *PublishResp) Reset() { - *x = PublishResp{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[120] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PublishResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PublishResp) ProtoMessage() {} - -func (x *PublishResp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[120] - 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 PublishResp.ProtoReflect.Descriptor instead. -func (*PublishResp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{120} -} - -func (x *PublishResp) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -type BatchUpsertConfigItemsReq_ConfigItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - FileType string `protobuf:"bytes,3,opt,name=file_type,json=fileType,proto3" json:"file_type,omitempty"` // file_type is enum type, source resource reference: pkg/dal/table/config_item.go - FileMode string `protobuf:"bytes,4,opt,name=file_mode,json=fileMode,proto3" json:"file_mode,omitempty"` // file_mode is enum type, source resource reference: pkg/dal/table/config_item.go - Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` - User string `protobuf:"bytes,6,opt,name=user,proto3" json:"user,omitempty"` - UserGroup string `protobuf:"bytes,7,opt,name=user_group,json=userGroup,proto3" json:"user_group,omitempty"` - Privilege string `protobuf:"bytes,8,opt,name=privilege,proto3" json:"privilege,omitempty"` - Sign string `protobuf:"bytes,9,opt,name=sign,proto3" json:"sign,omitempty"` - ByteSize uint64 `protobuf:"varint,10,opt,name=byte_size,json=byteSize,proto3" json:"byte_size,omitempty"` -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) Reset() { - *x = BatchUpsertConfigItemsReq_ConfigItem{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[121] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BatchUpsertConfigItemsReq_ConfigItem) ProtoMessage() {} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[121] - 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 BatchUpsertConfigItemsReq_ConfigItem.ProtoReflect.Descriptor instead. -func (*BatchUpsertConfigItemsReq_ConfigItem) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{26, 0} -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) GetFileType() string { - if x != nil { - return x.FileType - } - return "" -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) GetFileMode() string { - if x != nil { - return x.FileMode - } - return "" -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) GetMemo() string { - if x != nil { - return x.Memo - } - return "" -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) GetUser() string { - if x != nil { - return x.User - } - return "" -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) GetUserGroup() string { - if x != nil { - return x.UserGroup - } - return "" -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) GetPrivilege() string { - if x != nil { - return x.Privilege - } - return "" -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) GetSign() string { - if x != nil { - return x.Sign - } - return "" -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) GetByteSize() uint64 { - if x != nil { - return x.ByteSize - } - return 0 -} - -type GetHookInfoSpec_Releases struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NotReleaseId uint32 `protobuf:"varint,1,opt,name=not_release_id,json=notReleaseId,proto3" json:"not_release_id,omitempty"` -} - -func (x *GetHookInfoSpec_Releases) Reset() { - *x = GetHookInfoSpec_Releases{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[122] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetHookInfoSpec_Releases) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetHookInfoSpec_Releases) ProtoMessage() {} - -func (x *GetHookInfoSpec_Releases) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[122] - 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 GetHookInfoSpec_Releases.ProtoReflect.Descriptor instead. -func (*GetHookInfoSpec_Releases) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{77, 0} -} - -func (x *GetHookInfoSpec_Releases) GetNotReleaseId() uint32 { - if x != nil { - return x.NotReleaseId - } - return 0 -} - -type ListAllGroupsResp_ListAllGroupsData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Public bool `protobuf:"varint,3,opt,name=public,proto3" json:"public,omitempty"` - BindApps []*ListAllGroupsResp_ListAllGroupsData_BindApp `protobuf:"bytes,4,rep,name=bind_apps,json=bindApps,proto3" json:"bind_apps,omitempty"` - Selector *structpb.Struct `protobuf:"bytes,5,opt,name=selector,proto3" json:"selector,omitempty"` - ReleasedAppsNum uint32 `protobuf:"varint,6,opt,name=released_apps_num,json=releasedAppsNum,proto3" json:"released_apps_num,omitempty"` - Edited bool `protobuf:"varint,7,opt,name=edited,proto3" json:"edited,omitempty"` -} - -func (x *ListAllGroupsResp_ListAllGroupsData) Reset() { - *x = ListAllGroupsResp_ListAllGroupsData{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[123] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAllGroupsResp_ListAllGroupsData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAllGroupsResp_ListAllGroupsData) ProtoMessage() {} - -func (x *ListAllGroupsResp_ListAllGroupsData) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[123] - 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 ListAllGroupsResp_ListAllGroupsData.ProtoReflect.Descriptor instead. -func (*ListAllGroupsResp_ListAllGroupsData) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{112, 0} -} - -func (x *ListAllGroupsResp_ListAllGroupsData) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *ListAllGroupsResp_ListAllGroupsData) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ListAllGroupsResp_ListAllGroupsData) GetPublic() bool { - if x != nil { - return x.Public - } - return false -} - -func (x *ListAllGroupsResp_ListAllGroupsData) GetBindApps() []*ListAllGroupsResp_ListAllGroupsData_BindApp { - if x != nil { - return x.BindApps - } - return nil -} - -func (x *ListAllGroupsResp_ListAllGroupsData) GetSelector() *structpb.Struct { - if x != nil { - return x.Selector - } - return nil -} - -func (x *ListAllGroupsResp_ListAllGroupsData) GetReleasedAppsNum() uint32 { - if x != nil { - return x.ReleasedAppsNum - } - return 0 -} - -func (x *ListAllGroupsResp_ListAllGroupsData) GetEdited() bool { - if x != nil { - return x.Edited - } - return false -} - -type ListAllGroupsResp_ListAllGroupsData_BindApp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *ListAllGroupsResp_ListAllGroupsData_BindApp) Reset() { - *x = ListAllGroupsResp_ListAllGroupsData_BindApp{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[124] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAllGroupsResp_ListAllGroupsData_BindApp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAllGroupsResp_ListAllGroupsData_BindApp) ProtoMessage() {} - -func (x *ListAllGroupsResp_ListAllGroupsData_BindApp) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[124] - 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 ListAllGroupsResp_ListAllGroupsData_BindApp.ProtoReflect.Descriptor instead. -func (*ListAllGroupsResp_ListAllGroupsData_BindApp) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{112, 0, 0} -} - -func (x *ListAllGroupsResp_ListAllGroupsData_BindApp) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *ListAllGroupsResp_ListAllGroupsData_BindApp) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type ListAppGroupsResp_ListAppGroupsData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GroupId uint32 `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - GroupName string `protobuf:"bytes,2,opt,name=group_name,json=groupName,proto3" json:"group_name,omitempty"` - ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` - ReleaseName string `protobuf:"bytes,4,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - OldSelector *structpb.Struct `protobuf:"bytes,5,opt,name=old_selector,json=oldSelector,proto3" json:"old_selector,omitempty"` - NewSelector *structpb.Struct `protobuf:"bytes,6,opt,name=new_selector,json=newSelector,proto3" json:"new_selector,omitempty"` - Edited bool `protobuf:"varint,7,opt,name=edited,proto3" json:"edited,omitempty"` -} - -func (x *ListAppGroupsResp_ListAppGroupsData) Reset() { - *x = ListAppGroupsResp_ListAppGroupsData{} - if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[125] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAppGroupsResp_ListAppGroupsData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAppGroupsResp_ListAppGroupsData) ProtoMessage() {} - -func (x *ListAppGroupsResp_ListAppGroupsData) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[125] - 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 ListAppGroupsResp_ListAppGroupsData.ProtoReflect.Descriptor instead. -func (*ListAppGroupsResp_ListAppGroupsData) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{114, 0} -} - -func (x *ListAppGroupsResp_ListAppGroupsData) GetGroupId() uint32 { - if x != nil { - return x.GroupId - } - return 0 -} - -func (x *ListAppGroupsResp_ListAppGroupsData) GetGroupName() string { - if x != nil { - return x.GroupName - } - return "" -} - -func (x *ListAppGroupsResp_ListAppGroupsData) GetReleaseId() uint32 { - if x != nil { - return x.ReleaseId - } - return 0 -} - -func (x *ListAppGroupsResp_ListAppGroupsData) GetReleaseName() string { - if x != nil { - return x.ReleaseName - } - return "" -} - -func (x *ListAppGroupsResp_ListAppGroupsData) GetOldSelector() *structpb.Struct { - if x != nil { - return x.OldSelector - } - return nil -} - -func (x *ListAppGroupsResp_ListAppGroupsData) GetNewSelector() *structpb.Struct { - if x != nil { - return x.NewSelector - } - return nil -} - -func (x *ListAppGroupsResp_ListAppGroupsData) GetEdited() bool { - if x != nil { - return x.Edited - } - return false +func (x *ListAppGroupsResp_ListAppGroupsData) GetEdited() bool { + if x != nil { + return x.Edited + } + return false } type ListGroupReleasedAppsResp_ListGroupReleasedAppsData struct { @@ -7954,7 +6665,7 @@ type ListGroupReleasedAppsResp_ListGroupReleasedAppsData struct { func (x *ListGroupReleasedAppsResp_ListGroupReleasedAppsData) Reset() { *x = ListGroupReleasedAppsResp_ListGroupReleasedAppsData{} if protoimpl.UnsafeEnabled { - mi := &file_config_service_proto_msgTypes[126] + mi := &file_config_service_proto_msgTypes[104] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7967,7 +6678,7 @@ func (x *ListGroupReleasedAppsResp_ListGroupReleasedAppsData) String() string { func (*ListGroupReleasedAppsResp_ListGroupReleasedAppsData) ProtoMessage() {} func (x *ListGroupReleasedAppsResp_ListGroupReleasedAppsData) ProtoReflect() protoreflect.Message { - mi := &file_config_service_proto_msgTypes[126] + mi := &file_config_service_proto_msgTypes[104] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7980,7 +6691,7 @@ func (x *ListGroupReleasedAppsResp_ListGroupReleasedAppsData) ProtoReflect() pro // Deprecated: Use ListGroupReleasedAppsResp_ListGroupReleasedAppsData.ProtoReflect.Descriptor instead. func (*ListGroupReleasedAppsResp_ListGroupReleasedAppsData) Descriptor() ([]byte, []int) { - return file_config_service_proto_rawDescGZIP(), []int{116, 0} + return file_config_service_proto_rawDescGZIP(), []int{95, 0} } func (x *ListGroupReleasedAppsResp_ListGroupReleasedAppsData) GetAppId() uint32 { @@ -8047,1418 +6758,1209 @@ var file_config_service_proto_rawDesc = []byte{ 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2d, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x29, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x68, - 0x6f, 0x6f, 0x6b, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x39, + 0x6f, 0x6f, 0x6b, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2f, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x2d, 0x72, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x72, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2f, 0x62, 0x73, 0x63, 0x70, 0x2e, - 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x72, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x37, 0x62, 0x73, 0x63, 0x70, - 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x2d, 0x63, - 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x5f, 0x63, 0x69, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x31, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x41, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, - 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, - 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2d, 0x72, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x3d, 0x62, 0x73, 0x63, 0x70, 0x2e, - 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2d, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x37, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, + 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x37, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x64, 0x2d, 0x63, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x5f, + 0x63, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x31, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2d, 0x68, 0x6f, 0x6f, 0x6b, 0x2f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc3, 0x01, - 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x64, 0x65, - 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x49, - 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x61, 0x64, 0x64, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x15, - 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x0b, 0x61, 0x6c, - 0x74, 0x65, 0x72, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, - 0x6f, 0x70, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x0a, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x53, 0x63, - 0x6f, 0x70, 0x65, 0x22, 0x1b, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x55, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, - 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, - 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x66, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x43, - 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x07, 0x64, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, - 0x72, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, - 0x70, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, - 0x55, 0x0a, 0x14, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x16, - 0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x17, 0x0a, 0x15, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x3d, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x22, 0x17, - 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x69, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, - 0x6d, 0x6f, 0x22, 0x17, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x75, 0x0a, 0x12, 0x4c, - 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, - 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x22, 0x63, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x36, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2e, - 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x07, - 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x56, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x12, - 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, - 0x6d, 0x6f, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, - 0x70, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x22, - 0x26, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0xcd, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, - 0x72, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x72, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, - 0x10, 0x72, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, - 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x46, - 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x22, 0x1f, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0xa8, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, + 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2f, 0x74, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x41, 0x62, 0x73, 0x63, + 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2d, + 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, + 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x3d, + 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x74, 0x65, 0x2d, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, + 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc3, 0x01, 0x0a, 0x18, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, + 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x1b, 0x0a, + 0x09, 0x61, 0x64, 0x64, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x08, 0x61, 0x64, 0x64, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, + 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, + 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, + 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x0b, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x5f, + 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, + 0x63, 0x72, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x53, + 0x70, 0x65, 0x63, 0x52, 0x0a, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x22, + 0x1b, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x55, 0x0a, 0x17, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, + 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x23, + 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x49, 0x64, 0x22, 0x66, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x73, 0x2e, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x55, 0x0a, 0x14, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, + 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x22, 0x17, 0x0a, 0x15, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x3d, 0x0a, 0x14, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, + 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x22, 0x17, 0x0a, 0x15, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x69, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, + 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, + 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, + 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x17, + 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x75, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, + 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, + 0x69, 0x7a, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x63, + 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x36, 0x0a, 0x07, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, + 0x62, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2e, 0x43, 0x72, 0x65, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x22, 0x56, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, + 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x15, + 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x22, 0x26, 0x0a, 0x14, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x02, 0x69, 0x64, 0x22, 0xcd, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x70, + 0x70, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x6c, 0x6f, - 0x61, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, + 0x61, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x72, 0x65, 0x6c, - 0x6f, 0x61, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x06, 0x20, + 0x6f, 0x61, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x50, - 0x61, 0x74, 0x68, 0x22, 0x0f, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, - 0x52, 0x65, 0x73, 0x70, 0x22, 0x35, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, - 0x70, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x22, 0x0f, 0x0a, 0x0d, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x39, 0x0a, 0x09, - 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, - 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x41, 0x70, - 0x70, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, - 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, - 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x84, 0x01, 0x0a, - 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, - 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, - 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x22, 0x8b, 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, - 0x42, 0x79, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x15, - 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x22, 0x4a, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x61, 0x70, 0x70, - 0x2e, 0x41, 0x70, 0x70, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0xbb, 0x02, - 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, - 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, + 0x61, 0x74, 0x68, 0x22, 0x1f, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x02, 0x69, 0x64, 0x22, 0xa8, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, + 0x70, 0x70, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x6c, 0x6f, 0x61, + 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x72, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x5f, + 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0e, 0x72, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x22, + 0x0f, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x35, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x22, 0x0f, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x39, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x41, + 0x70, 0x70, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, - 0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x66, - 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, - 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1d, 0x0a, - 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1c, 0x0a, 0x09, - 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, - 0x67, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x1b, - 0x0a, 0x09, 0x62, 0x79, 0x74, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x08, 0x62, 0x79, 0x74, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x92, 0x03, 0x0a, 0x19, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, + 0x70, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x42, 0x79, 0x4e, + 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x19, 0x0a, + 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x7b, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, + 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2f, + 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, + 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, + 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x84, 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, + 0x70, 0x73, 0x52, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, - 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x42, 0x61, - 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, - 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, - 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x84, 0x02, 0x0a, 0x0a, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, - 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, - 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, - 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x12, - 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, - 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, - 0x69, 0x67, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x79, 0x74, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x79, 0x74, 0x65, 0x53, 0x69, 0x7a, 0x65, - 0x22, 0x1c, 0x0a, 0x1a, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x26, - 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, - 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0xcb, 0x02, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, - 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1a, 0x0a, 0x08, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x8b, 0x01, 0x0a, + 0x16, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x42, 0x79, 0x53, 0x70, 0x61, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4a, 0x0a, 0x0c, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x24, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x61, 0x70, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x52, 0x07, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0xbb, 0x02, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x15, + 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x07, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, - 0x6d, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, + 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, + 0x6d, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, + 0x72, 0x6f, 0x75, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, - 0x67, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, - 0x65, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, + 0x65, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x79, 0x74, 0x65, 0x5f, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x79, 0x74, 0x65, - 0x53, 0x69, 0x7a, 0x65, 0x22, 0x16, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x22, 0x53, 0x0a, 0x13, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, - 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, - 0x70, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, - 0x64, 0x22, 0x16, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x22, 0x85, 0x01, 0x0a, 0x10, 0x47, 0x65, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x15, - 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, - 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, - 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, - 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, - 0x64, 0x22, 0x78, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, - 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, - 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x30, 0x0a, 0x07, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x53, 0x70, - 0x65, 0x63, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0xbd, 0x01, 0x0a, 0x12, - 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, + 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x79, 0x74, 0x65, + 0x53, 0x69, 0x7a, 0x65, 0x22, 0x92, 0x03, 0x0a, 0x19, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, + 0x73, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, - 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x61, - 0x6c, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x0a, - 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x22, 0x57, 0x0a, 0x13, 0x4c, - 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, + 0x12, 0x40, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2a, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, + 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, + 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x1a, 0x84, 0x02, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, + 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, + 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, + 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6d, + 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4d, + 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x75, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, + 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, + 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x1b, 0x0a, 0x09, + 0x62, 0x79, 0x74, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x08, 0x62, 0x79, 0x74, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x42, 0x61, 0x74, + 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, + 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x26, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, + 0xcb, 0x02, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, + 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1b, 0x0a, + 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, + 0x6c, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, + 0x69, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x75, + 0x73, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, + 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1c, + 0x0a, 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x73, 0x69, 0x67, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, + 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x79, 0x74, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x79, 0x74, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x16, 0x0a, + 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, + 0x6d, 0x52, 0x65, 0x73, 0x70, 0x22, 0x53, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, + 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, + 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x85, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x24, + 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, + 0x65, 0x6d, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x22, 0x78, 0x0a, 0x11, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x31, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, + 0x65, 0x6d, 0x12, 0x30, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x22, 0xbd, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, + 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, + 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x4b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x4b, 0x65, 0x79, 0x22, 0x57, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x46, 0x0a, + 0x16, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, + 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x05, + 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x4f, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x34, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x07, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x97, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, + 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, + 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, + 0x69, 0x67, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x79, 0x74, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x79, 0x74, 0x65, 0x53, 0x69, 0x7a, 0x65, + 0x22, 0x23, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x96, 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, + 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x56, + 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x63, 0x69, - 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x64, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x73, 0x22, 0x46, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x15, - 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x4f, 0x0a, 0x17, - 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x34, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x69, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x97, 0x01, - 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, + 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x98, 0x01, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, + 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, + 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, + 0x6f, 0x22, 0x22, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x95, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, + 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, + 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, + 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x53, 0x0a, + 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x73, 0x22, 0x68, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, + 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, + 0x70, 0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x23, 0x0a, 0x11, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, + 0x64, 0x22, 0xbb, 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, + 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, + 0x70, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x10, 0x0a, + 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, + 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x22, + 0x56, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x64, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x07, + 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x78, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, + 0x6d, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, + 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x04, 0x70, + 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, 0x04, 0x70, 0x61, 0x67, + 0x65, 0x22, 0x68, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x33, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x62, 0x72, 0x63, 0x69, 0x2e, + 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, + 0x65, 0x6d, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0xe0, 0x01, 0x0a, 0x0d, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, + 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, + 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x70, 0x72, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x70, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x72, 0x65, + 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x65, + 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x22, 0x20, + 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, + 0x22, 0xf9, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, - 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, - 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x79, - 0x74, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, - 0x79, 0x74, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x23, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x96, 0x01, 0x0a, - 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, - 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x2f, - 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, - 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, - 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x56, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x2c, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x70, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x85, 0x01, - 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, - 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, - 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, - 0x70, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, - 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x70, 0x72, 0x65, 0x48, 0x6f, 0x6f, - 0x6b, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, - 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x74, 0x48, - 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x22, 0x26, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x9d, 0x01, - 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, - 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, - 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, - 0x70, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, - 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x70, 0x72, 0x65, 0x48, 0x6f, 0x6f, - 0x6b, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, - 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x74, 0x48, - 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x16, 0x0a, - 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, - 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x40, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, + 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x70, 0x72, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x70, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x5f, 0x68, + 0x6f, 0x6f, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x65, 0x48, 0x6f, + 0x6f, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x22, 0x10, 0x0a, 0x0e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x56, + 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x12, + 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x17, 0x0a, + 0x07, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, + 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x93, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, + 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x46, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, 0x0b, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x63, 0x68, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, - 0x6f, 0x6f, 0x6b, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x22, - 0x98, 0x01, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x4d, + 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, + 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x57, 0x0a, + 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, + 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x29, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, + 0x64, 0x22, 0x83, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, + 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, + 0x7a, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, + 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x19, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x5b, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, + 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, + 0x7a, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, + 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x22, + 0x19, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x5a, 0x0a, 0x15, 0x4c, 0x69, + 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, - 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, - 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, - 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x22, 0x0a, 0x10, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x95, - 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, - 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, - 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x53, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x2a, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x70, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x68, 0x0a, 0x10, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, - 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x23, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0xbb, 0x01, 0x0a, 0x0f, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, - 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, - 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, - 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x22, 0x56, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, - 0x22, 0x78, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, - 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, - 0x50, 0x61, 0x67, 0x65, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x68, 0x0a, 0x1b, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x33, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x70, 0x62, 0x72, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x64, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, - 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, - 0x6d, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x18, - 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x20, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x3f, 0x0a, 0x0d, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x5d, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x62, 0x74, 0x73, 0x2e, 0x54, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x07, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x94, 0x03, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, - 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0xa2, 0x01, - 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, - 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x61, - 0x6c, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x17, 0x0a, - 0x07, 0x6e, 0x6f, 0x74, 0x5f, 0x74, 0x61, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, - 0x6e, 0x6f, 0x74, 0x54, 0x61, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x22, 0x4d, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x07, 0x64, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x68, - 0x6f, 0x6f, 0x6b, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x22, 0x28, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x54, 0x61, 0x67, - 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x10, 0x4c, - 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x2f, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x15, 0x2e, 0x70, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x48, - 0x6f, 0x6f, 0x6b, 0x54, 0x61, 0x67, 0x73, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, - 0x22, 0x88, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, - 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, - 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x27, 0x0a, 0x15, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x02, 0x69, 0x64, 0x22, 0xb7, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, - 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, + 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x74, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, + 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x6d, 0x6f, + 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, + 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1d, + 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1c, 0x0a, + 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x69, 0x67, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, + 0x1b, 0x0a, 0x09, 0x62, 0x79, 0x74, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x08, 0x62, 0x79, 0x74, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x24, 0x0a, 0x12, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, + 0x69, 0x64, 0x22, 0x8b, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, + 0x2a, 0x0a, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x74, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x0a, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, + 0x22, 0x14, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x77, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, - 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x58, - 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x07, 0x64, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, - 0x62, 0x68, 0x72, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, - 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x65, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, - 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, - 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x22, - 0x17, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x66, 0x0a, 0x15, 0x50, 0x75, 0x62, 0x6c, - 0x69, 0x73, 0x68, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, + 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x74, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1f, + 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x22, + 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x81, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, + 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, + 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x74, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x59, 0x0a, 0x11, 0x4c, 0x69, 0x73, + 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, + 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x74, 0x65, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x07, 0x64, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x73, 0x22, 0xa8, 0x03, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, - 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, - 0x22, 0x18, 0x0a, 0x16, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x48, 0x6f, 0x6f, 0x6b, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x3c, 0x0a, 0x0a, 0x47, 0x65, - 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, - 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x22, 0xae, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, - 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, - 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, - 0x70, 0x65, 0x63, 0x12, 0x36, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, 0x68, 0x6f, 0x6f, 0x6b, - 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, - 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x08, 0x72, - 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xee, 0x01, 0x0a, 0x0f, 0x47, 0x65, - 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x12, 0x3a, 0x0a, 0x08, - 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, - 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x49, 0x6e, 0x66, - 0x6f, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x08, - 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x1a, 0x30, 0x0a, 0x08, 0x52, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x6e, 0x6f, 0x74, 0x5f, 0x72, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6e, 0x6f, - 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x22, 0x62, 0x0a, 0x11, 0x47, 0x65, - 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, - 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, - 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x22, 0xa7, - 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x17, - 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x17, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x22, 0x9a, 0x01, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, - 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x6f, 0x6f, - 0x6b, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x79, - 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x62, 0x68, 0x72, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, - 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x57, 0x0a, 0x16, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, - 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, - 0x6d, 0x6f, 0x22, 0x29, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x83, 0x01, - 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, + 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, + 0x63, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, + 0x61, 0x74, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, + 0x67, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x79, 0x74, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x79, 0x74, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, + 0x2b, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0xa9, 0x01, 0x0a, + 0x17, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x74, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, - 0x65, 0x6d, 0x6f, 0x22, 0x19, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x5b, - 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, + 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x0a, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x61, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, + 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2f, 0x0a, 0x07, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x62, + 0x74, 0x72, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0xae, 0x01, 0x0a, 0x18, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x74, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, - 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x5a, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, - 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x22, 0x5d, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x62, 0x74, 0x73, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x22, 0x94, 0x03, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2a, - 0x0a, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x74, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1b, 0x0a, 0x09, - 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, - 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, - 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, - 0x65, 0x72, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x75, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x69, - 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, - 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x62, - 0x79, 0x74, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, - 0x62, 0x79, 0x74, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x24, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x8b, - 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x74, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x14, 0x0a, 0x12, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x77, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2a, - 0x0a, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x74, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x0a, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x22, 0x81, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2a, 0x0a, - 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, - 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x59, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x2e, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, - 0x22, 0xa8, 0x03, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, + 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x0a, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x13, + 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x22, 0x1b, 0x0a, 0x19, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0xcb, 0x01, 0x0a, 0x0e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, + 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, + 0x7a, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, + 0x1b, 0x0a, 0x09, 0x62, 0x69, 0x6e, 0x64, 0x5f, 0x61, 0x70, 0x70, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0d, 0x52, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x73, 0x12, 0x12, 0x0a, 0x04, + 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, + 0x12, 0x33, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x08, 0x73, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x21, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0xe6, 0x01, 0x0a, 0x0e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, - 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x0f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, - 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, - 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, - 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, - 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, - 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1d, 0x0a, - 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1c, 0x0a, 0x09, - 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, - 0x67, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x1b, - 0x0a, 0x09, 0x62, 0x79, 0x74, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x08, 0x62, 0x79, 0x74, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x2b, 0x0a, 0x19, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0xa9, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, - 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x74, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x22, 0x61, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2f, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x62, 0x74, 0x72, 0x2e, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x07, - 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0xae, 0x01, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x74, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x74, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x22, 0x1b, 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0xcb, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x03, 0x20, + 0x69, 0x7a, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x1b, 0x0a, 0x09, 0x62, - 0x69, 0x6e, 0x64, 0x5f, 0x61, 0x70, 0x70, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, + 0x69, 0x6e, 0x64, 0x5f, 0x61, 0x70, 0x70, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x33, 0x0a, 0x08, - 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x33, 0x0a, 0x08, + 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x75, 0x69, 0x64, 0x22, 0x21, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0xe6, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, - 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x69, 0x6e, 0x64, 0x5f, - 0x61, 0x70, 0x70, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, 0x62, 0x69, 0x6e, 0x64, - 0x41, 0x70, 0x70, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x33, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, - 0x75, 0x63, 0x74, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x10, 0x0a, - 0x03, 0x75, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, - 0x11, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x42, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x29, 0x0a, 0x10, 0x4c, 0x69, 0x73, - 0x74, 0x41, 0x6c, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, - 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, - 0x69, 0x7a, 0x49, 0x64, 0x22, 0xa2, 0x03, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x43, 0x0a, 0x07, 0x64, 0x65, - 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, 0x62, - 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x1a, - 0xc7, 0x02, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x12, 0x4e, 0x0a, 0x09, 0x62, 0x69, 0x6e, 0x64, 0x5f, 0x61, 0x70, 0x70, 0x73, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x41, 0x6c, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, 0x2e, - 0x42, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x52, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, - 0x73, 0x12, 0x33, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x08, 0x73, 0x65, - 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x64, 0x5f, 0x61, 0x70, 0x70, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x0f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x4e, - 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x1a, 0x2d, 0x0a, 0x07, 0x42, 0x69, - 0x6e, 0x64, 0x41, 0x70, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x40, 0x0a, 0x10, 0x4c, 0x69, 0x73, - 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, - 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, - 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0xfa, 0x02, 0x0a, 0x11, - 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x43, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, - 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x64, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x1a, 0x9f, 0x02, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, - 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x19, 0x0a, 0x08, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x0c, 0x6f, 0x6c, 0x64, 0x5f, - 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x75, 0x69, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x42, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, + 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x29, 0x0a, + 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, + 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x22, 0xa2, 0x03, 0x0a, 0x11, 0x4c, 0x69, 0x73, + 0x74, 0x41, 0x6c, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x43, + 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x1a, 0xc7, 0x02, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x4e, 0x0a, 0x09, 0x62, 0x69, 0x6e, 0x64, 0x5f, 0x61, 0x70, + 0x70, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x44, + 0x61, 0x74, 0x61, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x52, 0x08, 0x62, 0x69, 0x6e, + 0x64, 0x41, 0x70, 0x70, 0x73, 0x12, 0x33, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x72, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x70, 0x70, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, + 0x70, 0x70, 0x73, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x1a, 0x2d, + 0x0a, 0x07, 0x42, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x40, 0x0a, + 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, + 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, + 0xfa, 0x02, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x43, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x44, 0x61, 0x74, + 0x61, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x1a, 0x9f, 0x02, 0x0a, 0x11, 0x4c, + 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, + 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x0c, + 0x6f, 0x6c, 0x64, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x6f, 0x6c, 0x64, + 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x3a, 0x0a, 0x0c, 0x6e, 0x65, 0x77, 0x5f, + 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x6f, 0x6c, 0x64, 0x53, 0x65, 0x6c, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x12, 0x3a, 0x0a, 0x0c, 0x6e, 0x65, 0x77, 0x5f, 0x73, 0x65, 0x6c, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, - 0x75, 0x63, 0x74, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x12, 0x16, 0x0a, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x22, 0x78, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, - 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x22, 0xb0, 0x02, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x53, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, - 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x1a, 0xa7, 0x01, 0x0a, 0x19, + 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x53, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x22, 0x78, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x64, 0x41, 0x70, 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, - 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, - 0x64, 0x69, 0x74, 0x65, 0x64, 0x22, 0xb1, 0x01, 0x0a, 0x0a, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, - 0x68, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, - 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, - 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, - 0x0d, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0xbc, 0x01, 0x0a, 0x1c, 0x47, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x6e, 0x64, - 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, - 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, - 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x10, - 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, - 0x12, 0x16, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0x2f, 0x0a, 0x1d, 0x47, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1d, 0x0a, 0x0b, 0x50, 0x75, 0x62, - 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x32, 0xfc, 0x43, 0x0a, 0x06, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x6e, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, - 0x12, 0x12, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x70, - 0x70, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x32, 0x22, 0x2d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x70, + 0x64, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, + 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0xb0, 0x02, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x53, 0x0a, 0x07, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x70, 0x62, + 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, + 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x1a, + 0xa7, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x15, 0x0a, + 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, + 0x70, 0x70, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x21, + 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x22, 0xb1, 0x01, 0x0a, 0x0a, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, + 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0xbc, 0x01, + 0x0a, 0x1c, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x41, 0x6e, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x15, + 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, + 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4d, 0x65, + 0x6d, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0x2f, 0x0a, 0x1d, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, + 0x6e, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1d, 0x0a, + 0x0b, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x32, 0xee, 0x39, 0x0a, + 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x6e, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x41, 0x70, 0x70, 0x12, 0x12, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x38, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x22, 0x2d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x70, + 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, + 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x7a, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x41, 0x70, 0x70, 0x12, 0x12, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x44, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x1a, 0x39, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x70, + 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, - 0x3a, 0x01, 0x2a, 0x12, 0x7a, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, - 0x12, 0x12, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, - 0x70, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x3e, 0x1a, 0x39, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x70, + 0x3a, 0x01, 0x2a, 0x12, 0x77, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, 0x70, + 0x12, 0x12, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, + 0x70, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x41, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x3b, 0x2a, 0x39, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, - 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, - 0x77, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, 0x70, 0x12, 0x12, 0x2e, 0x70, - 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, - 0x1a, 0x13, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, - 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x41, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x2a, 0x39, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x64, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x70, - 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, - 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x69, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x41, - 0x70, 0x70, 0x12, 0x0f, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, - 0x52, 0x65, 0x71, 0x1a, 0x0a, 0x2e, 0x70, 0x62, 0x61, 0x70, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x22, - 0x42, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3c, 0x12, 0x3a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x65, 0x74, 0x2f, 0x61, 0x70, 0x70, 0x2f, - 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, - 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, - 0x69, 0x64, 0x7d, 0x12, 0x71, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x42, 0x79, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, - 0x70, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0a, 0x2e, 0x70, 0x62, 0x61, - 0x70, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x12, 0x36, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, - 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, - 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x2f, 0x7b, 0x61, 0x70, 0x70, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x63, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, - 0x70, 0x73, 0x52, 0x65, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, - 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, - 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x12, 0x7c, 0x0a, 0x13, 0x4c, - 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x42, 0x79, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, - 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, - 0x70, 0x73, 0x42, 0x79, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, - 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6c, 0x69, 0x73, - 0x74, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, - 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xa3, 0x01, 0x0a, 0x10, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x19, - 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x73, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, - 0x6d, 0x52, 0x65, 0x73, 0x70, 0x22, 0x58, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x52, 0x22, 0x4d, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x2f, 0x61, 0x70, 0x70, - 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, - 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, - 0x9e, 0x01, 0x0a, 0x16, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x63, + 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x69, 0x0a, 0x06, + 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x12, 0x0f, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, + 0x74, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x0a, 0x2e, 0x70, 0x62, 0x61, 0x70, 0x70, 0x2e, + 0x41, 0x70, 0x70, 0x22, 0x42, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3c, 0x12, 0x3a, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x65, 0x74, 0x2f, + 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, + 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, + 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x71, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x70, + 0x70, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, + 0x65, 0x74, 0x41, 0x70, 0x70, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0a, + 0x2e, 0x70, 0x62, 0x61, 0x70, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x38, 0x12, 0x36, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, + 0x61, 0x70, 0x70, 0x73, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x2f, + 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x69, 0x0a, 0x08, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x63, 0x73, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x36, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x22, 0x2b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x61, + 0x70, 0x70, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, + 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x63, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, + 0x73, 0x52, 0x65, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, + 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, + 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x12, 0x7c, 0x0a, 0x13, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x42, 0x79, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x74, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, + 0x73, 0x42, 0x79, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, + 0x12, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6c, 0x69, 0x73, 0x74, + 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, + 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xa3, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x19, 0x2e, + 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x58, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x52, 0x22, 0x4d, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x2f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x2f, 0x61, 0x70, 0x70, 0x5f, + 0x69, 0x64, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, + 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x9e, + 0x01, 0x0a, 0x16, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x63, 0x73, + 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x70, 0x62, - 0x63, 0x73, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x41, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x1a, 0x36, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, + 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x41, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x3b, 0x1a, 0x36, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, + 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x3a, 0x01, 0x2a, 0x12, + 0xb7, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x49, 0x74, 0x65, 0x6d, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, + 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x22, 0x6c, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x66, 0x1a, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, + 0x65, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, + 0x64, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x61, + 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, + 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0xb4, 0x01, 0x0a, 0x10, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x19, + 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x73, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, + 0x6d, 0x52, 0x65, 0x73, 0x70, 0x22, 0x69, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x63, 0x2a, 0x61, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, + 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x69, 0x64, 0x7d, + 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, + 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, + 0x12, 0x91, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, + 0x65, 0x6d, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x63, + 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x4f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x49, 0x12, 0x47, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, + 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x7b, 0x61, + 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, + 0x65, 0x6d, 0x73, 0x2f, 0x7b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, + 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x86, 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, + 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x3e, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x12, 0x36, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x3a, 0x01, 0x2a, - 0x12, 0xb7, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, - 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x22, 0x6c, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x66, 0x1a, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, - 0x74, 0x65, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, - 0x69, 0x64, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, - 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, - 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0xb4, 0x01, 0x0a, 0x10, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, - 0x19, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x63, - 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, - 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x22, 0x69, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x63, 0x2a, 0x61, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x64, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, - 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x2f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x69, 0x64, + 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x8f, 0x01, + 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x22, 0x30, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, 0x62, 0x69, 0x7a, + 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, + 0xb2, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x63, 0x73, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x70, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x6a, 0x22, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, + 0x2f, 0x7b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, - 0x7d, 0x12, 0x91, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, - 0x74, 0x65, 0x6d, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x62, - 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, - 0x52, 0x65, 0x73, 0x70, 0x22, 0x4f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x49, 0x12, 0x47, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, - 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x7b, - 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, - 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x7b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, - 0x6d, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x86, 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x63, 0x73, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, - 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x3e, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x12, 0x36, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, - 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, - 0x7d, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x8f, - 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, - 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x22, 0x30, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2f, 0x62, 0x69, - 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, - 0x12, 0xb2, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x63, - 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x70, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x6a, 0x22, 0x65, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, - 0x64, 0x2f, 0x7b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, - 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, - 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, - 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x8d, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, - 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x4e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x48, 0x22, 0x43, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6c, 0x69, - 0x73, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, - 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, - 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x8c, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x63, - 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, - 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x22, 0x41, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x1a, 0x36, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, - 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x7b, 0x61, 0x70, 0x70, - 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, - 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x80, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x17, - 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, - 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x12, - 0x36, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, - 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, - 0x73, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0xad, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, - 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x68, 0x22, - 0x63, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, - 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, - 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x61, 0x70, 0x70, - 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, - 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x88, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, - 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x22, 0x4c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x46, 0x22, 0x41, 0x2f, 0x61, + 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x8d, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x70, + 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x4e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x48, 0x22, 0x43, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6c, 0x69, 0x73, - 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, - 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, - 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x3a, - 0x01, 0x2a, 0x12, 0x92, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, - 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x50, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4a, 0x22, 0x45, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x72, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x61, 0x70, 0x70, - 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, - 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x79, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, - 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, - 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, - 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x73, 0x12, 0xba, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x20, - 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, - 0x1a, 0x21, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x5a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x54, 0x22, 0x4f, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6c, 0x69, 0x73, 0x74, - 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, - 0x69, 0x74, 0x65, 0x6d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x2f, - 0x7b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, + 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, + 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, + 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0xad, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x70, + 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x68, 0x22, 0x63, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, + 0x2f, 0x7b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, + 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, + 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, + 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x88, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x73, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x63, + 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x4c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x46, 0x22, 0x41, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2f, 0x61, 0x70, 0x70, + 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, - 0x65, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x13, 0x2e, - 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, - 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, - 0x22, 0x21, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, - 0x6f, 0x6b, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x6c, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x63, 0x73, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x2a, 0x2b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, - 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2f, 0x7b, 0x68, 0x6f, 0x6f, 0x6b, - 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x5f, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, - 0x73, 0x12, 0x12, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, - 0x6b, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x23, 0x12, 0x21, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, - 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x6c, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, - 0x6b, 0x54, 0x61, 0x67, 0x73, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x70, - 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x54, 0x61, 0x67, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, - 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x74, - 0x61, 0x67, 0x73, 0x12, 0x63, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x10, - 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, - 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x61, 0x70, + 0x92, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x63, 0x73, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x50, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4a, 0x22, 0x45, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, + 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, + 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x79, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x73, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x70, 0x62, + 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, - 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2f, 0x7b, - 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x92, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x1a, - 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x63, - 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x22, - 0x39, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, - 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, 0x6f, - 0x6b, 0x73, 0x2f, 0x7b, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, 0x6f, - 0x6b, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x89, 0x01, - 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, - 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x70, 0x62, - 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x41, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x12, 0x39, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, - 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, - 0x73, 0x2f, 0x7b, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, - 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x9c, 0x01, 0x0a, 0x11, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, - 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, - 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x70, 0x62, - 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x4e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x48, - 0x2a, 0x46, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, - 0x6f, 0x6b, 0x73, 0x2f, 0x7b, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, - 0x6f, 0x6b, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x7b, 0x72, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xa7, 0x01, 0x0a, 0x12, 0x50, 0x75, 0x62, - 0x6c, 0x69, 0x73, 0x68, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, - 0x1b, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x48, 0x6f, - 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x70, - 0x62, 0x63, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x48, 0x6f, 0x6f, 0x6b, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x56, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x50, 0x1a, 0x4e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, + 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x7b, 0x61, + 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, + 0xba, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x20, 0x2e, 0x70, 0x62, + 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, + 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x5a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x54, 0x22, 0x4f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x2f, 0x72, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, + 0x6d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x72, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, + 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x73, 0x0a, 0x0a, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x63, + 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x1a, + 0x14, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, + 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x22, 0x2f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, + 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x2f, + 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x3a, 0x01, + 0x2a, 0x12, 0x7a, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x12, + 0x13, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, + 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x41, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x3b, 0x2a, 0x39, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, - 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2f, 0x7b, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x7d, 0x2f, - 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x7b, 0x72, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x73, 0x68, 0x12, 0x8c, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, - 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x11, - 0x2e, 0x70, 0x62, 0x68, 0x72, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x22, 0x4e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x48, 0x12, 0x46, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, - 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2f, 0x7b, 0x68, 0x6f, - 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x72, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x73, 0x2f, 0x7b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, - 0x7d, 0x12, 0x9f, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x51, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4b, 0x1a, 0x46, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, - 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2f, 0x7b, 0x68, 0x6f, 0x6f, - 0x6b, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x73, 0x2f, 0x7b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x7d, - 0x3a, 0x01, 0x2a, 0x12, 0xa7, 0x01, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x73, 0x12, 0x23, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, - 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x3e, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x12, 0x36, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, - 0x64, 0x7d, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2f, 0x7b, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, - 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x8a, 0x01, - 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, - 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x22, 0x2b, 0x2f, 0x61, 0x70, 0x69, + 0x61, 0x70, 0x70, 0x73, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, + 0x6f, 0x6b, 0x73, 0x2f, 0x7b, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x7d, 0x0a, + 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x13, 0x2e, 0x70, 0x62, + 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, + 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x6f, + 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x1a, 0x39, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, + 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, + 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2f, + 0x7b, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x75, 0x0a, 0x09, + 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x12, 0x2e, 0x70, 0x62, 0x63, 0x73, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, + 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x3f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x22, 0x34, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, - 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x9b, 0x01, 0x0a, 0x13, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, - 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, - 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x47, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x41, 0x2a, 0x3f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, + 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x7b, 0x61, 0x70, + 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, + 0x3a, 0x01, 0x2a, 0x12, 0x8a, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, + 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x63, 0x73, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, + 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, + 0x22, 0x2b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x3a, 0x01, 0x2a, + 0x12, 0x9b, 0x01, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, + 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x47, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x41, 0x2a, 0x3f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, + 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x9e, + 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, + 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x1a, 0x3f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, + 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, + 0x84, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, + 0x53, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, + 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x99, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x63, 0x73, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x54, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x4e, 0x22, 0x49, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, + 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x3a, + 0x01, 0x2a, 0x12, 0xa4, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x18, + 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x5f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x59, + 0x2a, 0x57, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x74, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, + 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xa7, 0x01, 0x0a, 0x0e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x70, + 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x62, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x5c, 0x1a, 0x57, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x9e, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, - 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1d, - 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x4a, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x1a, 0x3f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, - 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x84, 0x01, 0x0a, 0x12, 0x4c, 0x69, - 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x73, - 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, + 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x7d, + 0x3a, 0x01, 0x2a, 0x12, 0x93, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x33, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, - 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, - 0x12, 0x99, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, - 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x54, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4e, 0x22, 0x49, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x51, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4b, 0x12, 0x49, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, - 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0xa4, 0x01, 0x0a, - 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, - 0x17, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x5f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x59, 0x2a, 0x57, 0x2f, 0x61, 0x70, 0x69, + 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0xce, 0x01, 0x0a, 0x15, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x6e, 0x22, 0x69, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, + 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0xc8, 0x01, 0x0a, 0x14, 0x4c, + 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x71, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x6b, 0x12, 0x69, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, - 0x69, 0x64, 0x7d, 0x12, 0xa7, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, - 0x18, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x62, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x5c, 0x1a, 0x57, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x7b, - 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, - 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x93, 0x01, - 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, - 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x51, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4b, 0x12, 0x49, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, - 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x73, 0x12, 0xce, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x1e, 0x2e, - 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, - 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x74, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x6e, 0x22, 0x69, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, - 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, - 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x73, 0x3a, 0x01, 0x2a, 0x12, 0xc8, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x1d, 0x2e, - 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x70, - 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x71, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x6b, 0x12, 0x69, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, - 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, - 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, - 0xe3, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x63, 0x73, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x63, 0x73, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x88, 0x01, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x81, 0x01, 0x2a, 0x7f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, - 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, - 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, - 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x69, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x63, - 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, - 0x70, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x22, 0x22, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0xe3, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, + 0x1e, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, + 0x1f, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x88, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x81, 0x01, 0x2a, 0x7f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, + 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, + 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, + 0x69, 0x64, 0x7d, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x7b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, + 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x69, 0x0a, 0x0b, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x63, + 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, + 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x22, + 0x22, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, + 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x71, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x62, + 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x2a, 0x2d, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, + 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x7b, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x74, 0x0a, 0x0b, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x15, + 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x1a, 0x2d, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, + 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x73, 0x2f, 0x7b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, + 0x6c, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, + 0x12, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, - 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x3a, 0x01, 0x2a, - 0x12, 0x71, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, - 0x14, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x35, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x2f, 0x2a, 0x2d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, - 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x7b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, - 0x69, 0x64, 0x7d, 0x12, 0x74, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x1a, 0x2d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, - 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x7b, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x6c, 0x0a, 0x0d, 0x4c, 0x69, 0x73, - 0x74, 0x41, 0x6c, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x63, - 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, - 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, - 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x2a, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, - 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x7a, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x41, - 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, - 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x32, 0x12, 0x30, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, - 0x70, 0x70, 0x73, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x73, 0x12, 0x9d, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x12, 0x1e, 0x2e, - 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, - 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x43, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3d, 0x12, 0x3b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, - 0x69, 0x64, 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x7b, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x5f, 0x61, - 0x70, 0x70, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x07, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, - 0x10, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, - 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, - 0x52, 0x65, 0x73, 0x70, 0x22, 0x71, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x6b, 0x22, 0x66, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x2f, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x73, 0x68, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2f, 0x72, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x61, 0x70, 0x70, - 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, - 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x90, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x22, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x6e, 0x64, 0x50, - 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x63, 0x73, - 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x22, 0x3c, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x36, 0x22, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, - 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x3a, 0x01, 0x2a, 0x12, 0x81, 0x01, 0x0a, 0x11, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, - 0x12, 0x19, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x62, - 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x22, - 0x2a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, - 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, - 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x7a, - 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, - 0x73, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x70, 0x62, - 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, - 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x12, 0x2a, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, - 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, - 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x7e, 0x0a, 0x10, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x1a, - 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x63, - 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x2a, - 0x29, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, - 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, - 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x81, 0x01, 0x0a, 0x10, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, - 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x70, 0x62, - 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, - 0x1a, 0x29, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, - 0x2f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x3a, 0x01, 0x2a, 0x12, 0x9f, - 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, - 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, - 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x48, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x42, 0x12, 0x40, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, - 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, - 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2f, 0x7b, 0x63, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, - 0x12, 0xa4, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x63, - 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x63, - 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x4a, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x44, 0x1a, 0x3f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, - 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2f, 0x7b, - 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x73, - 0x63, 0x6f, 0x70, 0x65, 0x3a, 0x01, 0x2a, 0x42, 0x29, 0x5a, 0x27, 0x62, 0x73, 0x63, 0x70, 0x2e, - 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3b, 0x70, 0x62, - 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x7a, 0x0a, + 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x16, + 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, + 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, 0x62, 0x69, 0x7a, + 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, + 0x64, 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x9d, 0x01, 0x0a, 0x15, 0x4c, 0x69, + 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, + 0x70, 0x70, 0x73, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, + 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3d, 0x12, 0x3b, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, + 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, + 0x2f, 0x7b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x70, 0x70, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x07, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x22, 0x71, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x6b, 0x22, 0x66, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, + 0x67, 0x79, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x73, 0x68, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x69, + 0x64, 0x2f, 0x7b, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, + 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x90, 0x01, + 0x0a, 0x19, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x41, 0x6e, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x22, 0x2e, 0x70, 0x62, + 0x63, 0x73, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x1a, + 0x11, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x3c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x22, 0x31, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x2f, 0x7b, + 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x70, 0x70, 0x73, 0x2f, 0x7b, 0x61, 0x70, + 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x3a, 0x01, 0x2a, + 0x12, 0x81, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, + 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x22, 0x35, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x22, 0x2a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, + 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x7a, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, + 0x71, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x32, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x2c, 0x12, 0x2a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, + 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, + 0x12, 0x7e, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x61, 0x6c, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, + 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x31, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x2a, 0x29, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, + 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x12, 0x81, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, + 0x71, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x34, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x1a, 0x29, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, + 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x3a, 0x01, 0x2a, 0x12, 0x9f, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x1d, 0x2e, + 0x70, 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x70, + 0x62, 0x63, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x48, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x42, 0x12, 0x40, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x62, 0x69, 0x7a, + 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2f, + 0x7b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, + 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0xa4, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, + 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, + 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x63, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x1a, 0x3f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, + 0x2f, 0x7b, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x61, 0x6c, 0x2f, 0x7b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x3a, 0x01, 0x2a, 0x42, 0x29, 0x5a, + 0x27, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2d, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x3b, 0x70, 0x62, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -9473,7 +7975,7 @@ func file_config_service_proto_rawDescGZIP() []byte { return file_config_service_proto_rawDescData } -var file_config_service_proto_msgTypes = make([]protoimpl.MessageInfo, 127) +var file_config_service_proto_msgTypes = make([]protoimpl.MessageInfo, 105) var file_config_service_proto_goTypes = []interface{}{ (*UpdateCredentialScopeReq)(nil), // 0: pbcs.UpdateCredentialScopeReq (*UpdateCredentialScopeResp)(nil), // 1: pbcs.UpdateCredentialScopeResp @@ -9497,300 +7999,250 @@ var file_config_service_proto_goTypes = []interface{}{ (*DeleteAppResp)(nil), // 19: pbcs.DeleteAppResp (*GetAppReq)(nil), // 20: pbcs.GetAppReq (*GetAppByNameReq)(nil), // 21: pbcs.GetAppByNameReq - (*ListAppsRestReq)(nil), // 22: pbcs.ListAppsRestReq - (*ListAppsBySpaceRestReq)(nil), // 23: pbcs.ListAppsBySpaceRestReq - (*ListAppsResp)(nil), // 24: pbcs.ListAppsResp - (*CreateConfigItemReq)(nil), // 25: pbcs.CreateConfigItemReq - (*BatchUpsertConfigItemsReq)(nil), // 26: pbcs.BatchUpsertConfigItemsReq - (*BatchUpsertConfigItemsResp)(nil), // 27: pbcs.BatchUpsertConfigItemsResp - (*CreateConfigItemResp)(nil), // 28: pbcs.CreateConfigItemResp - (*UpdateConfigItemReq)(nil), // 29: pbcs.UpdateConfigItemReq - (*UpdateConfigItemResp)(nil), // 30: pbcs.UpdateConfigItemResp - (*DeleteConfigItemReq)(nil), // 31: pbcs.DeleteConfigItemReq - (*DeleteConfigItemResp)(nil), // 32: pbcs.DeleteConfigItemResp - (*GetConfigItemReq)(nil), // 33: pbcs.GetConfigItemReq - (*GetConfigItemResp)(nil), // 34: pbcs.GetConfigItemResp - (*ListConfigItemsReq)(nil), // 35: pbcs.ListConfigItemsReq - (*ListConfigItemsResp)(nil), // 36: pbcs.ListConfigItemsResp - (*ListConfigItemCountReq)(nil), // 37: pbcs.ListConfigItemCountReq - (*ListConfigItemCountResp)(nil), // 38: pbcs.ListConfigItemCountResp - (*CreateContentReq)(nil), // 39: pbcs.CreateContentReq - (*CreateContentResp)(nil), // 40: pbcs.CreateContentResp - (*ListContentsReq)(nil), // 41: pbcs.ListContentsReq - (*ListContentsResp)(nil), // 42: pbcs.ListContentsResp - (*CreateConfigHookReq)(nil), // 43: pbcs.CreateConfigHookReq - (*CreateConfigHookResp)(nil), // 44: pbcs.CreateConfigHookResp - (*UpdateConfigHookReq)(nil), // 45: pbcs.UpdateConfigHookReq - (*UpdateConfigHookResp)(nil), // 46: pbcs.UpdateConfigHookResp - (*GetConfigHookReq)(nil), // 47: pbcs.GetConfigHookReq - (*GetConfigHookResp)(nil), // 48: pbcs.GetConfigHookResp - (*CreateCommitReq)(nil), // 49: pbcs.CreateCommitReq - (*CreateCommitResp)(nil), // 50: pbcs.CreateCommitResp - (*ListCommitsReq)(nil), // 51: pbcs.ListCommitsReq - (*ListCommitsResp)(nil), // 52: pbcs.ListCommitsResp - (*CreateReleaseReq)(nil), // 53: pbcs.CreateReleaseReq - (*CreateReleaseResp)(nil), // 54: pbcs.CreateReleaseResp - (*ListReleasesReq)(nil), // 55: pbcs.ListReleasesReq - (*ListReleasesResp)(nil), // 56: pbcs.ListReleasesResp - (*ListReleasedConfigItemsReq)(nil), // 57: pbcs.ListReleasedConfigItemsReq - (*ListReleasedConfigItemsResp)(nil), // 58: pbcs.ListReleasedConfigItemsResp - (*CreateHookReq)(nil), // 59: pbcs.CreateHookReq - (*CreateHookResp)(nil), // 60: pbcs.CreateHookResp - (*DeleteHookReq)(nil), // 61: pbcs.DeleteHookReq - (*DeleteHookResp)(nil), // 62: pbcs.DeleteHookResp - (*ListHooksReq)(nil), // 63: pbcs.ListHooksReq - (*ListHooksResp)(nil), // 64: pbcs.ListHooksResp - (*ListHookTagsReq)(nil), // 65: pbcs.ListHookTagsReq - (*ListHookTagsResp)(nil), // 66: pbcs.ListHookTagsResp - (*CreateHookReleaseReq)(nil), // 67: pbcs.CreateHookReleaseReq - (*CreateHookReleaseResp)(nil), // 68: pbcs.CreateHookReleaseResp - (*ListHookReleaseReq)(nil), // 69: pbcs.ListHookReleaseReq - (*ListHookReleaseResp)(nil), // 70: pbcs.ListHookReleaseResp - (*DeleteHookReleaseReq)(nil), // 71: pbcs.DeleteHookReleaseReq - (*DeleteHookReleaseResp)(nil), // 72: pbcs.DeleteHookReleaseResp - (*PublishHookReleaseReq)(nil), // 73: pbcs.PublishHookReleaseReq - (*PublishHookReleaseResp)(nil), // 74: pbcs.PublishHookReleaseResp - (*GetHookReq)(nil), // 75: pbcs.GetHookReq - (*GetHookResp)(nil), // 76: pbcs.GetHookResp - (*GetHookInfoSpec)(nil), // 77: pbcs.GetHookInfoSpec - (*GetHookReleaseReq)(nil), // 78: pbcs.GetHookReleaseReq - (*UpdateHookReleaseReq)(nil), // 79: pbcs.UpdateHookReleaseReq - (*UpdateHookReleaseResp)(nil), // 80: pbcs.UpdateHookReleaseResp - (*ListHookReleasesReferencesReq)(nil), // 81: pbcs.ListHookReleasesReferencesReq - (*ListHookReleasesReferencesResp)(nil), // 82: pbcs.ListHookReleasesReferencesResp - (*CreateTemplateSpaceReq)(nil), // 83: pbcs.CreateTemplateSpaceReq - (*CreateTemplateSpaceResp)(nil), // 84: pbcs.CreateTemplateSpaceResp - (*UpdateTemplateSpaceReq)(nil), // 85: pbcs.UpdateTemplateSpaceReq - (*UpdateTemplateSpaceResp)(nil), // 86: pbcs.UpdateTemplateSpaceResp - (*DeleteTemplateSpaceReq)(nil), // 87: pbcs.DeleteTemplateSpaceReq - (*DeleteTemplateSpaceResp)(nil), // 88: pbcs.DeleteTemplateSpaceResp - (*ListTemplateSpacesReq)(nil), // 89: pbcs.ListTemplateSpacesReq - (*ListTemplateSpacesResp)(nil), // 90: pbcs.ListTemplateSpacesResp - (*CreateTemplateReq)(nil), // 91: pbcs.CreateTemplateReq - (*CreateTemplateResp)(nil), // 92: pbcs.CreateTemplateResp - (*UpdateTemplateReq)(nil), // 93: pbcs.UpdateTemplateReq - (*UpdateTemplateResp)(nil), // 94: pbcs.UpdateTemplateResp - (*DeleteTemplateReq)(nil), // 95: pbcs.DeleteTemplateReq - (*DeleteTemplateResp)(nil), // 96: pbcs.DeleteTemplateResp - (*ListTemplatesReq)(nil), // 97: pbcs.ListTemplatesReq - (*ListTemplatesResp)(nil), // 98: pbcs.ListTemplatesResp - (*CreateTemplateReleaseReq)(nil), // 99: pbcs.CreateTemplateReleaseReq - (*CreateTemplateReleaseResp)(nil), // 100: pbcs.CreateTemplateReleaseResp - (*ListTemplateReleasesReq)(nil), // 101: pbcs.ListTemplateReleasesReq - (*ListTemplateReleasesResp)(nil), // 102: pbcs.ListTemplateReleasesResp - (*DeleteTemplateReleaseReq)(nil), // 103: pbcs.DeleteTemplateReleaseReq - (*DeleteTemplateReleaseResp)(nil), // 104: pbcs.DeleteTemplateReleaseResp - (*CreateGroupReq)(nil), // 105: pbcs.CreateGroupReq - (*CreateGroupResp)(nil), // 106: pbcs.CreateGroupResp - (*UpdateGroupReq)(nil), // 107: pbcs.UpdateGroupReq - (*UpdateGroupResp)(nil), // 108: pbcs.UpdateGroupResp - (*DeleteGroupReq)(nil), // 109: pbcs.DeleteGroupReq - (*DeleteGroupResp)(nil), // 110: pbcs.DeleteGroupResp - (*ListAllGroupsReq)(nil), // 111: pbcs.ListAllGroupsReq - (*ListAllGroupsResp)(nil), // 112: pbcs.ListAllGroupsResp - (*ListAppGroupsReq)(nil), // 113: pbcs.ListAppGroupsReq - (*ListAppGroupsResp)(nil), // 114: pbcs.ListAppGroupsResp - (*ListGroupReleasedAppsReq)(nil), // 115: pbcs.ListGroupReleasedAppsReq - (*ListGroupReleasedAppsResp)(nil), // 116: pbcs.ListGroupReleasedAppsResp - (*PublishReq)(nil), // 117: pbcs.PublishReq - (*GenerateReleaseAndPublishReq)(nil), // 118: pbcs.GenerateReleaseAndPublishReq - (*GenerateReleaseAndPublishResp)(nil), // 119: pbcs.GenerateReleaseAndPublishResp - (*PublishResp)(nil), // 120: pbcs.PublishResp - (*BatchUpsertConfigItemsReq_ConfigItem)(nil), // 121: pbcs.BatchUpsertConfigItemsReq.ConfigItem - (*GetHookInfoSpec_Releases)(nil), // 122: pbcs.GetHookInfoSpec.Releases - (*ListAllGroupsResp_ListAllGroupsData)(nil), // 123: pbcs.ListAllGroupsResp.ListAllGroupsData - (*ListAllGroupsResp_ListAllGroupsData_BindApp)(nil), // 124: pbcs.ListAllGroupsResp.ListAllGroupsData.BindApp - (*ListAppGroupsResp_ListAppGroupsData)(nil), // 125: pbcs.ListAppGroupsResp.ListAppGroupsData - (*ListGroupReleasedAppsResp_ListGroupReleasedAppsData)(nil), // 126: pbcs.ListGroupReleasedAppsResp.ListGroupReleasedAppsData - (*credential_scope.UpdateScopeSpec)(nil), // 127: pbcrs.UpdateScopeSpec - (*credential_scope.CredentialScopeList)(nil), // 128: pbcrs.CredentialScopeList - (*credential.CredentialList)(nil), // 129: pbcredential.CredentialList - (*app.App)(nil), // 130: pbapp.App - (*config_item.ConfigItem)(nil), // 131: pbci.ConfigItem - (*content.ContentSpec)(nil), // 132: pbcontent.ContentSpec - (*config_item.ListConfigItemCounts)(nil), // 133: pbci.ListConfigItemCounts - (*structpb.Struct)(nil), // 134: google.protobuf.Struct - (*base.BasePage)(nil), // 135: pbbase.BasePage - (*content.Content)(nil), // 136: pbcontent.Content - (*config_hook.ConfigHook)(nil), // 137: pbch.ConfigHook - (*commit.Commit)(nil), // 138: pbcommit.Commit - (*release.Release)(nil), // 139: pbrelease.Release - (*released_ci.ReleasedConfigItem)(nil), // 140: pbrci.ReleasedConfigItem - (*hook.Hook)(nil), // 141: pbhook.Hook - (*hook.CountHookTags)(nil), // 142: pbhook.CountHookTags - (*hook_release.HookRelease)(nil), // 143: pbhr.HookRelease - (*hook.HookAttachment)(nil), // 144: pbhook.HookAttachment - (*base.Revision)(nil), // 145: pbbase.Revision - (*hook_release.ListHookReleasesReferencesDetails)(nil), // 146: pbhr.ListHookReleasesReferencesDetails - (*template_space.TemplateSpace)(nil), // 147: pbts.TemplateSpace - (*template.Template)(nil), // 148: pbtemplate.Template - (*template_release.TemplateRelease)(nil), // 149: pbtr.TemplateRelease + (*ListAppsReq)(nil), // 22: pbcs.ListAppsReq + (*ListAppsRestReq)(nil), // 23: pbcs.ListAppsRestReq + (*ListAppsBySpaceRestReq)(nil), // 24: pbcs.ListAppsBySpaceRestReq + (*ListAppsResp)(nil), // 25: pbcs.ListAppsResp + (*CreateConfigItemReq)(nil), // 26: pbcs.CreateConfigItemReq + (*BatchUpsertConfigItemsReq)(nil), // 27: pbcs.BatchUpsertConfigItemsReq + (*BatchUpsertConfigItemsResp)(nil), // 28: pbcs.BatchUpsertConfigItemsResp + (*CreateConfigItemResp)(nil), // 29: pbcs.CreateConfigItemResp + (*UpdateConfigItemReq)(nil), // 30: pbcs.UpdateConfigItemReq + (*UpdateConfigItemResp)(nil), // 31: pbcs.UpdateConfigItemResp + (*DeleteConfigItemReq)(nil), // 32: pbcs.DeleteConfigItemReq + (*DeleteConfigItemResp)(nil), // 33: pbcs.DeleteConfigItemResp + (*GetConfigItemReq)(nil), // 34: pbcs.GetConfigItemReq + (*GetConfigItemResp)(nil), // 35: pbcs.GetConfigItemResp + (*ListConfigItemsReq)(nil), // 36: pbcs.ListConfigItemsReq + (*ListConfigItemsResp)(nil), // 37: pbcs.ListConfigItemsResp + (*ListConfigItemCountReq)(nil), // 38: pbcs.ListConfigItemCountReq + (*ListConfigItemCountResp)(nil), // 39: pbcs.ListConfigItemCountResp + (*CreateContentReq)(nil), // 40: pbcs.CreateContentReq + (*CreateContentResp)(nil), // 41: pbcs.CreateContentResp + (*ListContentsReq)(nil), // 42: pbcs.ListContentsReq + (*ListContentsResp)(nil), // 43: pbcs.ListContentsResp + (*CreateCommitReq)(nil), // 44: pbcs.CreateCommitReq + (*CreateCommitResp)(nil), // 45: pbcs.CreateCommitResp + (*ListCommitsReq)(nil), // 46: pbcs.ListCommitsReq + (*ListCommitsResp)(nil), // 47: pbcs.ListCommitsResp + (*CreateReleaseReq)(nil), // 48: pbcs.CreateReleaseReq + (*CreateReleaseResp)(nil), // 49: pbcs.CreateReleaseResp + (*ListReleasesReq)(nil), // 50: pbcs.ListReleasesReq + (*ListReleasesResp)(nil), // 51: pbcs.ListReleasesResp + (*ListReleasedConfigItemsReq)(nil), // 52: pbcs.ListReleasedConfigItemsReq + (*ListReleasedConfigItemsResp)(nil), // 53: pbcs.ListReleasedConfigItemsResp + (*CreateHookReq)(nil), // 54: pbcs.CreateHookReq + (*CreateHookResp)(nil), // 55: pbcs.CreateHookResp + (*UpdateHookReq)(nil), // 56: pbcs.UpdateHookReq + (*UpdateHookResp)(nil), // 57: pbcs.UpdateHookResp + (*DeleteHookReq)(nil), // 58: pbcs.DeleteHookReq + (*DeleteHookResp)(nil), // 59: pbcs.DeleteHookResp + (*ListHooksReq)(nil), // 60: pbcs.ListHooksReq + (*ListHooksResp)(nil), // 61: pbcs.ListHooksResp + (*CreateTemplateSpaceReq)(nil), // 62: pbcs.CreateTemplateSpaceReq + (*CreateTemplateSpaceResp)(nil), // 63: pbcs.CreateTemplateSpaceResp + (*UpdateTemplateSpaceReq)(nil), // 64: pbcs.UpdateTemplateSpaceReq + (*UpdateTemplateSpaceResp)(nil), // 65: pbcs.UpdateTemplateSpaceResp + (*DeleteTemplateSpaceReq)(nil), // 66: pbcs.DeleteTemplateSpaceReq + (*DeleteTemplateSpaceResp)(nil), // 67: pbcs.DeleteTemplateSpaceResp + (*ListTemplateSpacesReq)(nil), // 68: pbcs.ListTemplateSpacesReq + (*ListTemplateSpacesResp)(nil), // 69: pbcs.ListTemplateSpacesResp + (*CreateTemplateReq)(nil), // 70: pbcs.CreateTemplateReq + (*CreateTemplateResp)(nil), // 71: pbcs.CreateTemplateResp + (*UpdateTemplateReq)(nil), // 72: pbcs.UpdateTemplateReq + (*UpdateTemplateResp)(nil), // 73: pbcs.UpdateTemplateResp + (*DeleteTemplateReq)(nil), // 74: pbcs.DeleteTemplateReq + (*DeleteTemplateResp)(nil), // 75: pbcs.DeleteTemplateResp + (*ListTemplatesReq)(nil), // 76: pbcs.ListTemplatesReq + (*ListTemplatesResp)(nil), // 77: pbcs.ListTemplatesResp + (*CreateTemplateReleaseReq)(nil), // 78: pbcs.CreateTemplateReleaseReq + (*CreateTemplateReleaseResp)(nil), // 79: pbcs.CreateTemplateReleaseResp + (*ListTemplateReleasesReq)(nil), // 80: pbcs.ListTemplateReleasesReq + (*ListTemplateReleasesResp)(nil), // 81: pbcs.ListTemplateReleasesResp + (*DeleteTemplateReleaseReq)(nil), // 82: pbcs.DeleteTemplateReleaseReq + (*DeleteTemplateReleaseResp)(nil), // 83: pbcs.DeleteTemplateReleaseResp + (*CreateGroupReq)(nil), // 84: pbcs.CreateGroupReq + (*CreateGroupResp)(nil), // 85: pbcs.CreateGroupResp + (*UpdateGroupReq)(nil), // 86: pbcs.UpdateGroupReq + (*UpdateGroupResp)(nil), // 87: pbcs.UpdateGroupResp + (*DeleteGroupReq)(nil), // 88: pbcs.DeleteGroupReq + (*DeleteGroupResp)(nil), // 89: pbcs.DeleteGroupResp + (*ListAllGroupsReq)(nil), // 90: pbcs.ListAllGroupsReq + (*ListAllGroupsResp)(nil), // 91: pbcs.ListAllGroupsResp + (*ListAppGroupsReq)(nil), // 92: pbcs.ListAppGroupsReq + (*ListAppGroupsResp)(nil), // 93: pbcs.ListAppGroupsResp + (*ListGroupReleasedAppsReq)(nil), // 94: pbcs.ListGroupReleasedAppsReq + (*ListGroupReleasedAppsResp)(nil), // 95: pbcs.ListGroupReleasedAppsResp + (*PublishReq)(nil), // 96: pbcs.PublishReq + (*GenerateReleaseAndPublishReq)(nil), // 97: pbcs.GenerateReleaseAndPublishReq + (*GenerateReleaseAndPublishResp)(nil), // 98: pbcs.GenerateReleaseAndPublishResp + (*PublishResp)(nil), // 99: pbcs.PublishResp + (*BatchUpsertConfigItemsReq_ConfigItem)(nil), // 100: pbcs.BatchUpsertConfigItemsReq.ConfigItem + (*ListAllGroupsResp_ListAllGroupsData)(nil), // 101: pbcs.ListAllGroupsResp.ListAllGroupsData + (*ListAllGroupsResp_ListAllGroupsData_BindApp)(nil), // 102: pbcs.ListAllGroupsResp.ListAllGroupsData.BindApp + (*ListAppGroupsResp_ListAppGroupsData)(nil), // 103: pbcs.ListAppGroupsResp.ListAppGroupsData + (*ListGroupReleasedAppsResp_ListGroupReleasedAppsData)(nil), // 104: pbcs.ListGroupReleasedAppsResp.ListGroupReleasedAppsData + (*credential_scope.UpdateScopeSpec)(nil), // 105: pbcrs.UpdateScopeSpec + (*credential_scope.CredentialScopeList)(nil), // 106: pbcrs.CredentialScopeList + (*credential.CredentialList)(nil), // 107: pbcredential.CredentialList + (*structpb.Struct)(nil), // 108: google.protobuf.Struct + (*base.BasePage)(nil), // 109: pbbase.BasePage + (*app.App)(nil), // 110: pbapp.App + (*config_item.ConfigItem)(nil), // 111: pbci.ConfigItem + (*content.ContentSpec)(nil), // 112: pbcontent.ContentSpec + (*config_item.ListConfigItemCounts)(nil), // 113: pbci.ListConfigItemCounts + (*content.Content)(nil), // 114: pbcontent.Content + (*commit.Commit)(nil), // 115: pbcommit.Commit + (*release.Release)(nil), // 116: pbrelease.Release + (*released_ci.ReleasedConfigItem)(nil), // 117: pbrci.ReleasedConfigItem + (*hook.Hook)(nil), // 118: pbhook.Hook + (*template_space.TemplateSpace)(nil), // 119: pbts.TemplateSpace + (*template.Template)(nil), // 120: pbtemplate.Template + (*template_release.TemplateRelease)(nil), // 121: pbtr.TemplateRelease } var file_config_service_proto_depIdxs = []int32{ - 127, // 0: pbcs.UpdateCredentialScopeReq.alter_scope:type_name -> pbcrs.UpdateScopeSpec - 128, // 1: pbcs.ListCredentialScopesResp.details:type_name -> pbcrs.CredentialScopeList - 129, // 2: pbcs.ListCredentialsResp.details:type_name -> pbcredential.CredentialList - 130, // 3: pbcs.ListAppsResp.details:type_name -> pbapp.App - 121, // 4: pbcs.BatchUpsertConfigItemsReq.items:type_name -> pbcs.BatchUpsertConfigItemsReq.ConfigItem - 131, // 5: pbcs.GetConfigItemResp.config_item:type_name -> pbci.ConfigItem - 132, // 6: pbcs.GetConfigItemResp.content:type_name -> pbcontent.ContentSpec - 131, // 7: pbcs.ListConfigItemsResp.details:type_name -> pbci.ConfigItem - 133, // 8: pbcs.ListConfigItemCountResp.details:type_name -> pbci.ListConfigItemCounts - 134, // 9: pbcs.ListContentsReq.filter:type_name -> google.protobuf.Struct - 135, // 10: pbcs.ListContentsReq.page:type_name -> pbbase.BasePage - 136, // 11: pbcs.ListContentsResp.details:type_name -> pbcontent.Content - 137, // 12: pbcs.GetConfigHookResp.config_hook:type_name -> pbch.ConfigHook - 134, // 13: pbcs.ListCommitsReq.filter:type_name -> google.protobuf.Struct - 135, // 14: pbcs.ListCommitsReq.page:type_name -> pbbase.BasePage - 138, // 15: pbcs.ListCommitsResp.details:type_name -> pbcommit.Commit - 139, // 16: pbcs.ListReleasesResp.details:type_name -> pbrelease.Release - 135, // 17: pbcs.ListReleasedConfigItemsReq.page:type_name -> pbbase.BasePage - 140, // 18: pbcs.ListReleasedConfigItemsResp.details:type_name -> pbrci.ReleasedConfigItem - 141, // 19: pbcs.ListHooksResp.details:type_name -> pbhook.Hook - 142, // 20: pbcs.ListHookTagsResp.details:type_name -> pbhook.CountHookTags - 143, // 21: pbcs.ListHookReleaseResp.details:type_name -> pbhr.HookRelease - 77, // 22: pbcs.GetHookResp.spec:type_name -> pbcs.GetHookInfoSpec - 144, // 23: pbcs.GetHookResp.attachment:type_name -> pbhook.HookAttachment - 145, // 24: pbcs.GetHookResp.revision:type_name -> pbbase.Revision - 122, // 25: pbcs.GetHookInfoSpec.releases:type_name -> pbcs.GetHookInfoSpec.Releases - 146, // 26: pbcs.ListHookReleasesReferencesResp.details:type_name -> pbhr.ListHookReleasesReferencesDetails - 147, // 27: pbcs.ListTemplateSpacesResp.details:type_name -> pbts.TemplateSpace - 148, // 28: pbcs.ListTemplatesResp.details:type_name -> pbtemplate.Template - 149, // 29: pbcs.ListTemplateReleasesResp.details:type_name -> pbtr.TemplateRelease - 134, // 30: pbcs.CreateGroupReq.selector:type_name -> google.protobuf.Struct - 134, // 31: pbcs.UpdateGroupReq.selector:type_name -> google.protobuf.Struct - 123, // 32: pbcs.ListAllGroupsResp.details:type_name -> pbcs.ListAllGroupsResp.ListAllGroupsData - 125, // 33: pbcs.ListAppGroupsResp.details:type_name -> pbcs.ListAppGroupsResp.ListAppGroupsData - 126, // 34: pbcs.ListGroupReleasedAppsResp.details:type_name -> pbcs.ListGroupReleasedAppsResp.ListGroupReleasedAppsData - 124, // 35: pbcs.ListAllGroupsResp.ListAllGroupsData.bind_apps:type_name -> pbcs.ListAllGroupsResp.ListAllGroupsData.BindApp - 134, // 36: pbcs.ListAllGroupsResp.ListAllGroupsData.selector:type_name -> google.protobuf.Struct - 134, // 37: pbcs.ListAppGroupsResp.ListAppGroupsData.old_selector:type_name -> google.protobuf.Struct - 134, // 38: pbcs.ListAppGroupsResp.ListAppGroupsData.new_selector:type_name -> google.protobuf.Struct - 14, // 39: pbcs.Config.CreateApp:input_type -> pbcs.CreateAppReq - 16, // 40: pbcs.Config.UpdateApp:input_type -> pbcs.UpdateAppReq - 18, // 41: pbcs.Config.DeleteApp:input_type -> pbcs.DeleteAppReq - 20, // 42: pbcs.Config.GetApp:input_type -> pbcs.GetAppReq - 21, // 43: pbcs.Config.GetAppByName:input_type -> pbcs.GetAppByNameReq - 22, // 44: pbcs.Config.ListAppsRest:input_type -> pbcs.ListAppsRestReq - 23, // 45: pbcs.Config.ListAppsBySpaceRest:input_type -> pbcs.ListAppsBySpaceRestReq - 25, // 46: pbcs.Config.CreateConfigItem:input_type -> pbcs.CreateConfigItemReq - 26, // 47: pbcs.Config.BatchUpsertConfigItems:input_type -> pbcs.BatchUpsertConfigItemsReq - 29, // 48: pbcs.Config.UpdateConfigItem:input_type -> pbcs.UpdateConfigItemReq - 31, // 49: pbcs.Config.DeleteConfigItem:input_type -> pbcs.DeleteConfigItemReq - 33, // 50: pbcs.Config.GetConfigItem:input_type -> pbcs.GetConfigItemReq - 35, // 51: pbcs.Config.ListConfigItems:input_type -> pbcs.ListConfigItemsReq - 37, // 52: pbcs.Config.ListConfigItemCount:input_type -> pbcs.ListConfigItemCountReq - 39, // 53: pbcs.Config.CreateContent:input_type -> pbcs.CreateContentReq - 41, // 54: pbcs.Config.ListContents:input_type -> pbcs.ListContentsReq - 45, // 55: pbcs.Config.UpdateConfigHook:input_type -> pbcs.UpdateConfigHookReq - 47, // 56: pbcs.Config.GetConfigHook:input_type -> pbcs.GetConfigHookReq - 49, // 57: pbcs.Config.CreateCommit:input_type -> pbcs.CreateCommitReq - 51, // 58: pbcs.Config.ListCommits:input_type -> pbcs.ListCommitsReq - 53, // 59: pbcs.Config.CreateRelease:input_type -> pbcs.CreateReleaseReq - 55, // 60: pbcs.Config.ListReleases:input_type -> pbcs.ListReleasesReq - 57, // 61: pbcs.Config.ListReleasedConfigItems:input_type -> pbcs.ListReleasedConfigItemsReq - 59, // 62: pbcs.Config.CreateHook:input_type -> pbcs.CreateHookReq - 61, // 63: pbcs.Config.DeleteHook:input_type -> pbcs.DeleteHookReq - 63, // 64: pbcs.Config.ListHooks:input_type -> pbcs.ListHooksReq - 65, // 65: pbcs.Config.ListHookTags:input_type -> pbcs.ListHookTagsReq - 75, // 66: pbcs.Config.GetHook:input_type -> pbcs.GetHookReq - 67, // 67: pbcs.Config.CreateHookRelease:input_type -> pbcs.CreateHookReleaseReq - 69, // 68: pbcs.Config.ListHookRelease:input_type -> pbcs.ListHookReleaseReq - 71, // 69: pbcs.Config.DeleteHookRelease:input_type -> pbcs.DeleteHookReleaseReq - 73, // 70: pbcs.Config.PublishHookRelease:input_type -> pbcs.PublishHookReleaseReq - 78, // 71: pbcs.Config.GetHookRelease:input_type -> pbcs.GetHookReleaseReq - 79, // 72: pbcs.Config.UpdateHookRelease:input_type -> pbcs.UpdateHookReleaseReq - 81, // 73: pbcs.Config.ListHookReleasesReferences:input_type -> pbcs.ListHookReleasesReferencesReq - 83, // 74: pbcs.Config.CreateTemplateSpace:input_type -> pbcs.CreateTemplateSpaceReq - 87, // 75: pbcs.Config.DeleteTemplateSpace:input_type -> pbcs.DeleteTemplateSpaceReq - 85, // 76: pbcs.Config.UpdateTemplateSpace:input_type -> pbcs.UpdateTemplateSpaceReq - 89, // 77: pbcs.Config.ListTemplateSpaces:input_type -> pbcs.ListTemplateSpacesReq - 91, // 78: pbcs.Config.CreateTemplate:input_type -> pbcs.CreateTemplateReq - 95, // 79: pbcs.Config.DeleteTemplate:input_type -> pbcs.DeleteTemplateReq - 93, // 80: pbcs.Config.UpdateTemplate:input_type -> pbcs.UpdateTemplateReq - 97, // 81: pbcs.Config.ListTemplates:input_type -> pbcs.ListTemplatesReq - 99, // 82: pbcs.Config.CreateTemplateRelease:input_type -> pbcs.CreateTemplateReleaseReq - 101, // 83: pbcs.Config.ListTemplateReleases:input_type -> pbcs.ListTemplateReleasesReq - 103, // 84: pbcs.Config.DeleteTemplateRelease:input_type -> pbcs.DeleteTemplateReleaseReq - 105, // 85: pbcs.Config.CreateGroup:input_type -> pbcs.CreateGroupReq - 109, // 86: pbcs.Config.DeleteGroup:input_type -> pbcs.DeleteGroupReq - 107, // 87: pbcs.Config.UpdateGroup:input_type -> pbcs.UpdateGroupReq - 111, // 88: pbcs.Config.ListAllGroups:input_type -> pbcs.ListAllGroupsReq - 113, // 89: pbcs.Config.ListAppGroups:input_type -> pbcs.ListAppGroupsReq - 115, // 90: pbcs.Config.ListGroupReleasedApps:input_type -> pbcs.ListGroupReleasedAppsReq - 117, // 91: pbcs.Config.Publish:input_type -> pbcs.PublishReq - 118, // 92: pbcs.Config.GenerateReleaseAndPublish:input_type -> pbcs.GenerateReleaseAndPublishReq - 12, // 93: pbcs.Config.CreateCredentials:input_type -> pbcs.CreateCredentialReq - 10, // 94: pbcs.Config.ListCredentials:input_type -> pbcs.ListCredentialsReq - 6, // 95: pbcs.Config.DeleteCredential:input_type -> pbcs.DeleteCredentialsReq - 8, // 96: pbcs.Config.UpdateCredential:input_type -> pbcs.UpdateCredentialsReq - 2, // 97: pbcs.Config.ListCredentialScopes:input_type -> pbcs.ListCredentialScopesReq - 0, // 98: pbcs.Config.UpdateCredentialScope:input_type -> pbcs.UpdateCredentialScopeReq - 15, // 99: pbcs.Config.CreateApp:output_type -> pbcs.CreateAppResp - 17, // 100: pbcs.Config.UpdateApp:output_type -> pbcs.UpdateAppResp - 19, // 101: pbcs.Config.DeleteApp:output_type -> pbcs.DeleteAppResp - 130, // 102: pbcs.Config.GetApp:output_type -> pbapp.App - 130, // 103: pbcs.Config.GetAppByName:output_type -> pbapp.App - 24, // 104: pbcs.Config.ListAppsRest:output_type -> pbcs.ListAppsResp - 24, // 105: pbcs.Config.ListAppsBySpaceRest:output_type -> pbcs.ListAppsResp - 28, // 106: pbcs.Config.CreateConfigItem:output_type -> pbcs.CreateConfigItemResp - 27, // 107: pbcs.Config.BatchUpsertConfigItems:output_type -> pbcs.BatchUpsertConfigItemsResp - 30, // 108: pbcs.Config.UpdateConfigItem:output_type -> pbcs.UpdateConfigItemResp - 32, // 109: pbcs.Config.DeleteConfigItem:output_type -> pbcs.DeleteConfigItemResp - 34, // 110: pbcs.Config.GetConfigItem:output_type -> pbcs.GetConfigItemResp - 36, // 111: pbcs.Config.ListConfigItems:output_type -> pbcs.ListConfigItemsResp - 38, // 112: pbcs.Config.ListConfigItemCount:output_type -> pbcs.ListConfigItemCountResp - 40, // 113: pbcs.Config.CreateContent:output_type -> pbcs.CreateContentResp - 42, // 114: pbcs.Config.ListContents:output_type -> pbcs.ListContentsResp - 46, // 115: pbcs.Config.UpdateConfigHook:output_type -> pbcs.UpdateConfigHookResp - 48, // 116: pbcs.Config.GetConfigHook:output_type -> pbcs.GetConfigHookResp - 50, // 117: pbcs.Config.CreateCommit:output_type -> pbcs.CreateCommitResp - 52, // 118: pbcs.Config.ListCommits:output_type -> pbcs.ListCommitsResp - 54, // 119: pbcs.Config.CreateRelease:output_type -> pbcs.CreateReleaseResp - 56, // 120: pbcs.Config.ListReleases:output_type -> pbcs.ListReleasesResp - 58, // 121: pbcs.Config.ListReleasedConfigItems:output_type -> pbcs.ListReleasedConfigItemsResp - 60, // 122: pbcs.Config.CreateHook:output_type -> pbcs.CreateHookResp - 62, // 123: pbcs.Config.DeleteHook:output_type -> pbcs.DeleteHookResp - 64, // 124: pbcs.Config.ListHooks:output_type -> pbcs.ListHooksResp - 66, // 125: pbcs.Config.ListHookTags:output_type -> pbcs.ListHookTagsResp - 76, // 126: pbcs.Config.GetHook:output_type -> pbcs.GetHookResp - 68, // 127: pbcs.Config.CreateHookRelease:output_type -> pbcs.CreateHookReleaseResp - 70, // 128: pbcs.Config.ListHookRelease:output_type -> pbcs.ListHookReleaseResp - 72, // 129: pbcs.Config.DeleteHookRelease:output_type -> pbcs.DeleteHookReleaseResp - 74, // 130: pbcs.Config.PublishHookRelease:output_type -> pbcs.PublishHookReleaseResp - 143, // 131: pbcs.Config.GetHookRelease:output_type -> pbhr.HookRelease - 80, // 132: pbcs.Config.UpdateHookRelease:output_type -> pbcs.UpdateHookReleaseResp - 82, // 133: pbcs.Config.ListHookReleasesReferences:output_type -> pbcs.ListHookReleasesReferencesResp - 84, // 134: pbcs.Config.CreateTemplateSpace:output_type -> pbcs.CreateTemplateSpaceResp - 88, // 135: pbcs.Config.DeleteTemplateSpace:output_type -> pbcs.DeleteTemplateSpaceResp - 86, // 136: pbcs.Config.UpdateTemplateSpace:output_type -> pbcs.UpdateTemplateSpaceResp - 90, // 137: pbcs.Config.ListTemplateSpaces:output_type -> pbcs.ListTemplateSpacesResp - 92, // 138: pbcs.Config.CreateTemplate:output_type -> pbcs.CreateTemplateResp - 96, // 139: pbcs.Config.DeleteTemplate:output_type -> pbcs.DeleteTemplateResp - 94, // 140: pbcs.Config.UpdateTemplate:output_type -> pbcs.UpdateTemplateResp - 98, // 141: pbcs.Config.ListTemplates:output_type -> pbcs.ListTemplatesResp - 100, // 142: pbcs.Config.CreateTemplateRelease:output_type -> pbcs.CreateTemplateReleaseResp - 102, // 143: pbcs.Config.ListTemplateReleases:output_type -> pbcs.ListTemplateReleasesResp - 104, // 144: pbcs.Config.DeleteTemplateRelease:output_type -> pbcs.DeleteTemplateReleaseResp - 106, // 145: pbcs.Config.CreateGroup:output_type -> pbcs.CreateGroupResp - 110, // 146: pbcs.Config.DeleteGroup:output_type -> pbcs.DeleteGroupResp - 108, // 147: pbcs.Config.UpdateGroup:output_type -> pbcs.UpdateGroupResp - 112, // 148: pbcs.Config.ListAllGroups:output_type -> pbcs.ListAllGroupsResp - 114, // 149: pbcs.Config.ListAppGroups:output_type -> pbcs.ListAppGroupsResp - 116, // 150: pbcs.Config.ListGroupReleasedApps:output_type -> pbcs.ListGroupReleasedAppsResp - 120, // 151: pbcs.Config.Publish:output_type -> pbcs.PublishResp - 120, // 152: pbcs.Config.GenerateReleaseAndPublish:output_type -> pbcs.PublishResp - 13, // 153: pbcs.Config.CreateCredentials:output_type -> pbcs.CreateCredentialResp - 11, // 154: pbcs.Config.ListCredentials:output_type -> pbcs.ListCredentialsResp - 7, // 155: pbcs.Config.DeleteCredential:output_type -> pbcs.DeleteCredentialsResp - 9, // 156: pbcs.Config.UpdateCredential:output_type -> pbcs.UpdateCredentialsResp - 3, // 157: pbcs.Config.ListCredentialScopes:output_type -> pbcs.ListCredentialScopesResp - 1, // 158: pbcs.Config.UpdateCredentialScope:output_type -> pbcs.UpdateCredentialScopeResp - 99, // [99:159] is the sub-list for method output_type - 39, // [39:99] is the sub-list for method input_type - 39, // [39:39] is the sub-list for extension type_name - 39, // [39:39] is the sub-list for extension extendee - 0, // [0:39] is the sub-list for field type_name + 105, // 0: pbcs.UpdateCredentialScopeReq.alter_scope:type_name -> pbcrs.UpdateScopeSpec + 106, // 1: pbcs.ListCredentialScopesResp.details:type_name -> pbcrs.CredentialScopeList + 107, // 2: pbcs.ListCredentialsResp.details:type_name -> pbcredential.CredentialList + 108, // 3: pbcs.ListAppsReq.filter:type_name -> google.protobuf.Struct + 109, // 4: pbcs.ListAppsReq.page:type_name -> pbbase.BasePage + 110, // 5: pbcs.ListAppsResp.details:type_name -> pbapp.App + 100, // 6: pbcs.BatchUpsertConfigItemsReq.items:type_name -> pbcs.BatchUpsertConfigItemsReq.ConfigItem + 111, // 7: pbcs.GetConfigItemResp.config_item:type_name -> pbci.ConfigItem + 112, // 8: pbcs.GetConfigItemResp.content:type_name -> pbcontent.ContentSpec + 111, // 9: pbcs.ListConfigItemsResp.details:type_name -> pbci.ConfigItem + 113, // 10: pbcs.ListConfigItemCountResp.details:type_name -> pbci.ListConfigItemCounts + 108, // 11: pbcs.ListContentsReq.filter:type_name -> google.protobuf.Struct + 109, // 12: pbcs.ListContentsReq.page:type_name -> pbbase.BasePage + 114, // 13: pbcs.ListContentsResp.details:type_name -> pbcontent.Content + 108, // 14: pbcs.ListCommitsReq.filter:type_name -> google.protobuf.Struct + 109, // 15: pbcs.ListCommitsReq.page:type_name -> pbbase.BasePage + 115, // 16: pbcs.ListCommitsResp.details:type_name -> pbcommit.Commit + 116, // 17: pbcs.ListReleasesResp.details:type_name -> pbrelease.Release + 109, // 18: pbcs.ListReleasedConfigItemsReq.page:type_name -> pbbase.BasePage + 117, // 19: pbcs.ListReleasedConfigItemsResp.details:type_name -> pbrci.ReleasedConfigItem + 108, // 20: pbcs.ListHooksReq.filter:type_name -> google.protobuf.Struct + 109, // 21: pbcs.ListHooksReq.page:type_name -> pbbase.BasePage + 118, // 22: pbcs.ListHooksResp.details:type_name -> pbhook.Hook + 119, // 23: pbcs.ListTemplateSpacesResp.details:type_name -> pbts.TemplateSpace + 120, // 24: pbcs.ListTemplatesResp.details:type_name -> pbtemplate.Template + 121, // 25: pbcs.ListTemplateReleasesResp.details:type_name -> pbtr.TemplateRelease + 108, // 26: pbcs.CreateGroupReq.selector:type_name -> google.protobuf.Struct + 108, // 27: pbcs.UpdateGroupReq.selector:type_name -> google.protobuf.Struct + 101, // 28: pbcs.ListAllGroupsResp.details:type_name -> pbcs.ListAllGroupsResp.ListAllGroupsData + 103, // 29: pbcs.ListAppGroupsResp.details:type_name -> pbcs.ListAppGroupsResp.ListAppGroupsData + 104, // 30: pbcs.ListGroupReleasedAppsResp.details:type_name -> pbcs.ListGroupReleasedAppsResp.ListGroupReleasedAppsData + 102, // 31: pbcs.ListAllGroupsResp.ListAllGroupsData.bind_apps:type_name -> pbcs.ListAllGroupsResp.ListAllGroupsData.BindApp + 108, // 32: pbcs.ListAllGroupsResp.ListAllGroupsData.selector:type_name -> google.protobuf.Struct + 108, // 33: pbcs.ListAppGroupsResp.ListAppGroupsData.old_selector:type_name -> google.protobuf.Struct + 108, // 34: pbcs.ListAppGroupsResp.ListAppGroupsData.new_selector:type_name -> google.protobuf.Struct + 14, // 35: pbcs.Config.CreateApp:input_type -> pbcs.CreateAppReq + 16, // 36: pbcs.Config.UpdateApp:input_type -> pbcs.UpdateAppReq + 18, // 37: pbcs.Config.DeleteApp:input_type -> pbcs.DeleteAppReq + 20, // 38: pbcs.Config.GetApp:input_type -> pbcs.GetAppReq + 21, // 39: pbcs.Config.GetAppByName:input_type -> pbcs.GetAppByNameReq + 22, // 40: pbcs.Config.ListApps:input_type -> pbcs.ListAppsReq + 23, // 41: pbcs.Config.ListAppsRest:input_type -> pbcs.ListAppsRestReq + 24, // 42: pbcs.Config.ListAppsBySpaceRest:input_type -> pbcs.ListAppsBySpaceRestReq + 26, // 43: pbcs.Config.CreateConfigItem:input_type -> pbcs.CreateConfigItemReq + 27, // 44: pbcs.Config.BatchUpsertConfigItems:input_type -> pbcs.BatchUpsertConfigItemsReq + 30, // 45: pbcs.Config.UpdateConfigItem:input_type -> pbcs.UpdateConfigItemReq + 32, // 46: pbcs.Config.DeleteConfigItem:input_type -> pbcs.DeleteConfigItemReq + 34, // 47: pbcs.Config.GetConfigItem:input_type -> pbcs.GetConfigItemReq + 36, // 48: pbcs.Config.ListConfigItems:input_type -> pbcs.ListConfigItemsReq + 38, // 49: pbcs.Config.ListConfigItemCount:input_type -> pbcs.ListConfigItemCountReq + 40, // 50: pbcs.Config.CreateContent:input_type -> pbcs.CreateContentReq + 42, // 51: pbcs.Config.ListContents:input_type -> pbcs.ListContentsReq + 44, // 52: pbcs.Config.CreateCommit:input_type -> pbcs.CreateCommitReq + 46, // 53: pbcs.Config.ListCommits:input_type -> pbcs.ListCommitsReq + 48, // 54: pbcs.Config.CreateRelease:input_type -> pbcs.CreateReleaseReq + 50, // 55: pbcs.Config.ListReleases:input_type -> pbcs.ListReleasesReq + 52, // 56: pbcs.Config.ListReleasedConfigItems:input_type -> pbcs.ListReleasedConfigItemsReq + 54, // 57: pbcs.Config.CreateHook:input_type -> pbcs.CreateHookReq + 58, // 58: pbcs.Config.DeleteHook:input_type -> pbcs.DeleteHookReq + 56, // 59: pbcs.Config.UpdateHook:input_type -> pbcs.UpdateHookReq + 60, // 60: pbcs.Config.ListHooks:input_type -> pbcs.ListHooksReq + 62, // 61: pbcs.Config.CreateTemplateSpace:input_type -> pbcs.CreateTemplateSpaceReq + 66, // 62: pbcs.Config.DeleteTemplateSpace:input_type -> pbcs.DeleteTemplateSpaceReq + 64, // 63: pbcs.Config.UpdateTemplateSpace:input_type -> pbcs.UpdateTemplateSpaceReq + 68, // 64: pbcs.Config.ListTemplateSpaces:input_type -> pbcs.ListTemplateSpacesReq + 70, // 65: pbcs.Config.CreateTemplate:input_type -> pbcs.CreateTemplateReq + 74, // 66: pbcs.Config.DeleteTemplate:input_type -> pbcs.DeleteTemplateReq + 72, // 67: pbcs.Config.UpdateTemplate:input_type -> pbcs.UpdateTemplateReq + 76, // 68: pbcs.Config.ListTemplates:input_type -> pbcs.ListTemplatesReq + 78, // 69: pbcs.Config.CreateTemplateRelease:input_type -> pbcs.CreateTemplateReleaseReq + 80, // 70: pbcs.Config.ListTemplateReleases:input_type -> pbcs.ListTemplateReleasesReq + 82, // 71: pbcs.Config.DeleteTemplateRelease:input_type -> pbcs.DeleteTemplateReleaseReq + 84, // 72: pbcs.Config.CreateGroup:input_type -> pbcs.CreateGroupReq + 88, // 73: pbcs.Config.DeleteGroup:input_type -> pbcs.DeleteGroupReq + 86, // 74: pbcs.Config.UpdateGroup:input_type -> pbcs.UpdateGroupReq + 90, // 75: pbcs.Config.ListAllGroups:input_type -> pbcs.ListAllGroupsReq + 92, // 76: pbcs.Config.ListAppGroups:input_type -> pbcs.ListAppGroupsReq + 94, // 77: pbcs.Config.ListGroupReleasedApps:input_type -> pbcs.ListGroupReleasedAppsReq + 96, // 78: pbcs.Config.Publish:input_type -> pbcs.PublishReq + 97, // 79: pbcs.Config.GenerateReleaseAndPublish:input_type -> pbcs.GenerateReleaseAndPublishReq + 12, // 80: pbcs.Config.CreateCredentials:input_type -> pbcs.CreateCredentialReq + 10, // 81: pbcs.Config.ListCredentials:input_type -> pbcs.ListCredentialsReq + 6, // 82: pbcs.Config.DeleteCredential:input_type -> pbcs.DeleteCredentialsReq + 8, // 83: pbcs.Config.UpdateCredential:input_type -> pbcs.UpdateCredentialsReq + 2, // 84: pbcs.Config.ListCredentialScopes:input_type -> pbcs.ListCredentialScopesReq + 0, // 85: pbcs.Config.UpdateCredentialScope:input_type -> pbcs.UpdateCredentialScopeReq + 15, // 86: pbcs.Config.CreateApp:output_type -> pbcs.CreateAppResp + 17, // 87: pbcs.Config.UpdateApp:output_type -> pbcs.UpdateAppResp + 19, // 88: pbcs.Config.DeleteApp:output_type -> pbcs.DeleteAppResp + 110, // 89: pbcs.Config.GetApp:output_type -> pbapp.App + 110, // 90: pbcs.Config.GetAppByName:output_type -> pbapp.App + 25, // 91: pbcs.Config.ListApps:output_type -> pbcs.ListAppsResp + 25, // 92: pbcs.Config.ListAppsRest:output_type -> pbcs.ListAppsResp + 25, // 93: pbcs.Config.ListAppsBySpaceRest:output_type -> pbcs.ListAppsResp + 29, // 94: pbcs.Config.CreateConfigItem:output_type -> pbcs.CreateConfigItemResp + 28, // 95: pbcs.Config.BatchUpsertConfigItems:output_type -> pbcs.BatchUpsertConfigItemsResp + 31, // 96: pbcs.Config.UpdateConfigItem:output_type -> pbcs.UpdateConfigItemResp + 33, // 97: pbcs.Config.DeleteConfigItem:output_type -> pbcs.DeleteConfigItemResp + 35, // 98: pbcs.Config.GetConfigItem:output_type -> pbcs.GetConfigItemResp + 37, // 99: pbcs.Config.ListConfigItems:output_type -> pbcs.ListConfigItemsResp + 39, // 100: pbcs.Config.ListConfigItemCount:output_type -> pbcs.ListConfigItemCountResp + 41, // 101: pbcs.Config.CreateContent:output_type -> pbcs.CreateContentResp + 43, // 102: pbcs.Config.ListContents:output_type -> pbcs.ListContentsResp + 45, // 103: pbcs.Config.CreateCommit:output_type -> pbcs.CreateCommitResp + 47, // 104: pbcs.Config.ListCommits:output_type -> pbcs.ListCommitsResp + 49, // 105: pbcs.Config.CreateRelease:output_type -> pbcs.CreateReleaseResp + 51, // 106: pbcs.Config.ListReleases:output_type -> pbcs.ListReleasesResp + 53, // 107: pbcs.Config.ListReleasedConfigItems:output_type -> pbcs.ListReleasedConfigItemsResp + 55, // 108: pbcs.Config.CreateHook:output_type -> pbcs.CreateHookResp + 59, // 109: pbcs.Config.DeleteHook:output_type -> pbcs.DeleteHookResp + 57, // 110: pbcs.Config.UpdateHook:output_type -> pbcs.UpdateHookResp + 61, // 111: pbcs.Config.ListHooks:output_type -> pbcs.ListHooksResp + 63, // 112: pbcs.Config.CreateTemplateSpace:output_type -> pbcs.CreateTemplateSpaceResp + 67, // 113: pbcs.Config.DeleteTemplateSpace:output_type -> pbcs.DeleteTemplateSpaceResp + 65, // 114: pbcs.Config.UpdateTemplateSpace:output_type -> pbcs.UpdateTemplateSpaceResp + 69, // 115: pbcs.Config.ListTemplateSpaces:output_type -> pbcs.ListTemplateSpacesResp + 71, // 116: pbcs.Config.CreateTemplate:output_type -> pbcs.CreateTemplateResp + 75, // 117: pbcs.Config.DeleteTemplate:output_type -> pbcs.DeleteTemplateResp + 73, // 118: pbcs.Config.UpdateTemplate:output_type -> pbcs.UpdateTemplateResp + 77, // 119: pbcs.Config.ListTemplates:output_type -> pbcs.ListTemplatesResp + 79, // 120: pbcs.Config.CreateTemplateRelease:output_type -> pbcs.CreateTemplateReleaseResp + 81, // 121: pbcs.Config.ListTemplateReleases:output_type -> pbcs.ListTemplateReleasesResp + 83, // 122: pbcs.Config.DeleteTemplateRelease:output_type -> pbcs.DeleteTemplateReleaseResp + 85, // 123: pbcs.Config.CreateGroup:output_type -> pbcs.CreateGroupResp + 89, // 124: pbcs.Config.DeleteGroup:output_type -> pbcs.DeleteGroupResp + 87, // 125: pbcs.Config.UpdateGroup:output_type -> pbcs.UpdateGroupResp + 91, // 126: pbcs.Config.ListAllGroups:output_type -> pbcs.ListAllGroupsResp + 93, // 127: pbcs.Config.ListAppGroups:output_type -> pbcs.ListAppGroupsResp + 95, // 128: pbcs.Config.ListGroupReleasedApps:output_type -> pbcs.ListGroupReleasedAppsResp + 99, // 129: pbcs.Config.Publish:output_type -> pbcs.PublishResp + 99, // 130: pbcs.Config.GenerateReleaseAndPublish:output_type -> pbcs.PublishResp + 13, // 131: pbcs.Config.CreateCredentials:output_type -> pbcs.CreateCredentialResp + 11, // 132: pbcs.Config.ListCredentials:output_type -> pbcs.ListCredentialsResp + 7, // 133: pbcs.Config.DeleteCredential:output_type -> pbcs.DeleteCredentialsResp + 9, // 134: pbcs.Config.UpdateCredential:output_type -> pbcs.UpdateCredentialsResp + 3, // 135: pbcs.Config.ListCredentialScopes:output_type -> pbcs.ListCredentialScopesResp + 1, // 136: pbcs.Config.UpdateCredentialScope:output_type -> pbcs.UpdateCredentialScopeResp + 86, // [86:137] is the sub-list for method output_type + 35, // [35:86] is the sub-list for method input_type + 35, // [35:35] is the sub-list for extension type_name + 35, // [35:35] is the sub-list for extension extendee + 0, // [0:35] is the sub-list for field type_name } func init() { file_config_service_proto_init() } @@ -9919,260 +8371,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCredentialsReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCredentialsResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateCredentialReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateCredentialResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAppReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAppResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateAppReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateAppResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteAppReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteAppResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAppReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAppByNameReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAppsRestReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAppsBySpaceRestReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAppsResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateConfigItemReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BatchUpsertConfigItemsReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BatchUpsertConfigItemsResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateConfigItemResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateConfigItemReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateConfigItemResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteConfigItemReq); i { + file_config_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCredentialsReq); i { case 0: return &v.state case 1: @@ -10183,8 +8383,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteConfigItemResp); i { + file_config_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCredentialsResp); i { case 0: return &v.state case 1: @@ -10195,8 +8395,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetConfigItemReq); i { + file_config_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCredentialReq); i { case 0: return &v.state case 1: @@ -10207,8 +8407,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetConfigItemResp); i { + file_config_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCredentialResp); i { case 0: return &v.state case 1: @@ -10219,8 +8419,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListConfigItemsReq); i { + file_config_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateAppReq); i { case 0: return &v.state case 1: @@ -10231,8 +8431,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListConfigItemsResp); i { + file_config_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateAppResp); i { case 0: return &v.state case 1: @@ -10243,8 +8443,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListConfigItemCountReq); i { + file_config_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateAppReq); i { case 0: return &v.state case 1: @@ -10255,8 +8455,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListConfigItemCountResp); i { + file_config_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateAppResp); i { case 0: return &v.state case 1: @@ -10267,8 +8467,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateContentReq); i { + file_config_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteAppReq); i { case 0: return &v.state case 1: @@ -10279,8 +8479,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateContentResp); i { + file_config_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteAppResp); i { case 0: return &v.state case 1: @@ -10291,8 +8491,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListContentsReq); i { + file_config_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAppReq); i { case 0: return &v.state case 1: @@ -10303,8 +8503,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListContentsResp); i { + file_config_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAppByNameReq); i { case 0: return &v.state case 1: @@ -10315,8 +8515,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateConfigHookReq); i { + file_config_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAppsReq); i { case 0: return &v.state case 1: @@ -10327,8 +8527,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateConfigHookResp); i { + file_config_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAppsRestReq); i { case 0: return &v.state case 1: @@ -10339,8 +8539,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateConfigHookReq); i { + file_config_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAppsBySpaceRestReq); i { case 0: return &v.state case 1: @@ -10351,8 +8551,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateConfigHookResp); i { + file_config_service_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAppsResp); i { case 0: return &v.state case 1: @@ -10363,8 +8563,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetConfigHookReq); i { + file_config_service_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateConfigItemReq); i { case 0: return &v.state case 1: @@ -10375,8 +8575,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetConfigHookResp); i { + file_config_service_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchUpsertConfigItemsReq); i { case 0: return &v.state case 1: @@ -10387,8 +8587,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateCommitReq); i { + file_config_service_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchUpsertConfigItemsResp); i { case 0: return &v.state case 1: @@ -10399,8 +8599,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateCommitResp); i { + file_config_service_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateConfigItemResp); i { case 0: return &v.state case 1: @@ -10411,8 +8611,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCommitsReq); i { + file_config_service_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateConfigItemReq); i { case 0: return &v.state case 1: @@ -10423,8 +8623,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCommitsResp); i { + file_config_service_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateConfigItemResp); i { case 0: return &v.state case 1: @@ -10435,8 +8635,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateReleaseReq); i { + file_config_service_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteConfigItemReq); i { case 0: return &v.state case 1: @@ -10447,8 +8647,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateReleaseResp); i { + file_config_service_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteConfigItemResp); i { case 0: return &v.state case 1: @@ -10459,8 +8659,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListReleasesReq); i { + file_config_service_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetConfigItemReq); i { case 0: return &v.state case 1: @@ -10471,8 +8671,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListReleasesResp); i { + file_config_service_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetConfigItemResp); i { case 0: return &v.state case 1: @@ -10483,8 +8683,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListReleasedConfigItemsReq); i { + file_config_service_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListConfigItemsReq); i { case 0: return &v.state case 1: @@ -10495,8 +8695,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListReleasedConfigItemsResp); i { + file_config_service_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListConfigItemsResp); i { case 0: return &v.state case 1: @@ -10507,8 +8707,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateHookReq); i { + file_config_service_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListConfigItemCountReq); i { case 0: return &v.state case 1: @@ -10519,8 +8719,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateHookResp); i { + file_config_service_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListConfigItemCountResp); i { case 0: return &v.state case 1: @@ -10531,8 +8731,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteHookReq); i { + file_config_service_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateContentReq); i { case 0: return &v.state case 1: @@ -10543,8 +8743,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteHookResp); i { + file_config_service_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateContentResp); i { case 0: return &v.state case 1: @@ -10555,8 +8755,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHooksReq); i { + file_config_service_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListContentsReq); i { case 0: return &v.state case 1: @@ -10567,8 +8767,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHooksResp); i { + file_config_service_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListContentsResp); i { case 0: return &v.state case 1: @@ -10579,8 +8779,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHookTagsReq); i { + file_config_service_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCommitReq); i { case 0: return &v.state case 1: @@ -10591,8 +8791,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHookTagsResp); i { + file_config_service_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCommitResp); i { case 0: return &v.state case 1: @@ -10603,8 +8803,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateHookReleaseReq); i { + file_config_service_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommitsReq); i { case 0: return &v.state case 1: @@ -10615,8 +8815,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateHookReleaseResp); i { + file_config_service_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommitsResp); i { case 0: return &v.state case 1: @@ -10627,8 +8827,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHookReleaseReq); i { + file_config_service_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateReleaseReq); i { case 0: return &v.state case 1: @@ -10639,8 +8839,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHookReleaseResp); i { + file_config_service_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateReleaseResp); i { case 0: return &v.state case 1: @@ -10651,8 +8851,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteHookReleaseReq); i { + file_config_service_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReleasesReq); i { case 0: return &v.state case 1: @@ -10663,8 +8863,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteHookReleaseResp); i { + file_config_service_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReleasesResp); i { case 0: return &v.state case 1: @@ -10675,8 +8875,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PublishHookReleaseReq); i { + file_config_service_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReleasedConfigItemsReq); i { case 0: return &v.state case 1: @@ -10687,8 +8887,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PublishHookReleaseResp); i { + file_config_service_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReleasedConfigItemsResp); i { case 0: return &v.state case 1: @@ -10699,8 +8899,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetHookReq); i { + file_config_service_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateHookReq); i { case 0: return &v.state case 1: @@ -10711,8 +8911,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetHookResp); i { + file_config_service_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateHookResp); i { case 0: return &v.state case 1: @@ -10723,8 +8923,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetHookInfoSpec); i { + file_config_service_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateHookReq); i { case 0: return &v.state case 1: @@ -10735,8 +8935,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetHookReleaseReq); i { + file_config_service_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateHookResp); i { case 0: return &v.state case 1: @@ -10747,8 +8947,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateHookReleaseReq); i { + file_config_service_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteHookReq); i { case 0: return &v.state case 1: @@ -10759,8 +8959,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateHookReleaseResp); i { + file_config_service_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteHookResp); i { case 0: return &v.state case 1: @@ -10771,8 +8971,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHookReleasesReferencesReq); i { + file_config_service_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListHooksReq); i { case 0: return &v.state case 1: @@ -10783,8 +8983,8 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHookReleasesReferencesResp); i { + file_config_service_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListHooksResp); i { case 0: return &v.state case 1: @@ -10795,7 +8995,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateTemplateSpaceReq); i { case 0: return &v.state @@ -10807,7 +9007,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[84].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateTemplateSpaceResp); i { case 0: return &v.state @@ -10819,7 +9019,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[85].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateTemplateSpaceReq); i { case 0: return &v.state @@ -10831,7 +9031,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[86].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateTemplateSpaceResp); i { case 0: return &v.state @@ -10843,7 +9043,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[87].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteTemplateSpaceReq); i { case 0: return &v.state @@ -10855,7 +9055,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[88].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteTemplateSpaceResp); i { case 0: return &v.state @@ -10867,7 +9067,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[89].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListTemplateSpacesReq); i { case 0: return &v.state @@ -10879,7 +9079,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[90].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListTemplateSpacesResp); i { case 0: return &v.state @@ -10891,7 +9091,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[91].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateTemplateReq); i { case 0: return &v.state @@ -10903,7 +9103,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[92].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateTemplateResp); i { case 0: return &v.state @@ -10915,7 +9115,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[93].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateTemplateReq); i { case 0: return &v.state @@ -10927,7 +9127,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[94].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateTemplateResp); i { case 0: return &v.state @@ -10939,7 +9139,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[95].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteTemplateReq); i { case 0: return &v.state @@ -10951,7 +9151,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[96].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteTemplateResp); i { case 0: return &v.state @@ -10963,7 +9163,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[97].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListTemplatesReq); i { case 0: return &v.state @@ -10975,7 +9175,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[98].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListTemplatesResp); i { case 0: return &v.state @@ -10987,7 +9187,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[99].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateTemplateReleaseReq); i { case 0: return &v.state @@ -10999,7 +9199,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[100].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateTemplateReleaseResp); i { case 0: return &v.state @@ -11011,7 +9211,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[101].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListTemplateReleasesReq); i { case 0: return &v.state @@ -11023,7 +9223,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[102].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListTemplateReleasesResp); i { case 0: return &v.state @@ -11035,7 +9235,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[103].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteTemplateReleaseReq); i { case 0: return &v.state @@ -11047,7 +9247,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[104].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteTemplateReleaseResp); i { case 0: return &v.state @@ -11059,7 +9259,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[105].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[84].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGroupReq); i { case 0: return &v.state @@ -11071,7 +9271,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[106].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[85].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGroupResp); i { case 0: return &v.state @@ -11083,7 +9283,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[107].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[86].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateGroupReq); i { case 0: return &v.state @@ -11095,7 +9295,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[108].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[87].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateGroupResp); i { case 0: return &v.state @@ -11107,7 +9307,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[109].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[88].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteGroupReq); i { case 0: return &v.state @@ -11119,7 +9319,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[110].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[89].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteGroupResp); i { case 0: return &v.state @@ -11131,7 +9331,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[111].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[90].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAllGroupsReq); i { case 0: return &v.state @@ -11143,7 +9343,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[112].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[91].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAllGroupsResp); i { case 0: return &v.state @@ -11155,7 +9355,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[113].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[92].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAppGroupsReq); i { case 0: return &v.state @@ -11167,7 +9367,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[114].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[93].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAppGroupsResp); i { case 0: return &v.state @@ -11179,7 +9379,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[115].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[94].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListGroupReleasedAppsReq); i { case 0: return &v.state @@ -11191,7 +9391,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[116].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[95].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListGroupReleasedAppsResp); i { case 0: return &v.state @@ -11203,7 +9403,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[117].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[96].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PublishReq); i { case 0: return &v.state @@ -11215,7 +9415,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[118].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[97].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenerateReleaseAndPublishReq); i { case 0: return &v.state @@ -11227,7 +9427,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[119].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[98].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenerateReleaseAndPublishResp); i { case 0: return &v.state @@ -11239,7 +9439,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[120].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[99].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PublishResp); i { case 0: return &v.state @@ -11251,7 +9451,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[121].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[100].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchUpsertConfigItemsReq_ConfigItem); i { case 0: return &v.state @@ -11263,19 +9463,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[122].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetHookInfoSpec_Releases); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_service_proto_msgTypes[123].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[101].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAllGroupsResp_ListAllGroupsData); i { case 0: return &v.state @@ -11287,7 +9475,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[124].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[102].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAllGroupsResp_ListAllGroupsData_BindApp); i { case 0: return &v.state @@ -11299,7 +9487,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[125].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[103].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAppGroupsResp_ListAppGroupsData); i { case 0: return &v.state @@ -11311,7 +9499,7 @@ func file_config_service_proto_init() { return nil } } - file_config_service_proto_msgTypes[126].Exporter = func(v interface{}, i int) interface{} { + file_config_service_proto_msgTypes[104].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListGroupReleasedAppsResp_ListGroupReleasedAppsData); i { case 0: return &v.state @@ -11330,7 +9518,7 @@ func file_config_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_config_service_proto_rawDesc, NumEnums: 0, - NumMessages: 127, + NumMessages: 105, NumExtensions: 0, NumServices: 1, }, diff --git a/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service.pb.gw.go b/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service.pb.gw.go index f80f78aa7b..4e5c2476ce 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service.pb.gw.go +++ b/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service.pb.gw.go @@ -403,6 +403,74 @@ func local_request_Config_GetAppByName_0(ctx context.Context, marshaler runtime. } +func request_Config_ListApps_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListAppsReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["biz_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") + } + + protoReq.BizId, err = runtime.Uint32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) + } + + msg, err := client.ListApps(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Config_ListApps_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListAppsReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["biz_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") + } + + protoReq.BizId, err = runtime.Uint32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) + } + + msg, err := server.ListApps(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Config_ListAppsRest_0 = &utilities.DoubleArray{Encoding: map[string]int{"biz_id": 0, "bizId": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ) @@ -1383,166 +1451,6 @@ func local_request_Config_ListContents_0(ctx context.Context, marshaler runtime. } -func request_Config_UpdateConfigHook_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateConfigHookReq - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - msg, err := client.UpdateConfigHook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Config_UpdateConfigHook_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateConfigHookReq - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - msg, err := server.UpdateConfigHook(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Config_GetConfigHook_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetConfigHookReq - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - msg, err := client.GetConfigHook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Config_GetConfigHook_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetConfigHookReq - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - val, ok = pathParams["app_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") - } - - protoReq.AppId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) - } - - msg, err := server.GetConfigHook(ctx, &protoReq) - return msg, metadata, err - -} - func request_Config_CreateCommit_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq CreateCommitReq var metadata runtime.ServerMetadata @@ -2034,6 +1942,16 @@ func request_Config_CreateHook_0(ctx context.Context, marshaler runtime.Marshale return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) } + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + msg, err := client.CreateHook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err @@ -2068,6 +1986,16 @@ func local_request_Config_CreateHook_0(ctx context.Context, marshaler runtime.Ma return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) } + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + msg, err := server.CreateHook(ctx, &protoReq) return msg, metadata, err @@ -2094,6 +2022,16 @@ func request_Config_DeleteHook_0(ctx context.Context, marshaler runtime.Marshale return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) } + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + val, ok = pathParams["hook_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") @@ -2130,6 +2068,16 @@ func local_request_Config_DeleteHook_0(ctx context.Context, marshaler runtime.Ma return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) } + val, ok = pathParams["app_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") + } + + protoReq.AppId, err = runtime.Uint32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) + } + val, ok = pathParams["hook_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") @@ -2145,246 +2093,8 @@ func local_request_Config_DeleteHook_0(ctx context.Context, marshaler runtime.Ma } -var ( - filter_Config_ListHooks_0 = &utilities.DoubleArray{Encoding: map[string]int{"biz_id": 0, "bizId": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} -) - -func request_Config_ListHooks_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListHooksReq - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Config_ListHooks_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListHooks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Config_ListHooks_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListHooksReq - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Config_ListHooks_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListHooks(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Config_ListHookTags_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListHookTagsReq - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - msg, err := client.ListHookTags(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Config_ListHookTags_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListHookTagsReq - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - msg, err := server.ListHookTags(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Config_GetHook_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetHookReq - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - val, ok = pathParams["hook_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") - } - - protoReq.HookId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) - } - - msg, err := client.GetHook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Config_GetHook_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetHookReq - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - val, ok = pathParams["hook_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") - } - - protoReq.HookId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) - } - - msg, err := server.GetHook(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Config_CreateHookRelease_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateHookReleaseReq - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - val, ok = pathParams["hook_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") - } - - protoReq.HookId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) - } - - msg, err := client.CreateHookRelease(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Config_CreateHookRelease_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateHookReleaseReq +func request_Config_UpdateHook_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateHookReq var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -2412,44 +2122,14 @@ func local_request_Config_CreateHookRelease_0(ctx context.Context, marshaler run return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) } - val, ok = pathParams["hook_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") - } - - protoReq.HookId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) - } - - msg, err := server.CreateHookRelease(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Config_ListHookRelease_0 = &utilities.DoubleArray{Encoding: map[string]int{"biz_id": 0, "bizId": 1, "hook_id": 2, "hookId": 3}, Base: []int{1, 1, 2, 3, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 1, 2, 3, 4, 5}} -) - -func request_Config_ListHookRelease_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListHookReleaseReq - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] + val, ok = pathParams["app_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") } - protoReq.BizId, err = runtime.Uint32(val) + protoReq.AppId, err = runtime.Uint32(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) } val, ok = pathParams["hook_id"] @@ -2459,396 +2139,16 @@ func request_Config_ListHookRelease_0(ctx context.Context, marshaler runtime.Mar protoReq.HookId, err = runtime.Uint32(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Config_ListHookRelease_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListHookRelease(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Config_ListHookRelease_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListHookReleaseReq - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - val, ok = pathParams["hook_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") - } - - protoReq.HookId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Config_ListHookRelease_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListHookRelease(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Config_DeleteHookRelease_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteHookReleaseReq - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - val, ok = pathParams["hook_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") - } - - protoReq.HookId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) - } - - val, ok = pathParams["release_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "release_id") - } - - protoReq.ReleaseId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "release_id", err) - } - - msg, err := client.DeleteHookRelease(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Config_DeleteHookRelease_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteHookReleaseReq - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - val, ok = pathParams["hook_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") - } - - protoReq.HookId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) - } - - val, ok = pathParams["release_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "release_id") - } - - protoReq.ReleaseId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "release_id", err) - } - - msg, err := server.DeleteHookRelease(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Config_PublishHookRelease_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PublishHookReleaseReq - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - val, ok = pathParams["hook_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") - } - - protoReq.HookId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) - } - - val, ok = pathParams["release_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "release_id") - } - - protoReq.ReleaseId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "release_id", err) - } - - msg, err := client.PublishHookRelease(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Config_PublishHookRelease_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PublishHookReleaseReq - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - val, ok = pathParams["hook_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") - } - - protoReq.HookId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) - } - - val, ok = pathParams["release_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "release_id") - } - - protoReq.ReleaseId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "release_id", err) - } - - msg, err := server.PublishHookRelease(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Config_GetHookRelease_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetHookReleaseReq - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - val, ok = pathParams["hook_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") - } - - protoReq.HookId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) - } - - val, ok = pathParams["release_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "release_id") - } - - protoReq.ReleaseId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "release_id", err) - } - - msg, err := client.GetHookRelease(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Config_GetHookRelease_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetHookReleaseReq - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - val, ok = pathParams["hook_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") - } - - protoReq.HookId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) - } - - val, ok = pathParams["release_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "release_id") - } - - protoReq.ReleaseId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "release_id", err) - } - - msg, err := server.GetHookRelease(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Config_UpdateHookRelease_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateHookReleaseReq - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - val, ok = pathParams["hook_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") - } - - protoReq.HookId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) - } - - val, ok = pathParams["release_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "release_id") - } - - protoReq.ReleaseId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "release_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) } - msg, err := client.UpdateHookRelease(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.UpdateHook(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Config_UpdateHookRelease_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateHookReleaseReq +func local_request_Config_UpdateHook_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateHookReq var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -2876,39 +2176,43 @@ func local_request_Config_UpdateHookRelease_0(ctx context.Context, marshaler run return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) } - val, ok = pathParams["hook_id"] + val, ok = pathParams["app_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") } - protoReq.HookId, err = runtime.Uint32(val) + protoReq.AppId, err = runtime.Uint32(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) } - val, ok = pathParams["release_id"] + val, ok = pathParams["hook_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "release_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") } - protoReq.ReleaseId, err = runtime.Uint32(val) + protoReq.HookId, err = runtime.Uint32(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "release_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) } - msg, err := server.UpdateHookRelease(ctx, &protoReq) + msg, err := server.UpdateHook(ctx, &protoReq) return msg, metadata, err } -var ( - filter_Config_ListHookReleasesReferences_0 = &utilities.DoubleArray{Encoding: map[string]int{"biz_id": 0, "bizId": 1, "hook_id": 2, "hookId": 3}, Base: []int{1, 1, 2, 3, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 1, 2, 3, 4, 5}} -) - -func request_Config_ListHookReleasesReferences_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListHookReleasesReferencesReq +func request_Config_ListHooks_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListHooksReq var metadata runtime.ServerMetadata + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + var ( val string ok bool @@ -2926,32 +2230,33 @@ func request_Config_ListHookReleasesReferences_0(ctx context.Context, marshaler return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) } - val, ok = pathParams["hook_id"] + val, ok = pathParams["app_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") } - protoReq.HookId, err = runtime.Uint32(val) + protoReq.AppId, err = runtime.Uint32(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Config_ListHookReleasesReferences_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) } - msg, err := client.ListHookReleasesReferences(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.ListHooks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Config_ListHookReleasesReferences_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListHookReleasesReferencesReq +func local_request_Config_ListHooks_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListHooksReq var metadata runtime.ServerMetadata + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + var ( val string ok bool @@ -2969,24 +2274,17 @@ func local_request_Config_ListHookReleasesReferences_0(ctx context.Context, mars return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) } - val, ok = pathParams["hook_id"] + val, ok = pathParams["app_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hook_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "app_id") } - protoReq.HookId, err = runtime.Uint32(val) + protoReq.AppId, err = runtime.Uint32(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hook_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Config_ListHookReleasesReferences_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "app_id", err) } - msg, err := server.ListHookReleasesReferences(ctx, &protoReq) + msg, err := server.ListHooks(ctx, &protoReq) return msg, metadata, err } @@ -5014,295 +4312,70 @@ func request_Config_UpdateCredentialScope_0(ctx context.Context, marshaler runti val, ok = pathParams["credential_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "credential_id") - } - - protoReq.CredentialId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "credential_id", err) - } - - msg, err := client.UpdateCredentialScope(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Config_UpdateCredentialScope_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateCredentialScopeReq - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["biz_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") - } - - protoReq.BizId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) - } - - val, ok = pathParams["credential_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "credential_id") - } - - protoReq.CredentialId, err = runtime.Uint32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "credential_id", err) - } - - msg, err := server.UpdateCredentialScope(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterConfigHandlerServer registers the http handlers for service Config to "mux". -// UnaryRPC :call ConfigServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterConfigHandlerFromEndpoint instead. -func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ConfigServer) error { - - mux.Handle("POST", pattern_Config_CreateApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/CreateApp", runtime.WithHTTPPathPattern("/api/v1/config/create/app/app/biz_id/{biz_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Config_CreateApp_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Config_CreateApp_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PUT", pattern_Config_UpdateApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/UpdateApp", runtime.WithHTTPPathPattern("/api/v1/config/update/app/app/app_id/{id}/biz_id/{biz_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Config_UpdateApp_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Config_UpdateApp_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_Config_DeleteApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/DeleteApp", runtime.WithHTTPPathPattern("/api/v1/config/delete/app/app/app_id/{id}/biz_id/{biz_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Config_DeleteApp_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Config_DeleteApp_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Config_GetApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/GetApp", runtime.WithHTTPPathPattern("/api/v1/config/get/app/app/app_id/{app_id}/biz_id/{biz_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Config_GetApp_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Config_GetApp_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Config_GetAppByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/GetAppByName", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/query/name/{app_name}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Config_GetAppByName_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Config_GetAppByName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "credential_id") + } - }) + protoReq.CredentialId, err = runtime.Uint32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "credential_id", err) + } - mux.Handle("GET", pattern_Config_ListAppsRest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListAppsRest", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Config_ListAppsRest_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } + msg, err := client.UpdateCredentialScope(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err - forward_Config_ListAppsRest_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) +} - }) +func local_request_Config_UpdateCredentialScope_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateCredentialScopeReq + var metadata runtime.ServerMetadata - mux.Handle("GET", pattern_Config_ListAppsBySpaceRest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListAppsBySpaceRest", runtime.WithHTTPPathPattern("/api/v1/config/list/app/app/biz_id/{biz_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Config_ListAppsBySpaceRest_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } - forward_Config_ListAppsBySpaceRest_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + var ( + val string + ok bool + err error + _ = err + ) - }) + val, ok = pathParams["biz_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "biz_id") + } - mux.Handle("POST", pattern_Config_CreateConfigItem_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/CreateConfigItem", runtime.WithHTTPPathPattern("/api/v1/config/create/config_item/config_item/app_id/{app_id}/biz_id/{biz_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Config_CreateConfigItem_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } + protoReq.BizId, err = runtime.Uint32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "biz_id", err) + } - forward_Config_CreateConfigItem_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + val, ok = pathParams["credential_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "credential_id") + } - }) + protoReq.CredentialId, err = runtime.Uint32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "credential_id", err) + } - mux.Handle("PUT", pattern_Config_BatchUpsertConfigItems_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/BatchUpsertConfigItems", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/config_items")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Config_BatchUpsertConfigItems_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } + msg, err := server.UpdateCredentialScope(ctx, &protoReq) + return msg, metadata, err - forward_Config_BatchUpsertConfigItems_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) +} - }) +// RegisterConfigHandlerServer registers the http handlers for service Config to "mux". +// UnaryRPC :call ConfigServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterConfigHandlerFromEndpoint instead. +func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ConfigServer) error { - mux.Handle("PUT", pattern_Config_UpdateConfigItem_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Config_CreateApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5310,12 +4383,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/UpdateConfigItem", runtime.WithHTTPPathPattern("/api/v1/config/update/config_item/config_item/config_item_id/{id}/app_id/{app_id}/biz_id/{biz_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/CreateApp", runtime.WithHTTPPathPattern("/api/v1/config/create/app/app/biz_id/{biz_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_UpdateConfigItem_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_CreateApp_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5323,11 +4396,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_UpdateConfigItem_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_CreateApp_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("DELETE", pattern_Config_DeleteConfigItem_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("PUT", pattern_Config_UpdateApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5335,12 +4408,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/DeleteConfigItem", runtime.WithHTTPPathPattern("/api/v1/config/delete/config_item/config_item/config_item_id/{id}/app_id/{app_id}/biz_id/{biz_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/UpdateApp", runtime.WithHTTPPathPattern("/api/v1/config/update/app/app/app_id/{id}/biz_id/{biz_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_DeleteConfigItem_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_UpdateApp_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5348,11 +4421,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_DeleteConfigItem_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_UpdateApp_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Config_GetConfigItem_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("DELETE", pattern_Config_DeleteApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5360,12 +4433,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/GetConfigItem", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/config_items/{config_item_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/DeleteApp", runtime.WithHTTPPathPattern("/api/v1/config/delete/app/app/app_id/{id}/biz_id/{biz_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_GetConfigItem_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_DeleteApp_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5373,11 +4446,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_GetConfigItem_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_DeleteApp_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Config_ListConfigItems_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Config_GetApp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5385,12 +4458,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListConfigItems", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/config_items")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/GetApp", runtime.WithHTTPPathPattern("/api/v1/config/get/app/app/app_id/{app_id}/biz_id/{biz_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_ListConfigItems_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_GetApp_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5398,11 +4471,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_ListConfigItems_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_GetApp_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_Config_ListConfigItemCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Config_GetAppByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5410,12 +4483,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListConfigItemCount", runtime.WithHTTPPathPattern("/api/v1/config/config_item_count/biz_id/{biz_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/GetAppByName", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/query/name/{app_name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_ListConfigItemCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_GetAppByName_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5423,11 +4496,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_ListConfigItemCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_GetAppByName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_Config_CreateContent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Config_ListApps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5435,12 +4508,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/CreateContent", runtime.WithHTTPPathPattern("/api/v1/config/create/content/content/config_item_id/{config_item_id}/app_id/{app_id}/biz_id/{biz_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListApps", runtime.WithHTTPPathPattern("/api/v1/config/list/app/app/biz_id/{biz_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_CreateContent_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_ListApps_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5448,11 +4521,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_CreateContent_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_ListApps_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_Config_ListContents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Config_ListAppsRest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5460,12 +4533,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListContents", runtime.WithHTTPPathPattern("/api/v1/config/list/content/content/app_id/{app_id}/biz_id/{biz_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListAppsRest", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_ListContents_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_ListAppsRest_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5473,11 +4546,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_ListContents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_ListAppsRest_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("PUT", pattern_Config_UpdateConfigHook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Config_ListAppsBySpaceRest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5485,12 +4558,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/UpdateConfigHook", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/config_hooks")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListAppsBySpaceRest", runtime.WithHTTPPathPattern("/api/v1/config/list/app/app/biz_id/{biz_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_UpdateConfigHook_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_ListAppsBySpaceRest_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5498,11 +4571,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_UpdateConfigHook_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_ListAppsBySpaceRest_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Config_GetConfigHook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Config_CreateConfigItem_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5510,12 +4583,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/GetConfigHook", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/config_hooks")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/CreateConfigItem", runtime.WithHTTPPathPattern("/api/v1/config/create/config_item/config_item/app_id/{app_id}/biz_id/{biz_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_GetConfigHook_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_CreateConfigItem_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5523,11 +4596,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_GetConfigHook_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_CreateConfigItem_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_Config_CreateCommit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("PUT", pattern_Config_BatchUpsertConfigItems_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5535,12 +4608,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/CreateCommit", runtime.WithHTTPPathPattern("/api/v1/config/create/commit/commit/config_item_id/{config_item_id}/app_id/{app_id}/biz_id/{biz_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/BatchUpsertConfigItems", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/config_items")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_CreateCommit_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_BatchUpsertConfigItems_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5548,11 +4621,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_CreateCommit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_BatchUpsertConfigItems_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_Config_ListCommits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("PUT", pattern_Config_UpdateConfigItem_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5560,12 +4633,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListCommits", runtime.WithHTTPPathPattern("/api/v1/config/list/commit/commit/app_id/{app_id}/biz_id/{biz_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/UpdateConfigItem", runtime.WithHTTPPathPattern("/api/v1/config/update/config_item/config_item/config_item_id/{id}/app_id/{app_id}/biz_id/{biz_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_ListCommits_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_UpdateConfigItem_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5573,11 +4646,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_ListCommits_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_UpdateConfigItem_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_Config_CreateRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("DELETE", pattern_Config_DeleteConfigItem_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5585,12 +4658,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/CreateRelease", runtime.WithHTTPPathPattern("/api/v1/config/create/release/release/app_id/{app_id}/biz_id/{biz_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/DeleteConfigItem", runtime.WithHTTPPathPattern("/api/v1/config/delete/config_item/config_item/config_item_id/{id}/app_id/{app_id}/biz_id/{biz_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_CreateRelease_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_DeleteConfigItem_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5598,11 +4671,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_CreateRelease_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_DeleteConfigItem_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Config_ListReleases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Config_GetConfigItem_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5610,12 +4683,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListReleases", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/releases")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/GetConfigItem", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/config_items/{config_item_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_ListReleases_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_GetConfigItem_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5623,11 +4696,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_ListReleases_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_GetConfigItem_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_Config_ListReleasedConfigItems_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Config_ListConfigItems_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5635,12 +4708,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListReleasedConfigItems", runtime.WithHTTPPathPattern("/api/v1/config/list/release/config_item/release_id/{release_id}/biz_id/{biz_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListConfigItems", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/config_items")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_ListReleasedConfigItems_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_ListConfigItems_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5648,11 +4721,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_ListReleasedConfigItems_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_ListConfigItems_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_Config_CreateHook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Config_ListConfigItemCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5660,12 +4733,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/CreateHook", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListConfigItemCount", runtime.WithHTTPPathPattern("/api/v1/config/config_item_count/biz_id/{biz_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_CreateHook_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_ListConfigItemCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5673,11 +4746,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_CreateHook_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_ListConfigItemCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("DELETE", pattern_Config_DeleteHook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Config_CreateContent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5685,12 +4758,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/DeleteHook", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/CreateContent", runtime.WithHTTPPathPattern("/api/v1/config/create/content/content/config_item_id/{config_item_id}/app_id/{app_id}/biz_id/{biz_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_DeleteHook_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_CreateContent_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5698,11 +4771,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_DeleteHook_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_CreateContent_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Config_ListHooks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Config_ListContents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5710,12 +4783,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListHooks", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListContents", runtime.WithHTTPPathPattern("/api/v1/config/list/content/content/app_id/{app_id}/biz_id/{biz_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_ListHooks_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_ListContents_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5723,11 +4796,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_ListHooks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_ListContents_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Config_ListHookTags_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Config_CreateCommit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5735,12 +4808,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListHookTags", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hook_tags")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/CreateCommit", runtime.WithHTTPPathPattern("/api/v1/config/create/commit/commit/config_item_id/{config_item_id}/app_id/{app_id}/biz_id/{biz_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_ListHookTags_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_CreateCommit_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5748,11 +4821,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_ListHookTags_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_CreateCommit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Config_GetHook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Config_ListCommits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5760,12 +4833,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/GetHook", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListCommits", runtime.WithHTTPPathPattern("/api/v1/config/list/commit/commit/app_id/{app_id}/biz_id/{biz_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_GetHook_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_ListCommits_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5773,11 +4846,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_GetHook_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_ListCommits_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_Config_CreateHookRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Config_CreateRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5785,12 +4858,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/CreateHookRelease", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/CreateRelease", runtime.WithHTTPPathPattern("/api/v1/config/create/release/release/app_id/{app_id}/biz_id/{biz_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_CreateHookRelease_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_CreateRelease_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5798,11 +4871,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_CreateHookRelease_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_CreateRelease_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Config_ListHookRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Config_ListReleases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5810,12 +4883,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListHookRelease", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListReleases", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/releases")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_ListHookRelease_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_ListReleases_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5823,11 +4896,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_ListHookRelease_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_ListReleases_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("DELETE", pattern_Config_DeleteHookRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Config_ListReleasedConfigItems_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5835,12 +4908,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/DeleteHookRelease", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListReleasedConfigItems", runtime.WithHTTPPathPattern("/api/v1/config/list/release/config_item/release_id/{release_id}/biz_id/{biz_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_DeleteHookRelease_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_ListReleasedConfigItems_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5848,11 +4921,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_DeleteHookRelease_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_ListReleasedConfigItems_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("PUT", pattern_Config_PublishHookRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Config_CreateHook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5860,12 +4933,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/PublishHookRelease", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id}/publish")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/CreateHook", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/hooks")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_PublishHookRelease_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_CreateHook_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5873,11 +4946,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_PublishHookRelease_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_CreateHook_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Config_GetHookRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("DELETE", pattern_Config_DeleteHook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5885,12 +4958,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/GetHookRelease", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/DeleteHook", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/hooks/{hook_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_GetHookRelease_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_DeleteHook_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5898,11 +4971,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_GetHookRelease_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_DeleteHook_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("PUT", pattern_Config_UpdateHookRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("PUT", pattern_Config_UpdateHook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5910,12 +4983,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/UpdateHookRelease", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/UpdateHook", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/hooks/{hook_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_UpdateHookRelease_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_UpdateHook_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5923,11 +4996,11 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_UpdateHookRelease_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_UpdateHook_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Config_ListHookReleasesReferences_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Config_ListHooks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -5935,12 +5008,12 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListHookReleasesReferences", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}/references")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbcs.Config/ListHooks", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/hooks/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Config_ListHookReleasesReferences_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Config_ListHooks_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -5948,7 +5021,7 @@ func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser return } - forward_Config_ListHookReleasesReferences_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_ListHooks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -6728,6 +5801,28 @@ func RegisterConfigHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli }) + mux.Handle("POST", pattern_Config_ListApps_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/ListApps", runtime.WithHTTPPathPattern("/api/v1/config/list/app/app/biz_id/{biz_id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Config_ListApps_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Config_ListApps_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Config_ListAppsRest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -6970,50 +6065,6 @@ func RegisterConfigHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli }) - mux.Handle("PUT", pattern_Config_UpdateConfigHook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/UpdateConfigHook", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/config_hooks")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Config_UpdateConfigHook_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Config_UpdateConfigHook_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Config_GetConfigHook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/GetConfigHook", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/config_hooks")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Config_GetConfigHook_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Config_GetConfigHook_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("POST", pattern_Config_CreateCommit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -7130,7 +6181,7 @@ func RegisterConfigHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/CreateHook", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/CreateHook", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/hooks")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -7152,7 +6203,7 @@ func RegisterConfigHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/DeleteHook", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/DeleteHook", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/hooks/{hook_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -7168,223 +6219,47 @@ func RegisterConfigHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli }) - mux.Handle("GET", pattern_Config_ListHooks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/ListHooks", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Config_ListHooks_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Config_ListHooks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Config_ListHookTags_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/ListHookTags", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hook_tags")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Config_ListHookTags_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Config_ListHookTags_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Config_GetHook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/GetHook", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Config_GetHook_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Config_GetHook_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_Config_CreateHookRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/CreateHookRelease", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Config_CreateHookRelease_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Config_CreateHookRelease_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Config_ListHookRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/ListHookRelease", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Config_ListHookRelease_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Config_ListHookRelease_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("DELETE", pattern_Config_DeleteHookRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/DeleteHookRelease", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Config_DeleteHookRelease_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Config_DeleteHookRelease_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PUT", pattern_Config_PublishHookRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/PublishHookRelease", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id}/publish")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Config_PublishHookRelease_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Config_PublishHookRelease_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Config_GetHookRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/GetHookRelease", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id}")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Config_GetHookRelease_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_Config_GetHookRelease_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("PUT", pattern_Config_UpdateHookRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("PUT", pattern_Config_UpdateHook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/UpdateHookRelease", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/UpdateHook", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/hooks/{hook_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Config_UpdateHookRelease_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Config_UpdateHook_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Config_UpdateHookRelease_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_UpdateHook_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Config_ListHookReleasesReferences_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Config_ListHooks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/ListHookReleasesReferences", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/hooks/{hook_id}/references")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbcs.Config/ListHooks", runtime.WithHTTPPathPattern("/api/v1/config/biz/{biz_id}/apps/{app_id}/hooks/list")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Config_ListHookReleasesReferences_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Config_ListHooks_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_Config_ListHookReleasesReferences_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Config_ListHooks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -7952,6 +6827,8 @@ var ( pattern_Config_GetAppByName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 2, 6, 2, 7, 1, 0, 4, 1, 5, 8}, []string{"api", "v1", "config", "biz", "biz_id", "apps", "query", "name", "app_name"}, "")) + pattern_Config_ListApps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 4, 2, 5, 1, 0, 4, 1, 5, 5}, []string{"api", "v1", "config", "list", "app", "biz_id"}, "")) + pattern_Config_ListAppsRest_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"api", "v1", "config", "biz", "biz_id", "apps"}, "")) pattern_Config_ListAppsBySpaceRest_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 4, 2, 5, 1, 0, 4, 1, 5, 5}, []string{"api", "v1", "config", "list", "app", "biz_id"}, "")) @@ -7974,10 +6851,6 @@ var ( pattern_Config_ListContents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 4, 2, 5, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 6}, []string{"api", "v1", "config", "list", "content", "app_id", "biz_id"}, "")) - pattern_Config_UpdateConfigHook_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"api", "v1", "config", "biz", "biz_id", "apps", "app_id", "config_hooks"}, "")) - - pattern_Config_GetConfigHook_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"api", "v1", "config", "biz", "biz_id", "apps", "app_id", "config_hooks"}, "")) - pattern_Config_CreateCommit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 4, 2, 5, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 7}, []string{"api", "v1", "config", "create", "commit", "config_item_id", "app_id", "biz_id"}, "")) pattern_Config_ListCommits_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 4, 2, 5, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 6}, []string{"api", "v1", "config", "list", "commit", "app_id", "biz_id"}, "")) @@ -7988,29 +6861,13 @@ var ( pattern_Config_ListReleasedConfigItems_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 2, 6, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 7}, []string{"api", "v1", "config", "list", "release", "config_item", "release_id", "biz_id"}, "")) - pattern_Config_CreateHook_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"api", "v1", "config", "biz", "biz_id", "hooks"}, "")) - - pattern_Config_DeleteHook_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"api", "v1", "config", "biz", "biz_id", "hooks", "hook_id"}, "")) - - pattern_Config_ListHooks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"api", "v1", "config", "biz", "biz_id", "hooks"}, "")) - - pattern_Config_ListHookTags_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"api", "v1", "config", "biz", "biz_id", "hook_tags"}, "")) - - pattern_Config_GetHook_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"api", "v1", "config", "biz", "biz_id", "hooks", "hook_id"}, "")) - - pattern_Config_CreateHookRelease_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"api", "v1", "config", "biz", "biz_id", "hooks", "hook_id", "hook_releases"}, "")) + pattern_Config_CreateHook_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"api", "v1", "config", "biz", "biz_id", "apps", "app_id", "hooks"}, "")) - pattern_Config_ListHookRelease_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"api", "v1", "config", "biz", "biz_id", "hooks", "hook_id", "hook_releases"}, "")) + pattern_Config_DeleteHook_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8}, []string{"api", "v1", "config", "biz", "biz_id", "apps", "app_id", "hooks", "hook_id"}, "")) - pattern_Config_DeleteHookRelease_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8}, []string{"api", "v1", "config", "biz", "biz_id", "hooks", "hook_id", "hook_releases", "release_id"}, "")) + pattern_Config_UpdateHook_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8}, []string{"api", "v1", "config", "biz", "biz_id", "apps", "app_id", "hooks", "hook_id"}, "")) - pattern_Config_PublishHookRelease_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8, 2, 9}, []string{"api", "v1", "config", "biz", "biz_id", "hooks", "hook_id", "hook_releases", "release_id", "publish"}, "")) - - pattern_Config_GetHookRelease_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8}, []string{"api", "v1", "config", "biz", "biz_id", "hooks", "hook_id", "hook_releases", "release_id"}, "")) - - pattern_Config_UpdateHookRelease_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8}, []string{"api", "v1", "config", "biz", "biz_id", "hooks", "hook_id", "hook_releases", "release_id"}, "")) - - pattern_Config_ListHookReleasesReferences_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"api", "v1", "config", "biz", "biz_id", "hooks", "hook_id", "references"}, "")) + pattern_Config_ListHooks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 2, 8}, []string{"api", "v1", "config", "biz", "biz_id", "apps", "app_id", "hooks", "list"}, "")) pattern_Config_CreateTemplateSpace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"api", "v1", "config", "biz", "biz_id", "template_spaces"}, "")) @@ -8074,6 +6931,8 @@ var ( forward_Config_GetAppByName_0 = runtime.ForwardResponseMessage + forward_Config_ListApps_0 = runtime.ForwardResponseMessage + forward_Config_ListAppsRest_0 = runtime.ForwardResponseMessage forward_Config_ListAppsBySpaceRest_0 = runtime.ForwardResponseMessage @@ -8096,10 +6955,6 @@ var ( forward_Config_ListContents_0 = runtime.ForwardResponseMessage - forward_Config_UpdateConfigHook_0 = runtime.ForwardResponseMessage - - forward_Config_GetConfigHook_0 = runtime.ForwardResponseMessage - forward_Config_CreateCommit_0 = runtime.ForwardResponseMessage forward_Config_ListCommits_0 = runtime.ForwardResponseMessage @@ -8114,25 +6969,9 @@ var ( forward_Config_DeleteHook_0 = runtime.ForwardResponseMessage - forward_Config_ListHooks_0 = runtime.ForwardResponseMessage - - forward_Config_ListHookTags_0 = runtime.ForwardResponseMessage + forward_Config_UpdateHook_0 = runtime.ForwardResponseMessage - forward_Config_GetHook_0 = runtime.ForwardResponseMessage - - forward_Config_CreateHookRelease_0 = runtime.ForwardResponseMessage - - forward_Config_ListHookRelease_0 = runtime.ForwardResponseMessage - - forward_Config_DeleteHookRelease_0 = runtime.ForwardResponseMessage - - forward_Config_PublishHookRelease_0 = runtime.ForwardResponseMessage - - forward_Config_GetHookRelease_0 = runtime.ForwardResponseMessage - - forward_Config_UpdateHookRelease_0 = runtime.ForwardResponseMessage - - forward_Config_ListHookReleasesReferences_0 = runtime.ForwardResponseMessage + forward_Config_ListHooks_0 = runtime.ForwardResponseMessage forward_Config_CreateTemplateSpace_0 = runtime.ForwardResponseMessage diff --git a/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service.proto b/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service.proto index 17cb5a51bb..4d5416cf0e 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service.proto +++ b/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service.proto @@ -8,13 +8,11 @@ import "bscp.io/pkg/protocol/core/content/content.proto"; import "bscp.io/pkg/protocol/core/credential/credential.proto"; import "bscp.io/pkg/protocol/core/credential-scope/credential-scope.proto"; import "bscp.io/pkg/protocol/core/hook/hook.proto"; -import "bscp.io/pkg/protocol/core/hook-release/hook_release.proto"; import "bscp.io/pkg/protocol/core/release/release.proto"; import "bscp.io/pkg/protocol/core/released-ci/released_ci.proto"; import "bscp.io/pkg/protocol/core/template/template.proto"; import "bscp.io/pkg/protocol/core/template-release/template_release.proto"; import "bscp.io/pkg/protocol/core/template-space/template_space.proto"; -import "bscp.io/pkg/protocol/core/config-hook/config_hook.proto"; import "google/api/annotations.proto"; import "google/protobuf/struct.proto"; @@ -50,6 +48,12 @@ service Config { get: "/api/v1/config/biz/{biz_id}/apps/query/name/{app_name}" }; } + rpc ListApps(ListAppsReq) returns (ListAppsResp) { + option (google.api.http) = { + post : "/api/v1/config/list/app/app/biz_id/{biz_id}" + body : "*" + }; + } // 获取用户有权限的 spaces 所有的 apps rpc ListAppsRest(ListAppsRestReq) returns (ListAppsResp) { @@ -116,18 +120,6 @@ service Config { }; } - rpc UpdateConfigHook(UpdateConfigHookReq) returns (UpdateConfigHookResp) { - option (google.api.http) = { - put : "/api/v1/config/biz/{biz_id}/apps/{app_id}/config_hooks" - body : "*" - }; - } - rpc GetConfigHook(GetConfigHookReq) returns (GetConfigHookResp) { - option (google.api.http) = { - get : "/api/v1/config/biz/{biz_id}/apps/{app_id}/config_hooks" - }; - } - rpc CreateCommit(CreateCommitReq) returns (CreateCommitResp) { option (google.api.http) = { post : "/api/v1/config/create/commit/commit/config_item_id/{config_item_id}/app_id/{app_id}/biz_id/{biz_id}" @@ -161,68 +153,27 @@ service Config { rpc CreateHook(CreateHookReq) returns (CreateHookResp) { option (google.api.http) = { - post : "/api/v1/config/biz/{biz_id}/hooks" + post : "/api/v1/config/biz/{biz_id}/apps/{app_id}/hooks" body : "*" }; } rpc DeleteHook(DeleteHookReq) returns (DeleteHookResp) { option (google.api.http) = { - delete : "/api/v1/config/biz/{biz_id}/hooks/{hook_id}" - }; - } - rpc ListHooks(ListHooksReq) returns (ListHooksResp) { - option (google.api.http) = { - get : "/api/v1/config/biz/{biz_id}/hooks" + delete : "/api/v1/config/biz/{biz_id}/apps/{app_id}/hooks/{hook_id}" }; } - rpc ListHookTags(ListHookTagsReq) returns (ListHookTagsResp) { + rpc UpdateHook(UpdateHookReq) returns (UpdateHookResp) { option (google.api.http) = { - get : "/api/v1/config/biz/{biz_id}/hook_tags" - }; - } - rpc GetHook(GetHookReq) returns (GetHookResp){ - option (google.api.http) = { - get : "/api/v1/config/biz/{biz_id}/hooks/{hook_id}" - }; - } - - rpc CreateHookRelease(CreateHookReleaseReq) returns (CreateHookReleaseResp){ - option (google.api.http) = { - post : "/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases" + put : "/api/v1/config/biz/{biz_id}/apps/{app_id}/hooks/{hook_id}" body : "*" }; } - rpc ListHookRelease(ListHookReleaseReq) returns (ListHookReleaseResp){ - option (google.api.http) = { - get : "/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases" - }; - } - rpc DeleteHookRelease(DeleteHookReleaseReq) returns (DeleteHookReleaseResp){ - option (google.api.http) = { - delete : "/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id}" - }; - } - rpc PublishHookRelease(PublishHookReleaseReq) returns (PublishHookReleaseResp){ - option (google.api.http) = { - put : "/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id}/publish" - }; - } - rpc GetHookRelease(GetHookReleaseReq) returns (pbhr.HookRelease) { - option (google.api.http) = { - get : "/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id}" - }; - } - rpc UpdateHookRelease(UpdateHookReleaseReq) returns (UpdateHookReleaseResp) { + rpc ListHooks(ListHooksReq) returns (ListHooksResp) { option (google.api.http) = { - put : "/api/v1/config/biz/{biz_id}/hooks/{hook_id}/hook_releases/{release_id}" + post : "/api/v1/config/biz/{biz_id}/apps/{app_id}/hooks/list" body : "*" }; } - rpc ListHookReleasesReferences(ListHookReleasesReferencesReq) returns (ListHookReleasesReferencesResp) { - option (google.api.http) = { - get : "/api/v1/config/biz/{biz_id}/hooks/{hook_id}/references" - }; - } rpc CreateTemplateSpace(CreateTemplateSpaceReq) returns (CreateTemplateSpaceResp) { option (google.api.http) = { @@ -477,6 +428,12 @@ message GetAppByNameReq { string app_name = 2; } +message ListAppsReq { + uint32 biz_id = 1; + google.protobuf.Struct filter = 2; + pbbase.BasePage page = 3; +} + message ListAppsRestReq { uint32 biz_id = 1; uint32 start = 2; @@ -623,36 +580,6 @@ message ListContentsResp { repeated pbcontent.Content details = 2; } -message CreateConfigHookReq { - uint32 biz_id = 1; - uint32 app_id = 2; - uint32 pre_hook_id = 3; - uint32 post_hook_id = 4; -} - -message CreateConfigHookResp { - uint32 id = 1; -} - -message UpdateConfigHookReq { - uint32 biz_id = 1; - uint32 app_id = 2; - uint32 pre_hook_id = 3; - uint32 post_hook_id = 4; - bool enable = 5; -} - -message UpdateConfigHookResp {} - -message GetConfigHookReq { - uint32 biz_id = 1; - uint32 app_id = 2; -} - -message GetConfigHookResp { - pbch.ConfigHook config_hook = 1; -} - message CreateCommitReq { uint32 biz_id = 1; uint32 app_id = 2; @@ -716,34 +643,48 @@ message ListReleasedConfigItemsResp { } message CreateHookReq { - uint32 biz_id = 1; - string name = 2; - string release_name = 3; - string type = 4; - string tag = 5; - string memo = 6; - string content = 7; + uint32 biz_id = 1; + uint32 app_id = 2; + uint32 release_id = 3; + string name = 4; + string pre_type = 5; + string pre_hook = 6; + string post_type = 7; + string post_hook = 8; } message CreateHookResp { uint32 id = 1; } +message UpdateHookReq { + uint32 biz_id = 1; + uint32 app_id = 2; + uint32 hook_id = 3; + uint32 release_id = 4; + string name = 5; + string pre_type = 6; + string pre_hook = 7; + string post_type = 8; + string post_hook = 9; +} + +message UpdateHookResp { +} + message DeleteHookReq { uint32 biz_id = 1; - uint32 hook_id = 2; + uint32 app_id = 2; + uint32 hook_id = 3; } message DeleteHookResp {} message ListHooksReq { - uint32 biz_id = 1; - string name = 2; - string tag = 3; - bool all = 4; - bool not_tag = 5; - uint32 start = 6; - uint32 limit = 7; + uint32 biz_id = 1; + uint32 app_id = 2; + google.protobuf.Struct filter = 3; + pbbase.BasePage page = 4; } message ListHooksResp { @@ -751,111 +692,6 @@ message ListHooksResp { repeated pbhook.Hook details = 2; } -message ListHookTagsReq { - uint32 biz_id = 1; -} - -message ListHookTagsResp { - repeated pbhook.CountHookTags details = 1; -} - -message CreateHookReleaseReq { - uint32 biz_id = 1; - uint32 hook_id = 2; - string name = 3; - string memo = 4; - string content = 7; -} - -message CreateHookReleaseResp { - uint32 id = 1; -} - -message ListHookReleaseReq { - uint32 biz_id = 1; - uint32 hook_id = 2; - string search_key = 3; - uint32 start = 4; - uint32 limit = 5; - bool all = 6; - string state = 7; -} - -message ListHookReleaseResp { - uint32 count = 1; - repeated pbhr.HookRelease details = 2; -} - -message DeleteHookReleaseReq { - uint32 biz_id = 1; - uint32 hook_id = 2; - uint32 release_id = 3; -} - -message DeleteHookReleaseResp {} - -message PublishHookReleaseReq { - uint32 biz_id = 1; - uint32 hook_id = 2; - uint32 release_id = 3; -} - -message PublishHookReleaseResp {} - -message GetHookReq { - uint32 biz_id = 1; - uint32 hook_id = 2; -} - -message GetHookResp { - uint32 id = 1; - GetHookInfoSpec spec = 2; - pbhook.HookAttachment attachment = 3; - pbbase.Revision revision = 4; -} - -message GetHookInfoSpec { - string name = 1; - string type = 3; - string tag = 4; - string memo = 5; - uint32 publish_num = 7; - message Releases { - uint32 not_release_id = 1; - } - Releases releases = 8; -} - -message GetHookReleaseReq { - uint32 biz_id = 1; - uint32 hook_id = 2; - uint32 release_id = 3; -} - -message UpdateHookReleaseReq { - uint32 biz_id = 1; - uint32 hook_id = 2; - uint32 release_id = 3; - string name = 4; - string content = 5; - string memo = 6; -} - -message UpdateHookReleaseResp {} - -message ListHookReleasesReferencesReq { - uint32 biz_id = 1; - uint32 hook_id = 2; - uint32 release_id = 3; - uint32 start = 4; - uint32 limit = 5; -} - -message ListHookReleasesReferencesResp { - uint32 count = 1; - repeated pbhr.ListHookReleasesReferencesDetails details = 2; -} - message CreateTemplateSpaceReq { uint32 biz_id = 1; string name = 2; diff --git a/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service_grpc.pb.go b/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service_grpc.pb.go index 0ad2ae64c0..8bb6d6412c 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service_grpc.pb.go +++ b/bcs-services/bcs-bscp/pkg/protocol/config-server/config_service_grpc.pb.go @@ -8,7 +8,6 @@ package pbcs import ( app "bscp.io/pkg/protocol/core/app" - hook_release "bscp.io/pkg/protocol/core/hook-release" context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -21,66 +20,57 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Config_CreateApp_FullMethodName = "/pbcs.Config/CreateApp" - Config_UpdateApp_FullMethodName = "/pbcs.Config/UpdateApp" - Config_DeleteApp_FullMethodName = "/pbcs.Config/DeleteApp" - Config_GetApp_FullMethodName = "/pbcs.Config/GetApp" - Config_GetAppByName_FullMethodName = "/pbcs.Config/GetAppByName" - Config_ListAppsRest_FullMethodName = "/pbcs.Config/ListAppsRest" - Config_ListAppsBySpaceRest_FullMethodName = "/pbcs.Config/ListAppsBySpaceRest" - Config_CreateConfigItem_FullMethodName = "/pbcs.Config/CreateConfigItem" - Config_BatchUpsertConfigItems_FullMethodName = "/pbcs.Config/BatchUpsertConfigItems" - Config_UpdateConfigItem_FullMethodName = "/pbcs.Config/UpdateConfigItem" - Config_DeleteConfigItem_FullMethodName = "/pbcs.Config/DeleteConfigItem" - Config_GetConfigItem_FullMethodName = "/pbcs.Config/GetConfigItem" - Config_ListConfigItems_FullMethodName = "/pbcs.Config/ListConfigItems" - Config_ListConfigItemCount_FullMethodName = "/pbcs.Config/ListConfigItemCount" - Config_CreateContent_FullMethodName = "/pbcs.Config/CreateContent" - Config_ListContents_FullMethodName = "/pbcs.Config/ListContents" - Config_UpdateConfigHook_FullMethodName = "/pbcs.Config/UpdateConfigHook" - Config_GetConfigHook_FullMethodName = "/pbcs.Config/GetConfigHook" - Config_CreateCommit_FullMethodName = "/pbcs.Config/CreateCommit" - Config_ListCommits_FullMethodName = "/pbcs.Config/ListCommits" - Config_CreateRelease_FullMethodName = "/pbcs.Config/CreateRelease" - Config_ListReleases_FullMethodName = "/pbcs.Config/ListReleases" - Config_ListReleasedConfigItems_FullMethodName = "/pbcs.Config/ListReleasedConfigItems" - Config_CreateHook_FullMethodName = "/pbcs.Config/CreateHook" - Config_DeleteHook_FullMethodName = "/pbcs.Config/DeleteHook" - Config_ListHooks_FullMethodName = "/pbcs.Config/ListHooks" - Config_ListHookTags_FullMethodName = "/pbcs.Config/ListHookTags" - Config_GetHook_FullMethodName = "/pbcs.Config/GetHook" - Config_CreateHookRelease_FullMethodName = "/pbcs.Config/CreateHookRelease" - Config_ListHookRelease_FullMethodName = "/pbcs.Config/ListHookRelease" - Config_DeleteHookRelease_FullMethodName = "/pbcs.Config/DeleteHookRelease" - Config_PublishHookRelease_FullMethodName = "/pbcs.Config/PublishHookRelease" - Config_GetHookRelease_FullMethodName = "/pbcs.Config/GetHookRelease" - Config_UpdateHookRelease_FullMethodName = "/pbcs.Config/UpdateHookRelease" - Config_ListHookReleasesReferences_FullMethodName = "/pbcs.Config/ListHookReleasesReferences" - Config_CreateTemplateSpace_FullMethodName = "/pbcs.Config/CreateTemplateSpace" - Config_DeleteTemplateSpace_FullMethodName = "/pbcs.Config/DeleteTemplateSpace" - Config_UpdateTemplateSpace_FullMethodName = "/pbcs.Config/UpdateTemplateSpace" - Config_ListTemplateSpaces_FullMethodName = "/pbcs.Config/ListTemplateSpaces" - Config_CreateTemplate_FullMethodName = "/pbcs.Config/CreateTemplate" - Config_DeleteTemplate_FullMethodName = "/pbcs.Config/DeleteTemplate" - Config_UpdateTemplate_FullMethodName = "/pbcs.Config/UpdateTemplate" - Config_ListTemplates_FullMethodName = "/pbcs.Config/ListTemplates" - Config_CreateTemplateRelease_FullMethodName = "/pbcs.Config/CreateTemplateRelease" - Config_ListTemplateReleases_FullMethodName = "/pbcs.Config/ListTemplateReleases" - Config_DeleteTemplateRelease_FullMethodName = "/pbcs.Config/DeleteTemplateRelease" - Config_CreateGroup_FullMethodName = "/pbcs.Config/CreateGroup" - Config_DeleteGroup_FullMethodName = "/pbcs.Config/DeleteGroup" - Config_UpdateGroup_FullMethodName = "/pbcs.Config/UpdateGroup" - Config_ListAllGroups_FullMethodName = "/pbcs.Config/ListAllGroups" - Config_ListAppGroups_FullMethodName = "/pbcs.Config/ListAppGroups" - Config_ListGroupReleasedApps_FullMethodName = "/pbcs.Config/ListGroupReleasedApps" - Config_Publish_FullMethodName = "/pbcs.Config/Publish" - Config_GenerateReleaseAndPublish_FullMethodName = "/pbcs.Config/GenerateReleaseAndPublish" - Config_CreateCredentials_FullMethodName = "/pbcs.Config/CreateCredentials" - Config_ListCredentials_FullMethodName = "/pbcs.Config/ListCredentials" - Config_DeleteCredential_FullMethodName = "/pbcs.Config/DeleteCredential" - Config_UpdateCredential_FullMethodName = "/pbcs.Config/UpdateCredential" - Config_ListCredentialScopes_FullMethodName = "/pbcs.Config/ListCredentialScopes" - Config_UpdateCredentialScope_FullMethodName = "/pbcs.Config/UpdateCredentialScope" + Config_CreateApp_FullMethodName = "/pbcs.Config/CreateApp" + Config_UpdateApp_FullMethodName = "/pbcs.Config/UpdateApp" + Config_DeleteApp_FullMethodName = "/pbcs.Config/DeleteApp" + Config_GetApp_FullMethodName = "/pbcs.Config/GetApp" + Config_GetAppByName_FullMethodName = "/pbcs.Config/GetAppByName" + Config_ListApps_FullMethodName = "/pbcs.Config/ListApps" + Config_ListAppsRest_FullMethodName = "/pbcs.Config/ListAppsRest" + Config_ListAppsBySpaceRest_FullMethodName = "/pbcs.Config/ListAppsBySpaceRest" + Config_CreateConfigItem_FullMethodName = "/pbcs.Config/CreateConfigItem" + Config_BatchUpsertConfigItems_FullMethodName = "/pbcs.Config/BatchUpsertConfigItems" + Config_UpdateConfigItem_FullMethodName = "/pbcs.Config/UpdateConfigItem" + Config_DeleteConfigItem_FullMethodName = "/pbcs.Config/DeleteConfigItem" + Config_GetConfigItem_FullMethodName = "/pbcs.Config/GetConfigItem" + Config_ListConfigItems_FullMethodName = "/pbcs.Config/ListConfigItems" + Config_ListConfigItemCount_FullMethodName = "/pbcs.Config/ListConfigItemCount" + Config_CreateContent_FullMethodName = "/pbcs.Config/CreateContent" + Config_ListContents_FullMethodName = "/pbcs.Config/ListContents" + Config_CreateCommit_FullMethodName = "/pbcs.Config/CreateCommit" + Config_ListCommits_FullMethodName = "/pbcs.Config/ListCommits" + Config_CreateRelease_FullMethodName = "/pbcs.Config/CreateRelease" + Config_ListReleases_FullMethodName = "/pbcs.Config/ListReleases" + Config_ListReleasedConfigItems_FullMethodName = "/pbcs.Config/ListReleasedConfigItems" + Config_CreateHook_FullMethodName = "/pbcs.Config/CreateHook" + Config_DeleteHook_FullMethodName = "/pbcs.Config/DeleteHook" + Config_UpdateHook_FullMethodName = "/pbcs.Config/UpdateHook" + Config_ListHooks_FullMethodName = "/pbcs.Config/ListHooks" + Config_CreateTemplateSpace_FullMethodName = "/pbcs.Config/CreateTemplateSpace" + Config_DeleteTemplateSpace_FullMethodName = "/pbcs.Config/DeleteTemplateSpace" + Config_UpdateTemplateSpace_FullMethodName = "/pbcs.Config/UpdateTemplateSpace" + Config_ListTemplateSpaces_FullMethodName = "/pbcs.Config/ListTemplateSpaces" + Config_CreateTemplate_FullMethodName = "/pbcs.Config/CreateTemplate" + Config_DeleteTemplate_FullMethodName = "/pbcs.Config/DeleteTemplate" + Config_UpdateTemplate_FullMethodName = "/pbcs.Config/UpdateTemplate" + Config_ListTemplates_FullMethodName = "/pbcs.Config/ListTemplates" + Config_CreateTemplateRelease_FullMethodName = "/pbcs.Config/CreateTemplateRelease" + Config_ListTemplateReleases_FullMethodName = "/pbcs.Config/ListTemplateReleases" + Config_DeleteTemplateRelease_FullMethodName = "/pbcs.Config/DeleteTemplateRelease" + Config_CreateGroup_FullMethodName = "/pbcs.Config/CreateGroup" + Config_DeleteGroup_FullMethodName = "/pbcs.Config/DeleteGroup" + Config_UpdateGroup_FullMethodName = "/pbcs.Config/UpdateGroup" + Config_ListAllGroups_FullMethodName = "/pbcs.Config/ListAllGroups" + Config_ListAppGroups_FullMethodName = "/pbcs.Config/ListAppGroups" + Config_ListGroupReleasedApps_FullMethodName = "/pbcs.Config/ListGroupReleasedApps" + Config_Publish_FullMethodName = "/pbcs.Config/Publish" + Config_GenerateReleaseAndPublish_FullMethodName = "/pbcs.Config/GenerateReleaseAndPublish" + Config_CreateCredentials_FullMethodName = "/pbcs.Config/CreateCredentials" + Config_ListCredentials_FullMethodName = "/pbcs.Config/ListCredentials" + Config_DeleteCredential_FullMethodName = "/pbcs.Config/DeleteCredential" + Config_UpdateCredential_FullMethodName = "/pbcs.Config/UpdateCredential" + Config_ListCredentialScopes_FullMethodName = "/pbcs.Config/ListCredentialScopes" + Config_UpdateCredentialScope_FullMethodName = "/pbcs.Config/UpdateCredentialScope" ) // ConfigClient is the client API for Config service. @@ -92,6 +82,7 @@ type ConfigClient interface { DeleteApp(ctx context.Context, in *DeleteAppReq, opts ...grpc.CallOption) (*DeleteAppResp, error) GetApp(ctx context.Context, in *GetAppReq, opts ...grpc.CallOption) (*app.App, error) GetAppByName(ctx context.Context, in *GetAppByNameReq, opts ...grpc.CallOption) (*app.App, error) + ListApps(ctx context.Context, in *ListAppsReq, opts ...grpc.CallOption) (*ListAppsResp, error) // 获取用户有权限的 spaces 所有的 apps ListAppsRest(ctx context.Context, in *ListAppsRestReq, opts ...grpc.CallOption) (*ListAppsResp, error) // 按 space 查询 app 信息 @@ -105,8 +96,6 @@ type ConfigClient interface { ListConfigItemCount(ctx context.Context, in *ListConfigItemCountReq, opts ...grpc.CallOption) (*ListConfigItemCountResp, error) CreateContent(ctx context.Context, in *CreateContentReq, opts ...grpc.CallOption) (*CreateContentResp, error) ListContents(ctx context.Context, in *ListContentsReq, opts ...grpc.CallOption) (*ListContentsResp, error) - UpdateConfigHook(ctx context.Context, in *UpdateConfigHookReq, opts ...grpc.CallOption) (*UpdateConfigHookResp, error) - GetConfigHook(ctx context.Context, in *GetConfigHookReq, opts ...grpc.CallOption) (*GetConfigHookResp, error) CreateCommit(ctx context.Context, in *CreateCommitReq, opts ...grpc.CallOption) (*CreateCommitResp, error) ListCommits(ctx context.Context, in *ListCommitsReq, opts ...grpc.CallOption) (*ListCommitsResp, error) CreateRelease(ctx context.Context, in *CreateReleaseReq, opts ...grpc.CallOption) (*CreateReleaseResp, error) @@ -114,16 +103,8 @@ type ConfigClient interface { ListReleasedConfigItems(ctx context.Context, in *ListReleasedConfigItemsReq, opts ...grpc.CallOption) (*ListReleasedConfigItemsResp, error) CreateHook(ctx context.Context, in *CreateHookReq, opts ...grpc.CallOption) (*CreateHookResp, error) DeleteHook(ctx context.Context, in *DeleteHookReq, opts ...grpc.CallOption) (*DeleteHookResp, error) + UpdateHook(ctx context.Context, in *UpdateHookReq, opts ...grpc.CallOption) (*UpdateHookResp, error) ListHooks(ctx context.Context, in *ListHooksReq, opts ...grpc.CallOption) (*ListHooksResp, error) - ListHookTags(ctx context.Context, in *ListHookTagsReq, opts ...grpc.CallOption) (*ListHookTagsResp, error) - GetHook(ctx context.Context, in *GetHookReq, opts ...grpc.CallOption) (*GetHookResp, error) - CreateHookRelease(ctx context.Context, in *CreateHookReleaseReq, opts ...grpc.CallOption) (*CreateHookReleaseResp, error) - ListHookRelease(ctx context.Context, in *ListHookReleaseReq, opts ...grpc.CallOption) (*ListHookReleaseResp, error) - DeleteHookRelease(ctx context.Context, in *DeleteHookReleaseReq, opts ...grpc.CallOption) (*DeleteHookReleaseResp, error) - PublishHookRelease(ctx context.Context, in *PublishHookReleaseReq, opts ...grpc.CallOption) (*PublishHookReleaseResp, error) - GetHookRelease(ctx context.Context, in *GetHookReleaseReq, opts ...grpc.CallOption) (*hook_release.HookRelease, error) - UpdateHookRelease(ctx context.Context, in *UpdateHookReleaseReq, opts ...grpc.CallOption) (*UpdateHookReleaseResp, error) - ListHookReleasesReferences(ctx context.Context, in *ListHookReleasesReferencesReq, opts ...grpc.CallOption) (*ListHookReleasesReferencesResp, error) CreateTemplateSpace(ctx context.Context, in *CreateTemplateSpaceReq, opts ...grpc.CallOption) (*CreateTemplateSpaceResp, error) DeleteTemplateSpace(ctx context.Context, in *DeleteTemplateSpaceReq, opts ...grpc.CallOption) (*DeleteTemplateSpaceResp, error) UpdateTemplateSpace(ctx context.Context, in *UpdateTemplateSpaceReq, opts ...grpc.CallOption) (*UpdateTemplateSpaceResp, error) @@ -204,6 +185,15 @@ func (c *configClient) GetAppByName(ctx context.Context, in *GetAppByNameReq, op return out, nil } +func (c *configClient) ListApps(ctx context.Context, in *ListAppsReq, opts ...grpc.CallOption) (*ListAppsResp, error) { + out := new(ListAppsResp) + err := c.cc.Invoke(ctx, Config_ListApps_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *configClient) ListAppsRest(ctx context.Context, in *ListAppsRestReq, opts ...grpc.CallOption) (*ListAppsResp, error) { out := new(ListAppsResp) err := c.cc.Invoke(ctx, Config_ListAppsRest_FullMethodName, in, out, opts...) @@ -303,24 +293,6 @@ func (c *configClient) ListContents(ctx context.Context, in *ListContentsReq, op return out, nil } -func (c *configClient) UpdateConfigHook(ctx context.Context, in *UpdateConfigHookReq, opts ...grpc.CallOption) (*UpdateConfigHookResp, error) { - out := new(UpdateConfigHookResp) - err := c.cc.Invoke(ctx, Config_UpdateConfigHook_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *configClient) GetConfigHook(ctx context.Context, in *GetConfigHookReq, opts ...grpc.CallOption) (*GetConfigHookResp, error) { - out := new(GetConfigHookResp) - err := c.cc.Invoke(ctx, Config_GetConfigHook_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *configClient) CreateCommit(ctx context.Context, in *CreateCommitReq, opts ...grpc.CallOption) (*CreateCommitResp, error) { out := new(CreateCommitResp) err := c.cc.Invoke(ctx, Config_CreateCommit_FullMethodName, in, out, opts...) @@ -384,90 +356,18 @@ func (c *configClient) DeleteHook(ctx context.Context, in *DeleteHookReq, opts . return out, nil } -func (c *configClient) ListHooks(ctx context.Context, in *ListHooksReq, opts ...grpc.CallOption) (*ListHooksResp, error) { - out := new(ListHooksResp) - err := c.cc.Invoke(ctx, Config_ListHooks_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *configClient) ListHookTags(ctx context.Context, in *ListHookTagsReq, opts ...grpc.CallOption) (*ListHookTagsResp, error) { - out := new(ListHookTagsResp) - err := c.cc.Invoke(ctx, Config_ListHookTags_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *configClient) GetHook(ctx context.Context, in *GetHookReq, opts ...grpc.CallOption) (*GetHookResp, error) { - out := new(GetHookResp) - err := c.cc.Invoke(ctx, Config_GetHook_FullMethodName, in, out, opts...) +func (c *configClient) UpdateHook(ctx context.Context, in *UpdateHookReq, opts ...grpc.CallOption) (*UpdateHookResp, error) { + out := new(UpdateHookResp) + err := c.cc.Invoke(ctx, Config_UpdateHook_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *configClient) CreateHookRelease(ctx context.Context, in *CreateHookReleaseReq, opts ...grpc.CallOption) (*CreateHookReleaseResp, error) { - out := new(CreateHookReleaseResp) - err := c.cc.Invoke(ctx, Config_CreateHookRelease_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *configClient) ListHookRelease(ctx context.Context, in *ListHookReleaseReq, opts ...grpc.CallOption) (*ListHookReleaseResp, error) { - out := new(ListHookReleaseResp) - err := c.cc.Invoke(ctx, Config_ListHookRelease_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *configClient) DeleteHookRelease(ctx context.Context, in *DeleteHookReleaseReq, opts ...grpc.CallOption) (*DeleteHookReleaseResp, error) { - out := new(DeleteHookReleaseResp) - err := c.cc.Invoke(ctx, Config_DeleteHookRelease_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *configClient) PublishHookRelease(ctx context.Context, in *PublishHookReleaseReq, opts ...grpc.CallOption) (*PublishHookReleaseResp, error) { - out := new(PublishHookReleaseResp) - err := c.cc.Invoke(ctx, Config_PublishHookRelease_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *configClient) GetHookRelease(ctx context.Context, in *GetHookReleaseReq, opts ...grpc.CallOption) (*hook_release.HookRelease, error) { - out := new(hook_release.HookRelease) - err := c.cc.Invoke(ctx, Config_GetHookRelease_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *configClient) UpdateHookRelease(ctx context.Context, in *UpdateHookReleaseReq, opts ...grpc.CallOption) (*UpdateHookReleaseResp, error) { - out := new(UpdateHookReleaseResp) - err := c.cc.Invoke(ctx, Config_UpdateHookRelease_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *configClient) ListHookReleasesReferences(ctx context.Context, in *ListHookReleasesReferencesReq, opts ...grpc.CallOption) (*ListHookReleasesReferencesResp, error) { - out := new(ListHookReleasesReferencesResp) - err := c.cc.Invoke(ctx, Config_ListHookReleasesReferences_FullMethodName, in, out, opts...) +func (c *configClient) ListHooks(ctx context.Context, in *ListHooksReq, opts ...grpc.CallOption) (*ListHooksResp, error) { + out := new(ListHooksResp) + err := c.cc.Invoke(ctx, Config_ListHooks_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -708,6 +608,7 @@ type ConfigServer interface { DeleteApp(context.Context, *DeleteAppReq) (*DeleteAppResp, error) GetApp(context.Context, *GetAppReq) (*app.App, error) GetAppByName(context.Context, *GetAppByNameReq) (*app.App, error) + ListApps(context.Context, *ListAppsReq) (*ListAppsResp, error) // 获取用户有权限的 spaces 所有的 apps ListAppsRest(context.Context, *ListAppsRestReq) (*ListAppsResp, error) // 按 space 查询 app 信息 @@ -721,8 +622,6 @@ type ConfigServer interface { ListConfigItemCount(context.Context, *ListConfigItemCountReq) (*ListConfigItemCountResp, error) CreateContent(context.Context, *CreateContentReq) (*CreateContentResp, error) ListContents(context.Context, *ListContentsReq) (*ListContentsResp, error) - UpdateConfigHook(context.Context, *UpdateConfigHookReq) (*UpdateConfigHookResp, error) - GetConfigHook(context.Context, *GetConfigHookReq) (*GetConfigHookResp, error) CreateCommit(context.Context, *CreateCommitReq) (*CreateCommitResp, error) ListCommits(context.Context, *ListCommitsReq) (*ListCommitsResp, error) CreateRelease(context.Context, *CreateReleaseReq) (*CreateReleaseResp, error) @@ -730,16 +629,8 @@ type ConfigServer interface { ListReleasedConfigItems(context.Context, *ListReleasedConfigItemsReq) (*ListReleasedConfigItemsResp, error) CreateHook(context.Context, *CreateHookReq) (*CreateHookResp, error) DeleteHook(context.Context, *DeleteHookReq) (*DeleteHookResp, error) + UpdateHook(context.Context, *UpdateHookReq) (*UpdateHookResp, error) ListHooks(context.Context, *ListHooksReq) (*ListHooksResp, error) - ListHookTags(context.Context, *ListHookTagsReq) (*ListHookTagsResp, error) - GetHook(context.Context, *GetHookReq) (*GetHookResp, error) - CreateHookRelease(context.Context, *CreateHookReleaseReq) (*CreateHookReleaseResp, error) - ListHookRelease(context.Context, *ListHookReleaseReq) (*ListHookReleaseResp, error) - DeleteHookRelease(context.Context, *DeleteHookReleaseReq) (*DeleteHookReleaseResp, error) - PublishHookRelease(context.Context, *PublishHookReleaseReq) (*PublishHookReleaseResp, error) - GetHookRelease(context.Context, *GetHookReleaseReq) (*hook_release.HookRelease, error) - UpdateHookRelease(context.Context, *UpdateHookReleaseReq) (*UpdateHookReleaseResp, error) - ListHookReleasesReferences(context.Context, *ListHookReleasesReferencesReq) (*ListHookReleasesReferencesResp, error) CreateTemplateSpace(context.Context, *CreateTemplateSpaceReq) (*CreateTemplateSpaceResp, error) DeleteTemplateSpace(context.Context, *DeleteTemplateSpaceReq) (*DeleteTemplateSpaceResp, error) UpdateTemplateSpace(context.Context, *UpdateTemplateSpaceReq) (*UpdateTemplateSpaceResp, error) @@ -786,6 +677,9 @@ func (UnimplementedConfigServer) GetApp(context.Context, *GetAppReq) (*app.App, func (UnimplementedConfigServer) GetAppByName(context.Context, *GetAppByNameReq) (*app.App, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAppByName not implemented") } +func (UnimplementedConfigServer) ListApps(context.Context, *ListAppsReq) (*ListAppsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListApps not implemented") +} func (UnimplementedConfigServer) ListAppsRest(context.Context, *ListAppsRestReq) (*ListAppsResp, error) { return nil, status.Errorf(codes.Unimplemented, "method ListAppsRest not implemented") } @@ -819,12 +713,6 @@ func (UnimplementedConfigServer) CreateContent(context.Context, *CreateContentRe func (UnimplementedConfigServer) ListContents(context.Context, *ListContentsReq) (*ListContentsResp, error) { return nil, status.Errorf(codes.Unimplemented, "method ListContents not implemented") } -func (UnimplementedConfigServer) UpdateConfigHook(context.Context, *UpdateConfigHookReq) (*UpdateConfigHookResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateConfigHook not implemented") -} -func (UnimplementedConfigServer) GetConfigHook(context.Context, *GetConfigHookReq) (*GetConfigHookResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetConfigHook not implemented") -} func (UnimplementedConfigServer) CreateCommit(context.Context, *CreateCommitReq) (*CreateCommitResp, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateCommit not implemented") } @@ -846,36 +734,12 @@ func (UnimplementedConfigServer) CreateHook(context.Context, *CreateHookReq) (*C func (UnimplementedConfigServer) DeleteHook(context.Context, *DeleteHookReq) (*DeleteHookResp, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteHook not implemented") } +func (UnimplementedConfigServer) UpdateHook(context.Context, *UpdateHookReq) (*UpdateHookResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateHook not implemented") +} func (UnimplementedConfigServer) ListHooks(context.Context, *ListHooksReq) (*ListHooksResp, error) { return nil, status.Errorf(codes.Unimplemented, "method ListHooks not implemented") } -func (UnimplementedConfigServer) ListHookTags(context.Context, *ListHookTagsReq) (*ListHookTagsResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListHookTags not implemented") -} -func (UnimplementedConfigServer) GetHook(context.Context, *GetHookReq) (*GetHookResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetHook not implemented") -} -func (UnimplementedConfigServer) CreateHookRelease(context.Context, *CreateHookReleaseReq) (*CreateHookReleaseResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateHookRelease not implemented") -} -func (UnimplementedConfigServer) ListHookRelease(context.Context, *ListHookReleaseReq) (*ListHookReleaseResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListHookRelease not implemented") -} -func (UnimplementedConfigServer) DeleteHookRelease(context.Context, *DeleteHookReleaseReq) (*DeleteHookReleaseResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteHookRelease not implemented") -} -func (UnimplementedConfigServer) PublishHookRelease(context.Context, *PublishHookReleaseReq) (*PublishHookReleaseResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method PublishHookRelease not implemented") -} -func (UnimplementedConfigServer) GetHookRelease(context.Context, *GetHookReleaseReq) (*hook_release.HookRelease, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetHookRelease not implemented") -} -func (UnimplementedConfigServer) UpdateHookRelease(context.Context, *UpdateHookReleaseReq) (*UpdateHookReleaseResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateHookRelease not implemented") -} -func (UnimplementedConfigServer) ListHookReleasesReferences(context.Context, *ListHookReleasesReferencesReq) (*ListHookReleasesReferencesResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListHookReleasesReferences not implemented") -} func (UnimplementedConfigServer) CreateTemplateSpace(context.Context, *CreateTemplateSpaceReq) (*CreateTemplateSpaceResp, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateTemplateSpace not implemented") } @@ -1053,6 +917,24 @@ func _Config_GetAppByName_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Config_ListApps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAppsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConfigServer).ListApps(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Config_ListApps_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConfigServer).ListApps(ctx, req.(*ListAppsReq)) + } + return interceptor(ctx, in, info, handler) +} + func _Config_ListAppsRest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListAppsRestReq) if err := dec(in); err != nil { @@ -1251,42 +1133,6 @@ func _Config_ListContents_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } -func _Config_UpdateConfigHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateConfigHookReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConfigServer).UpdateConfigHook(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Config_UpdateConfigHook_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConfigServer).UpdateConfigHook(ctx, req.(*UpdateConfigHookReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Config_GetConfigHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetConfigHookReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConfigServer).GetConfigHook(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Config_GetConfigHook_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConfigServer).GetConfigHook(ctx, req.(*GetConfigHookReq)) - } - return interceptor(ctx, in, info, handler) -} - func _Config_CreateCommit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateCommitReq) if err := dec(in); err != nil { @@ -1413,182 +1259,38 @@ func _Config_DeleteHook_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } -func _Config_ListHooks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListHooksReq) +func _Config_UpdateHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateHookReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ConfigServer).ListHooks(ctx, in) + return srv.(ConfigServer).UpdateHook(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Config_ListHooks_FullMethodName, + FullMethod: Config_UpdateHook_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConfigServer).ListHooks(ctx, req.(*ListHooksReq)) + return srv.(ConfigServer).UpdateHook(ctx, req.(*UpdateHookReq)) } return interceptor(ctx, in, info, handler) } -func _Config_ListHookTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListHookTagsReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConfigServer).ListHookTags(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Config_ListHookTags_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConfigServer).ListHookTags(ctx, req.(*ListHookTagsReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Config_GetHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetHookReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConfigServer).GetHook(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Config_GetHook_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConfigServer).GetHook(ctx, req.(*GetHookReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Config_CreateHookRelease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateHookReleaseReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConfigServer).CreateHookRelease(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Config_CreateHookRelease_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConfigServer).CreateHookRelease(ctx, req.(*CreateHookReleaseReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Config_ListHookRelease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListHookReleaseReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConfigServer).ListHookRelease(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Config_ListHookRelease_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConfigServer).ListHookRelease(ctx, req.(*ListHookReleaseReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Config_DeleteHookRelease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteHookReleaseReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConfigServer).DeleteHookRelease(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Config_DeleteHookRelease_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConfigServer).DeleteHookRelease(ctx, req.(*DeleteHookReleaseReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Config_PublishHookRelease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PublishHookReleaseReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConfigServer).PublishHookRelease(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Config_PublishHookRelease_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConfigServer).PublishHookRelease(ctx, req.(*PublishHookReleaseReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Config_GetHookRelease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetHookReleaseReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConfigServer).GetHookRelease(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Config_GetHookRelease_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConfigServer).GetHookRelease(ctx, req.(*GetHookReleaseReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Config_UpdateHookRelease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateHookReleaseReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConfigServer).UpdateHookRelease(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Config_UpdateHookRelease_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConfigServer).UpdateHookRelease(ctx, req.(*UpdateHookReleaseReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Config_ListHookReleasesReferences_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListHookReleasesReferencesReq) +func _Config_ListHooks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListHooksReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ConfigServer).ListHookReleasesReferences(ctx, in) + return srv.(ConfigServer).ListHooks(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Config_ListHookReleasesReferences_FullMethodName, + FullMethod: Config_ListHooks_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConfigServer).ListHookReleasesReferences(ctx, req.(*ListHookReleasesReferencesReq)) + return srv.(ConfigServer).ListHooks(ctx, req.(*ListHooksReq)) } return interceptor(ctx, in, info, handler) } @@ -2070,6 +1772,10 @@ var Config_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetAppByName", Handler: _Config_GetAppByName_Handler, }, + { + MethodName: "ListApps", + Handler: _Config_ListApps_Handler, + }, { MethodName: "ListAppsRest", Handler: _Config_ListAppsRest_Handler, @@ -2114,14 +1820,6 @@ var Config_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListContents", Handler: _Config_ListContents_Handler, }, - { - MethodName: "UpdateConfigHook", - Handler: _Config_UpdateConfigHook_Handler, - }, - { - MethodName: "GetConfigHook", - Handler: _Config_GetConfigHook_Handler, - }, { MethodName: "CreateCommit", Handler: _Config_CreateCommit_Handler, @@ -2151,44 +1849,12 @@ var Config_ServiceDesc = grpc.ServiceDesc{ Handler: _Config_DeleteHook_Handler, }, { - MethodName: "ListHooks", - Handler: _Config_ListHooks_Handler, - }, - { - MethodName: "ListHookTags", - Handler: _Config_ListHookTags_Handler, + MethodName: "UpdateHook", + Handler: _Config_UpdateHook_Handler, }, { - MethodName: "GetHook", - Handler: _Config_GetHook_Handler, - }, - { - MethodName: "CreateHookRelease", - Handler: _Config_CreateHookRelease_Handler, - }, - { - MethodName: "ListHookRelease", - Handler: _Config_ListHookRelease_Handler, - }, - { - MethodName: "DeleteHookRelease", - Handler: _Config_DeleteHookRelease_Handler, - }, - { - MethodName: "PublishHookRelease", - Handler: _Config_PublishHookRelease_Handler, - }, - { - MethodName: "GetHookRelease", - Handler: _Config_GetHookRelease_Handler, - }, - { - MethodName: "UpdateHookRelease", - Handler: _Config_UpdateHookRelease_Handler, - }, - { - MethodName: "ListHookReleasesReferences", - Handler: _Config_ListHookReleasesReferences_Handler, + MethodName: "ListHooks", + Handler: _Config_ListHooks_Handler, }, { MethodName: "CreateTemplateSpace", diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/Makefile b/bcs-services/bcs-bscp/pkg/protocol/core/Makefile index 2603f6de1e..cdcfae8880 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/core/Makefile +++ b/bcs-services/bcs-bscp/pkg/protocol/core/Makefile @@ -8,13 +8,11 @@ all: @cd released-ci && make @cd event && make @cd hook && make - @cd hook-release && make @cd group && make @cd released-group && make @cd credential && make @cd credential-scope && make @cd template-space && make - @cd config-hook && make @cd template && make @cd template-release && make @@ -28,12 +26,10 @@ clean: @cd released-ci && make clean @cd event && make clean @cd hook && make - @cd hook-release && make clean @cd group && make clean @cd released-group && make clean @cd credential && make clean @cd credential-scope && make clean @cd template-space && make clean - @cd config-hook && make clean @cd template && make clean @cd template-release && make clean diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/config-hook/Makefile b/bcs-services/bcs-bscp/pkg/protocol/core/config-hook/Makefile deleted file mode 100644 index 296efe0f5c..0000000000 --- a/bcs-services/bcs-bscp/pkg/protocol/core/config-hook/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../../../scripts/makefile/core_pb.mk diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/config-hook/config_hook.pb.go b/bcs-services/bcs-bscp/pkg/protocol/core/config-hook/config_hook.pb.go deleted file mode 100644 index 49ee449b5f..0000000000 --- a/bcs-services/bcs-bscp/pkg/protocol/core/config-hook/config_hook.pb.go +++ /dev/null @@ -1,354 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v4.22.0 -// source: config_hook.proto - -package pbch - -import ( - base "bscp.io/pkg/protocol/core/base" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - 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) -) - -// ConfigHook source resource reference: pkg/dal/table/configHook.go -type ConfigHook struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Spec *ConfigHookSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` - Attachment *ConfigHookAttachment `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"` - Revision *base.Revision `protobuf:"bytes,4,opt,name=revision,proto3" json:"revision,omitempty"` -} - -func (x *ConfigHook) Reset() { - *x = ConfigHook{} - if protoimpl.UnsafeEnabled { - mi := &file_config_hook_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ConfigHook) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfigHook) ProtoMessage() {} - -func (x *ConfigHook) ProtoReflect() protoreflect.Message { - mi := &file_config_hook_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 ConfigHook.ProtoReflect.Descriptor instead. -func (*ConfigHook) Descriptor() ([]byte, []int) { - return file_config_hook_proto_rawDescGZIP(), []int{0} -} - -func (x *ConfigHook) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *ConfigHook) GetSpec() *ConfigHookSpec { - if x != nil { - return x.Spec - } - return nil -} - -func (x *ConfigHook) GetAttachment() *ConfigHookAttachment { - if x != nil { - return x.Attachment - } - return nil -} - -func (x *ConfigHook) GetRevision() *base.Revision { - if x != nil { - return x.Revision - } - return nil -} - -// ConfigHookSpec source resource reference: pkg/dal/table/configHook.go -type ConfigHookSpec struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PreHookId uint32 `protobuf:"varint,1,opt,name=pre_hook_id,json=preHookId,proto3" json:"pre_hook_id,omitempty"` - PreHookReleaseId uint32 `protobuf:"varint,2,opt,name=pre_hook_release_id,json=preHookReleaseId,proto3" json:"pre_hook_release_id,omitempty"` - PostHookId uint32 `protobuf:"varint,3,opt,name=post_hook_id,json=postHookId,proto3" json:"post_hook_id,omitempty"` - PostHookReleaseId uint32 `protobuf:"varint,4,opt,name=post_hook_release_id,json=postHookReleaseId,proto3" json:"post_hook_release_id,omitempty"` -} - -func (x *ConfigHookSpec) Reset() { - *x = ConfigHookSpec{} - if protoimpl.UnsafeEnabled { - mi := &file_config_hook_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ConfigHookSpec) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfigHookSpec) ProtoMessage() {} - -func (x *ConfigHookSpec) ProtoReflect() protoreflect.Message { - mi := &file_config_hook_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 ConfigHookSpec.ProtoReflect.Descriptor instead. -func (*ConfigHookSpec) Descriptor() ([]byte, []int) { - return file_config_hook_proto_rawDescGZIP(), []int{1} -} - -func (x *ConfigHookSpec) GetPreHookId() uint32 { - if x != nil { - return x.PreHookId - } - return 0 -} - -func (x *ConfigHookSpec) GetPreHookReleaseId() uint32 { - if x != nil { - return x.PreHookReleaseId - } - return 0 -} - -func (x *ConfigHookSpec) GetPostHookId() uint32 { - if x != nil { - return x.PostHookId - } - return 0 -} - -func (x *ConfigHookSpec) GetPostHookReleaseId() uint32 { - if x != nil { - return x.PostHookReleaseId - } - return 0 -} - -type ConfigHookAttachment struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` -} - -func (x *ConfigHookAttachment) Reset() { - *x = ConfigHookAttachment{} - if protoimpl.UnsafeEnabled { - mi := &file_config_hook_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ConfigHookAttachment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfigHookAttachment) ProtoMessage() {} - -func (x *ConfigHookAttachment) ProtoReflect() protoreflect.Message { - mi := &file_config_hook_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 ConfigHookAttachment.ProtoReflect.Descriptor instead. -func (*ConfigHookAttachment) Descriptor() ([]byte, []int) { - return file_config_hook_proto_rawDescGZIP(), []int{2} -} - -func (x *ConfigHookAttachment) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -func (x *ConfigHookAttachment) GetAppId() uint32 { - if x != nil { - return x.AppId - } - return 0 -} - -var File_config_hook_proto protoreflect.FileDescriptor - -var file_config_hook_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x70, 0x62, 0x63, 0x68, 0x1a, 0x29, 0x62, 0x73, 0x63, 0x70, 0x2e, - 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb0, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, - 0x6f, 0x6f, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x28, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, 0x63, 0x68, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, - 0x6f, 0x6f, 0x6b, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x3a, 0x0a, - 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x68, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, - 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, - 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x08, 0x72, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, - 0x62, 0x61, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x72, - 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xb2, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1e, 0x0a, 0x0b, 0x70, 0x72, - 0x65, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x09, 0x70, 0x72, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x13, 0x70, 0x72, - 0x65, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x70, 0x72, 0x65, 0x48, 0x6f, 0x6f, 0x6b, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x70, 0x6f, 0x73, - 0x74, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x0a, 0x70, 0x6f, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x70, - 0x6f, 0x73, 0x74, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x70, 0x6f, 0x73, 0x74, 0x48, - 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x22, 0x44, 0x0a, 0x14, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, - 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, - 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, - 0x49, 0x64, 0x42, 0x2c, 0x5a, 0x2a, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2d, 0x68, 0x6f, 0x6f, 0x6b, 0x3b, 0x70, 0x62, 0x63, 0x68, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_config_hook_proto_rawDescOnce sync.Once - file_config_hook_proto_rawDescData = file_config_hook_proto_rawDesc -) - -func file_config_hook_proto_rawDescGZIP() []byte { - file_config_hook_proto_rawDescOnce.Do(func() { - file_config_hook_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_hook_proto_rawDescData) - }) - return file_config_hook_proto_rawDescData -} - -var file_config_hook_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_config_hook_proto_goTypes = []interface{}{ - (*ConfigHook)(nil), // 0: pbch.ConfigHook - (*ConfigHookSpec)(nil), // 1: pbch.ConfigHookSpec - (*ConfigHookAttachment)(nil), // 2: pbch.ConfigHookAttachment - (*base.Revision)(nil), // 3: pbbase.Revision -} -var file_config_hook_proto_depIdxs = []int32{ - 1, // 0: pbch.ConfigHook.spec:type_name -> pbch.ConfigHookSpec - 2, // 1: pbch.ConfigHook.attachment:type_name -> pbch.ConfigHookAttachment - 3, // 2: pbch.ConfigHook.revision:type_name -> pbbase.Revision - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_config_hook_proto_init() } -func file_config_hook_proto_init() { - if File_config_hook_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_config_hook_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfigHook); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_hook_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfigHookSpec); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_config_hook_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfigHookAttachment); 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_config_hook_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_config_hook_proto_goTypes, - DependencyIndexes: file_config_hook_proto_depIdxs, - MessageInfos: file_config_hook_proto_msgTypes, - }.Build() - File_config_hook_proto = out.File - file_config_hook_proto_rawDesc = nil - file_config_hook_proto_goTypes = nil - file_config_hook_proto_depIdxs = nil -} diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/config-hook/config_hook.proto b/bcs-services/bcs-bscp/pkg/protocol/core/config-hook/config_hook.proto deleted file mode 100644 index b2bdf39569..0000000000 --- a/bcs-services/bcs-bscp/pkg/protocol/core/config-hook/config_hook.proto +++ /dev/null @@ -1,28 +0,0 @@ -syntax = "proto3"; - -package pbch; - -import "bscp.io/pkg/protocol/core/base/base.proto"; - -option go_package = "bscp.io/pkg/protocol/core/config-hook;pbch"; - -// ConfigHook source resource reference: pkg/dal/table/configHook.go -message ConfigHook { - uint32 id = 1; - ConfigHookSpec spec = 2; - ConfigHookAttachment attachment = 3; - pbbase.Revision revision = 4; -} - -// ConfigHookSpec source resource reference: pkg/dal/table/configHook.go -message ConfigHookSpec { - uint32 pre_hook_id = 1; - uint32 pre_hook_release_id = 2; - uint32 post_hook_id = 3; - uint32 post_hook_release_id = 4; -} - -message ConfigHookAttachment { - uint32 biz_id = 1; - uint32 app_id = 2; -} \ No newline at end of file diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/config-hook/convert.go b/bcs-services/bcs-bscp/pkg/protocol/core/config-hook/convert.go deleted file mode 100644 index c939111542..0000000000 --- a/bcs-services/bcs-bscp/pkg/protocol/core/config-hook/convert.go +++ /dev/null @@ -1,102 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 pbch - -import ( - "bscp.io/pkg/dal/table" - pbbase "bscp.io/pkg/protocol/core/base" -) - -// ConfigHook convert pb ConfigHook to table ConfigHook -func (m *ConfigHook) ConfigHook() (*table.ConfigHook, error) { - if m == nil { - return nil, nil - } - - spec, err := m.Spec.ConfigHookSpec() - if err != nil { - return nil, err - } - - return &table.ConfigHook{ - ID: m.Id, - Spec: spec, - Attachment: m.Attachment.ConfigHookAttachment(), - }, nil -} - -// ConfigHookSpec convert pb ConfigHookSpec to table ConfigHookSpec -func (m *ConfigHookSpec) ConfigHookSpec() (*table.ConfigHookSpec, error) { - if m == nil { - return nil, nil - } - - return &table.ConfigHookSpec{ - PreHookID: m.PreHookId, - PreHookReleaseID: m.PreHookReleaseId, - PostHookID: m.PostHookId, - PostHookReleaseID: m.PostHookReleaseId, - }, nil -} - -// ConfigHookAttachment convert pb ConfigHookAttachment to table ConfigHookAttachment -func (m *ConfigHookAttachment) ConfigHookAttachment() *table.ConfigHookAttachment { - if m == nil { - return nil - } - - return &table.ConfigHookAttachment{ - BizID: m.BizId, - AppID: m.AppId, - } -} - -// PbConfigHook convert table ConfigHook to pb ConfigHook -func PbConfigHook(c *table.ConfigHook) *ConfigHook { - if c == nil { - return nil - } - return &ConfigHook{ - Id: c.ID, - Spec: PbConfigHookSpec(c.Spec), - Attachment: PbConfigHookAttachment(c.Attachment), - Revision: pbbase.PbRevision(c.Revision), - } -} - -// PbConfigHookSpec convert table ConfigHookSpec to pb ConfigHookSpec -func PbConfigHookSpec(spec *table.ConfigHookSpec) *ConfigHookSpec { - if spec == nil { - return nil - } - - return &ConfigHookSpec{ - PreHookId: spec.PreHookID, - PreHookReleaseId: spec.PreHookReleaseID, - PostHookId: spec.PostHookID, - PostHookReleaseId: spec.PostHookReleaseID, - } - -} - -// PbConfigHookAttachment convert table ConfigHookAttachment to pb ConfigHookAttachment -func PbConfigHookAttachment(at *table.ConfigHookAttachment) *ConfigHookAttachment { - if at == nil { - return nil - } - - return &ConfigHookAttachment{ - BizId: at.BizID, - AppId: at.AppID, - } -} diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/content/convert.go b/bcs-services/bcs-bscp/pkg/protocol/core/content/convert.go index 691246f380..3751181351 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/core/content/convert.go +++ b/bcs-services/bcs-bscp/pkg/protocol/core/content/convert.go @@ -70,7 +70,7 @@ func PbContentAttachment(at *table.ContentAttachment) *ContentAttachment { } } -// PbContents convert table Content to pb Content +// PbContents convert table Contents to pb Contents func PbContents(cs []*table.Content) []*Content { if cs == nil { return make([]*Content, 0) diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/credential/convert.go b/bcs-services/bcs-bscp/pkg/protocol/core/credential/convert.go index 22dca38f4d..5d06a39804 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/core/credential/convert.go +++ b/bcs-services/bcs-bscp/pkg/protocol/core/credential/convert.go @@ -1,15 +1,3 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 pbcredential import ( @@ -18,9 +6,9 @@ import ( ) // CredentialSpec convert pb CredentialSpec to table CredentialSpec -func (c *CredentialSpec) CredentialSpec() *table.CredentialSpec { +func (c *CredentialSpec) CredentialSpec() (*table.CredentialSpec, error) { if c == nil { - return nil + return nil, nil } return &table.CredentialSpec{ @@ -29,7 +17,7 @@ func (c *CredentialSpec) CredentialSpec() *table.CredentialSpec { EncAlgorithm: c.EncAlgorithm, Memo: c.Memo, Enable: c.Enable, - } + }, nil } // CredentialAttachment convert pb CredentialAttachment to table CredentialAttachment @@ -44,37 +32,46 @@ func (m *CredentialAttachment) CredentialAttachment() *table.CredentialAttachmen } // PbCredentials Credentials -func PbCredentials(s []*table.Credential) []*CredentialList { +func PbCredentials(s []*table.Credential) ([]*CredentialList, error) { if s == nil { - return make([]*CredentialList, 0) + return make([]*CredentialList, 0), nil } result := make([]*CredentialList, 0) for _, one := range s { - result = append(result, PbCredential(one)) + credential, err := PbCredential(one) + if err != nil { + return nil, err + } + result = append(result, credential) } - return result + return result, nil } // PbCredential convert table Credential to pb Credential -func PbCredential(s *table.Credential) *CredentialList { +func PbCredential(s *table.Credential) (*CredentialList, error) { if s == nil { - return nil + return nil, nil + } + + spec, err := PbCredentialSpec(s.Spec) + if err != nil { + return nil, err } return &CredentialList{ Id: s.ID, - Spec: PbCredentialSpec(s.Spec), + Spec: spec, Attachment: PbCredentialAttachment(s.Attachment), Revision: pbbase.PbRevision(s.Revision), - } + }, nil } // PbCredentialSpec convert table CredentialSpec to pb CredentialSpec -func PbCredentialSpec(spec *table.CredentialSpec) *CredentialSpec { +func PbCredentialSpec(spec *table.CredentialSpec) (*CredentialSpec, error) { if spec == nil { - return nil + return nil, nil } return &CredentialSpec{ @@ -83,7 +80,7 @@ func PbCredentialSpec(spec *table.CredentialSpec) *CredentialSpec { EncAlgorithm: spec.EncAlgorithm, Enable: spec.Enable, Memo: spec.Memo, - } + }, nil } // PbCredentialAttachment convert table CredentialAttachment to pb CredentialAttachment diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/hook-release/Makefile b/bcs-services/bcs-bscp/pkg/protocol/core/hook-release/Makefile deleted file mode 100644 index 296efe0f5c..0000000000 --- a/bcs-services/bcs-bscp/pkg/protocol/core/hook-release/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../../../scripts/makefile/core_pb.mk diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/hook-release/convert.go b/bcs-services/bcs-bscp/pkg/protocol/core/hook-release/convert.go deleted file mode 100644 index aa237ceeb1..0000000000 --- a/bcs-services/bcs-bscp/pkg/protocol/core/hook-release/convert.go +++ /dev/null @@ -1,174 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 pbhr - -import ( - "bscp.io/pkg/dal/table" - pbbase "bscp.io/pkg/protocol/core/base" - "bscp.io/pkg/runtime/selector" - "bscp.io/pkg/types" - pbstruct "github.com/golang/protobuf/ptypes/struct" -) - -// HookReleaseSpace convert pb HookReleaseSpace to table HookReleaseSpace -func (m *HookRelease) HookReleaseSpace() (*table.HookRelease, error) { - if m == nil { - return nil, nil - } - - spec, err := m.Spec.HookReleaseSpec() - if err != nil { - return nil, err - } - - return &table.HookRelease{ - ID: m.Id, - Spec: spec, - Attachment: m.Attachment.HookReleaseAttachment(), - }, nil -} - -// HookReleaseSpec convert pb HookReleaseSpace to table HookReleaseSpace -func (m *HookReleaseSpec) HookReleaseSpec() (*table.HookReleaseSpec, error) { - if m == nil { - return nil, nil - } - - return &table.HookReleaseSpec{ - Name: m.Name, - PublishNum: 0, - Content: m.Content, - Memo: m.Memo, - }, nil -} - -// PbHookReleaseSpec convert table HookReleaseSpec to pb HookReleaseSpec -func PbHookReleaseSpec(spec *table.HookReleaseSpec) (*HookReleaseSpec, error) { - if spec == nil { - return nil, nil - } - - return &HookReleaseSpec{ - Name: spec.Name, - Content: spec.Content, - PublishNum: spec.PublishNum, - State: spec.State.String(), - Memo: spec.Memo, - }, nil -} - -// HookReleaseAttachment convert pb HookReleaseAttachment to table HookReleaseAttachment -func (m *HookReleaseAttachment) HookReleaseAttachment() *table.HookReleaseAttachment { - if m == nil { - return nil - } - - return &table.HookReleaseAttachment{ - BizID: m.BizId, - HookID: m.HookId, - } -} - -// HookReleaseSpaceAttachment convert table HookReleaseAttachment to pb HookReleaseAttachment -func HookReleaseSpaceAttachment(at *table.HookReleaseAttachment) *HookReleaseAttachment { - if at == nil { - return nil - } - - return &HookReleaseAttachment{ - BizId: at.BizID, - HookId: at.HookID, - } -} - -// PbHookReleaseSpaces convert table HookRelease to pb HookRelease -func PbHookReleaseSpaces(s []*table.HookRelease) ([]*HookRelease, error) { - if s == nil { - return make([]*HookRelease, 0), nil - } - - result := make([]*HookRelease, 0) - for _, one := range s { - hook, err := PbHookRelease(one) - if err != nil { - return nil, err - } - result = append(result, hook) - } - - return result, nil -} - -// PbHookRelease convert table HookRelease to pb HookRelease -func PbHookRelease(s *table.HookRelease) (*HookRelease, error) { - if s == nil { - return nil, nil - } - - spec, err := PbHookReleaseSpec(s.Spec) - if err != nil { - return nil, err - } - - return &HookRelease{ - Id: s.ID, - Spec: spec, - Attachment: HookReleaseSpaceAttachment(s.Attachment), - Revision: pbbase.PbRevision(s.Revision), - }, nil -} - -// UnmarshalSelector unmarshal pb struct to selector. -func UnmarshalSelector(pb *pbstruct.Struct) (*selector.Selector, error) { - json, err := pb.MarshalJSON() - if err != nil { - return nil, err - } - - s := new(selector.Selector) - if err = s.Unmarshal(json); err != nil { - return nil, err - } - - return s, nil -} - -// PbListHookReleasesReferencesDetails .. -func PbListHookReleasesReferencesDetails( - resp []*types.ListHookReleasesReferences) []*ListHookReleasesReferencesDetails { - if resp == nil { - return nil - } - - result := make([]*ListHookReleasesReferencesDetails, 0) - for _, one := range resp { - hook := PbListHookReleasesReferences(one) - - result = append(result, hook) - } - - return result - -} - -// PbListHookReleasesReferences ... -func PbListHookReleasesReferences(h *types.ListHookReleasesReferences) *ListHookReleasesReferencesDetails { - return &ListHookReleasesReferencesDetails{ - HookReleaseName: h.HookReleaseName, - AppName: h.AppName, - AppId: h.AppID, - ConfigReleaseName: h.ConfigReleaseName, - ConfigReleaseId: h.HookReleaseID, - State: h.PubSate, - } -} diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/hook-release/hook_release.pb.go b/bcs-services/bcs-bscp/pkg/protocol/core/hook-release/hook_release.pb.go deleted file mode 100644 index fe698b0d02..0000000000 --- a/bcs-services/bcs-bscp/pkg/protocol/core/hook-release/hook_release.pb.go +++ /dev/null @@ -1,477 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v4.22.0 -// source: hook_release.proto - -package pbhr - -import ( - base "bscp.io/pkg/protocol/core/base" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - 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) -) - -// HookRelease source resource reference: pkg/dal/table/hook_release.go -type HookRelease struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Spec *HookReleaseSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` - Attachment *HookReleaseAttachment `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"` - Revision *base.Revision `protobuf:"bytes,4,opt,name=revision,proto3" json:"revision,omitempty"` -} - -func (x *HookRelease) Reset() { - *x = HookRelease{} - if protoimpl.UnsafeEnabled { - mi := &file_hook_release_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HookRelease) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HookRelease) ProtoMessage() {} - -func (x *HookRelease) ProtoReflect() protoreflect.Message { - mi := &file_hook_release_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 HookRelease.ProtoReflect.Descriptor instead. -func (*HookRelease) Descriptor() ([]byte, []int) { - return file_hook_release_proto_rawDescGZIP(), []int{0} -} - -func (x *HookRelease) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *HookRelease) GetSpec() *HookReleaseSpec { - if x != nil { - return x.Spec - } - return nil -} - -func (x *HookRelease) GetAttachment() *HookReleaseAttachment { - if x != nil { - return x.Attachment - } - return nil -} - -func (x *HookRelease) GetRevision() *base.Revision { - if x != nil { - return x.Revision - } - return nil -} - -// HookReleaseAttachment source resource reference: pkg/dal/table/hook_release.go -type HookReleaseSpec struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` - PublishNum uint32 `protobuf:"varint,3,opt,name=publish_num,json=publishNum,proto3" json:"publish_num,omitempty"` - State string `protobuf:"bytes,4,opt,name=state,proto3" json:"state,omitempty"` - Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` -} - -func (x *HookReleaseSpec) Reset() { - *x = HookReleaseSpec{} - if protoimpl.UnsafeEnabled { - mi := &file_hook_release_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HookReleaseSpec) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HookReleaseSpec) ProtoMessage() {} - -func (x *HookReleaseSpec) ProtoReflect() protoreflect.Message { - mi := &file_hook_release_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 HookReleaseSpec.ProtoReflect.Descriptor instead. -func (*HookReleaseSpec) Descriptor() ([]byte, []int) { - return file_hook_release_proto_rawDescGZIP(), []int{1} -} - -func (x *HookReleaseSpec) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *HookReleaseSpec) GetContent() string { - if x != nil { - return x.Content - } - return "" -} - -func (x *HookReleaseSpec) GetPublishNum() uint32 { - if x != nil { - return x.PublishNum - } - return 0 -} - -func (x *HookReleaseSpec) GetState() string { - if x != nil { - return x.State - } - return "" -} - -func (x *HookReleaseSpec) GetMemo() string { - if x != nil { - return x.Memo - } - return "" -} - -// HookReleaseAttachment source resource reference: pkg/dal/table/hook_release.go -type HookReleaseAttachment struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` -} - -func (x *HookReleaseAttachment) Reset() { - *x = HookReleaseAttachment{} - if protoimpl.UnsafeEnabled { - mi := &file_hook_release_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HookReleaseAttachment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HookReleaseAttachment) ProtoMessage() {} - -func (x *HookReleaseAttachment) ProtoReflect() protoreflect.Message { - mi := &file_hook_release_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 HookReleaseAttachment.ProtoReflect.Descriptor instead. -func (*HookReleaseAttachment) Descriptor() ([]byte, []int) { - return file_hook_release_proto_rawDescGZIP(), []int{2} -} - -func (x *HookReleaseAttachment) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -func (x *HookReleaseAttachment) GetHookId() uint32 { - if x != nil { - return x.HookId - } - return 0 -} - -// HookReleaseAttachment source resource reference: pkg/types/hook_release.go -type ListHookReleasesReferencesDetails struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - HookReleaseName string `protobuf:"bytes,1,opt,name=hook_release_name,json=hookReleaseName,proto3" json:"hook_release_name,omitempty"` - AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - AppName string `protobuf:"bytes,3,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"` - ConfigReleaseName string `protobuf:"bytes,4,opt,name=config_release_name,json=configReleaseName,proto3" json:"config_release_name,omitempty"` - ConfigReleaseId uint32 `protobuf:"varint,5,opt,name=config_release_id,json=configReleaseId,proto3" json:"config_release_id,omitempty"` - State string `protobuf:"bytes,6,opt,name=state,proto3" json:"state,omitempty"` -} - -func (x *ListHookReleasesReferencesDetails) Reset() { - *x = ListHookReleasesReferencesDetails{} - if protoimpl.UnsafeEnabled { - mi := &file_hook_release_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListHookReleasesReferencesDetails) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListHookReleasesReferencesDetails) ProtoMessage() {} - -func (x *ListHookReleasesReferencesDetails) ProtoReflect() protoreflect.Message { - mi := &file_hook_release_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 ListHookReleasesReferencesDetails.ProtoReflect.Descriptor instead. -func (*ListHookReleasesReferencesDetails) Descriptor() ([]byte, []int) { - return file_hook_release_proto_rawDescGZIP(), []int{3} -} - -func (x *ListHookReleasesReferencesDetails) GetHookReleaseName() string { - if x != nil { - return x.HookReleaseName - } - return "" -} - -func (x *ListHookReleasesReferencesDetails) GetAppId() uint32 { - if x != nil { - return x.AppId - } - return 0 -} - -func (x *ListHookReleasesReferencesDetails) GetAppName() string { - if x != nil { - return x.AppName - } - return "" -} - -func (x *ListHookReleasesReferencesDetails) GetConfigReleaseName() string { - if x != nil { - return x.ConfigReleaseName - } - return "" -} - -func (x *ListHookReleasesReferencesDetails) GetConfigReleaseId() uint32 { - if x != nil { - return x.ConfigReleaseId - } - return 0 -} - -func (x *ListHookReleasesReferencesDetails) GetState() string { - if x != nil { - return x.State - } - return "" -} - -var File_hook_release_proto protoreflect.FileDescriptor - -var file_hook_release_proto_rawDesc = []byte{ - 0x0a, 0x12, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x70, 0x62, 0x68, 0x72, 0x1a, 0x29, 0x62, 0x73, 0x63, 0x70, - 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb3, 0x01, 0x0a, 0x0b, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x62, 0x68, 0x72, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, - 0x12, 0x3b, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x62, 0x68, 0x72, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, - 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, - 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8a, 0x01, 0x0a, 0x0f, - 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x0a, - 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x12, 0x14, - 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x47, 0x0a, 0x15, 0x48, 0x6f, 0x6f, 0x6b, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, - 0x74, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, - 0x64, 0x22, 0xf3, 0x01, 0x0a, 0x21, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, - 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, - 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0f, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, - 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, - 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, - 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, - 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, - 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x42, 0x2d, 0x5a, 0x2b, 0x62, 0x73, 0x63, 0x70, 0x2e, - 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x2d, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x3b, 0x70, 0x62, 0x68, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_hook_release_proto_rawDescOnce sync.Once - file_hook_release_proto_rawDescData = file_hook_release_proto_rawDesc -) - -func file_hook_release_proto_rawDescGZIP() []byte { - file_hook_release_proto_rawDescOnce.Do(func() { - file_hook_release_proto_rawDescData = protoimpl.X.CompressGZIP(file_hook_release_proto_rawDescData) - }) - return file_hook_release_proto_rawDescData -} - -var file_hook_release_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_hook_release_proto_goTypes = []interface{}{ - (*HookRelease)(nil), // 0: pbhr.HookRelease - (*HookReleaseSpec)(nil), // 1: pbhr.HookReleaseSpec - (*HookReleaseAttachment)(nil), // 2: pbhr.HookReleaseAttachment - (*ListHookReleasesReferencesDetails)(nil), // 3: pbhr.ListHookReleasesReferencesDetails - (*base.Revision)(nil), // 4: pbbase.Revision -} -var file_hook_release_proto_depIdxs = []int32{ - 1, // 0: pbhr.HookRelease.spec:type_name -> pbhr.HookReleaseSpec - 2, // 1: pbhr.HookRelease.attachment:type_name -> pbhr.HookReleaseAttachment - 4, // 2: pbhr.HookRelease.revision:type_name -> pbbase.Revision - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_hook_release_proto_init() } -func file_hook_release_proto_init() { - if File_hook_release_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_hook_release_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HookRelease); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_hook_release_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HookReleaseSpec); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_hook_release_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HookReleaseAttachment); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_hook_release_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHookReleasesReferencesDetails); 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_hook_release_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_hook_release_proto_goTypes, - DependencyIndexes: file_hook_release_proto_depIdxs, - MessageInfos: file_hook_release_proto_msgTypes, - }.Build() - File_hook_release_proto = out.File - file_hook_release_proto_rawDesc = nil - file_hook_release_proto_goTypes = nil - file_hook_release_proto_depIdxs = nil -} diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/hook-release/hook_release.proto b/bcs-services/bcs-bscp/pkg/protocol/core/hook-release/hook_release.proto deleted file mode 100644 index 99369b1237..0000000000 --- a/bcs-services/bcs-bscp/pkg/protocol/core/hook-release/hook_release.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; - -package pbhr; - -import "bscp.io/pkg/protocol/core/base/base.proto"; - -option go_package = "bscp.io/pkg/protocol/core/hook-release;pbhr"; - - -// HookRelease source resource reference: pkg/dal/table/hook_release.go -message HookRelease { - uint32 id = 1; - HookReleaseSpec spec = 2; - HookReleaseAttachment attachment = 3; - pbbase.Revision revision = 4; -} - - -// HookReleaseAttachment source resource reference: pkg/dal/table/hook_release.go -message HookReleaseSpec { - string name = 1; - string content = 2; - uint32 publish_num = 3; - string state = 4; - string memo = 5; -} - -// HookReleaseAttachment source resource reference: pkg/dal/table/hook_release.go -message HookReleaseAttachment { - uint32 biz_id = 1; - uint32 hook_id = 2; -} - -// HookReleaseAttachment source resource reference: pkg/types/hook_release.go -message ListHookReleasesReferencesDetails { - string hook_release_name = 1; - uint32 app_id = 2; - string app_name = 3; - string config_release_name = 4; - uint32 config_release_id = 5; - string state = 6; -} diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/hook/convert.go b/bcs-services/bcs-bscp/pkg/protocol/core/hook/convert.go index d9423f9a47..81ba922948 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/core/hook/convert.go +++ b/bcs-services/bcs-bscp/pkg/protocol/core/hook/convert.go @@ -16,6 +16,7 @@ import ( "bscp.io/pkg/dal/table" pbbase "bscp.io/pkg/protocol/core/base" "bscp.io/pkg/runtime/selector" + pbstruct "github.com/golang/protobuf/ptypes/struct" ) @@ -44,10 +45,11 @@ func (m *HookSpec) HookSpec() (*table.HookSpec, error) { } return &table.HookSpec{ - Name: m.Name, - Type: table.HookType(m.Type), - Tag: m.Tag, - Memo: m.Memo, + Name: m.Name, + PreType: table.HookType(m.PreType), + PreHook: m.PreHook, + PostType: table.HookType(m.PostType), + PostHook: m.PostHook, }, nil } @@ -58,12 +60,11 @@ func PbHookSpec(spec *table.HookSpec) (*HookSpec, error) { } return &HookSpec{ - Name: spec.Name, - ReleaseName: spec.Name, - Type: string(spec.Type), - Tag: spec.Tag, - Memo: spec.Memo, - PublishNum: spec.PublishNum, + Name: spec.Name, + PreType: string(spec.PreType), + PreHook: spec.PreHook, + PostType: string(spec.PostType), + PostHook: spec.PostHook, }, nil } @@ -74,7 +75,9 @@ func (m *HookAttachment) HookAttachment() *table.HookAttachment { } return &table.HookAttachment{ - BizID: m.BizId, + BizID: m.BizId, + AppID: m.AppId, + ReleaseID: m.ReleaseId, } } @@ -85,7 +88,9 @@ func PbHookAttachment(at *table.HookAttachment) *HookAttachment { } return &HookAttachment{ - BizId: at.BizID, + BizId: at.BizID, + AppId: at.AppID, + ReleaseId: at.ReleaseID, } } diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/hook/hook.pb.go b/bcs-services/bcs-bscp/pkg/protocol/core/hook/hook.pb.go index d710a84ef4..c9c61d3023 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/core/hook/hook.pb.go +++ b/bcs-services/bcs-bscp/pkg/protocol/core/hook/hook.pb.go @@ -99,13 +99,11 @@ type HookSpec struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - ReleaseName string `protobuf:"bytes,2,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` - Tag string `protobuf:"bytes,4,opt,name=tag,proto3" json:"tag,omitempty"` - Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` - Content string `protobuf:"bytes,6,opt,name=content,proto3" json:"content,omitempty"` - PublishNum uint32 `protobuf:"varint,7,opt,name=publish_num,json=publishNum,proto3" json:"publish_num,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + PreType string `protobuf:"bytes,2,opt,name=pre_type,json=preType,proto3" json:"pre_type,omitempty"` + PreHook string `protobuf:"bytes,3,opt,name=pre_hook,json=preHook,proto3" json:"pre_hook,omitempty"` + PostType string `protobuf:"bytes,4,opt,name=post_type,json=postType,proto3" json:"post_type,omitempty"` + PostHook string `protobuf:"bytes,5,opt,name=post_hook,json=postHook,proto3" json:"post_hook,omitempty"` } func (x *HookSpec) Reset() { @@ -147,55 +145,43 @@ func (x *HookSpec) GetName() string { return "" } -func (x *HookSpec) GetReleaseName() string { +func (x *HookSpec) GetPreType() string { if x != nil { - return x.ReleaseName + return x.PreType } return "" } -func (x *HookSpec) GetType() string { +func (x *HookSpec) GetPreHook() string { if x != nil { - return x.Type + return x.PreHook } return "" } -func (x *HookSpec) GetTag() string { +func (x *HookSpec) GetPostType() string { if x != nil { - return x.Tag + return x.PostType } return "" } -func (x *HookSpec) GetMemo() string { +func (x *HookSpec) GetPostHook() string { if x != nil { - return x.Memo + return x.PostHook } return "" } -func (x *HookSpec) GetContent() string { - if x != nil { - return x.Content - } - return "" -} - -func (x *HookSpec) GetPublishNum() uint32 { - if x != nil { - return x.PublishNum - } - return 0 -} - // HookAttachment source resource reference: pkg/dal/table/hook.go type HookAttachment struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` } func (x *HookAttachment) Reset() { @@ -237,129 +223,16 @@ func (x *HookAttachment) GetBizId() uint32 { return 0 } -// ListConfigItemCounts source resource reference: pkg/dal/table/config_item.go -type ListHookTagCounts struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppId uint32 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` - Count uint32 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"` - UpdateAt string `protobuf:"bytes,4,opt,name=update_at,json=updateAt,proto3" json:"update_at,omitempty"` -} - -func (x *ListHookTagCounts) Reset() { - *x = ListHookTagCounts{} - if protoimpl.UnsafeEnabled { - mi := &file_hook_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListHookTagCounts) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListHookTagCounts) ProtoMessage() {} - -func (x *ListHookTagCounts) ProtoReflect() protoreflect.Message { - mi := &file_hook_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 ListHookTagCounts.ProtoReflect.Descriptor instead. -func (*ListHookTagCounts) Descriptor() ([]byte, []int) { - return file_hook_proto_rawDescGZIP(), []int{3} -} - -func (x *ListHookTagCounts) GetAppId() uint32 { +func (x *HookAttachment) GetAppId() uint32 { if x != nil { return x.AppId } return 0 } -func (x *ListHookTagCounts) GetTag() string { +func (x *HookAttachment) GetReleaseId() uint32 { if x != nil { - return x.Tag - } - return "" -} - -func (x *ListHookTagCounts) GetCount() uint32 { - if x != nil { - return x.Count - } - return 0 -} - -func (x *ListHookTagCounts) GetUpdateAt() string { - if x != nil { - return x.UpdateAt - } - return "" -} - -type CountHookTags struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` - Counts uint32 `protobuf:"varint,2,opt,name=counts,proto3" json:"counts,omitempty"` -} - -func (x *CountHookTags) Reset() { - *x = CountHookTags{} - if protoimpl.UnsafeEnabled { - mi := &file_hook_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountHookTags) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountHookTags) ProtoMessage() {} - -func (x *CountHookTags) ProtoReflect() protoreflect.Message { - mi := &file_hook_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 CountHookTags.ProtoReflect.Descriptor instead. -func (*CountHookTags) Descriptor() ([]byte, []int) { - return file_hook_proto_rawDescGZIP(), []int{4} -} - -func (x *CountHookTags) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -func (x *CountHookTags) GetCounts() uint32 { - if x != nil { - return x.Counts + return x.ReleaseId } return 0 } @@ -381,35 +254,25 @@ var file_hook_proto_rawDesc = []byte{ 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xb6, 0x01, 0x0a, 0x08, 0x48, 0x6f, 0x6f, 0x6b, 0x53, 0x70, 0x65, + 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x08, 0x48, 0x6f, 0x6f, 0x6b, 0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, - 0x74, 0x61, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x12, - 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, - 0x6d, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x22, 0x27, 0x0a, - 0x0e, 0x48, 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, - 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x22, 0x6f, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, - 0x6f, 0x6b, 0x54, 0x61, 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x61, - 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, - 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x74, 0x61, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x74, 0x22, 0x39, 0x0a, 0x0d, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x48, 0x6f, 0x6f, 0x6b, 0x54, 0x61, 0x67, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x42, 0x27, 0x5a, 0x25, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x68, 0x6f, 0x6f, 0x6b, 0x3b, 0x70, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x70, + 0x6f, 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x70, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, + 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, + 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x22, 0x5d, 0x0a, 0x0e, 0x48, 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x74, + 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, + 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x49, 0x64, 0x42, 0x27, 0x5a, 0x25, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, + 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, + 0x65, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x3b, 0x70, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -424,19 +287,17 @@ func file_hook_proto_rawDescGZIP() []byte { return file_hook_proto_rawDescData } -var file_hook_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_hook_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_hook_proto_goTypes = []interface{}{ - (*Hook)(nil), // 0: pbhook.Hook - (*HookSpec)(nil), // 1: pbhook.HookSpec - (*HookAttachment)(nil), // 2: pbhook.HookAttachment - (*ListHookTagCounts)(nil), // 3: pbhook.ListHookTagCounts - (*CountHookTags)(nil), // 4: pbhook.CountHookTags - (*base.Revision)(nil), // 5: pbbase.Revision + (*Hook)(nil), // 0: pbhook.Hook + (*HookSpec)(nil), // 1: pbhook.HookSpec + (*HookAttachment)(nil), // 2: pbhook.HookAttachment + (*base.Revision)(nil), // 3: pbbase.Revision } var file_hook_proto_depIdxs = []int32{ 1, // 0: pbhook.Hook.spec:type_name -> pbhook.HookSpec 2, // 1: pbhook.Hook.attachment:type_name -> pbhook.HookAttachment - 5, // 2: pbhook.Hook.revision:type_name -> pbbase.Revision + 3, // 2: pbhook.Hook.revision:type_name -> pbbase.Revision 3, // [3:3] is the sub-list for method output_type 3, // [3:3] is the sub-list for method input_type 3, // [3:3] is the sub-list for extension type_name @@ -486,30 +347,6 @@ func file_hook_proto_init() { return nil } } - file_hook_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHookTagCounts); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_hook_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountHookTags); 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{ @@ -517,7 +354,7 @@ func file_hook_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_hook_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/hook/hook.proto b/bcs-services/bcs-bscp/pkg/protocol/core/hook/hook.proto index c315aa97dd..0e7e7750c0 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/core/hook/hook.proto +++ b/bcs-services/bcs-bscp/pkg/protocol/core/hook/hook.proto @@ -1,45 +1,31 @@ syntax = "proto3"; -package pbhook; - import "bscp.io/pkg/protocol/core/base/base.proto"; +package pbhook; + option go_package = "bscp.io/pkg/protocol/core/hook;pbhook"; // Hook source resource reference: pkg/dal/table/hook.go message Hook { - uint32 id = 1; - HookSpec spec = 2; - HookAttachment attachment = 3; - pbbase.Revision revision = 4; + uint32 id = 1; + HookSpec spec = 2; + HookAttachment attachment = 3; + pbbase.Revision revision = 4; } // HookSpec source resource reference: pkg/dal/table/hook.go message HookSpec { - string name = 1; - string release_name = 2; - string type = 3; - string tag = 4; - string memo = 5; - string content = 6; - uint32 publish_num = 7; + string name = 1; + string pre_type = 2; + string pre_hook = 3; + string post_type = 4; + string post_hook = 5; } // HookAttachment source resource reference: pkg/dal/table/hook.go message HookAttachment { - uint32 biz_id = 1; + uint32 biz_id = 1; + uint32 app_id = 2; + uint32 release_id = 3; } - - -// ListConfigItemCounts source resource reference: pkg/dal/table/config_item.go -message ListHookTagCounts { - uint32 app_id = 1; - string tag = 2; - uint32 count = 3; - string update_at = 4; -} - -message CountHookTags { - string tag = 1; - uint32 counts = 2; -} \ No newline at end of file diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/release/convert.go b/bcs-services/bcs-bscp/pkg/protocol/core/release/convert.go index a9ace56029..3e64406296 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/core/release/convert.go +++ b/bcs-services/bcs-bscp/pkg/protocol/core/release/convert.go @@ -28,26 +28,9 @@ func (m *ReleaseSpec) ReleaseSpec() *table.ReleaseSpec { Memo: m.Memo, Deprecated: m.Deprecated, PublishNum: m.PublishNum, - Hook: m.Hook.ReleaseSpecHook(), } } -// ReleaseSpecHook convert pb ReleaseSpecHook to table ReleaseSpecHook -func (h *Hook) ReleaseSpecHook() *table.ReleaseHook { - - if h == nil { - return &table.ReleaseHook{} - } - - return &table.ReleaseHook{ - PreHookID: h.PreHookId, - PreHookReleaseID: h.PreHookReleaseId, - PostHookID: h.PostHookId, - PostHookReleaseID: h.PostHookReleaseId, - } - -} - // PbReleaseSpec convert table ReleaseSpec to pb ReleaseSpec func PbReleaseSpec(spec *table.ReleaseSpec) *ReleaseSpec { if spec == nil { @@ -59,12 +42,6 @@ func PbReleaseSpec(spec *table.ReleaseSpec) *ReleaseSpec { Memo: spec.Memo, Deprecated: spec.Deprecated, PublishNum: spec.PublishNum, - Hook: &Hook{ - PreHookId: spec.Hook.PreHookID, - PreHookReleaseId: spec.Hook.PreHookReleaseID, - PostHookId: spec.Hook.PostHookID, - PostHookReleaseId: spec.Hook.PostHookReleaseID, - }, } } diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/release/release.pb.go b/bcs-services/bcs-bscp/pkg/protocol/core/release/release.pb.go index a1a50f5d30..d3985aa0c0 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/core/release/release.pb.go +++ b/bcs-services/bcs-bscp/pkg/protocol/core/release/release.pb.go @@ -112,7 +112,6 @@ type ReleaseSpec struct { Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` Deprecated bool `protobuf:"varint,3,opt,name=deprecated,proto3" json:"deprecated,omitempty"` PublishNum uint32 `protobuf:"varint,4,opt,name=publish_num,json=publishNum,proto3" json:"publish_num,omitempty"` - Hook *Hook `protobuf:"bytes,5,opt,name=hook,proto3" json:"hook,omitempty"` } func (x *ReleaseSpec) Reset() { @@ -175,13 +174,6 @@ func (x *ReleaseSpec) GetPublishNum() uint32 { return 0 } -func (x *ReleaseSpec) GetHook() *Hook { - if x != nil { - return x.Hook - } - return nil -} - // ReleaseStatus status that not in db type ReleaseStatus struct { state protoimpl.MessageState @@ -294,77 +286,6 @@ func (x *ReleaseAttachment) GetAppId() uint32 { return 0 } -type Hook struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PreHookId uint32 `protobuf:"varint,1,opt,name=pre_hook_id,json=preHookId,proto3" json:"pre_hook_id,omitempty"` - PreHookReleaseId uint32 `protobuf:"varint,2,opt,name=pre_hook_release_id,json=preHookReleaseId,proto3" json:"pre_hook_release_id,omitempty"` - PostHookId uint32 `protobuf:"varint,3,opt,name=post_hook_id,json=postHookId,proto3" json:"post_hook_id,omitempty"` - PostHookReleaseId uint32 `protobuf:"varint,4,opt,name=post_hook_release_id,json=postHookReleaseId,proto3" json:"post_hook_release_id,omitempty"` -} - -func (x *Hook) Reset() { - *x = Hook{} - if protoimpl.UnsafeEnabled { - mi := &file_release_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Hook) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Hook) ProtoMessage() {} - -func (x *Hook) ProtoReflect() protoreflect.Message { - mi := &file_release_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 Hook.ProtoReflect.Descriptor instead. -func (*Hook) Descriptor() ([]byte, []int) { - return file_release_proto_rawDescGZIP(), []int{4} -} - -func (x *Hook) GetPreHookId() uint32 { - if x != nil { - return x.PreHookId - } - return 0 -} - -func (x *Hook) GetPreHookReleaseId() uint32 { - if x != nil { - return x.PreHookReleaseId - } - return 0 -} - -func (x *Hook) GetPostHookId() uint32 { - if x != nil { - return x.PostHookId - } - return 0 -} - -func (x *Hook) GetPostHookReleaseId() uint32 { - if x != nil { - return x.PostHookReleaseId - } - return 0 -} - type ReleaseStatus_ReleasedGroup struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -382,7 +303,7 @@ type ReleaseStatus_ReleasedGroup struct { func (x *ReleaseStatus_ReleasedGroup) Reset() { *x = ReleaseStatus_ReleasedGroup{} if protoimpl.UnsafeEnabled { - mi := &file_release_proto_msgTypes[5] + mi := &file_release_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -395,7 +316,7 @@ func (x *ReleaseStatus_ReleasedGroup) String() string { func (*ReleaseStatus_ReleasedGroup) ProtoMessage() {} func (x *ReleaseStatus_ReleasedGroup) ProtoReflect() protoreflect.Message { - mi := &file_release_proto_msgTypes[5] + mi := &file_release_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -484,58 +405,45 @@ var file_release_proto_rawDesc = []byte{ 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x22, 0x9b, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x70, 0x65, 0x63, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, - 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x73, 0x68, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x12, 0x23, 0x0a, 0x04, 0x68, 0x6f, 0x6f, - 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x72, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x04, 0x68, 0x6f, 0x6f, 0x6b, 0x22, 0xf3, - 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, - 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4f, 0x0a, 0x0f, 0x72, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x64, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x26, 0x2e, 0x70, 0x62, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x0e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x1a, 0xe9, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x6f, - 0x64, 0x65, 0x12, 0x3a, 0x0a, 0x0c, 0x6f, 0x6c, 0x64, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, - 0x74, 0x52, 0x0b, 0x6f, 0x6c, 0x64, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x3a, - 0x0a, 0x0c, 0x6e, 0x65, 0x77, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x6e, - 0x65, 0x77, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, - 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, - 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x64, - 0x69, 0x74, 0x65, 0x64, 0x22, 0x41, 0x0a, 0x11, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, - 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, - 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0xa8, 0x01, 0x0a, 0x04, 0x48, 0x6f, 0x6f, 0x6b, - 0x12, 0x1e, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x70, 0x72, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x49, 0x64, - 0x12, 0x2d, 0x0a, 0x13, 0x70, 0x72, 0x65, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x72, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x70, - 0x72, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, - 0x20, 0x0a, 0x0c, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x49, - 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x72, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x11, 0x70, 0x6f, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x49, 0x64, 0x42, 0x2d, 0x5a, 0x2b, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x3b, 0x70, 0x62, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x76, 0x0a, 0x0b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, + 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, + 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x73, 0x68, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x22, 0xf3, 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x4f, 0x0a, 0x0f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x5f, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x62, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x52, 0x0e, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x73, 0x1a, 0xe9, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x3a, 0x0a, 0x0c, + 0x6f, 0x6c, 0x64, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x6f, 0x6c, 0x64, + 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x3a, 0x0a, 0x0c, 0x6e, 0x65, 0x77, 0x5f, + 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x53, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x22, 0x41, + 0x0a, 0x11, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, + 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, + 0x64, 0x42, 0x2d, 0x5a, 0x2b, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x3b, 0x70, 0x62, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -550,31 +458,29 @@ func file_release_proto_rawDescGZIP() []byte { return file_release_proto_rawDescData } -var file_release_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_release_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_release_proto_goTypes = []interface{}{ (*Release)(nil), // 0: pbrelease.Release (*ReleaseSpec)(nil), // 1: pbrelease.ReleaseSpec (*ReleaseStatus)(nil), // 2: pbrelease.ReleaseStatus (*ReleaseAttachment)(nil), // 3: pbrelease.ReleaseAttachment - (*Hook)(nil), // 4: pbrelease.Hook - (*ReleaseStatus_ReleasedGroup)(nil), // 5: pbrelease.ReleaseStatus.ReleasedGroup - (*base.CreatedRevision)(nil), // 6: pbbase.CreatedRevision - (*structpb.Struct)(nil), // 7: google.protobuf.Struct + (*ReleaseStatus_ReleasedGroup)(nil), // 4: pbrelease.ReleaseStatus.ReleasedGroup + (*base.CreatedRevision)(nil), // 5: pbbase.CreatedRevision + (*structpb.Struct)(nil), // 6: google.protobuf.Struct } var file_release_proto_depIdxs = []int32{ 1, // 0: pbrelease.Release.spec:type_name -> pbrelease.ReleaseSpec 2, // 1: pbrelease.Release.status:type_name -> pbrelease.ReleaseStatus 3, // 2: pbrelease.Release.attachment:type_name -> pbrelease.ReleaseAttachment - 6, // 3: pbrelease.Release.revision:type_name -> pbbase.CreatedRevision - 4, // 4: pbrelease.ReleaseSpec.hook:type_name -> pbrelease.Hook - 5, // 5: pbrelease.ReleaseStatus.released_groups:type_name -> pbrelease.ReleaseStatus.ReleasedGroup - 7, // 6: pbrelease.ReleaseStatus.ReleasedGroup.old_selector:type_name -> google.protobuf.Struct - 7, // 7: pbrelease.ReleaseStatus.ReleasedGroup.new_selector:type_name -> google.protobuf.Struct - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 5, // 3: pbrelease.Release.revision:type_name -> pbbase.CreatedRevision + 4, // 4: pbrelease.ReleaseStatus.released_groups:type_name -> pbrelease.ReleaseStatus.ReleasedGroup + 6, // 5: pbrelease.ReleaseStatus.ReleasedGroup.old_selector:type_name -> google.protobuf.Struct + 6, // 6: pbrelease.ReleaseStatus.ReleasedGroup.new_selector:type_name -> google.protobuf.Struct + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_release_proto_init() } @@ -632,18 +538,6 @@ func file_release_proto_init() { } } file_release_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Hook); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_release_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReleaseStatus_ReleasedGroup); i { case 0: return &v.state @@ -662,7 +556,7 @@ func file_release_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_release_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 5, NumExtensions: 0, NumServices: 0, }, diff --git a/bcs-services/bcs-bscp/pkg/protocol/core/release/release.proto b/bcs-services/bcs-bscp/pkg/protocol/core/release/release.proto index 52b59c8c99..e1899b1e32 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/core/release/release.proto +++ b/bcs-services/bcs-bscp/pkg/protocol/core/release/release.proto @@ -18,11 +18,10 @@ message Release { // ReleaseSpec source resource reference: pkg/dal/table/release.go message ReleaseSpec { - string name = 1; - string memo = 2; - bool deprecated = 3; - uint32 publish_num = 4; - Hook hook = 5; + string name = 1; + string memo = 2; + bool deprecated = 3; + uint32 publish_num = 4; } // ReleaseStatus status that not in db @@ -45,10 +44,3 @@ message ReleaseAttachment { uint32 biz_id = 1; uint32 app_id = 2; } - -message Hook { - uint32 pre_hook_id = 1; - uint32 pre_hook_release_id = 2; - uint32 post_hook_id = 3; - uint32 post_hook_release_id = 4; -} diff --git a/bcs-services/bcs-bscp/pkg/protocol/data-service/data_service.pb.go b/bcs-services/bcs-bscp/pkg/protocol/data-service/data_service.pb.go index 9c32204784..ff2c1d4310 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/data-service/data_service.pb.go +++ b/bcs-services/bcs-bscp/pkg/protocol/data-service/data_service.pb.go @@ -10,14 +10,12 @@ import ( app "bscp.io/pkg/protocol/core/app" base "bscp.io/pkg/protocol/core/base" commit "bscp.io/pkg/protocol/core/commit" - config_hook "bscp.io/pkg/protocol/core/config-hook" config_item "bscp.io/pkg/protocol/core/config-item" content "bscp.io/pkg/protocol/core/content" credential "bscp.io/pkg/protocol/core/credential" credential_scope "bscp.io/pkg/protocol/core/credential-scope" group "bscp.io/pkg/protocol/core/group" hook "bscp.io/pkg/protocol/core/hook" - hook_release "bscp.io/pkg/protocol/core/hook-release" release "bscp.io/pkg/protocol/core/release" released_ci "bscp.io/pkg/protocol/core/released-ci" template "bscp.io/pkg/protocol/core/template" @@ -473,10 +471,9 @@ type ListCredentialReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - SearchKey string `protobuf:"bytes,2,opt,name=searchKey,proto3" json:"searchKey,omitempty"` - Start uint32 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + Page *base.BasePage `protobuf:"bytes,2,opt,name=page,proto3" json:"page,omitempty"` + Filter *structpb.Struct `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"` } func (x *ListCredentialReq) Reset() { @@ -518,25 +515,18 @@ func (x *ListCredentialReq) GetBizId() uint32 { return 0 } -func (x *ListCredentialReq) GetSearchKey() string { - if x != nil { - return x.SearchKey - } - return "" -} - -func (x *ListCredentialReq) GetStart() uint32 { +func (x *ListCredentialReq) GetPage() *base.BasePage { if x != nil { - return x.Start + return x.Page } - return 0 + return nil } -func (x *ListCredentialReq) GetLimit() uint32 { +func (x *ListCredentialReq) GetFilter() *structpb.Struct { if x != nil { - return x.Limit + return x.Filter } - return 0 + return nil } type ListCredentialResp struct { @@ -822,124 +812,6 @@ func (x *CreateResp) GetId() uint32 { return 0 } -type UpdateConfigHookReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Attachment *config_hook.ConfigHookAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` - Spec *config_hook.ConfigHookSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` -} - -func (x *UpdateConfigHookReq) Reset() { - *x = UpdateConfigHookReq{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateConfigHookReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateConfigHookReq) ProtoMessage() {} - -func (x *UpdateConfigHookReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_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 UpdateConfigHookReq.ProtoReflect.Descriptor instead. -func (*UpdateConfigHookReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{14} -} - -func (x *UpdateConfigHookReq) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *UpdateConfigHookReq) GetAttachment() *config_hook.ConfigHookAttachment { - if x != nil { - return x.Attachment - } - return nil -} - -func (x *UpdateConfigHookReq) GetSpec() *config_hook.ConfigHookSpec { - if x != nil { - return x.Spec - } - return nil -} - -type GetConfigHookReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` -} - -func (x *GetConfigHookReq) Reset() { - *x = GetConfigHookReq{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetConfigHookReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetConfigHookReq) ProtoMessage() {} - -func (x *GetConfigHookReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_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 GetConfigHookReq.ProtoReflect.Descriptor instead. -func (*GetConfigHookReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{15} -} - -func (x *GetConfigHookReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -func (x *GetConfigHookReq) GetAppId() uint32 { - if x != nil { - return x.AppId - } - return 0 -} - type CreateAppReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -952,7 +824,7 @@ type CreateAppReq struct { func (x *CreateAppReq) Reset() { *x = CreateAppReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[16] + mi := &file_data_service_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -965,7 +837,7 @@ func (x *CreateAppReq) String() string { func (*CreateAppReq) ProtoMessage() {} func (x *CreateAppReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[16] + mi := &file_data_service_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -978,7 +850,7 @@ func (x *CreateAppReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateAppReq.ProtoReflect.Descriptor instead. func (*CreateAppReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{16} + return file_data_service_proto_rawDescGZIP(), []int{14} } func (x *CreateAppReq) GetBizId() uint32 { @@ -1008,7 +880,7 @@ type UpdateAppReq struct { func (x *UpdateAppReq) Reset() { *x = UpdateAppReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[17] + mi := &file_data_service_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1021,7 +893,7 @@ func (x *UpdateAppReq) String() string { func (*UpdateAppReq) ProtoMessage() {} func (x *UpdateAppReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[17] + mi := &file_data_service_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1034,7 +906,7 @@ func (x *UpdateAppReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateAppReq.ProtoReflect.Descriptor instead. func (*UpdateAppReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{17} + return file_data_service_proto_rawDescGZIP(), []int{15} } func (x *UpdateAppReq) GetId() uint32 { @@ -1070,7 +942,7 @@ type DeleteAppReq struct { func (x *DeleteAppReq) Reset() { *x = DeleteAppReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[18] + mi := &file_data_service_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1083,7 +955,7 @@ func (x *DeleteAppReq) String() string { func (*DeleteAppReq) ProtoMessage() {} func (x *DeleteAppReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[18] + mi := &file_data_service_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1096,7 +968,7 @@ func (x *DeleteAppReq) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteAppReq.ProtoReflect.Descriptor instead. func (*DeleteAppReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{18} + return file_data_service_proto_rawDescGZIP(), []int{16} } func (x *DeleteAppReq) GetId() uint32 { @@ -1125,7 +997,7 @@ type GetAppReq struct { func (x *GetAppReq) Reset() { *x = GetAppReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[19] + mi := &file_data_service_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1138,7 +1010,7 @@ func (x *GetAppReq) String() string { func (*GetAppReq) ProtoMessage() {} func (x *GetAppReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[19] + mi := &file_data_service_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1151,7 +1023,7 @@ func (x *GetAppReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAppReq.ProtoReflect.Descriptor instead. func (*GetAppReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{19} + return file_data_service_proto_rawDescGZIP(), []int{17} } func (x *GetAppReq) GetBizId() uint32 { @@ -1179,7 +1051,7 @@ type GetAppByIDReq struct { func (x *GetAppByIDReq) Reset() { *x = GetAppByIDReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[20] + mi := &file_data_service_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1192,7 +1064,7 @@ func (x *GetAppByIDReq) String() string { func (*GetAppByIDReq) ProtoMessage() {} func (x *GetAppByIDReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[20] + mi := &file_data_service_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1205,7 +1077,7 @@ func (x *GetAppByIDReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAppByIDReq.ProtoReflect.Descriptor instead. func (*GetAppByIDReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{20} + return file_data_service_proto_rawDescGZIP(), []int{18} } func (x *GetAppByIDReq) GetAppId() uint32 { @@ -1227,7 +1099,7 @@ type GetAppByNameReq struct { func (x *GetAppByNameReq) Reset() { *x = GetAppByNameReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[21] + mi := &file_data_service_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1240,7 +1112,7 @@ func (x *GetAppByNameReq) String() string { func (*GetAppByNameReq) ProtoMessage() {} func (x *GetAppByNameReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[21] + mi := &file_data_service_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1253,7 +1125,7 @@ func (x *GetAppByNameReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAppByNameReq.ProtoReflect.Descriptor instead. func (*GetAppByNameReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{21} + return file_data_service_proto_rawDescGZIP(), []int{19} } func (x *GetAppByNameReq) GetBizId() uint32 { @@ -1270,6 +1142,69 @@ func (x *GetAppByNameReq) GetAppName() string { return "" } +type ListAppsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + Filter *structpb.Struct `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"` + Page *base.BasePage `protobuf:"bytes,3,opt,name=page,proto3" json:"page,omitempty"` +} + +func (x *ListAppsReq) Reset() { + *x = ListAppsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_data_service_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAppsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAppsReq) ProtoMessage() {} + +func (x *ListAppsReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_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 ListAppsReq.ProtoReflect.Descriptor instead. +func (*ListAppsReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{20} +} + +func (x *ListAppsReq) GetBizId() uint32 { + if x != nil { + return x.BizId + } + return 0 +} + +func (x *ListAppsReq) GetFilter() *structpb.Struct { + if x != nil { + return x.Filter + } + return nil +} + +func (x *ListAppsReq) GetPage() *base.BasePage { + if x != nil { + return x.Page + } + return nil +} + type ListAppsRestReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1285,7 +1220,7 @@ type ListAppsRestReq struct { func (x *ListAppsRestReq) Reset() { *x = ListAppsRestReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[22] + mi := &file_data_service_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1298,7 +1233,7 @@ func (x *ListAppsRestReq) String() string { func (*ListAppsRestReq) ProtoMessage() {} func (x *ListAppsRestReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[22] + mi := &file_data_service_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1311,7 +1246,7 @@ func (x *ListAppsRestReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListAppsRestReq.ProtoReflect.Descriptor instead. func (*ListAppsRestReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{22} + return file_data_service_proto_rawDescGZIP(), []int{21} } func (x *ListAppsRestReq) GetBizId() string { @@ -1361,7 +1296,7 @@ type ListAppsResp struct { func (x *ListAppsResp) Reset() { *x = ListAppsResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[23] + mi := &file_data_service_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1374,7 +1309,7 @@ func (x *ListAppsResp) String() string { func (*ListAppsResp) ProtoMessage() {} func (x *ListAppsResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[23] + mi := &file_data_service_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1387,7 +1322,7 @@ func (x *ListAppsResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListAppsResp.ProtoReflect.Descriptor instead. func (*ListAppsResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{23} + return file_data_service_proto_rawDescGZIP(), []int{22} } func (x *ListAppsResp) GetCount() uint32 { @@ -1404,31 +1339,33 @@ func (x *ListAppsResp) GetDetails() []*app.App { return nil } -type ListAppsByIDsReq struct { +type CreateConfigItemReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Ids []uint32 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` + ConfigItemAttachment *config_item.ConfigItemAttachment `protobuf:"bytes,1,opt,name=config_item_attachment,json=configItemAttachment,proto3" json:"config_item_attachment,omitempty"` + ConfigItemSpec *config_item.ConfigItemSpec `protobuf:"bytes,2,opt,name=config_item_spec,json=configItemSpec,proto3" json:"config_item_spec,omitempty"` + ContentSpec *content.ContentSpec `protobuf:"bytes,3,opt,name=content_spec,json=contentSpec,proto3" json:"content_spec,omitempty"` } -func (x *ListAppsByIDsReq) Reset() { - *x = ListAppsByIDsReq{} +func (x *CreateConfigItemReq) Reset() { + *x = CreateConfigItemReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[24] + mi := &file_data_service_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListAppsByIDsReq) String() string { +func (x *CreateConfigItemReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListAppsByIDsReq) ProtoMessage() {} +func (*CreateConfigItemReq) ProtoMessage() {} -func (x *ListAppsByIDsReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[24] +func (x *CreateConfigItemReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1439,155 +1376,59 @@ func (x *ListAppsByIDsReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListAppsByIDsReq.ProtoReflect.Descriptor instead. -func (*ListAppsByIDsReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{24} +// Deprecated: Use CreateConfigItemReq.ProtoReflect.Descriptor instead. +func (*CreateConfigItemReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{23} +} + +func (x *CreateConfigItemReq) GetConfigItemAttachment() *config_item.ConfigItemAttachment { + if x != nil { + return x.ConfigItemAttachment + } + return nil +} + +func (x *CreateConfigItemReq) GetConfigItemSpec() *config_item.ConfigItemSpec { + if x != nil { + return x.ConfigItemSpec + } + return nil } -func (x *ListAppsByIDsReq) GetIds() []uint32 { +func (x *CreateConfigItemReq) GetContentSpec() *content.ContentSpec { if x != nil { - return x.Ids + return x.ContentSpec } return nil } -type ListAppsByIDsResp struct { +type BatchUpsertConfigItemsReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Details []*app.App `protobuf:"bytes,1,rep,name=details,proto3" json:"details,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + Items []*BatchUpsertConfigItemsReq_ConfigItem `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty"` } -func (x *ListAppsByIDsResp) Reset() { - *x = ListAppsByIDsResp{} +func (x *BatchUpsertConfigItemsReq) Reset() { + *x = BatchUpsertConfigItemsReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[25] + mi := &file_data_service_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListAppsByIDsResp) String() string { +func (x *BatchUpsertConfigItemsReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListAppsByIDsResp) ProtoMessage() {} - -func (x *ListAppsByIDsResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_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 ListAppsByIDsResp.ProtoReflect.Descriptor instead. -func (*ListAppsByIDsResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{25} -} - -func (x *ListAppsByIDsResp) GetDetails() []*app.App { - if x != nil { - return x.Details - } - return nil -} - -type CreateConfigItemReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ConfigItemAttachment *config_item.ConfigItemAttachment `protobuf:"bytes,1,opt,name=config_item_attachment,json=configItemAttachment,proto3" json:"config_item_attachment,omitempty"` - ConfigItemSpec *config_item.ConfigItemSpec `protobuf:"bytes,2,opt,name=config_item_spec,json=configItemSpec,proto3" json:"config_item_spec,omitempty"` - ContentSpec *content.ContentSpec `protobuf:"bytes,3,opt,name=content_spec,json=contentSpec,proto3" json:"content_spec,omitempty"` -} - -func (x *CreateConfigItemReq) Reset() { - *x = CreateConfigItemReq{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateConfigItemReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateConfigItemReq) ProtoMessage() {} - -func (x *CreateConfigItemReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_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 CreateConfigItemReq.ProtoReflect.Descriptor instead. -func (*CreateConfigItemReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{26} -} - -func (x *CreateConfigItemReq) GetConfigItemAttachment() *config_item.ConfigItemAttachment { - if x != nil { - return x.ConfigItemAttachment - } - return nil -} - -func (x *CreateConfigItemReq) GetConfigItemSpec() *config_item.ConfigItemSpec { - if x != nil { - return x.ConfigItemSpec - } - return nil -} - -func (x *CreateConfigItemReq) GetContentSpec() *content.ContentSpec { - if x != nil { - return x.ContentSpec - } - return nil -} - -type BatchUpsertConfigItemsReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - Items []*BatchUpsertConfigItemsReq_ConfigItem `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty"` -} - -func (x *BatchUpsertConfigItemsReq) Reset() { - *x = BatchUpsertConfigItemsReq{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BatchUpsertConfigItemsReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BatchUpsertConfigItemsReq) ProtoMessage() {} +func (*BatchUpsertConfigItemsReq) ProtoMessage() {} func (x *BatchUpsertConfigItemsReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[27] + mi := &file_data_service_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1600,7 +1441,7 @@ func (x *BatchUpsertConfigItemsReq) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchUpsertConfigItemsReq.ProtoReflect.Descriptor instead. func (*BatchUpsertConfigItemsReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{27} + return file_data_service_proto_rawDescGZIP(), []int{24} } func (x *BatchUpsertConfigItemsReq) GetBizId() uint32 { @@ -1637,7 +1478,7 @@ type UpdateConfigItemReq struct { func (x *UpdateConfigItemReq) Reset() { *x = UpdateConfigItemReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[28] + mi := &file_data_service_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1650,7 +1491,7 @@ func (x *UpdateConfigItemReq) String() string { func (*UpdateConfigItemReq) ProtoMessage() {} func (x *UpdateConfigItemReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[28] + mi := &file_data_service_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1663,7 +1504,7 @@ func (x *UpdateConfigItemReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateConfigItemReq.ProtoReflect.Descriptor instead. func (*UpdateConfigItemReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{28} + return file_data_service_proto_rawDescGZIP(), []int{25} } func (x *UpdateConfigItemReq) GetId() uint32 { @@ -1699,7 +1540,7 @@ type DeleteConfigItemReq struct { func (x *DeleteConfigItemReq) Reset() { *x = DeleteConfigItemReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[29] + mi := &file_data_service_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1712,7 +1553,7 @@ func (x *DeleteConfigItemReq) String() string { func (*DeleteConfigItemReq) ProtoMessage() {} func (x *DeleteConfigItemReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[29] + mi := &file_data_service_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1725,7 +1566,7 @@ func (x *DeleteConfigItemReq) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteConfigItemReq.ProtoReflect.Descriptor instead. func (*DeleteConfigItemReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{29} + return file_data_service_proto_rawDescGZIP(), []int{26} } func (x *DeleteConfigItemReq) GetId() uint32 { @@ -1755,7 +1596,7 @@ type GetConfigItemReq struct { func (x *GetConfigItemReq) Reset() { *x = GetConfigItemReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[30] + mi := &file_data_service_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1768,7 +1609,7 @@ func (x *GetConfigItemReq) String() string { func (*GetConfigItemReq) ProtoMessage() {} func (x *GetConfigItemReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[30] + mi := &file_data_service_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1781,7 +1622,7 @@ func (x *GetConfigItemReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetConfigItemReq.ProtoReflect.Descriptor instead. func (*GetConfigItemReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{30} + return file_data_service_proto_rawDescGZIP(), []int{27} } func (x *GetConfigItemReq) GetId() uint32 { @@ -1822,7 +1663,7 @@ type ListConfigItemsReq struct { func (x *ListConfigItemsReq) Reset() { *x = ListConfigItemsReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[31] + mi := &file_data_service_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1835,7 +1676,7 @@ func (x *ListConfigItemsReq) String() string { func (*ListConfigItemsReq) ProtoMessage() {} func (x *ListConfigItemsReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[31] + mi := &file_data_service_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1848,7 +1689,7 @@ func (x *ListConfigItemsReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListConfigItemsReq.ProtoReflect.Descriptor instead. func (*ListConfigItemsReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{31} + return file_data_service_proto_rawDescGZIP(), []int{28} } func (x *ListConfigItemsReq) GetBizId() uint32 { @@ -1912,7 +1753,7 @@ type ListConfigItemsResp struct { func (x *ListConfigItemsResp) Reset() { *x = ListConfigItemsResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[32] + mi := &file_data_service_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1925,7 +1766,7 @@ func (x *ListConfigItemsResp) String() string { func (*ListConfigItemsResp) ProtoMessage() {} func (x *ListConfigItemsResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[32] + mi := &file_data_service_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1938,7 +1779,7 @@ func (x *ListConfigItemsResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListConfigItemsResp.ProtoReflect.Descriptor instead. func (*ListConfigItemsResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{32} + return file_data_service_proto_rawDescGZIP(), []int{29} } func (x *ListConfigItemsResp) GetCount() uint32 { @@ -1967,7 +1808,7 @@ type ListConfigItemCountReq struct { func (x *ListConfigItemCountReq) Reset() { *x = ListConfigItemCountReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[33] + mi := &file_data_service_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1980,7 +1821,7 @@ func (x *ListConfigItemCountReq) String() string { func (*ListConfigItemCountReq) ProtoMessage() {} func (x *ListConfigItemCountReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[33] + mi := &file_data_service_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1993,7 +1834,7 @@ func (x *ListConfigItemCountReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListConfigItemCountReq.ProtoReflect.Descriptor instead. func (*ListConfigItemCountReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{33} + return file_data_service_proto_rawDescGZIP(), []int{30} } func (x *ListConfigItemCountReq) GetBizId() uint32 { @@ -2021,7 +1862,7 @@ type ListConfigItemCountResp struct { func (x *ListConfigItemCountResp) Reset() { *x = ListConfigItemCountResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[34] + mi := &file_data_service_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2034,7 +1875,7 @@ func (x *ListConfigItemCountResp) String() string { func (*ListConfigItemCountResp) ProtoMessage() {} func (x *ListConfigItemCountResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[34] + mi := &file_data_service_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2047,7 +1888,7 @@ func (x *ListConfigItemCountResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListConfigItemCountResp.ProtoReflect.Descriptor instead. func (*ListConfigItemCountResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{34} + return file_data_service_proto_rawDescGZIP(), []int{31} } func (x *ListConfigItemCountResp) GetDetails() []*config_item.ListConfigItemCounts { @@ -2057,61 +1898,6 @@ func (x *ListConfigItemCountResp) GetDetails() []*config_item.ListConfigItemCoun return nil } -type CreateConfigHookReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Attachment *config_hook.ConfigHookAttachment `protobuf:"bytes,1,opt,name=attachment,proto3" json:"attachment,omitempty"` - Spec *config_hook.ConfigHookSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` -} - -func (x *CreateConfigHookReq) Reset() { - *x = CreateConfigHookReq{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateConfigHookReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateConfigHookReq) ProtoMessage() {} - -func (x *CreateConfigHookReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_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 CreateConfigHookReq.ProtoReflect.Descriptor instead. -func (*CreateConfigHookReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{35} -} - -func (x *CreateConfigHookReq) GetAttachment() *config_hook.ConfigHookAttachment { - if x != nil { - return x.Attachment - } - return nil -} - -func (x *CreateConfigHookReq) GetSpec() *config_hook.ConfigHookSpec { - if x != nil { - return x.Spec - } - return nil -} - type CreateContentReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2124,7 +1910,7 @@ type CreateContentReq struct { func (x *CreateContentReq) Reset() { *x = CreateContentReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[36] + mi := &file_data_service_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2137,7 +1923,7 @@ func (x *CreateContentReq) String() string { func (*CreateContentReq) ProtoMessage() {} func (x *CreateContentReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[36] + mi := &file_data_service_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2150,7 +1936,7 @@ func (x *CreateContentReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateContentReq.ProtoReflect.Descriptor instead. func (*CreateContentReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{36} + return file_data_service_proto_rawDescGZIP(), []int{32} } func (x *CreateContentReq) GetAttachment() *content.ContentAttachment { @@ -2180,7 +1966,7 @@ type GetContentReq struct { func (x *GetContentReq) Reset() { *x = GetContentReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[37] + mi := &file_data_service_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2193,7 +1979,7 @@ func (x *GetContentReq) String() string { func (*GetContentReq) ProtoMessage() {} func (x *GetContentReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[37] + mi := &file_data_service_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2206,7 +1992,7 @@ func (x *GetContentReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetContentReq.ProtoReflect.Descriptor instead. func (*GetContentReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{37} + return file_data_service_proto_rawDescGZIP(), []int{33} } func (x *GetContentReq) GetId() uint32 { @@ -2244,7 +2030,7 @@ type ListContentsReq struct { func (x *ListContentsReq) Reset() { *x = ListContentsReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[38] + mi := &file_data_service_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2257,7 +2043,7 @@ func (x *ListContentsReq) String() string { func (*ListContentsReq) ProtoMessage() {} func (x *ListContentsReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[38] + mi := &file_data_service_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2270,7 +2056,7 @@ func (x *ListContentsReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListContentsReq.ProtoReflect.Descriptor instead. func (*ListContentsReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{38} + return file_data_service_proto_rawDescGZIP(), []int{34} } func (x *ListContentsReq) GetBizId() uint32 { @@ -2313,7 +2099,7 @@ type ListContentsResp struct { func (x *ListContentsResp) Reset() { *x = ListContentsResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[39] + mi := &file_data_service_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2326,7 +2112,7 @@ func (x *ListContentsResp) String() string { func (*ListContentsResp) ProtoMessage() {} func (x *ListContentsResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[39] + mi := &file_data_service_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2339,7 +2125,7 @@ func (x *ListContentsResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListContentsResp.ProtoReflect.Descriptor instead. func (*ListContentsResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{39} + return file_data_service_proto_rawDescGZIP(), []int{35} } func (x *ListContentsResp) GetCount() uint32 { @@ -2369,7 +2155,7 @@ type CreateCommitReq struct { func (x *CreateCommitReq) Reset() { *x = CreateCommitReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[40] + mi := &file_data_service_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2382,7 +2168,7 @@ func (x *CreateCommitReq) String() string { func (*CreateCommitReq) ProtoMessage() {} func (x *CreateCommitReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[40] + mi := &file_data_service_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2395,7 +2181,7 @@ func (x *CreateCommitReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateCommitReq.ProtoReflect.Descriptor instead. func (*CreateCommitReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{40} + return file_data_service_proto_rawDescGZIP(), []int{36} } func (x *CreateCommitReq) GetAttachment() *commit.CommitAttachment { @@ -2432,7 +2218,7 @@ type GetLatestCommitReq struct { func (x *GetLatestCommitReq) Reset() { *x = GetLatestCommitReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[41] + mi := &file_data_service_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2445,7 +2231,7 @@ func (x *GetLatestCommitReq) String() string { func (*GetLatestCommitReq) ProtoMessage() {} func (x *GetLatestCommitReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[41] + mi := &file_data_service_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2458,7 +2244,7 @@ func (x *GetLatestCommitReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetLatestCommitReq.ProtoReflect.Descriptor instead. func (*GetLatestCommitReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{41} + return file_data_service_proto_rawDescGZIP(), []int{37} } func (x *GetLatestCommitReq) GetBizId() uint32 { @@ -2496,7 +2282,7 @@ type ListCommitsReq struct { func (x *ListCommitsReq) Reset() { *x = ListCommitsReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[42] + mi := &file_data_service_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2509,7 +2295,7 @@ func (x *ListCommitsReq) String() string { func (*ListCommitsReq) ProtoMessage() {} func (x *ListCommitsReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[42] + mi := &file_data_service_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2522,7 +2308,7 @@ func (x *ListCommitsReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListCommitsReq.ProtoReflect.Descriptor instead. func (*ListCommitsReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{42} + return file_data_service_proto_rawDescGZIP(), []int{38} } func (x *ListCommitsReq) GetBizId() uint32 { @@ -2565,7 +2351,7 @@ type ListCommitsResp struct { func (x *ListCommitsResp) Reset() { *x = ListCommitsResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[43] + mi := &file_data_service_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2578,7 +2364,7 @@ func (x *ListCommitsResp) String() string { func (*ListCommitsResp) ProtoMessage() {} func (x *ListCommitsResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[43] + mi := &file_data_service_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2591,7 +2377,7 @@ func (x *ListCommitsResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListCommitsResp.ProtoReflect.Descriptor instead. func (*ListCommitsResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{43} + return file_data_service_proto_rawDescGZIP(), []int{39} } func (x *ListCommitsResp) GetCount() uint32 { @@ -2620,7 +2406,7 @@ type CreateReleaseReq struct { func (x *CreateReleaseReq) Reset() { *x = CreateReleaseReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[44] + mi := &file_data_service_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2633,7 +2419,7 @@ func (x *CreateReleaseReq) String() string { func (*CreateReleaseReq) ProtoMessage() {} func (x *CreateReleaseReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[44] + mi := &file_data_service_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2646,7 +2432,7 @@ func (x *CreateReleaseReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateReleaseReq.ProtoReflect.Descriptor instead. func (*CreateReleaseReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{44} + return file_data_service_proto_rawDescGZIP(), []int{40} } func (x *CreateReleaseReq) GetAttachment() *release.ReleaseAttachment { @@ -2678,7 +2464,7 @@ type ListReleasesReq struct { func (x *ListReleasesReq) Reset() { *x = ListReleasesReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[45] + mi := &file_data_service_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2691,7 +2477,7 @@ func (x *ListReleasesReq) String() string { func (*ListReleasesReq) ProtoMessage() {} func (x *ListReleasesReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[45] + mi := &file_data_service_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2704,7 +2490,7 @@ func (x *ListReleasesReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListReleasesReq.ProtoReflect.Descriptor instead. func (*ListReleasesReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{45} + return file_data_service_proto_rawDescGZIP(), []int{41} } func (x *ListReleasesReq) GetBizId() uint32 { @@ -2754,7 +2540,7 @@ type ListReleasesResp struct { func (x *ListReleasesResp) Reset() { *x = ListReleasesResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[46] + mi := &file_data_service_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2767,7 +2553,7 @@ func (x *ListReleasesResp) String() string { func (*ListReleasesResp) ProtoMessage() {} func (x *ListReleasesResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[46] + mi := &file_data_service_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2780,7 +2566,7 @@ func (x *ListReleasesResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListReleasesResp.ProtoReflect.Descriptor instead. func (*ListReleasesResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{46} + return file_data_service_proto_rawDescGZIP(), []int{42} } func (x *ListReleasesResp) GetCount() uint32 { @@ -2811,7 +2597,7 @@ type GetReleasedCIReq struct { func (x *GetReleasedCIReq) Reset() { *x = GetReleasedCIReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[47] + mi := &file_data_service_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2824,7 +2610,7 @@ func (x *GetReleasedCIReq) String() string { func (*GetReleasedCIReq) ProtoMessage() {} func (x *GetReleasedCIReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[47] + mi := &file_data_service_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2837,7 +2623,7 @@ func (x *GetReleasedCIReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetReleasedCIReq.ProtoReflect.Descriptor instead. func (*GetReleasedCIReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{47} + return file_data_service_proto_rawDescGZIP(), []int{43} } func (x *GetReleasedCIReq) GetBizId() uint32 { @@ -2881,7 +2667,7 @@ type ListReleasedCIsReq struct { func (x *ListReleasedCIsReq) Reset() { *x = ListReleasedCIsReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[48] + mi := &file_data_service_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2894,7 +2680,7 @@ func (x *ListReleasedCIsReq) String() string { func (*ListReleasedCIsReq) ProtoMessage() {} func (x *ListReleasedCIsReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[48] + mi := &file_data_service_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2907,7 +2693,7 @@ func (x *ListReleasedCIsReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ListReleasedCIsReq.ProtoReflect.Descriptor instead. func (*ListReleasedCIsReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{48} + return file_data_service_proto_rawDescGZIP(), []int{44} } func (x *ListReleasedCIsReq) GetBizId() uint32 { @@ -2943,7 +2729,7 @@ type ListReleasedCIsResp struct { func (x *ListReleasedCIsResp) Reset() { *x = ListReleasedCIsResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[49] + mi := &file_data_service_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2956,7 +2742,7 @@ func (x *ListReleasedCIsResp) String() string { func (*ListReleasedCIsResp) ProtoMessage() {} func (x *ListReleasedCIsResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[49] + mi := &file_data_service_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2969,7 +2755,7 @@ func (x *ListReleasedCIsResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ListReleasedCIsResp.ProtoReflect.Descriptor instead. func (*ListReleasedCIsResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{49} + return file_data_service_proto_rawDescGZIP(), []int{45} } func (x *ListReleasedCIsResp) GetCount() uint32 { @@ -2998,7 +2784,7 @@ type CreateHookReq struct { func (x *CreateHookReq) Reset() { *x = CreateHookReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[50] + mi := &file_data_service_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3011,7 +2797,7 @@ func (x *CreateHookReq) String() string { func (*CreateHookReq) ProtoMessage() {} func (x *CreateHookReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[50] + mi := &file_data_service_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3024,7 +2810,7 @@ func (x *CreateHookReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateHookReq.ProtoReflect.Descriptor instead. func (*CreateHookReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{50} + return file_data_service_proto_rawDescGZIP(), []int{46} } func (x *CreateHookReq) GetAttachment() *hook.HookAttachment { @@ -3041,31 +2827,34 @@ func (x *CreateHookReq) GetSpec() *hook.HookSpec { return nil } -type ListHookTagReq struct { +type ListHooksReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + Filter *structpb.Struct `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"` + Page *base.BasePage `protobuf:"bytes,4,opt,name=page,proto3" json:"page,omitempty"` } -func (x *ListHookTagReq) Reset() { - *x = ListHookTagReq{} +func (x *ListHooksReq) Reset() { + *x = ListHooksReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[51] + mi := &file_data_service_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListHookTagReq) String() string { +func (x *ListHooksReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListHookTagReq) ProtoMessage() {} +func (*ListHooksReq) ProtoMessage() {} -func (x *ListHookTagReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[51] +func (x *ListHooksReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3076,44 +2865,65 @@ func (x *ListHookTagReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListHookTagReq.ProtoReflect.Descriptor instead. -func (*ListHookTagReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{51} +// Deprecated: Use ListHooksReq.ProtoReflect.Descriptor instead. +func (*ListHooksReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{47} } -func (x *ListHookTagReq) GetBizId() uint32 { +func (x *ListHooksReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -type GetHookReq struct { +func (x *ListHooksReq) GetAppId() uint32 { + if x != nil { + return x.AppId + } + return 0 +} + +func (x *ListHooksReq) GetFilter() *structpb.Struct { + if x != nil { + return x.Filter + } + return nil +} + +func (x *ListHooksReq) GetPage() *base.BasePage { + if x != nil { + return x.Page + } + return nil +} + +type ListHooksResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Details []*hook.Hook `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *GetHookReq) Reset() { - *x = GetHookReq{} +func (x *ListHooksResp) Reset() { + *x = ListHooksResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[52] + mi := &file_data_service_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetHookReq) String() string { +func (x *ListHooksResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetHookReq) ProtoMessage() {} +func (*ListHooksResp) ProtoMessage() {} -func (x *GetHookReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[52] +func (x *ListHooksResp) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3124,53 +2934,52 @@ func (x *GetHookReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetHookReq.ProtoReflect.Descriptor instead. -func (*GetHookReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{52} +// Deprecated: Use ListHooksResp.ProtoReflect.Descriptor instead. +func (*ListHooksResp) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{48} } -func (x *GetHookReq) GetBizId() uint32 { +func (x *ListHooksResp) GetCount() uint32 { if x != nil { - return x.BizId + return x.Count } return 0 } -func (x *GetHookReq) GetHookId() uint32 { +func (x *ListHooksResp) GetDetails() []*hook.Hook { if x != nil { - return x.HookId + return x.Details } - return 0 + return nil } -type GetHookResp struct { +type UpdateHookReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Spec *GetHookInfoSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` - Attachment *hook.HookAttachment `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"` - Revision *base.Revision `protobuf:"bytes,4,opt,name=revision,proto3" json:"revision,omitempty"` + Attachment *hook.HookAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` + Spec *hook.HookSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` } -func (x *GetHookResp) Reset() { - *x = GetHookResp{} +func (x *UpdateHookReq) Reset() { + *x = UpdateHookReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[53] + mi := &file_data_service_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetHookResp) String() string { +func (x *UpdateHookReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetHookResp) ProtoMessage() {} +func (*UpdateHookReq) ProtoMessage() {} -func (x *GetHookResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[53] +func (x *UpdateHookReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3181,69 +2990,58 @@ func (x *GetHookResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetHookResp.ProtoReflect.Descriptor instead. -func (*GetHookResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{53} +// Deprecated: Use UpdateHookReq.ProtoReflect.Descriptor instead. +func (*UpdateHookReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{49} } -func (x *GetHookResp) GetId() uint32 { +func (x *UpdateHookReq) GetId() uint32 { if x != nil { return x.Id } return 0 } -func (x *GetHookResp) GetSpec() *GetHookInfoSpec { - if x != nil { - return x.Spec - } - return nil -} - -func (x *GetHookResp) GetAttachment() *hook.HookAttachment { +func (x *UpdateHookReq) GetAttachment() *hook.HookAttachment { if x != nil { return x.Attachment } return nil } -func (x *GetHookResp) GetRevision() *base.Revision { +func (x *UpdateHookReq) GetSpec() *hook.HookSpec { if x != nil { - return x.Revision + return x.Spec } return nil } -type GetHookInfoSpec struct { +type DeleteHookReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` - Tag string `protobuf:"bytes,4,opt,name=tag,proto3" json:"tag,omitempty"` - Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` - PublishNum uint32 `protobuf:"varint,7,opt,name=publish_num,json=publishNum,proto3" json:"publish_num,omitempty"` - Releases *GetHookInfoSpec_Releases `protobuf:"bytes,8,opt,name=releases,proto3" json:"releases,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Attachment *hook.HookAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` } -func (x *GetHookInfoSpec) Reset() { - *x = GetHookInfoSpec{} +func (x *DeleteHookReq) Reset() { + *x = DeleteHookReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[54] + mi := &file_data_service_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetHookInfoSpec) String() string { +func (x *DeleteHookReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetHookInfoSpec) ProtoMessage() {} +func (*DeleteHookReq) ProtoMessage() {} -func (x *GetHookInfoSpec) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[54] +func (x *DeleteHookReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3254,84 +3052,107 @@ func (x *GetHookInfoSpec) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetHookInfoSpec.ProtoReflect.Descriptor instead. -func (*GetHookInfoSpec) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{54} +// Deprecated: Use DeleteHookReq.ProtoReflect.Descriptor instead. +func (*DeleteHookReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{50} } -func (x *GetHookInfoSpec) GetName() string { +func (x *DeleteHookReq) GetId() uint32 { if x != nil { - return x.Name + return x.Id } - return "" + return 0 } -func (x *GetHookInfoSpec) GetType() string { +func (x *DeleteHookReq) GetAttachment() *hook.HookAttachment { if x != nil { - return x.Type + return x.Attachment } - return "" + return nil } -func (x *GetHookInfoSpec) GetTag() string { - if x != nil { - return x.Tag +type CreateTemplateSpaceReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Attachment *template_space.TemplateSpaceAttachment `protobuf:"bytes,1,opt,name=attachment,proto3" json:"attachment,omitempty"` + Spec *template_space.TemplateSpaceSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` +} + +func (x *CreateTemplateSpaceReq) Reset() { + *x = CreateTemplateSpaceReq{} + if protoimpl.UnsafeEnabled { + mi := &file_data_service_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return "" } -func (x *GetHookInfoSpec) GetMemo() string { - if x != nil { - return x.Memo +func (x *CreateTemplateSpaceReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTemplateSpaceReq) ProtoMessage() {} + +func (x *CreateTemplateSpaceReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[51] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return "" + return mi.MessageOf(x) +} + +// Deprecated: Use CreateTemplateSpaceReq.ProtoReflect.Descriptor instead. +func (*CreateTemplateSpaceReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{51} } -func (x *GetHookInfoSpec) GetPublishNum() uint32 { +func (x *CreateTemplateSpaceReq) GetAttachment() *template_space.TemplateSpaceAttachment { if x != nil { - return x.PublishNum + return x.Attachment } - return 0 + return nil } -func (x *GetHookInfoSpec) GetReleases() *GetHookInfoSpec_Releases { +func (x *CreateTemplateSpaceReq) GetSpec() *template_space.TemplateSpaceSpec { if x != nil { - return x.Releases + return x.Spec } return nil } -type ListHooksReq struct { +type ListTemplateSpacesReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Tag string `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"` - All bool `protobuf:"varint,5,opt,name=all,proto3" json:"all,omitempty"` - NotTag bool `protobuf:"varint,6,opt,name=not_tag,json=notTag,proto3" json:"not_tag,omitempty"` - Start uint32 `protobuf:"varint,7,opt,name=start,proto3" json:"start,omitempty"` - Limit uint32 `protobuf:"varint,8,opt,name=limit,proto3" json:"limit,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + Start uint32 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"` + Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` } -func (x *ListHooksReq) Reset() { - *x = ListHooksReq{} +func (x *ListTemplateSpacesReq) Reset() { + *x = ListTemplateSpacesReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[55] + mi := &file_data_service_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListHooksReq) String() string { +func (x *ListTemplateSpacesReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListHooksReq) ProtoMessage() {} +func (*ListTemplateSpacesReq) ProtoMessage() {} -func (x *ListHooksReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[55] +func (x *ListTemplateSpacesReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3342,86 +3163,58 @@ func (x *ListHooksReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListHooksReq.ProtoReflect.Descriptor instead. -func (*ListHooksReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{55} +// Deprecated: Use ListTemplateSpacesReq.ProtoReflect.Descriptor instead. +func (*ListTemplateSpacesReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{52} } -func (x *ListHooksReq) GetBizId() uint32 { +func (x *ListTemplateSpacesReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *ListHooksReq) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ListHooksReq) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -func (x *ListHooksReq) GetAll() bool { - if x != nil { - return x.All - } - return false -} - -func (x *ListHooksReq) GetNotTag() bool { - if x != nil { - return x.NotTag - } - return false -} - -func (x *ListHooksReq) GetStart() uint32 { +func (x *ListTemplateSpacesReq) GetStart() uint32 { if x != nil { return x.Start } return 0 } -func (x *ListHooksReq) GetLimit() uint32 { +func (x *ListTemplateSpacesReq) GetLimit() uint32 { if x != nil { return x.Limit } return 0 } -type ListHooksResp struct { +type ListTemplateSpacesResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*hook.Hook `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Details []*template_space.TemplateSpace `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *ListHooksResp) Reset() { - *x = ListHooksResp{} +func (x *ListTemplateSpacesResp) Reset() { + *x = ListTemplateSpacesResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[56] + mi := &file_data_service_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListHooksResp) String() string { +func (x *ListTemplateSpacesResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListHooksResp) ProtoMessage() {} +func (*ListTemplateSpacesResp) ProtoMessage() {} -func (x *ListHooksResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[56] +func (x *ListTemplateSpacesResp) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3432,50 +3225,52 @@ func (x *ListHooksResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListHooksResp.ProtoReflect.Descriptor instead. -func (*ListHooksResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{56} +// Deprecated: Use ListTemplateSpacesResp.ProtoReflect.Descriptor instead. +func (*ListTemplateSpacesResp) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{53} } -func (x *ListHooksResp) GetCount() uint32 { +func (x *ListTemplateSpacesResp) GetCount() uint32 { if x != nil { return x.Count } return 0 } -func (x *ListHooksResp) GetDetails() []*hook.Hook { +func (x *ListTemplateSpacesResp) GetDetails() []*template_space.TemplateSpace { if x != nil { return x.Details } return nil } -type ListHookTagResp struct { +type UpdateTemplateSpaceReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Details []*hook.CountHookTags `protobuf:"bytes,1,rep,name=details,proto3" json:"details,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Attachment *template_space.TemplateSpaceAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` + Spec *template_space.TemplateSpaceSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` } -func (x *ListHookTagResp) Reset() { - *x = ListHookTagResp{} +func (x *UpdateTemplateSpaceReq) Reset() { + *x = UpdateTemplateSpaceReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[57] + mi := &file_data_service_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListHookTagResp) String() string { +func (x *UpdateTemplateSpaceReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListHookTagResp) ProtoMessage() {} +func (*UpdateTemplateSpaceReq) ProtoMessage() {} -func (x *ListHookTagResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[57] +func (x *UpdateTemplateSpaceReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3486,44 +3281,58 @@ func (x *ListHookTagResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListHookTagResp.ProtoReflect.Descriptor instead. -func (*ListHookTagResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{57} +// Deprecated: Use UpdateTemplateSpaceReq.ProtoReflect.Descriptor instead. +func (*UpdateTemplateSpaceReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{54} } -func (x *ListHookTagResp) GetDetails() []*hook.CountHookTags { +func (x *UpdateTemplateSpaceReq) GetId() uint32 { if x != nil { - return x.Details + return x.Id + } + return 0 +} + +func (x *UpdateTemplateSpaceReq) GetAttachment() *template_space.TemplateSpaceAttachment { + if x != nil { + return x.Attachment } return nil } -type DeleteHookReq struct { +func (x *UpdateTemplateSpaceReq) GetSpec() *template_space.TemplateSpaceSpec { + if x != nil { + return x.Spec + } + return nil +} + +type DeleteTemplateSpaceReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Attachment *hook.HookAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Attachment *template_space.TemplateSpaceAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` } -func (x *DeleteHookReq) Reset() { - *x = DeleteHookReq{} +func (x *DeleteTemplateSpaceReq) Reset() { + *x = DeleteTemplateSpaceReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[58] + mi := &file_data_service_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *DeleteHookReq) String() string { +func (x *DeleteTemplateSpaceReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteHookReq) ProtoMessage() {} +func (*DeleteTemplateSpaceReq) ProtoMessage() {} -func (x *DeleteHookReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[58] +func (x *DeleteTemplateSpaceReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3534,51 +3343,52 @@ func (x *DeleteHookReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteHookReq.ProtoReflect.Descriptor instead. -func (*DeleteHookReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{58} +// Deprecated: Use DeleteTemplateSpaceReq.ProtoReflect.Descriptor instead. +func (*DeleteTemplateSpaceReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{55} } -func (x *DeleteHookReq) GetId() uint32 { +func (x *DeleteTemplateSpaceReq) GetId() uint32 { if x != nil { return x.Id } return 0 } -func (x *DeleteHookReq) GetAttachment() *hook.HookAttachment { +func (x *DeleteTemplateSpaceReq) GetAttachment() *template_space.TemplateSpaceAttachment { if x != nil { return x.Attachment } return nil } -type CreateHookReleaseReq struct { +type CreateTemplateReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Attachment *hook_release.HookReleaseAttachment `protobuf:"bytes,1,opt,name=attachment,proto3" json:"attachment,omitempty"` - Spec *hook_release.HookReleaseSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` + Attachment *template.TemplateAttachment `protobuf:"bytes,1,opt,name=attachment,proto3" json:"attachment,omitempty"` + Spec *template.TemplateSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` + TrSpec *template_release.TemplateReleaseSpec `protobuf:"bytes,3,opt,name=tr_spec,json=trSpec,proto3" json:"tr_spec,omitempty"` } -func (x *CreateHookReleaseReq) Reset() { - *x = CreateHookReleaseReq{} +func (x *CreateTemplateReq) Reset() { + *x = CreateTemplateReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[59] + mi := &file_data_service_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateHookReleaseReq) String() string { +func (x *CreateTemplateReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateHookReleaseReq) ProtoMessage() {} +func (*CreateTemplateReq) ProtoMessage() {} -func (x *CreateHookReleaseReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[59] +func (x *CreateTemplateReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3589,56 +3399,60 @@ func (x *CreateHookReleaseReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateHookReleaseReq.ProtoReflect.Descriptor instead. -func (*CreateHookReleaseReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{59} +// Deprecated: Use CreateTemplateReq.ProtoReflect.Descriptor instead. +func (*CreateTemplateReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{56} } -func (x *CreateHookReleaseReq) GetAttachment() *hook_release.HookReleaseAttachment { +func (x *CreateTemplateReq) GetAttachment() *template.TemplateAttachment { if x != nil { return x.Attachment } return nil } -func (x *CreateHookReleaseReq) GetSpec() *hook_release.HookReleaseSpec { +func (x *CreateTemplateReq) GetSpec() *template.TemplateSpec { if x != nil { return x.Spec } return nil } -type ListHookReleasesReq struct { +func (x *CreateTemplateReq) GetTrSpec() *template_release.TemplateReleaseSpec { + if x != nil { + return x.TrSpec + } + return nil +} + +type ListTemplatesReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` - SearchKey string `protobuf:"bytes,3,opt,name=search_key,json=searchKey,proto3" json:"search_key,omitempty"` - Start uint32 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"` - Limit uint32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` - All bool `protobuf:"varint,6,opt,name=all,proto3" json:"all,omitempty"` - State string `protobuf:"bytes,7,opt,name=state,proto3" json:"state,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` + Start uint32 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` + Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` } -func (x *ListHookReleasesReq) Reset() { - *x = ListHookReleasesReq{} +func (x *ListTemplatesReq) Reset() { + *x = ListTemplatesReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[60] + mi := &file_data_service_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListHookReleasesReq) String() string { +func (x *ListTemplatesReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListHookReleasesReq) ProtoMessage() {} +func (*ListTemplatesReq) ProtoMessage() {} -func (x *ListHookReleasesReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[60] +func (x *ListTemplatesReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3649,86 +3463,65 @@ func (x *ListHookReleasesReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListHookReleasesReq.ProtoReflect.Descriptor instead. -func (*ListHookReleasesReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{60} +// Deprecated: Use ListTemplatesReq.ProtoReflect.Descriptor instead. +func (*ListTemplatesReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{57} } -func (x *ListHookReleasesReq) GetBizId() uint32 { +func (x *ListTemplatesReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *ListHookReleasesReq) GetHookId() uint32 { +func (x *ListTemplatesReq) GetTemplateSpaceId() uint32 { if x != nil { - return x.HookId + return x.TemplateSpaceId } return 0 } -func (x *ListHookReleasesReq) GetSearchKey() string { - if x != nil { - return x.SearchKey - } - return "" -} - -func (x *ListHookReleasesReq) GetStart() uint32 { +func (x *ListTemplatesReq) GetStart() uint32 { if x != nil { return x.Start } return 0 } -func (x *ListHookReleasesReq) GetLimit() uint32 { +func (x *ListTemplatesReq) GetLimit() uint32 { if x != nil { return x.Limit } return 0 } -func (x *ListHookReleasesReq) GetAll() bool { - if x != nil { - return x.All - } - return false -} - -func (x *ListHookReleasesReq) GetState() string { - if x != nil { - return x.State - } - return "" -} - -type ListHookReleasesResp struct { +type ListTemplatesResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*hook_release.HookRelease `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Details []*template.Template `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *ListHookReleasesResp) Reset() { - *x = ListHookReleasesResp{} +func (x *ListTemplatesResp) Reset() { + *x = ListTemplatesResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[61] + mi := &file_data_service_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListHookReleasesResp) String() string { +func (x *ListTemplatesResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListHookReleasesResp) ProtoMessage() {} +func (*ListTemplatesResp) ProtoMessage() {} -func (x *ListHookReleasesResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[61] +func (x *ListTemplatesResp) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3739,52 +3532,52 @@ func (x *ListHookReleasesResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListHookReleasesResp.ProtoReflect.Descriptor instead. -func (*ListHookReleasesResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{61} +// Deprecated: Use ListTemplatesResp.ProtoReflect.Descriptor instead. +func (*ListTemplatesResp) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{58} } -func (x *ListHookReleasesResp) GetCount() uint32 { +func (x *ListTemplatesResp) GetCount() uint32 { if x != nil { return x.Count } return 0 } -func (x *ListHookReleasesResp) GetDetails() []*hook_release.HookRelease { +func (x *ListTemplatesResp) GetDetails() []*template.Template { if x != nil { return x.Details } return nil } -type GetHookReleaseByIdReq struct { +type UpdateTemplateReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` - Id uint32 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Attachment *template.TemplateAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` + Spec *template.TemplateSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` } -func (x *GetHookReleaseByIdReq) Reset() { - *x = GetHookReleaseByIdReq{} +func (x *UpdateTemplateReq) Reset() { + *x = UpdateTemplateReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[62] + mi := &file_data_service_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetHookReleaseByIdReq) String() string { +func (x *UpdateTemplateReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetHookReleaseByIdReq) ProtoMessage() {} +func (*UpdateTemplateReq) ProtoMessage() {} -func (x *GetHookReleaseByIdReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[62] +func (x *UpdateTemplateReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3795,59 +3588,58 @@ func (x *GetHookReleaseByIdReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetHookReleaseByIdReq.ProtoReflect.Descriptor instead. -func (*GetHookReleaseByIdReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{62} +// Deprecated: Use UpdateTemplateReq.ProtoReflect.Descriptor instead. +func (*UpdateTemplateReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{59} } -func (x *GetHookReleaseByIdReq) GetBizId() uint32 { +func (x *UpdateTemplateReq) GetId() uint32 { if x != nil { - return x.BizId + return x.Id } return 0 } -func (x *GetHookReleaseByIdReq) GetHookId() uint32 { +func (x *UpdateTemplateReq) GetAttachment() *template.TemplateAttachment { if x != nil { - return x.HookId + return x.Attachment } - return 0 + return nil } -func (x *GetHookReleaseByIdReq) GetId() uint32 { +func (x *UpdateTemplateReq) GetSpec() *template.TemplateSpec { if x != nil { - return x.Id + return x.Spec } - return 0 + return nil } -type DeleteHookReleaseReq struct { +type DeleteTemplateReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` - Id uint32 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Attachment *template.TemplateAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` } -func (x *DeleteHookReleaseReq) Reset() { - *x = DeleteHookReleaseReq{} +func (x *DeleteTemplateReq) Reset() { + *x = DeleteTemplateReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[63] + mi := &file_data_service_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *DeleteHookReleaseReq) String() string { +func (x *DeleteTemplateReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteHookReleaseReq) ProtoMessage() {} +func (*DeleteTemplateReq) ProtoMessage() {} -func (x *DeleteHookReleaseReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[63] +func (x *DeleteTemplateReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3858,59 +3650,51 @@ func (x *DeleteHookReleaseReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteHookReleaseReq.ProtoReflect.Descriptor instead. -func (*DeleteHookReleaseReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{63} -} - -func (x *DeleteHookReleaseReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 +// Deprecated: Use DeleteTemplateReq.ProtoReflect.Descriptor instead. +func (*DeleteTemplateReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{60} } -func (x *DeleteHookReleaseReq) GetHookId() uint32 { +func (x *DeleteTemplateReq) GetId() uint32 { if x != nil { - return x.HookId + return x.Id } return 0 } -func (x *DeleteHookReleaseReq) GetId() uint32 { +func (x *DeleteTemplateReq) GetAttachment() *template.TemplateAttachment { if x != nil { - return x.Id + return x.Attachment } - return 0 + return nil } -type PublishHookReleaseReq struct { +type CreateTemplateReleaseReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` - Id uint32 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` + Attachment *template_release.TemplateReleaseAttachment `protobuf:"bytes,1,opt,name=attachment,proto3" json:"attachment,omitempty"` + Spec *template_release.TemplateReleaseSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` } -func (x *PublishHookReleaseReq) Reset() { - *x = PublishHookReleaseReq{} +func (x *CreateTemplateReleaseReq) Reset() { + *x = CreateTemplateReleaseReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[64] + mi := &file_data_service_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *PublishHookReleaseReq) String() string { +func (x *CreateTemplateReleaseReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PublishHookReleaseReq) ProtoMessage() {} +func (*CreateTemplateReleaseReq) ProtoMessage() {} -func (x *PublishHookReleaseReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[64] +func (x *CreateTemplateReleaseReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3921,60 +3705,55 @@ func (x *PublishHookReleaseReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PublishHookReleaseReq.ProtoReflect.Descriptor instead. -func (*PublishHookReleaseReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{64} -} - -func (x *PublishHookReleaseReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 +// Deprecated: Use CreateTemplateReleaseReq.ProtoReflect.Descriptor instead. +func (*CreateTemplateReleaseReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{61} } -func (x *PublishHookReleaseReq) GetHookId() uint32 { +func (x *CreateTemplateReleaseReq) GetAttachment() *template_release.TemplateReleaseAttachment { if x != nil { - return x.HookId + return x.Attachment } - return 0 + return nil } -func (x *PublishHookReleaseReq) GetId() uint32 { +func (x *CreateTemplateReleaseReq) GetSpec() *template_release.TemplateReleaseSpec { if x != nil { - return x.Id + return x.Spec } - return 0 + return nil } -type GetByPubStateReq struct { +type ListTemplateReleasesReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` - State string `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` + TemplateId uint32 `protobuf:"varint,3,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"` + Start uint32 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"` + Limit uint32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` } -func (x *GetByPubStateReq) Reset() { - *x = GetByPubStateReq{} +func (x *ListTemplateReleasesReq) Reset() { + *x = ListTemplateReleasesReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[65] + mi := &file_data_service_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *GetByPubStateReq) String() string { +func (x *ListTemplateReleasesReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetByPubStateReq) ProtoMessage() {} +func (*ListTemplateReleasesReq) ProtoMessage() {} -func (x *GetByPubStateReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[65] - if protoimpl.UnsafeEnabled && x != nil { +func (x *ListTemplateReleasesReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[62] + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -3984,124 +3763,72 @@ func (x *GetByPubStateReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetByPubStateReq.ProtoReflect.Descriptor instead. -func (*GetByPubStateReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{65} +// Deprecated: Use ListTemplateReleasesReq.ProtoReflect.Descriptor instead. +func (*ListTemplateReleasesReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{62} } -func (x *GetByPubStateReq) GetBizId() uint32 { +func (x *ListTemplateReleasesReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *GetByPubStateReq) GetHookId() uint32 { +func (x *ListTemplateReleasesReq) GetTemplateSpaceId() uint32 { if x != nil { - return x.HookId + return x.TemplateSpaceId } return 0 } -func (x *GetByPubStateReq) GetState() string { - if x != nil { - return x.State - } - return "" -} - -type UpdateHookReleaseReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Attachment *hook_release.HookReleaseAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` - Spec *hook_release.HookReleaseSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` -} - -func (x *UpdateHookReleaseReq) Reset() { - *x = UpdateHookReleaseReq{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[66] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateHookReleaseReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateHookReleaseReq) ProtoMessage() {} - -func (x *UpdateHookReleaseReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[66] - 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 UpdateHookReleaseReq.ProtoReflect.Descriptor instead. -func (*UpdateHookReleaseReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{66} -} - -func (x *UpdateHookReleaseReq) GetId() uint32 { +func (x *ListTemplateReleasesReq) GetTemplateId() uint32 { if x != nil { - return x.Id + return x.TemplateId } return 0 } -func (x *UpdateHookReleaseReq) GetAttachment() *hook_release.HookReleaseAttachment { +func (x *ListTemplateReleasesReq) GetStart() uint32 { if x != nil { - return x.Attachment + return x.Start } - return nil + return 0 } -func (x *UpdateHookReleaseReq) GetSpec() *hook_release.HookReleaseSpec { +func (x *ListTemplateReleasesReq) GetLimit() uint32 { if x != nil { - return x.Spec + return x.Limit } - return nil + return 0 } -type ListHookReleasesReferencesReq struct { +type ListTemplateReleasesResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - HookId uint32 `protobuf:"varint,2,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` - ReleasesId uint32 `protobuf:"varint,3,opt,name=releases_id,json=releasesId,proto3" json:"releases_id,omitempty"` - Start uint32 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"` - Limit uint32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Details []*template_release.TemplateRelease `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *ListHookReleasesReferencesReq) Reset() { - *x = ListHookReleasesReferencesReq{} +func (x *ListTemplateReleasesResp) Reset() { + *x = ListTemplateReleasesResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[67] + mi := &file_data_service_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListHookReleasesReferencesReq) String() string { +func (x *ListTemplateReleasesResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListHookReleasesReferencesReq) ProtoMessage() {} +func (*ListTemplateReleasesResp) ProtoMessage() {} -func (x *ListHookReleasesReferencesReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[67] +func (x *ListTemplateReleasesResp) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[63] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4112,72 +3839,51 @@ func (x *ListHookReleasesReferencesReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListHookReleasesReferencesReq.ProtoReflect.Descriptor instead. -func (*ListHookReleasesReferencesReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{67} -} - -func (x *ListHookReleasesReferencesReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -func (x *ListHookReleasesReferencesReq) GetHookId() uint32 { - if x != nil { - return x.HookId - } - return 0 -} - -func (x *ListHookReleasesReferencesReq) GetReleasesId() uint32 { - if x != nil { - return x.ReleasesId - } - return 0 +// Deprecated: Use ListTemplateReleasesResp.ProtoReflect.Descriptor instead. +func (*ListTemplateReleasesResp) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{63} } -func (x *ListHookReleasesReferencesReq) GetStart() uint32 { +func (x *ListTemplateReleasesResp) GetCount() uint32 { if x != nil { - return x.Start + return x.Count } return 0 } -func (x *ListHookReleasesReferencesReq) GetLimit() uint32 { +func (x *ListTemplateReleasesResp) GetDetails() []*template_release.TemplateRelease { if x != nil { - return x.Limit + return x.Details } - return 0 + return nil } -type ListHookReleasesReferencesResp struct { +type DeleteTemplateReleaseReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*hook_release.ListHookReleasesReferencesDetails `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Attachment *template_release.TemplateReleaseAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` } -func (x *ListHookReleasesReferencesResp) Reset() { - *x = ListHookReleasesReferencesResp{} +func (x *DeleteTemplateReleaseReq) Reset() { + *x = DeleteTemplateReleaseReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[68] + mi := &file_data_service_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListHookReleasesReferencesResp) String() string { +func (x *DeleteTemplateReleaseReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListHookReleasesReferencesResp) ProtoMessage() {} +func (*DeleteTemplateReleaseReq) ProtoMessage() {} -func (x *ListHookReleasesReferencesResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[68] +func (x *DeleteTemplateReleaseReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[64] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4188,51 +3894,51 @@ func (x *ListHookReleasesReferencesResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListHookReleasesReferencesResp.ProtoReflect.Descriptor instead. -func (*ListHookReleasesReferencesResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{68} +// Deprecated: Use DeleteTemplateReleaseReq.ProtoReflect.Descriptor instead. +func (*DeleteTemplateReleaseReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{64} } -func (x *ListHookReleasesReferencesResp) GetCount() uint32 { +func (x *DeleteTemplateReleaseReq) GetId() uint32 { if x != nil { - return x.Count + return x.Id } return 0 } -func (x *ListHookReleasesReferencesResp) GetDetails() []*hook_release.ListHookReleasesReferencesDetails { +func (x *DeleteTemplateReleaseReq) GetAttachment() *template_release.TemplateReleaseAttachment { if x != nil { - return x.Details + return x.Attachment } return nil } -type CreateTemplateSpaceReq struct { +type CreateGroupReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Attachment *template_space.TemplateSpaceAttachment `protobuf:"bytes,1,opt,name=attachment,proto3" json:"attachment,omitempty"` - Spec *template_space.TemplateSpaceSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` + Attachment *group.GroupAttachment `protobuf:"bytes,1,opt,name=attachment,proto3" json:"attachment,omitempty"` + Spec *group.GroupSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` } -func (x *CreateTemplateSpaceReq) Reset() { - *x = CreateTemplateSpaceReq{} +func (x *CreateGroupReq) Reset() { + *x = CreateGroupReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[69] + mi := &file_data_service_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateTemplateSpaceReq) String() string { +func (x *CreateGroupReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateTemplateSpaceReq) ProtoMessage() {} +func (*CreateGroupReq) ProtoMessage() {} -func (x *CreateTemplateSpaceReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[69] +func (x *CreateGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[65] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4243,52 +3949,52 @@ func (x *CreateTemplateSpaceReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateTemplateSpaceReq.ProtoReflect.Descriptor instead. -func (*CreateTemplateSpaceReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{69} +// Deprecated: Use CreateGroupReq.ProtoReflect.Descriptor instead. +func (*CreateGroupReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{65} } -func (x *CreateTemplateSpaceReq) GetAttachment() *template_space.TemplateSpaceAttachment { +func (x *CreateGroupReq) GetAttachment() *group.GroupAttachment { if x != nil { return x.Attachment } return nil } -func (x *CreateTemplateSpaceReq) GetSpec() *template_space.TemplateSpaceSpec { +func (x *CreateGroupReq) GetSpec() *group.GroupSpec { if x != nil { return x.Spec } return nil } -type ListTemplateSpacesReq struct { +type ListGroupsReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - Start uint32 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"` - Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + Filter *structpb.Struct `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"` + Page *base.BasePage `protobuf:"bytes,3,opt,name=page,proto3" json:"page,omitempty"` } -func (x *ListTemplateSpacesReq) Reset() { - *x = ListTemplateSpacesReq{} +func (x *ListGroupsReq) Reset() { + *x = ListGroupsReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[70] + mi := &file_data_service_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListTemplateSpacesReq) String() string { +func (x *ListGroupsReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListTemplateSpacesReq) ProtoMessage() {} +func (*ListGroupsReq) ProtoMessage() {} -func (x *ListTemplateSpacesReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[70] +func (x *ListGroupsReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[66] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4299,58 +4005,58 @@ func (x *ListTemplateSpacesReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListTemplateSpacesReq.ProtoReflect.Descriptor instead. -func (*ListTemplateSpacesReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{70} +// Deprecated: Use ListGroupsReq.ProtoReflect.Descriptor instead. +func (*ListGroupsReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{66} } -func (x *ListTemplateSpacesReq) GetBizId() uint32 { +func (x *ListGroupsReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *ListTemplateSpacesReq) GetStart() uint32 { +func (x *ListGroupsReq) GetFilter() *structpb.Struct { if x != nil { - return x.Start + return x.Filter } - return 0 + return nil } -func (x *ListTemplateSpacesReq) GetLimit() uint32 { +func (x *ListGroupsReq) GetPage() *base.BasePage { if x != nil { - return x.Limit + return x.Page } - return 0 + return nil } -type ListTemplateSpacesResp struct { +type ListGroupsResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*template_space.TemplateSpace `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Details []*group.Group `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *ListTemplateSpacesResp) Reset() { - *x = ListTemplateSpacesResp{} +func (x *ListGroupsResp) Reset() { + *x = ListGroupsResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[71] + mi := &file_data_service_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListTemplateSpacesResp) String() string { +func (x *ListGroupsResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListTemplateSpacesResp) ProtoMessage() {} +func (*ListGroupsResp) ProtoMessage() {} -func (x *ListTemplateSpacesResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[71] +func (x *ListGroupsResp) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[67] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4361,52 +4067,51 @@ func (x *ListTemplateSpacesResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListTemplateSpacesResp.ProtoReflect.Descriptor instead. -func (*ListTemplateSpacesResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{71} +// Deprecated: Use ListGroupsResp.ProtoReflect.Descriptor instead. +func (*ListGroupsResp) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{67} } -func (x *ListTemplateSpacesResp) GetCount() uint32 { +func (x *ListGroupsResp) GetCount() uint32 { if x != nil { return x.Count } return 0 } -func (x *ListTemplateSpacesResp) GetDetails() []*template_space.TemplateSpace { +func (x *ListGroupsResp) GetDetails() []*group.Group { if x != nil { return x.Details } return nil } -type UpdateTemplateSpaceReq struct { +type ListAppGroupsReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Attachment *template_space.TemplateSpaceAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` - Spec *template_space.TemplateSpaceSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` } -func (x *UpdateTemplateSpaceReq) Reset() { - *x = UpdateTemplateSpaceReq{} +func (x *ListAppGroupsReq) Reset() { + *x = ListAppGroupsReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[72] + mi := &file_data_service_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *UpdateTemplateSpaceReq) String() string { +func (x *ListAppGroupsReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateTemplateSpaceReq) ProtoMessage() {} +func (*ListAppGroupsReq) ProtoMessage() {} -func (x *UpdateTemplateSpaceReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[72] +func (x *ListAppGroupsReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[68] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4417,58 +4122,50 @@ func (x *UpdateTemplateSpaceReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateTemplateSpaceReq.ProtoReflect.Descriptor instead. -func (*UpdateTemplateSpaceReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{72} +// Deprecated: Use ListAppGroupsReq.ProtoReflect.Descriptor instead. +func (*ListAppGroupsReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{68} } -func (x *UpdateTemplateSpaceReq) GetId() uint32 { +func (x *ListAppGroupsReq) GetBizId() uint32 { if x != nil { - return x.Id + return x.BizId } return 0 } -func (x *UpdateTemplateSpaceReq) GetAttachment() *template_space.TemplateSpaceAttachment { +func (x *ListAppGroupsReq) GetAppId() uint32 { if x != nil { - return x.Attachment - } - return nil -} - -func (x *UpdateTemplateSpaceReq) GetSpec() *template_space.TemplateSpaceSpec { - if x != nil { - return x.Spec + return x.AppId } - return nil + return 0 } -type DeleteTemplateSpaceReq struct { +type ListAppGroupsResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Attachment *template_space.TemplateSpaceAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` + Details []*ListAppGroupsResp_ListAppGroupsData `protobuf:"bytes,1,rep,name=details,proto3" json:"details,omitempty"` } -func (x *DeleteTemplateSpaceReq) Reset() { - *x = DeleteTemplateSpaceReq{} +func (x *ListAppGroupsResp) Reset() { + *x = ListAppGroupsResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[73] + mi := &file_data_service_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *DeleteTemplateSpaceReq) String() string { +func (x *ListAppGroupsResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteTemplateSpaceReq) ProtoMessage() {} +func (*ListAppGroupsResp) ProtoMessage() {} -func (x *DeleteTemplateSpaceReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[73] +func (x *ListAppGroupsResp) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[69] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4479,52 +4176,45 @@ func (x *DeleteTemplateSpaceReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteTemplateSpaceReq.ProtoReflect.Descriptor instead. -func (*DeleteTemplateSpaceReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{73} -} - -func (x *DeleteTemplateSpaceReq) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 +// Deprecated: Use ListAppGroupsResp.ProtoReflect.Descriptor instead. +func (*ListAppGroupsResp) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{69} } -func (x *DeleteTemplateSpaceReq) GetAttachment() *template_space.TemplateSpaceAttachment { +func (x *ListAppGroupsResp) GetDetails() []*ListAppGroupsResp_ListAppGroupsData { if x != nil { - return x.Attachment + return x.Details } return nil } -type CreateTemplateReq struct { +type UpdateGroupReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Attachment *template.TemplateAttachment `protobuf:"bytes,1,opt,name=attachment,proto3" json:"attachment,omitempty"` - Spec *template.TemplateSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` - TrSpec *template_release.TemplateReleaseSpec `protobuf:"bytes,3,opt,name=tr_spec,json=trSpec,proto3" json:"tr_spec,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Attachment *group.GroupAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` + Spec *group.GroupSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` } -func (x *CreateTemplateReq) Reset() { - *x = CreateTemplateReq{} +func (x *UpdateGroupReq) Reset() { + *x = UpdateGroupReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[74] + mi := &file_data_service_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateTemplateReq) String() string { +func (x *UpdateGroupReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateTemplateReq) ProtoMessage() {} +func (*UpdateGroupReq) ProtoMessage() {} -func (x *CreateTemplateReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[74] +func (x *UpdateGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[70] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4535,60 +4225,58 @@ func (x *CreateTemplateReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateTemplateReq.ProtoReflect.Descriptor instead. -func (*CreateTemplateReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{74} +// Deprecated: Use UpdateGroupReq.ProtoReflect.Descriptor instead. +func (*UpdateGroupReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{70} } -func (x *CreateTemplateReq) GetAttachment() *template.TemplateAttachment { +func (x *UpdateGroupReq) GetId() uint32 { if x != nil { - return x.Attachment + return x.Id } - return nil + return 0 } -func (x *CreateTemplateReq) GetSpec() *template.TemplateSpec { +func (x *UpdateGroupReq) GetAttachment() *group.GroupAttachment { if x != nil { - return x.Spec + return x.Attachment } return nil } -func (x *CreateTemplateReq) GetTrSpec() *template_release.TemplateReleaseSpec { +func (x *UpdateGroupReq) GetSpec() *group.GroupSpec { if x != nil { - return x.TrSpec + return x.Spec } return nil } -type ListTemplatesReq struct { +type DeleteGroupReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` - Start uint32 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Attachment *group.GroupAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` } -func (x *ListTemplatesReq) Reset() { - *x = ListTemplatesReq{} +func (x *DeleteGroupReq) Reset() { + *x = DeleteGroupReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[75] + mi := &file_data_service_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListTemplatesReq) String() string { +func (x *DeleteGroupReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListTemplatesReq) ProtoMessage() {} +func (*DeleteGroupReq) ProtoMessage() {} -func (x *ListTemplatesReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[75] +func (x *DeleteGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[71] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4599,65 +4287,51 @@ func (x *ListTemplatesReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListTemplatesReq.ProtoReflect.Descriptor instead. -func (*ListTemplatesReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{75} -} - -func (x *ListTemplatesReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -func (x *ListTemplatesReq) GetTemplateSpaceId() uint32 { - if x != nil { - return x.TemplateSpaceId - } - return 0 +// Deprecated: Use DeleteGroupReq.ProtoReflect.Descriptor instead. +func (*DeleteGroupReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{71} } -func (x *ListTemplatesReq) GetStart() uint32 { +func (x *DeleteGroupReq) GetId() uint32 { if x != nil { - return x.Start + return x.Id } return 0 } -func (x *ListTemplatesReq) GetLimit() uint32 { +func (x *DeleteGroupReq) GetAttachment() *group.GroupAttachment { if x != nil { - return x.Limit + return x.Attachment } - return 0 + return nil } -type ListTemplatesResp struct { +type CountGroupsReleasedAppsReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*template.Template `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + Groups []uint32 `protobuf:"varint,2,rep,packed,name=groups,proto3" json:"groups,omitempty"` } -func (x *ListTemplatesResp) Reset() { - *x = ListTemplatesResp{} +func (x *CountGroupsReleasedAppsReq) Reset() { + *x = CountGroupsReleasedAppsReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[76] + mi := &file_data_service_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListTemplatesResp) String() string { +func (x *CountGroupsReleasedAppsReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListTemplatesResp) ProtoMessage() {} +func (*CountGroupsReleasedAppsReq) ProtoMessage() {} -func (x *ListTemplatesResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[76] +func (x *CountGroupsReleasedAppsReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[72] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4668,52 +4342,50 @@ func (x *ListTemplatesResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListTemplatesResp.ProtoReflect.Descriptor instead. -func (*ListTemplatesResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{76} +// Deprecated: Use CountGroupsReleasedAppsReq.ProtoReflect.Descriptor instead. +func (*CountGroupsReleasedAppsReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{72} } -func (x *ListTemplatesResp) GetCount() uint32 { +func (x *CountGroupsReleasedAppsReq) GetBizId() uint32 { if x != nil { - return x.Count + return x.BizId } return 0 } -func (x *ListTemplatesResp) GetDetails() []*template.Template { +func (x *CountGroupsReleasedAppsReq) GetGroups() []uint32 { if x != nil { - return x.Details + return x.Groups } return nil } -type UpdateTemplateReq struct { +type CountGroupsReleasedAppsResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Attachment *template.TemplateAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` - Spec *template.TemplateSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` + Data []*CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` } -func (x *UpdateTemplateReq) Reset() { - *x = UpdateTemplateReq{} +func (x *CountGroupsReleasedAppsResp) Reset() { + *x = CountGroupsReleasedAppsResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[77] + mi := &file_data_service_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *UpdateTemplateReq) String() string { +func (x *CountGroupsReleasedAppsResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateTemplateReq) ProtoMessage() {} +func (*CountGroupsReleasedAppsResp) ProtoMessage() {} -func (x *UpdateTemplateReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[77] +func (x *CountGroupsReleasedAppsResp) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[73] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4724,58 +4396,46 @@ func (x *UpdateTemplateReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateTemplateReq.ProtoReflect.Descriptor instead. -func (*UpdateTemplateReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{77} -} - -func (x *UpdateTemplateReq) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *UpdateTemplateReq) GetAttachment() *template.TemplateAttachment { - if x != nil { - return x.Attachment - } - return nil +// Deprecated: Use CountGroupsReleasedAppsResp.ProtoReflect.Descriptor instead. +func (*CountGroupsReleasedAppsResp) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{73} } -func (x *UpdateTemplateReq) GetSpec() *template.TemplateSpec { +func (x *CountGroupsReleasedAppsResp) GetData() []*CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData { if x != nil { - return x.Spec + return x.Data } return nil } -type DeleteTemplateReq struct { +type ListGroupRleasesdAppsReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Attachment *template.TemplateAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + GroupId uint32 `protobuf:"varint,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + Start uint32 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` + Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` } -func (x *DeleteTemplateReq) Reset() { - *x = DeleteTemplateReq{} +func (x *ListGroupRleasesdAppsReq) Reset() { + *x = ListGroupRleasesdAppsReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[78] + mi := &file_data_service_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *DeleteTemplateReq) String() string { +func (x *ListGroupRleasesdAppsReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteTemplateReq) ProtoMessage() {} +func (*ListGroupRleasesdAppsReq) ProtoMessage() {} -func (x *DeleteTemplateReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[78] +func (x *ListGroupRleasesdAppsReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[74] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4786,51 +4446,65 @@ func (x *DeleteTemplateReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteTemplateReq.ProtoReflect.Descriptor instead. -func (*DeleteTemplateReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{78} +// Deprecated: Use ListGroupRleasesdAppsReq.ProtoReflect.Descriptor instead. +func (*ListGroupRleasesdAppsReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{74} } -func (x *DeleteTemplateReq) GetId() uint32 { +func (x *ListGroupRleasesdAppsReq) GetBizId() uint32 { if x != nil { - return x.Id + return x.BizId } return 0 } -func (x *DeleteTemplateReq) GetAttachment() *template.TemplateAttachment { +func (x *ListGroupRleasesdAppsReq) GetGroupId() uint32 { if x != nil { - return x.Attachment + return x.GroupId } - return nil + return 0 } -type CreateTemplateReleaseReq struct { +func (x *ListGroupRleasesdAppsReq) GetStart() uint32 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *ListGroupRleasesdAppsReq) GetLimit() uint32 { + if x != nil { + return x.Limit + } + return 0 +} + +type ListGroupRleasesdAppsResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Attachment *template_release.TemplateReleaseAttachment `protobuf:"bytes,1,opt,name=attachment,proto3" json:"attachment,omitempty"` - Spec *template_release.TemplateReleaseSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Details []*ListGroupRleasesdAppsResp_ListGroupReleasedAppsData `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *CreateTemplateReleaseReq) Reset() { - *x = CreateTemplateReleaseReq{} +func (x *ListGroupRleasesdAppsResp) Reset() { + *x = ListGroupRleasesdAppsResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[79] + mi := &file_data_service_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateTemplateReleaseReq) String() string { +func (x *ListGroupRleasesdAppsResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateTemplateReleaseReq) ProtoMessage() {} +func (*ListGroupRleasesdAppsResp) ProtoMessage() {} -func (x *CreateTemplateReleaseReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[79] +func (x *ListGroupRleasesdAppsResp) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[75] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4841,54 +4515,56 @@ func (x *CreateTemplateReleaseReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateTemplateReleaseReq.ProtoReflect.Descriptor instead. -func (*CreateTemplateReleaseReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{79} +// Deprecated: Use ListGroupRleasesdAppsResp.ProtoReflect.Descriptor instead. +func (*ListGroupRleasesdAppsResp) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{75} } -func (x *CreateTemplateReleaseReq) GetAttachment() *template_release.TemplateReleaseAttachment { +func (x *ListGroupRleasesdAppsResp) GetCount() uint32 { if x != nil { - return x.Attachment + return x.Count } - return nil + return 0 } -func (x *CreateTemplateReleaseReq) GetSpec() *template_release.TemplateReleaseSpec { +func (x *ListGroupRleasesdAppsResp) GetDetails() []*ListGroupRleasesdAppsResp_ListGroupReleasedAppsData { if x != nil { - return x.Spec + return x.Details } return nil } -type ListTemplateReleasesReq struct { +type PublishReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - TemplateSpaceId uint32 `protobuf:"varint,2,opt,name=template_space_id,json=templateSpaceId,proto3" json:"template_space_id,omitempty"` - TemplateId uint32 `protobuf:"varint,3,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"` - Start uint32 `protobuf:"varint,4,opt,name=start,proto3" json:"start,omitempty"` - Limit uint32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` + Memo string `protobuf:"bytes,4,opt,name=memo,proto3" json:"memo,omitempty"` + All bool `protobuf:"varint,5,opt,name=all,proto3" json:"all,omitempty"` + Default bool `protobuf:"varint,6,opt,name=default,proto3" json:"default,omitempty"` + Groups []uint32 `protobuf:"varint,7,rep,packed,name=groups,proto3" json:"groups,omitempty"` } -func (x *ListTemplateReleasesReq) Reset() { - *x = ListTemplateReleasesReq{} +func (x *PublishReq) Reset() { + *x = PublishReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[80] + mi := &file_data_service_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListTemplateReleasesReq) String() string { +func (x *PublishReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListTemplateReleasesReq) ProtoMessage() {} +func (*PublishReq) ProtoMessage() {} -func (x *ListTemplateReleasesReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[80] +func (x *PublishReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[76] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4899,72 +4575,90 @@ func (x *ListTemplateReleasesReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListTemplateReleasesReq.ProtoReflect.Descriptor instead. -func (*ListTemplateReleasesReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{80} +// Deprecated: Use PublishReq.ProtoReflect.Descriptor instead. +func (*PublishReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{76} } -func (x *ListTemplateReleasesReq) GetBizId() uint32 { +func (x *PublishReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *ListTemplateReleasesReq) GetTemplateSpaceId() uint32 { +func (x *PublishReq) GetAppId() uint32 { if x != nil { - return x.TemplateSpaceId + return x.AppId } return 0 } -func (x *ListTemplateReleasesReq) GetTemplateId() uint32 { +func (x *PublishReq) GetReleaseId() uint32 { if x != nil { - return x.TemplateId + return x.ReleaseId } return 0 } -func (x *ListTemplateReleasesReq) GetStart() uint32 { +func (x *PublishReq) GetMemo() string { if x != nil { - return x.Start + return x.Memo } - return 0 + return "" } -func (x *ListTemplateReleasesReq) GetLimit() uint32 { +func (x *PublishReq) GetAll() bool { if x != nil { - return x.Limit + return x.All } - return 0 + return false } -type ListTemplateReleasesResp struct { +func (x *PublishReq) GetDefault() bool { + if x != nil { + return x.Default + } + return false +} + +func (x *PublishReq) GetGroups() []uint32 { + if x != nil { + return x.Groups + } + return nil +} + +type GenerateReleaseAndPublishReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*template_release.TemplateRelease `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` + BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + ReleaseName string `protobuf:"bytes,3,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` + ReleaseMemo string `protobuf:"bytes,4,opt,name=release_memo,json=releaseMemo,proto3" json:"release_memo,omitempty"` + All bool `protobuf:"varint,5,opt,name=all,proto3" json:"all,omitempty"` + Groups []string `protobuf:"bytes,6,rep,name=groups,proto3" json:"groups,omitempty"` } -func (x *ListTemplateReleasesResp) Reset() { - *x = ListTemplateReleasesResp{} +func (x *GenerateReleaseAndPublishReq) Reset() { + *x = GenerateReleaseAndPublishReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[81] + mi := &file_data_service_proto_msgTypes[77] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListTemplateReleasesResp) String() string { +func (x *GenerateReleaseAndPublishReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListTemplateReleasesResp) ProtoMessage() {} +func (*GenerateReleaseAndPublishReq) ProtoMessage() {} -func (x *ListTemplateReleasesResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[81] +func (x *GenerateReleaseAndPublishReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[77] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4975,51 +4669,78 @@ func (x *ListTemplateReleasesResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListTemplateReleasesResp.ProtoReflect.Descriptor instead. -func (*ListTemplateReleasesResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{81} +// Deprecated: Use GenerateReleaseAndPublishReq.ProtoReflect.Descriptor instead. +func (*GenerateReleaseAndPublishReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{77} } -func (x *ListTemplateReleasesResp) GetCount() uint32 { +func (x *GenerateReleaseAndPublishReq) GetBizId() uint32 { if x != nil { - return x.Count + return x.BizId } return 0 } -func (x *ListTemplateReleasesResp) GetDetails() []*template_release.TemplateRelease { +func (x *GenerateReleaseAndPublishReq) GetAppId() uint32 { if x != nil { - return x.Details + return x.AppId + } + return 0 +} + +func (x *GenerateReleaseAndPublishReq) GetReleaseName() string { + if x != nil { + return x.ReleaseName + } + return "" +} + +func (x *GenerateReleaseAndPublishReq) GetReleaseMemo() string { + if x != nil { + return x.ReleaseMemo + } + return "" +} + +func (x *GenerateReleaseAndPublishReq) GetAll() bool { + if x != nil { + return x.All + } + return false +} + +func (x *GenerateReleaseAndPublishReq) GetGroups() []string { + if x != nil { + return x.Groups } return nil } -type DeleteTemplateReleaseReq struct { +type PublishResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Attachment *template_release.TemplateReleaseAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` + PublishedStrategyHistoryId uint32 `protobuf:"varint,1,opt,name=published_strategy_history_id,json=publishedStrategyHistoryId,proto3" json:"published_strategy_history_id,omitempty"` } -func (x *DeleteTemplateReleaseReq) Reset() { - *x = DeleteTemplateReleaseReq{} +func (x *PublishResp) Reset() { + *x = PublishResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[82] + mi := &file_data_service_proto_msgTypes[78] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *DeleteTemplateReleaseReq) String() string { +func (x *PublishResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteTemplateReleaseReq) ProtoMessage() {} +func (*PublishResp) ProtoMessage() {} -func (x *DeleteTemplateReleaseReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[82] +func (x *PublishResp) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[78] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5030,51 +4751,46 @@ func (x *DeleteTemplateReleaseReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteTemplateReleaseReq.ProtoReflect.Descriptor instead. -func (*DeleteTemplateReleaseReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{82} +// Deprecated: Use PublishResp.ProtoReflect.Descriptor instead. +func (*PublishResp) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{78} } -func (x *DeleteTemplateReleaseReq) GetId() uint32 { +func (x *PublishResp) GetPublishedStrategyHistoryId() uint32 { if x != nil { - return x.Id + return x.PublishedStrategyHistoryId } return 0 } -func (x *DeleteTemplateReleaseReq) GetAttachment() *template_release.TemplateReleaseAttachment { - if x != nil { - return x.Attachment - } - return nil -} - -type CreateGroupReq struct { +type ListInstancesReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Attachment *group.GroupAttachment `protobuf:"bytes,1,opt,name=attachment,proto3" json:"attachment,omitempty"` - Spec *group.GroupSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` + ResourceType string `protobuf:"bytes,1,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` + BizId uint32 `protobuf:"varint,2,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` + Filter *structpb.Struct `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"` + Page *base.BasePage `protobuf:"bytes,4,opt,name=page,proto3" json:"page,omitempty"` } -func (x *CreateGroupReq) Reset() { - *x = CreateGroupReq{} +func (x *ListInstancesReq) Reset() { + *x = ListInstancesReq{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[83] + mi := &file_data_service_proto_msgTypes[79] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateGroupReq) String() string { +func (x *ListInstancesReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateGroupReq) ProtoMessage() {} +func (*ListInstancesReq) ProtoMessage() {} -func (x *CreateGroupReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[83] +func (x *ListInstancesReq) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[79] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5085,114 +4801,65 @@ func (x *CreateGroupReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateGroupReq.ProtoReflect.Descriptor instead. -func (*CreateGroupReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{83} +// Deprecated: Use ListInstancesReq.ProtoReflect.Descriptor instead. +func (*ListInstancesReq) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{79} } -func (x *CreateGroupReq) GetAttachment() *group.GroupAttachment { +func (x *ListInstancesReq) GetResourceType() string { if x != nil { - return x.Attachment + return x.ResourceType } - return nil + return "" } -func (x *CreateGroupReq) GetSpec() *group.GroupSpec { - if x != nil { - return x.Spec - } - return nil -} - -type ListGroupsReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - Filter *structpb.Struct `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"` - Page *base.BasePage `protobuf:"bytes,3,opt,name=page,proto3" json:"page,omitempty"` -} - -func (x *ListGroupsReq) Reset() { - *x = ListGroupsReq{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[84] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListGroupsReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListGroupsReq) ProtoMessage() {} - -func (x *ListGroupsReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[84] - 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 ListGroupsReq.ProtoReflect.Descriptor instead. -func (*ListGroupsReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{84} -} - -func (x *ListGroupsReq) GetBizId() uint32 { +func (x *ListInstancesReq) GetBizId() uint32 { if x != nil { return x.BizId } return 0 } -func (x *ListGroupsReq) GetFilter() *structpb.Struct { +func (x *ListInstancesReq) GetFilter() *structpb.Struct { if x != nil { return x.Filter } return nil } -func (x *ListGroupsReq) GetPage() *base.BasePage { +func (x *ListInstancesReq) GetPage() *base.BasePage { if x != nil { return x.Page } return nil } -type ListGroupsResp struct { +type ListInstancesResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*group.Group `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` + Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Details []*InstanceResource `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` } -func (x *ListGroupsResp) Reset() { - *x = ListGroupsResp{} +func (x *ListInstancesResp) Reset() { + *x = ListInstancesResp{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[85] + mi := &file_data_service_proto_msgTypes[80] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListGroupsResp) String() string { +func (x *ListInstancesResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListGroupsResp) ProtoMessage() {} +func (*ListInstancesResp) ProtoMessage() {} -func (x *ListGroupsResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[85] +func (x *ListInstancesResp) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[80] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5203,51 +4870,51 @@ func (x *ListGroupsResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListGroupsResp.ProtoReflect.Descriptor instead. -func (*ListGroupsResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{85} +// Deprecated: Use ListInstancesResp.ProtoReflect.Descriptor instead. +func (*ListInstancesResp) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{80} } -func (x *ListGroupsResp) GetCount() uint32 { +func (x *ListInstancesResp) GetCount() uint32 { if x != nil { return x.Count } return 0 } -func (x *ListGroupsResp) GetDetails() []*group.Group { +func (x *ListInstancesResp) GetDetails() []*InstanceResource { if x != nil { return x.Details } return nil } -type ListAppGroupsReq struct { +type InstanceResource struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` } -func (x *ListAppGroupsReq) Reset() { - *x = ListAppGroupsReq{} +func (x *InstanceResource) Reset() { + *x = InstanceResource{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[86] + mi := &file_data_service_proto_msgTypes[81] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListAppGroupsReq) String() string { +func (x *InstanceResource) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListAppGroupsReq) ProtoMessage() {} +func (*InstanceResource) ProtoMessage() {} -func (x *ListAppGroupsReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[86] +func (x *InstanceResource) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[81] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5258,50 +4925,50 @@ func (x *ListAppGroupsReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListAppGroupsReq.ProtoReflect.Descriptor instead. -func (*ListAppGroupsReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{86} +// Deprecated: Use InstanceResource.ProtoReflect.Descriptor instead. +func (*InstanceResource) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{81} } -func (x *ListAppGroupsReq) GetBizId() uint32 { +func (x *InstanceResource) GetId() uint32 { if x != nil { - return x.BizId + return x.Id } return 0 } -func (x *ListAppGroupsReq) GetAppId() uint32 { +func (x *InstanceResource) GetName() string { if x != nil { - return x.AppId + return x.Name } - return 0 + return "" } -type ListAppGroupsResp struct { +type PingMsg struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Details []*ListAppGroupsResp_ListAppGroupsData `protobuf:"bytes,1,rep,name=details,proto3" json:"details,omitempty"` + Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` } -func (x *ListAppGroupsResp) Reset() { - *x = ListAppGroupsResp{} +func (x *PingMsg) Reset() { + *x = PingMsg{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[87] + mi := &file_data_service_proto_msgTypes[82] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListAppGroupsResp) String() string { +func (x *PingMsg) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListAppGroupsResp) ProtoMessage() {} +func (*PingMsg) ProtoMessage() {} -func (x *ListAppGroupsResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[87] +func (x *PingMsg) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[82] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5312,45 +4979,45 @@ func (x *ListAppGroupsResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListAppGroupsResp.ProtoReflect.Descriptor instead. -func (*ListAppGroupsResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{87} +// Deprecated: Use PingMsg.ProtoReflect.Descriptor instead. +func (*PingMsg) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{82} } -func (x *ListAppGroupsResp) GetDetails() []*ListAppGroupsResp_ListAppGroupsData { +func (x *PingMsg) GetData() string { if x != nil { - return x.Details + return x.Data } - return nil + return "" } -type UpdateGroupReq struct { +type BatchUpsertConfigItemsReq_ConfigItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Attachment *group.GroupAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` - Spec *group.GroupSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` + ConfigItemAttachment *config_item.ConfigItemAttachment `protobuf:"bytes,1,opt,name=config_item_attachment,json=configItemAttachment,proto3" json:"config_item_attachment,omitempty"` + ConfigItemSpec *config_item.ConfigItemSpec `protobuf:"bytes,2,opt,name=config_item_spec,json=configItemSpec,proto3" json:"config_item_spec,omitempty"` + ContentSpec *content.ContentSpec `protobuf:"bytes,3,opt,name=content_spec,json=contentSpec,proto3" json:"content_spec,omitempty"` } -func (x *UpdateGroupReq) Reset() { - *x = UpdateGroupReq{} +func (x *BatchUpsertConfigItemsReq_ConfigItem) Reset() { + *x = BatchUpsertConfigItemsReq_ConfigItem{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[88] + mi := &file_data_service_proto_msgTypes[83] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *UpdateGroupReq) String() string { +func (x *BatchUpsertConfigItemsReq_ConfigItem) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateGroupReq) ProtoMessage() {} +func (*BatchUpsertConfigItemsReq_ConfigItem) ProtoMessage() {} -func (x *UpdateGroupReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[88] +func (x *BatchUpsertConfigItemsReq_ConfigItem) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[83] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5361,58 +5028,63 @@ func (x *UpdateGroupReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateGroupReq.ProtoReflect.Descriptor instead. -func (*UpdateGroupReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{88} +// Deprecated: Use BatchUpsertConfigItemsReq_ConfigItem.ProtoReflect.Descriptor instead. +func (*BatchUpsertConfigItemsReq_ConfigItem) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{24, 0} } -func (x *UpdateGroupReq) GetId() uint32 { +func (x *BatchUpsertConfigItemsReq_ConfigItem) GetConfigItemAttachment() *config_item.ConfigItemAttachment { if x != nil { - return x.Id + return x.ConfigItemAttachment } - return 0 + return nil } -func (x *UpdateGroupReq) GetAttachment() *group.GroupAttachment { +func (x *BatchUpsertConfigItemsReq_ConfigItem) GetConfigItemSpec() *config_item.ConfigItemSpec { if x != nil { - return x.Attachment + return x.ConfigItemSpec } return nil } -func (x *UpdateGroupReq) GetSpec() *group.GroupSpec { +func (x *BatchUpsertConfigItemsReq_ConfigItem) GetContentSpec() *content.ContentSpec { if x != nil { - return x.Spec + return x.ContentSpec } return nil } -type DeleteGroupReq struct { +type ListAppGroupsResp_ListAppGroupsData struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Attachment *group.GroupAttachment `protobuf:"bytes,2,opt,name=attachment,proto3" json:"attachment,omitempty"` + GroupId uint32 `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + GroupName string `protobuf:"bytes,2,opt,name=group_name,json=groupName,proto3" json:"group_name,omitempty"` + ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` + ReleaseName string `protobuf:"bytes,4,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` + OldSelector *structpb.Struct `protobuf:"bytes,5,opt,name=old_selector,json=oldSelector,proto3" json:"old_selector,omitempty"` + NewSelector *structpb.Struct `protobuf:"bytes,6,opt,name=new_selector,json=newSelector,proto3" json:"new_selector,omitempty"` + Edited bool `protobuf:"varint,7,opt,name=edited,proto3" json:"edited,omitempty"` } -func (x *DeleteGroupReq) Reset() { - *x = DeleteGroupReq{} +func (x *ListAppGroupsResp_ListAppGroupsData) Reset() { + *x = ListAppGroupsResp_ListAppGroupsData{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[89] + mi := &file_data_service_proto_msgTypes[84] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *DeleteGroupReq) String() string { +func (x *ListAppGroupsResp_ListAppGroupsData) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteGroupReq) ProtoMessage() {} +func (*ListAppGroupsResp_ListAppGroupsData) ProtoMessage() {} -func (x *DeleteGroupReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[89] +func (x *ListAppGroupsResp_ListAppGroupsData) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[84] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5423,155 +5095,87 @@ func (x *DeleteGroupReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteGroupReq.ProtoReflect.Descriptor instead. -func (*DeleteGroupReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{89} +// Deprecated: Use ListAppGroupsResp_ListAppGroupsData.ProtoReflect.Descriptor instead. +func (*ListAppGroupsResp_ListAppGroupsData) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{69, 0} } -func (x *DeleteGroupReq) GetId() uint32 { +func (x *ListAppGroupsResp_ListAppGroupsData) GetGroupId() uint32 { if x != nil { - return x.Id + return x.GroupId } return 0 } -func (x *DeleteGroupReq) GetAttachment() *group.GroupAttachment { +func (x *ListAppGroupsResp_ListAppGroupsData) GetGroupName() string { if x != nil { - return x.Attachment + return x.GroupName } - return nil + return "" } -type CountGroupsReleasedAppsReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - Groups []uint32 `protobuf:"varint,2,rep,packed,name=groups,proto3" json:"groups,omitempty"` +func (x *ListAppGroupsResp_ListAppGroupsData) GetReleaseId() uint32 { + if x != nil { + return x.ReleaseId + } + return 0 } -func (x *CountGroupsReleasedAppsReq) Reset() { - *x = CountGroupsReleasedAppsReq{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[90] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func (x *ListAppGroupsResp_ListAppGroupsData) GetReleaseName() string { + if x != nil { + return x.ReleaseName } + return "" } -func (x *CountGroupsReleasedAppsReq) String() string { - return protoimpl.X.MessageStringOf(x) +func (x *ListAppGroupsResp_ListAppGroupsData) GetOldSelector() *structpb.Struct { + if x != nil { + return x.OldSelector + } + return nil } -func (*CountGroupsReleasedAppsReq) ProtoMessage() {} +func (x *ListAppGroupsResp_ListAppGroupsData) GetNewSelector() *structpb.Struct { + if x != nil { + return x.NewSelector + } + return nil +} -func (x *CountGroupsReleasedAppsReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[90] - 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 CountGroupsReleasedAppsReq.ProtoReflect.Descriptor instead. -func (*CountGroupsReleasedAppsReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{90} -} - -func (x *CountGroupsReleasedAppsReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -func (x *CountGroupsReleasedAppsReq) GetGroups() []uint32 { - if x != nil { - return x.Groups - } - return nil -} - -type CountGroupsReleasedAppsResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Data []*CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` -} - -func (x *CountGroupsReleasedAppsResp) Reset() { - *x = CountGroupsReleasedAppsResp{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[91] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountGroupsReleasedAppsResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountGroupsReleasedAppsResp) ProtoMessage() {} - -func (x *CountGroupsReleasedAppsResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[91] - 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 CountGroupsReleasedAppsResp.ProtoReflect.Descriptor instead. -func (*CountGroupsReleasedAppsResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{91} -} - -func (x *CountGroupsReleasedAppsResp) GetData() []*CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData { +func (x *ListAppGroupsResp_ListAppGroupsData) GetEdited() bool { if x != nil { - return x.Data + return x.Edited } - return nil + return false } -type ListGroupRleasesdAppsReq struct { +type CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - GroupId uint32 `protobuf:"varint,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - Start uint32 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` - Limit uint32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` + GroupId uint32 `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + Edited bool `protobuf:"varint,3,opt,name=edited,proto3" json:"edited,omitempty"` } -func (x *ListGroupRleasesdAppsReq) Reset() { - *x = ListGroupRleasesdAppsReq{} +func (x *CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData) Reset() { + *x = CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[92] + mi := &file_data_service_proto_msgTypes[85] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ListGroupRleasesdAppsReq) String() string { +func (x *CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListGroupRleasesdAppsReq) ProtoMessage() {} +func (*CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData) ProtoMessage() {} -func (x *ListGroupRleasesdAppsReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[92] +func (x *CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[85] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5582,125 +5186,61 @@ func (x *ListGroupRleasesdAppsReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListGroupRleasesdAppsReq.ProtoReflect.Descriptor instead. -func (*ListGroupRleasesdAppsReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{92} -} - -func (x *ListGroupRleasesdAppsReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 +// Deprecated: Use CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData.ProtoReflect.Descriptor instead. +func (*CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{73, 0} } -func (x *ListGroupRleasesdAppsReq) GetGroupId() uint32 { +func (x *CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData) GetGroupId() uint32 { if x != nil { return x.GroupId } return 0 } -func (x *ListGroupRleasesdAppsReq) GetStart() uint32 { - if x != nil { - return x.Start - } - return 0 -} - -func (x *ListGroupRleasesdAppsReq) GetLimit() uint32 { - if x != nil { - return x.Limit - } - return 0 -} - -type ListGroupRleasesdAppsResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*ListGroupRleasesdAppsResp_ListGroupReleasedAppsData `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` -} - -func (x *ListGroupRleasesdAppsResp) Reset() { - *x = ListGroupRleasesdAppsResp{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[93] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListGroupRleasesdAppsResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListGroupRleasesdAppsResp) ProtoMessage() {} - -func (x *ListGroupRleasesdAppsResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[93] - 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 ListGroupRleasesdAppsResp.ProtoReflect.Descriptor instead. -func (*ListGroupRleasesdAppsResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{93} -} - -func (x *ListGroupRleasesdAppsResp) GetCount() uint32 { +func (x *CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData) GetCount() uint32 { if x != nil { return x.Count } return 0 } -func (x *ListGroupRleasesdAppsResp) GetDetails() []*ListGroupRleasesdAppsResp_ListGroupReleasedAppsData { +func (x *CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData) GetEdited() bool { if x != nil { - return x.Details + return x.Edited } - return nil + return false } -type PublishReq struct { +type ListGroupRleasesdAppsResp_ListGroupReleasedAppsData struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` - Memo string `protobuf:"bytes,4,opt,name=memo,proto3" json:"memo,omitempty"` - All bool `protobuf:"varint,5,opt,name=all,proto3" json:"all,omitempty"` - Default bool `protobuf:"varint,6,opt,name=default,proto3" json:"default,omitempty"` - Groups []uint32 `protobuf:"varint,7,rep,packed,name=groups,proto3" json:"groups,omitempty"` + AppId uint32 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + AppName string `protobuf:"bytes,2,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"` + ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` + ReleaseName string `protobuf:"bytes,4,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` + Edited bool `protobuf:"varint,5,opt,name=edited,proto3" json:"edited,omitempty"` } -func (x *PublishReq) Reset() { - *x = PublishReq{} +func (x *ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) Reset() { + *x = ListGroupRleasesdAppsResp_ListGroupReleasedAppsData{} if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[94] + mi := &file_data_service_proto_msgTypes[86] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *PublishReq) String() string { +func (x *ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PublishReq) ProtoMessage() {} +func (*ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) ProtoMessage() {} -func (x *PublishReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[94] +func (x *ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) ProtoReflect() protoreflect.Message { + mi := &file_data_service_proto_msgTypes[86] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5711,770 +5251,47 @@ func (x *PublishReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PublishReq.ProtoReflect.Descriptor instead. -func (*PublishReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{94} +// Deprecated: Use ListGroupRleasesdAppsResp_ListGroupReleasedAppsData.ProtoReflect.Descriptor instead. +func (*ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) Descriptor() ([]byte, []int) { + return file_data_service_proto_rawDescGZIP(), []int{75, 0} } -func (x *PublishReq) GetBizId() uint32 { +func (x *ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) GetAppId() uint32 { if x != nil { - return x.BizId + return x.AppId } return 0 } -func (x *PublishReq) GetAppId() uint32 { +func (x *ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) GetAppName() string { if x != nil { - return x.AppId + return x.AppName } - return 0 + return "" } -func (x *PublishReq) GetReleaseId() uint32 { +func (x *ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) GetReleaseId() uint32 { if x != nil { return x.ReleaseId } return 0 } -func (x *PublishReq) GetMemo() string { +func (x *ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) GetReleaseName() string { if x != nil { - return x.Memo + return x.ReleaseName } return "" } -func (x *PublishReq) GetAll() bool { - if x != nil { - return x.All - } - return false -} - -func (x *PublishReq) GetDefault() bool { +func (x *ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) GetEdited() bool { if x != nil { - return x.Default + return x.Edited } return false } -func (x *PublishReq) GetGroups() []uint32 { - if x != nil { - return x.Groups - } - return nil -} - -type GenerateReleaseAndPublishReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BizId uint32 `protobuf:"varint,1,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - AppId uint32 `protobuf:"varint,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - ReleaseName string `protobuf:"bytes,3,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - ReleaseMemo string `protobuf:"bytes,4,opt,name=release_memo,json=releaseMemo,proto3" json:"release_memo,omitempty"` - All bool `protobuf:"varint,5,opt,name=all,proto3" json:"all,omitempty"` - Groups []string `protobuf:"bytes,6,rep,name=groups,proto3" json:"groups,omitempty"` -} - -func (x *GenerateReleaseAndPublishReq) Reset() { - *x = GenerateReleaseAndPublishReq{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[95] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenerateReleaseAndPublishReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateReleaseAndPublishReq) ProtoMessage() {} - -func (x *GenerateReleaseAndPublishReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[95] - 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 GenerateReleaseAndPublishReq.ProtoReflect.Descriptor instead. -func (*GenerateReleaseAndPublishReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{95} -} - -func (x *GenerateReleaseAndPublishReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -func (x *GenerateReleaseAndPublishReq) GetAppId() uint32 { - if x != nil { - return x.AppId - } - return 0 -} - -func (x *GenerateReleaseAndPublishReq) GetReleaseName() string { - if x != nil { - return x.ReleaseName - } - return "" -} - -func (x *GenerateReleaseAndPublishReq) GetReleaseMemo() string { - if x != nil { - return x.ReleaseMemo - } - return "" -} - -func (x *GenerateReleaseAndPublishReq) GetAll() bool { - if x != nil { - return x.All - } - return false -} - -func (x *GenerateReleaseAndPublishReq) GetGroups() []string { - if x != nil { - return x.Groups - } - return nil -} - -type PublishResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PublishedStrategyHistoryId uint32 `protobuf:"varint,1,opt,name=published_strategy_history_id,json=publishedStrategyHistoryId,proto3" json:"published_strategy_history_id,omitempty"` -} - -func (x *PublishResp) Reset() { - *x = PublishResp{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[96] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PublishResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PublishResp) ProtoMessage() {} - -func (x *PublishResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[96] - 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 PublishResp.ProtoReflect.Descriptor instead. -func (*PublishResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{96} -} - -func (x *PublishResp) GetPublishedStrategyHistoryId() uint32 { - if x != nil { - return x.PublishedStrategyHistoryId - } - return 0 -} - -type ListInstancesReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ResourceType string `protobuf:"bytes,1,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` - BizId uint32 `protobuf:"varint,2,opt,name=biz_id,json=bizId,proto3" json:"biz_id,omitempty"` - Filter *structpb.Struct `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"` - Page *base.BasePage `protobuf:"bytes,4,opt,name=page,proto3" json:"page,omitempty"` -} - -func (x *ListInstancesReq) Reset() { - *x = ListInstancesReq{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[97] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListInstancesReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListInstancesReq) ProtoMessage() {} - -func (x *ListInstancesReq) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[97] - 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 ListInstancesReq.ProtoReflect.Descriptor instead. -func (*ListInstancesReq) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{97} -} - -func (x *ListInstancesReq) GetResourceType() string { - if x != nil { - return x.ResourceType - } - return "" -} - -func (x *ListInstancesReq) GetBizId() uint32 { - if x != nil { - return x.BizId - } - return 0 -} - -func (x *ListInstancesReq) GetFilter() *structpb.Struct { - if x != nil { - return x.Filter - } - return nil -} - -func (x *ListInstancesReq) GetPage() *base.BasePage { - if x != nil { - return x.Page - } - return nil -} - -type ListInstancesResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - Details []*InstanceResource `protobuf:"bytes,2,rep,name=details,proto3" json:"details,omitempty"` -} - -func (x *ListInstancesResp) Reset() { - *x = ListInstancesResp{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[98] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListInstancesResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListInstancesResp) ProtoMessage() {} - -func (x *ListInstancesResp) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[98] - 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 ListInstancesResp.ProtoReflect.Descriptor instead. -func (*ListInstancesResp) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{98} -} - -func (x *ListInstancesResp) GetCount() uint32 { - if x != nil { - return x.Count - } - return 0 -} - -func (x *ListInstancesResp) GetDetails() []*InstanceResource { - if x != nil { - return x.Details - } - return nil -} - -type InstanceResource struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *InstanceResource) Reset() { - *x = InstanceResource{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[99] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InstanceResource) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InstanceResource) ProtoMessage() {} - -func (x *InstanceResource) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[99] - 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 InstanceResource.ProtoReflect.Descriptor instead. -func (*InstanceResource) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{99} -} - -func (x *InstanceResource) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *InstanceResource) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type PingMsg struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *PingMsg) Reset() { - *x = PingMsg{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[100] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PingMsg) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PingMsg) ProtoMessage() {} - -func (x *PingMsg) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[100] - 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 PingMsg.ProtoReflect.Descriptor instead. -func (*PingMsg) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{100} -} - -func (x *PingMsg) GetData() string { - if x != nil { - return x.Data - } - return "" -} - -type BatchUpsertConfigItemsReq_ConfigItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ConfigItemAttachment *config_item.ConfigItemAttachment `protobuf:"bytes,1,opt,name=config_item_attachment,json=configItemAttachment,proto3" json:"config_item_attachment,omitempty"` - ConfigItemSpec *config_item.ConfigItemSpec `protobuf:"bytes,2,opt,name=config_item_spec,json=configItemSpec,proto3" json:"config_item_spec,omitempty"` - ContentSpec *content.ContentSpec `protobuf:"bytes,3,opt,name=content_spec,json=contentSpec,proto3" json:"content_spec,omitempty"` -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) Reset() { - *x = BatchUpsertConfigItemsReq_ConfigItem{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[101] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BatchUpsertConfigItemsReq_ConfigItem) ProtoMessage() {} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[101] - 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 BatchUpsertConfigItemsReq_ConfigItem.ProtoReflect.Descriptor instead. -func (*BatchUpsertConfigItemsReq_ConfigItem) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{27, 0} -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) GetConfigItemAttachment() *config_item.ConfigItemAttachment { - if x != nil { - return x.ConfigItemAttachment - } - return nil -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) GetConfigItemSpec() *config_item.ConfigItemSpec { - if x != nil { - return x.ConfigItemSpec - } - return nil -} - -func (x *BatchUpsertConfigItemsReq_ConfigItem) GetContentSpec() *content.ContentSpec { - if x != nil { - return x.ContentSpec - } - return nil -} - -type GetHookInfoSpec_Releases struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NotReleaseId uint32 `protobuf:"varint,1,opt,name=not_release_id,json=notReleaseId,proto3" json:"not_release_id,omitempty"` -} - -func (x *GetHookInfoSpec_Releases) Reset() { - *x = GetHookInfoSpec_Releases{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[102] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetHookInfoSpec_Releases) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetHookInfoSpec_Releases) ProtoMessage() {} - -func (x *GetHookInfoSpec_Releases) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[102] - 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 GetHookInfoSpec_Releases.ProtoReflect.Descriptor instead. -func (*GetHookInfoSpec_Releases) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{54, 0} -} - -func (x *GetHookInfoSpec_Releases) GetNotReleaseId() uint32 { - if x != nil { - return x.NotReleaseId - } - return 0 -} - -type ListAppGroupsResp_ListAppGroupsData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GroupId uint32 `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - GroupName string `protobuf:"bytes,2,opt,name=group_name,json=groupName,proto3" json:"group_name,omitempty"` - ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` - ReleaseName string `protobuf:"bytes,4,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - OldSelector *structpb.Struct `protobuf:"bytes,5,opt,name=old_selector,json=oldSelector,proto3" json:"old_selector,omitempty"` - NewSelector *structpb.Struct `protobuf:"bytes,6,opt,name=new_selector,json=newSelector,proto3" json:"new_selector,omitempty"` - Edited bool `protobuf:"varint,7,opt,name=edited,proto3" json:"edited,omitempty"` -} - -func (x *ListAppGroupsResp_ListAppGroupsData) Reset() { - *x = ListAppGroupsResp_ListAppGroupsData{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[103] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAppGroupsResp_ListAppGroupsData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAppGroupsResp_ListAppGroupsData) ProtoMessage() {} - -func (x *ListAppGroupsResp_ListAppGroupsData) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[103] - 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 ListAppGroupsResp_ListAppGroupsData.ProtoReflect.Descriptor instead. -func (*ListAppGroupsResp_ListAppGroupsData) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{87, 0} -} - -func (x *ListAppGroupsResp_ListAppGroupsData) GetGroupId() uint32 { - if x != nil { - return x.GroupId - } - return 0 -} - -func (x *ListAppGroupsResp_ListAppGroupsData) GetGroupName() string { - if x != nil { - return x.GroupName - } - return "" -} - -func (x *ListAppGroupsResp_ListAppGroupsData) GetReleaseId() uint32 { - if x != nil { - return x.ReleaseId - } - return 0 -} - -func (x *ListAppGroupsResp_ListAppGroupsData) GetReleaseName() string { - if x != nil { - return x.ReleaseName - } - return "" -} - -func (x *ListAppGroupsResp_ListAppGroupsData) GetOldSelector() *structpb.Struct { - if x != nil { - return x.OldSelector - } - return nil -} - -func (x *ListAppGroupsResp_ListAppGroupsData) GetNewSelector() *structpb.Struct { - if x != nil { - return x.NewSelector - } - return nil -} - -func (x *ListAppGroupsResp_ListAppGroupsData) GetEdited() bool { - if x != nil { - return x.Edited - } - return false -} - -type CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GroupId uint32 `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` - Edited bool `protobuf:"varint,3,opt,name=edited,proto3" json:"edited,omitempty"` -} - -func (x *CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData) Reset() { - *x = CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[104] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData) ProtoMessage() {} - -func (x *CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[104] - 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 CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData.ProtoReflect.Descriptor instead. -func (*CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{91, 0} -} - -func (x *CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData) GetGroupId() uint32 { - if x != nil { - return x.GroupId - } - return 0 -} - -func (x *CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData) GetCount() uint32 { - if x != nil { - return x.Count - } - return 0 -} - -func (x *CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData) GetEdited() bool { - if x != nil { - return x.Edited - } - return false -} - -type ListGroupRleasesdAppsResp_ListGroupReleasedAppsData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppId uint32 `protobuf:"varint,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - AppName string `protobuf:"bytes,2,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"` - ReleaseId uint32 `protobuf:"varint,3,opt,name=release_id,json=releaseId,proto3" json:"release_id,omitempty"` - ReleaseName string `protobuf:"bytes,4,opt,name=release_name,json=releaseName,proto3" json:"release_name,omitempty"` - Edited bool `protobuf:"varint,5,opt,name=edited,proto3" json:"edited,omitempty"` -} - -func (x *ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) Reset() { - *x = ListGroupRleasesdAppsResp_ListGroupReleasedAppsData{} - if protoimpl.UnsafeEnabled { - mi := &file_data_service_proto_msgTypes[105] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) ProtoMessage() {} - -func (x *ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) ProtoReflect() protoreflect.Message { - mi := &file_data_service_proto_msgTypes[105] - 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 ListGroupRleasesdAppsResp_ListGroupReleasedAppsData.ProtoReflect.Descriptor instead. -func (*ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) Descriptor() ([]byte, []int) { - return file_data_service_proto_rawDescGZIP(), []int{93, 0} -} - -func (x *ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) GetAppId() uint32 { - if x != nil { - return x.AppId - } - return 0 -} - -func (x *ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) GetAppName() string { - if x != nil { - return x.AppName - } - return "" -} - -func (x *ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) GetReleaseId() uint32 { - if x != nil { - return x.ReleaseId - } - return 0 -} - -func (x *ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) GetReleaseName() string { - if x != nil { - return x.ReleaseName - } - return "" -} - -func (x *ListGroupRleasesdAppsResp_ListGroupReleasedAppsData) GetEdited() bool { - if x != nil { - return x.Edited - } - return false -} - -var File_data_service_proto protoreflect.FileDescriptor +var File_data_service_proto protoreflect.FileDescriptor var file_data_service_proto_rawDesc = []byte{ 0x0a, 0x12, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, @@ -6506,182 +5323,187 @@ var file_data_service_proto_rawDesc = []byte{ 0x75, 0x70, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x29, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x2f, 0x68, - 0x6f, 0x6f, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x39, 0x62, 0x73, 0x63, 0x70, 0x2e, + 0x6f, 0x6f, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2f, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x2d, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x2f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2f, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x37, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, + 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x72, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x37, 0x62, 0x73, 0x63, 0x70, + 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x2d, 0x63, + 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x5f, 0x63, 0x69, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x31, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x3d, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, + 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, + 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2d, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x41, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x2d, 0x63, 0x69, 0x2f, 0x72, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x64, 0x5f, 0x63, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x31, - 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x3d, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2d, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x41, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x2d, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x74, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x37, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2d, 0x68, 0x6f, 0x6f, 0x6b, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, - 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbd, 0x01, 0x0a, 0x19, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, - 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x23, 0x0a, - 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, - 0x49, 0x64, 0x12, 0x30, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x07, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x18, - 0x0a, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0d, 0x52, - 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x6d, 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0d, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x40, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x73, 0x2e, - 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x41, - 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, - 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x1c, 0x0a, 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, + 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2d, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbd, 0x01, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x55, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, - 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x66, 0x0a, 0x18, 0x4c, 0x69, - 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x07, - 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x70, 0x62, 0x63, 0x72, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, - 0x53, 0x63, 0x6f, 0x70, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x73, 0x22, 0x70, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, 0x12, 0x40, - 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, - 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, - 0x73, 0x70, 0x65, 0x63, 0x22, 0x8b, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, - 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x42, 0x0a, 0x0a, + 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x30, + 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, + 0x6f, 0x70, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x07, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x6d, 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x40, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, + 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, + 0x74, 0x22, 0x1c, 0x0a, 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x55, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, + 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, + 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x66, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x72, + 0x73, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, + 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x70, + 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x71, 0x12, 0x40, 0x0a, 0x0a, 0x61, 0x74, + 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, + 0x2e, 0x70, 0x62, 0x63, 0x72, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, + 0x22, 0x8b, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x42, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, + 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, + 0x62, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2e, 0x43, 0x72, 0x65, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x04, + 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x63, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x61, 0x6c, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x81, + 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x04, 0x70, + 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, 0x04, 0x70, 0x61, 0x67, + 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x22, 0x62, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x36, + 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2e, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x07, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x9b, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x42, + 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x41, 0x74, 0x74, 0x61, + 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2e, + 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, + 0x73, 0x70, 0x65, 0x63, 0x22, 0x69, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x42, 0x0a, 0x0a, 0x61, + 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2e, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, + 0x54, 0x0a, 0x13, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x16, 0x0a, + 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x1c, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x02, 0x69, 0x64, 0x22, 0x49, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, + 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x04, 0x73, 0x70, + 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x61, 0x70, 0x70, + 0x2e, 0x41, 0x70, 0x70, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x59, + 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, + 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x61, 0x70, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x53, + 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x35, 0x0a, 0x0c, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, + 0x22, 0x39, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, + 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, + 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x26, 0x0a, 0x0d, 0x47, + 0x65, 0x74, 0x41, 0x70, 0x70, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, + 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, + 0x70, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x42, 0x79, 0x4e, + 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x19, 0x0a, + 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x7b, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, + 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2f, + 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, + 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, + 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x84, 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, + 0x70, 0x73, 0x52, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1a, 0x0a, 0x08, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4a, 0x0a, 0x0c, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x61, 0x70, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x52, + 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0xe2, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, + 0x12, 0x50, 0x0a, 0x16, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2e, - 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, - 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x30, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x70, 0x62, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2e, 0x43, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, - 0x65, 0x63, 0x22, 0x74, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x1c, - 0x0a, 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x62, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, - 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, - 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x36, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x61, 0x6c, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x9b, 0x01, 0x0a, - 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, - 0x6c, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x42, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, - 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x65, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, - 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, - 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x69, 0x0a, 0x13, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, - 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x42, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x62, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x61, 0x6c, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x41, - 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, - 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x54, 0x0a, 0x13, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x43, - 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, - 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, - 0x7a, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x1c, 0x0a, 0x0a, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x8b, 0x01, 0x0a, 0x13, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, - 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x3a, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x68, 0x2e, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, - 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x28, 0x0a, - 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, - 0x63, 0x68, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x53, 0x70, 0x65, - 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x40, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, + 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, + 0x65, 0x6d, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x14, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x3e, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, + 0x6d, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, + 0x62, 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x70, + 0x65, 0x63, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x70, + 0x65, 0x63, 0x12, 0x39, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x70, + 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, + 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, 0x22, 0xe7, 0x02, + 0x0a, 0x19, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x49, 0x0a, 0x0c, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, - 0x12, 0x22, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, - 0x2e, 0x70, 0x62, 0x61, 0x70, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, - 0x73, 0x70, 0x65, 0x63, 0x22, 0x59, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, - 0x70, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x04, 0x73, - 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x61, 0x70, - 0x70, 0x2e, 0x41, 0x70, 0x70, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, - 0x35, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x22, 0x39, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, - 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, - 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, - 0x64, 0x22, 0x26, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x42, 0x79, 0x49, 0x44, 0x52, - 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x0f, 0x47, 0x65, 0x74, - 0x41, 0x70, 0x70, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, - 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, - 0x7a, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x84, - 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x74, 0x52, - 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, - 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4a, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x07, 0x64, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, - 0x62, 0x61, 0x70, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x22, 0x24, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x42, 0x79, 0x49, - 0x44, 0x73, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0d, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x39, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, - 0x70, 0x70, 0x73, 0x42, 0x79, 0x49, 0x44, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x07, - 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, - 0x70, 0x62, 0x61, 0x70, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x73, 0x22, 0xe2, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x50, 0x0a, 0x16, 0x63, 0x6f, + 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, + 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0xd9, 0x01, 0x0a, 0x0a, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x50, 0x0a, 0x16, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x41, 0x74, 0x74, 0x61, @@ -6694,893 +5516,704 @@ var file_data_service_proto_rawDesc = []byte{ 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, 0x22, 0xe7, 0x02, 0x0a, 0x19, 0x42, 0x61, 0x74, 0x63, - 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, - 0x6d, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, - 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, - 0x70, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, - 0x70, 0x73, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, - 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, - 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0xd9, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x49, 0x74, 0x65, 0x6d, 0x12, 0x50, 0x0a, 0x16, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, - 0x74, 0x65, 0x6d, 0x5f, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x41, 0x74, 0x74, 0x61, - 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x3e, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x70, 0x62, 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, - 0x65, 0x6d, 0x53, 0x70, 0x65, 0x63, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, - 0x65, 0x6d, 0x53, 0x70, 0x65, 0x63, 0x12, 0x39, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, - 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x53, 0x70, 0x65, 0x63, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, - 0x63, 0x22, 0x8b, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3a, 0x0a, 0x0a, 0x61, 0x74, 0x74, - 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x70, 0x62, 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x41, - 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, - 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, - 0x61, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, - 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3a, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, - 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, - 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x41, 0x74, 0x74, 0x61, - 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, - 0x6e, 0x74, 0x22, 0x50, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, - 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, - 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, - 0x70, 0x70, 0x49, 0x64, 0x22, 0xbd, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, - 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, - 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x4b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x4b, 0x65, 0x79, 0x22, 0x57, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x46, 0x0a, - 0x16, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, - 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x05, - 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x4f, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x34, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x07, 0x64, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x7b, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x3a, 0x0a, - 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x68, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, - 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, - 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x04, 0x73, 0x70, 0x65, - 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, 0x63, 0x68, 0x2e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, - 0x70, 0x65, 0x63, 0x22, 0x7c, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x3c, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, - 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x62, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x41, - 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, - 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, - 0x63, 0x22, 0x4d, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, - 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, - 0x22, 0x96, 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, - 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, - 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, - 0x61, 0x67, 0x65, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x56, 0x0a, 0x10, 0x4c, 0x69, 0x73, - 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, - 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x22, 0x80, 0x01, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x3a, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, - 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, - 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, - 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x49, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x68, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, - 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, - 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, - 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x22, 0x95, - 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, + 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, 0x22, 0x8b, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x3a, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x49, 0x74, 0x65, 0x6d, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x04, 0x73, + 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, 0x63, 0x69, + 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x70, 0x65, 0x63, 0x52, + 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x61, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3a, 0x0a, 0x0a, + 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, + 0x65, 0x6d, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, + 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x50, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, + 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, + 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0xbd, 0x01, 0x0a, 0x12, 0x4c, + 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, - 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, - 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x53, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x2a, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x70, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x7c, 0x0a, 0x10, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, - 0x3c, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, - 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x0a, - 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, - 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, - 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0xb6, 0x01, 0x0a, 0x0f, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, + 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, + 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x0a, 0x09, + 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x22, 0x57, 0x0a, 0x13, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x63, 0x69, 0x2e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x22, 0x46, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, + 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, + 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x4f, 0x0a, 0x17, 0x4c, + 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x34, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x69, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x7c, 0x0a, 0x10, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x12, 0x3c, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2a, + 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, + 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x4d, 0x0a, 0x0d, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x62, + 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, + 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x96, 0x01, 0x0a, 0x0f, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x64, - 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x04, - 0x70, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, + 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, 0x04, 0x70, 0x61, - 0x67, 0x65, 0x22, 0x56, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x67, 0x65, 0x22, 0x56, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x70, 0x62, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x10, 0x47, - 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x49, 0x52, 0x65, 0x71, 0x12, - 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x24, 0x0a, - 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, - 0x6d, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x49, 0x64, 0x22, 0x82, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x64, 0x43, 0x49, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, - 0x12, 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, - 0x65, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x60, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x49, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, - 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x33, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x62, 0x72, 0x63, 0x69, 0x2e, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, - 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x6d, 0x0a, 0x0d, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x36, 0x0a, 0x0a, 0x61, 0x74, - 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, - 0x2e, 0x70, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x74, 0x61, - 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x70, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x53, 0x70, - 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x27, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, - 0x48, 0x6f, 0x6f, 0x6b, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, + 0x70, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x80, 0x01, 0x0a, 0x0f, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x3a, + 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, + 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, + 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x68, 0x0a, + 0x12, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, + 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, + 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x22, 0x95, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, - 0x64, 0x22, 0x3c, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x12, - 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x22, - 0xae, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x29, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x70, 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x49, 0x6e, 0x66, 0x6f, - 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x36, 0x0a, 0x0a, 0x61, 0x74, - 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, - 0x2e, 0x70, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x74, 0x61, - 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x52, 0x65, - 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x22, 0xee, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x49, 0x6e, 0x66, 0x6f, - 0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, - 0x74, 0x61, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x12, - 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, - 0x6d, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, 0x6e, 0x75, - 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, - 0x4e, 0x75, 0x6d, 0x12, 0x3a, 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, - 0x48, 0x6f, 0x6f, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x52, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x1a, - 0x30, 0x0a, 0x08, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x6e, - 0x6f, 0x74, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6e, 0x6f, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, - 0x64, 0x22, 0xa2, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, + 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, + 0x53, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x07, 0x64, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x73, 0x22, 0x7c, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x3c, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, + 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, + 0x62, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, + 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, + 0x65, 0x63, 0x22, 0xb6, 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, + 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, + 0x70, 0x70, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, + 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, + 0x61, 0x74, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, + 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x56, 0x0a, 0x10, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x72, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x64, 0x43, 0x49, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, + 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, + 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x22, 0x82, 0x01, 0x0a, 0x12, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x49, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, - 0x03, 0x74, 0x61, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, - 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, - 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x74, 0x5f, 0x74, 0x61, 0x67, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x54, 0x61, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x4d, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, - 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x0a, - 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, - 0x2e, 0x70, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x07, 0x64, 0x65, - 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x42, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, - 0x6b, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2f, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x62, 0x68, 0x6f, - 0x6f, 0x6b, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x54, 0x61, 0x67, 0x73, - 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x57, 0x0a, 0x0d, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x36, 0x0a, 0x0a, 0x61, 0x74, - 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, - 0x2e, 0x70, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x74, 0x61, - 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, - 0x6e, 0x74, 0x22, 0x7e, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x3b, 0x0a, 0x0a, 0x61, 0x74, - 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x70, 0x62, 0x68, 0x72, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, - 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x62, 0x68, 0x72, 0x2e, 0x48, 0x6f, 0x6f, - 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, - 0x65, 0x63, 0x22, 0xb8, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, - 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, - 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, - 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x59, 0x0a, - 0x14, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x07, 0x64, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, - 0x62, 0x68, 0x72, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, - 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x57, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x48, - 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, - 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, - 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, - 0x64, 0x22, 0x56, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, - 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x57, 0x0a, 0x15, 0x50, 0x75, 0x62, - 0x6c, 0x69, 0x73, 0x68, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, + 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, + 0x63, 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, + 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, + 0x22, 0x60, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, + 0x43, 0x49, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x33, 0x0a, + 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x70, 0x62, 0x72, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x73, 0x22, 0x6d, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, + 0x52, 0x65, 0x71, 0x12, 0x36, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, 0x68, 0x6f, 0x6f, 0x6b, + 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x73, + 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x68, 0x6f, + 0x6f, 0x6b, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, + 0x63, 0x22, 0x93, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, - 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, - 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, - 0x69, 0x64, 0x22, 0x58, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x17, 0x0a, - 0x07, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, - 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x8e, 0x01, 0x0a, - 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, - 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x62, 0x68, 0x72, - 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x74, 0x74, 0x61, - 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x15, 0x2e, 0x70, 0x62, 0x68, 0x72, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x9c, 0x01, - 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, - 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x12, - 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x49, 0x64, - 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x79, 0x0a, 0x1e, - 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, - 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x62, 0x68, 0x72, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x07, - 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x84, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x12, 0x3d, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x62, 0x74, 0x73, 0x2e, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, - 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, - 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x70, 0x62, 0x74, 0x73, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, - 0x70, 0x61, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x5a, - 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, - 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x14, - 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x5d, 0x0a, 0x16, 0x4c, 0x69, - 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x64, 0x65, - 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x62, - 0x74, 0x73, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, - 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x94, 0x01, 0x0a, 0x16, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, - 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x3d, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, - 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x62, 0x74, 0x73, 0x2e, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x41, 0x74, 0x74, - 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, - 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x74, 0x73, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, - 0x22, 0x67, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3d, 0x0a, 0x0a, 0x61, 0x74, - 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, - 0x2e, 0x70, 0x62, 0x74, 0x73, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, - 0x61, 0x63, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, - 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xb5, 0x01, 0x0a, 0x11, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, - 0x3e, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, + 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, + 0x12, 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, + 0x65, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x4d, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x48, + 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, + 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0c, 0x2e, 0x70, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x07, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x7d, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x36, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, + 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, + 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, - 0x2c, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x70, 0x62, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x32, 0x0a, - 0x07, 0x74, 0x72, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x70, 0x62, 0x74, 0x72, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x06, 0x74, 0x72, 0x53, 0x70, 0x65, - 0x63, 0x22, 0x81, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2a, 0x0a, - 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, - 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x59, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x2e, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, - 0x22, 0x91, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3e, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, - 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x62, 0x74, + 0x24, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x70, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x53, 0x70, 0x65, 0x63, 0x52, + 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x57, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, + 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x36, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, + 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, 0x68, + 0x6f, 0x6f, 0x6b, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x84, + 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x12, 0x3d, 0x0a, 0x0a, 0x61, 0x74, 0x74, + 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x70, 0x62, 0x74, 0x73, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, + 0x63, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, + 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x74, 0x73, 0x2e, 0x54, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, + 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x5a, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, + 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x22, 0x5d, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x62, 0x74, 0x73, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, + 0x22, 0x94, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3d, 0x0a, 0x0a, 0x61, + 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x70, 0x62, 0x74, 0x73, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, + 0x70, 0x61, 0x63, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, + 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x73, 0x70, + 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x74, 0x73, 0x2e, + 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x53, 0x70, 0x65, + 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x67, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x3d, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x62, 0x74, 0x73, 0x2e, 0x54, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, + 0x22, 0xb5, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x3e, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, + 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, - 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x03, + 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, - 0x73, 0x70, 0x65, 0x63, 0x22, 0x63, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3e, 0x0a, 0x0a, 0x61, 0x74, 0x74, - 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, - 0x70, 0x62, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, - 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x8a, 0x01, 0x0a, 0x18, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x3f, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, - 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x62, 0x74, - 0x72, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, - 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x62, 0x74, 0x72, 0x2e, 0x54, 0x65, 0x6d, + 0x73, 0x70, 0x65, 0x63, 0x12, 0x32, 0x0a, 0x07, 0x74, 0x72, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x62, 0x74, 0x72, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x70, 0x65, 0x63, - 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0xa9, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, - 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x22, 0x61, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, + 0x52, 0x06, 0x74, 0x72, 0x53, 0x70, 0x65, 0x63, 0x22, 0x81, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, + 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, + 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, + 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, + 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x0f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x59, 0x0a, 0x11, + 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x07, + 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x91, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3e, 0x0a, + 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x54, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, + 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, + 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x63, 0x0a, 0x11, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x3e, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, + 0x22, 0x8a, 0x01, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x3f, 0x0a, + 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x62, 0x74, 0x72, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2d, + 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, + 0x62, 0x74, 0x72, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0xa9, 0x01, + 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, + 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x74, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, + 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0a, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x61, 0x0a, 0x18, 0x4c, 0x69, 0x73, + 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2f, 0x0a, 0x07, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, + 0x62, 0x74, 0x72, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x6b, 0x0a, 0x18, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3f, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, + 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, + 0x62, 0x74, 0x72, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, + 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x72, 0x0a, 0x0e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x38, 0x0a, 0x0a, 0x61, + 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x70, 0x62, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, + 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, + 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x7d, 0x0a, + 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, + 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, 0x61, + 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x50, 0x0a, 0x0e, + 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2f, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x62, 0x74, 0x72, 0x2e, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x07, 0x64, 0x65, - 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x6b, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, - 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x3f, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x62, 0x74, 0x72, 0x2e, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x74, 0x74, 0x61, - 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, - 0x6e, 0x74, 0x22, 0x72, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x52, 0x65, 0x71, 0x12, 0x38, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x67, 0x72, 0x6f, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x40, + 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, + 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, + 0x22, 0xfa, 0x02, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x43, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x44, 0x61, + 0x74, 0x61, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x1a, 0x9f, 0x02, 0x0a, 0x11, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x44, 0x61, 0x74, + 0x61, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, + 0x0c, 0x6f, 0x6c, 0x64, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x6f, 0x6c, + 0x64, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x3a, 0x0a, 0x0c, 0x6e, 0x65, 0x77, + 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x53, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x22, 0x82, 0x01, + 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x38, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, + 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x73, 0x70, + 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, + 0x65, 0x63, 0x22, 0x5a, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x38, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, - 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, - 0x62, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x70, 0x65, 0x63, - 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x7d, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2f, - 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, - 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, - 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x50, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x0a, - 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, - 0x2e, 0x70, 0x62, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x07, - 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x40, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, - 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, - 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, - 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0xfa, 0x02, 0x0a, 0x11, 0x4c, 0x69, - 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x43, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x29, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, - 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x64, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x73, 0x1a, 0x9f, 0x02, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x0c, 0x6f, 0x6c, 0x64, 0x5f, 0x73, 0x65, - 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, - 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x6f, 0x6c, 0x64, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x12, 0x3a, 0x0a, 0x0c, 0x6e, 0x65, 0x77, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, - 0x74, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x16, - 0x0a, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, - 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x22, 0x82, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x38, 0x0a, 0x0a, 0x61, 0x74, 0x74, - 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x70, 0x62, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x74, 0x74, - 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, - 0x65, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x5a, 0x0a, 0x0e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x38, 0x0a, - 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, - 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x4b, 0x0a, 0x1a, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, - 0x70, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x06, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x73, 0x22, 0xd8, 0x01, 0x0a, 0x1b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x73, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x44, 0x61, 0x74, - 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x66, 0x0a, 0x1b, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, - 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, - 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x22, - 0x78, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x73, 0x64, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, - 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, - 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, - 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0xb0, 0x02, 0x0a, 0x19, 0x4c, 0x69, - 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x64, 0x41, - 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x53, 0x0a, - 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, - 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x64, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x64, 0x41, 0x70, 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x73, 0x1a, 0xa7, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, - 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x22, 0xb1, 0x01, 0x0a, - 0x0a, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, - 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, - 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x10, 0x0a, 0x03, - 0x61, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x18, - 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, - 0x22, 0xbc, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, - 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, - 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x65, - 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, - 0x50, 0x0a, 0x0b, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x41, - 0x0a, 0x1d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x72, 0x61, - 0x74, 0x65, 0x67, 0x79, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x1a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, - 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x49, - 0x64, 0x22, 0xa5, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x62, - 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, - 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, - 0x61, 0x67, 0x65, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x5b, 0x0a, 0x11, 0x4c, 0x69, 0x73, - 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, + 0x6e, 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x4b, + 0x0a, 0x1a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, + 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, + 0x7a, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0d, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0xd8, 0x01, 0x0a, 0x1b, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x70, 0x62, 0x64, 0x73, + 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, + 0x41, 0x70, 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x66, + 0x0a, 0x1b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x19, 0x0a, + 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, + 0x0a, 0x06, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x22, 0x78, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x52, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x64, 0x41, 0x70, 0x70, 0x73, 0x52, + 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x22, 0xb0, 0x02, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x73, 0x64, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x49, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x07, 0x64, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x36, 0x0a, 0x10, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x63, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x1d, - 0x0a, 0x07, 0x50, 0x69, 0x6e, 0x67, 0x4d, 0x73, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0xdc, 0x24, - 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x33, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x41, 0x70, 0x70, 0x12, 0x12, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x09, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x12, 0x12, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, - 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x00, 0x12, 0x34, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, 0x70, 0x12, 0x12, - 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, - 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x27, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x41, 0x70, - 0x70, 0x12, 0x0f, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x52, - 0x65, 0x71, 0x1a, 0x0a, 0x2e, 0x70, 0x62, 0x61, 0x70, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x22, 0x00, - 0x12, 0x2f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x42, 0x79, 0x49, 0x44, 0x12, 0x13, - 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x42, 0x79, 0x49, 0x44, - 0x52, 0x65, 0x71, 0x1a, 0x0a, 0x2e, 0x70, 0x62, 0x61, 0x70, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x22, - 0x00, 0x12, 0x33, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x42, 0x79, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x42, - 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0a, 0x2e, 0x70, 0x62, 0x61, 0x70, 0x70, - 0x2e, 0x41, 0x70, 0x70, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, - 0x70, 0x73, 0x52, 0x65, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, - 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x42, - 0x79, 0x49, 0x44, 0x73, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x41, 0x70, 0x70, 0x73, 0x42, 0x79, 0x49, 0x44, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, - 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x42, 0x79, 0x49, 0x44, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x19, 0x2e, 0x70, 0x62, - 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, - 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x16, 0x42, 0x61, - 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, - 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x42, 0x61, 0x74, 0x63, - 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, - 0x6d, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x10, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x19, - 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, - 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, - 0x65, 0x6d, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, - 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, - 0x74, 0x65, 0x6d, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, - 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x22, 0x00, 0x12, - 0x48, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, - 0x6d, 0x73, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x70, - 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, - 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x13, 0x4c, 0x69, 0x73, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1d, - 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, - 0x41, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, - 0x6f, 0x6f, 0x6b, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x10, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x53, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x64, 0x41, 0x70, + 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x1a, 0xa7, 0x01, 0x0a, 0x19, 0x4c, 0x69, + 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, + 0x70, 0x70, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x19, + 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, + 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x64, 0x69, + 0x74, 0x65, 0x64, 0x22, 0xb1, 0x01, 0x0a, 0x0a, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, + 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, + 0x65, 0x6d, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0d, 0x52, + 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0xbc, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, + 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x10, 0x0a, 0x03, + 0x61, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x16, + 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0x50, 0x0a, 0x0b, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, + 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x41, 0x0a, 0x1d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, + 0x65, 0x64, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x5f, 0x68, 0x69, 0x73, 0x74, + 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x1a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x48, + 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x22, 0xa5, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, + 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x23, 0x0a, + 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, + 0x63, 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x04, 0x70, 0x61, + 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, + 0x22, 0x5b, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x07, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, + 0x62, 0x64, 0x73, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x36, 0x0a, + 0x10, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x1d, 0x0a, 0x07, 0x50, 0x69, 0x6e, 0x67, 0x4d, 0x73, 0x67, + 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x32, 0xee, 0x1d, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x33, 0x0a, + 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x12, 0x12, 0x2e, 0x70, 0x62, 0x64, + 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x10, + 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x00, 0x12, 0x34, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x12, + 0x12, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, + 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x41, 0x70, 0x70, 0x12, 0x12, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x27, + 0x0a, 0x06, 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x12, 0x0f, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, + 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x0a, 0x2e, 0x70, 0x62, 0x61, 0x70, + 0x70, 0x2e, 0x41, 0x70, 0x70, 0x22, 0x00, 0x12, 0x2f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41, 0x70, + 0x70, 0x42, 0x79, 0x49, 0x44, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, + 0x41, 0x70, 0x70, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x1a, 0x0a, 0x2e, 0x70, 0x62, 0x61, + 0x70, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, + 0x70, 0x70, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, + 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x1a, + 0x0a, 0x2e, 0x70, 0x62, 0x61, 0x70, 0x70, 0x2e, 0x41, 0x70, 0x70, 0x22, 0x00, 0x12, 0x33, 0x0a, + 0x08, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x64, 0x73, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, + 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, + 0x73, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, + 0x70, 0x73, 0x52, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x64, 0x73, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, + 0x41, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, + 0x74, 0x65, 0x6d, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x16, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x70, + 0x62, 0x64, 0x73, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, + 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, + 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x47, - 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x1a, - 0x10, 0x2e, 0x70, 0x62, 0x63, 0x68, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x6f, 0x6f, - 0x6b, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, - 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, - 0x12, 0x37, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x13, - 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0c, 0x4c, 0x69, 0x73, - 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x64, 0x73, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, - 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x0c, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x64, - 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x64, + 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, + 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0d, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x16, 0x2e, 0x70, 0x62, + 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, + 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x63, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x49, 0x74, 0x65, 0x6d, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x64, + 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, + 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x00, 0x12, 0x54, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, + 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x00, 0x12, 0x3f, 0x0a, + 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x2e, + 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39, + 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x15, + 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0f, 0x47, 0x65, 0x74, + 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x18, 0x2e, 0x70, + 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0b, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x64, 0x73, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x1a, + 0x15, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x64, 0x73, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, - 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, - 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, - 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x62, - 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, - 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x00, 0x12, 0x3f, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x73, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x16, 0x2e, 0x70, 0x62, - 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x49, - 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x72, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x22, 0x00, - 0x12, 0x50, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x18, 0x2e, 0x70, 0x62, - 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, - 0x49, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x49, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x00, 0x12, 0x35, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, - 0x12, 0x13, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, - 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x09, 0x4c, 0x69, 0x73, - 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x12, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x70, 0x62, 0x64, - 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x00, 0x12, 0x36, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x12, - 0x13, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, - 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0c, 0x4c, 0x69, 0x73, - 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x54, 0x61, 0x67, 0x73, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x64, 0x73, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x1a, - 0x15, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x54, - 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x30, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x48, - 0x6f, 0x6f, 0x6b, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x6f, - 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, - 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x11, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, - 0x1a, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, - 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, - 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, - 0x4b, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x73, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, - 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1a, - 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x12, - 0x47, 0x65, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x42, 0x79, - 0x49, 0x44, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x6f, 0x6f, - 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, - 0x11, 0x2e, 0x70, 0x62, 0x68, 0x72, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, - 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x64, 0x73, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x12, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x73, 0x68, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x48, - 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, - 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x00, 0x12, 0x47, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x42, 0x79, 0x50, 0x75, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, - 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x68, 0x72, 0x2e, 0x48, 0x6f, - 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x11, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x6f, - 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, - 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x00, 0x12, 0x69, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, - 0x23, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x13, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, - 0x61, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x70, + 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, + 0x16, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x64, 0x43, 0x49, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x72, 0x63, 0x69, 0x2e, + 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, + 0x65, 0x6d, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, + 0x18, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x64, 0x43, 0x49, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x64, 0x73, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x43, 0x49, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x36, 0x0a, + 0x09, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x12, 0x2e, 0x70, 0x62, 0x64, + 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x13, + 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, + 0x6f, 0x6f, 0x6b, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x36, 0x0a, + 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x13, 0x2e, 0x70, 0x62, + 0x64, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, + 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x70, + 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x64, + 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x51, + 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, + 0x61, 0x63, 0x65, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x00, 0x12, 0x48, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, + 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x13, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, + 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, + 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, + 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x64, + 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x64, + 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, - 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, - 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, - 0x1c, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, - 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x00, 0x12, 0x48, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x64, 0x73, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, - 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x17, - 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x4c, - 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x70, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x1d, 0x2e, + 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, - 0x3e, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, - 0x3e, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, - 0x4b, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x14, - 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x1e, - 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x11, - 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x0a, - 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x64, - 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x1a, - 0x14, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x41, - 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, - 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x0b, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x64, - 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, - 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, - 0x60, 0x0a, 0x17, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x64, - 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x70, - 0x62, 0x64, 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x00, 0x12, 0x5a, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x73, 0x64, 0x41, 0x70, 0x70, 0x73, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x64, - 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x73, 0x64, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x64, - 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x73, 0x64, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x30, 0x0a, - 0x07, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, - 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x64, - 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, - 0x54, 0x0a, 0x19, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x22, 0x2e, 0x70, - 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, - 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, - 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, - 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x64, 0x73, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, - 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, - 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, - 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, - 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, - 0x12, 0x42, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x61, 0x6c, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x1a, - 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x4c, + 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x0b, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x2e, 0x70, 0x62, + 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, + 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x73, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, + 0x12, 0x42, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x73, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x64, 0x73, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x38, + 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x2e, + 0x70, 0x62, 0x64, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, - 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, - 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, - 0x1e, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x00, 0x12, 0x5d, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, - 0x64, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x70, - 0x62, 0x64, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, - 0x12, 0x42, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, - 0x73, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x64, 0x73, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x0d, 0x2e, 0x70, - 0x62, 0x64, 0x73, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x4d, 0x73, 0x67, 0x1a, 0x0d, 0x2e, 0x70, 0x62, - 0x64, 0x73, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x4d, 0x73, 0x67, 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x0a, 0x22, 0x05, 0x2f, 0x70, 0x69, 0x6e, 0x67, 0x3a, 0x01, 0x2a, 0x42, 0x28, 0x5a, 0x26, - 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x3b, 0x70, 0x62, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x60, 0x0a, 0x17, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, + 0x70, 0x70, 0x73, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x41, 0x70, + 0x70, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, + 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x15, 0x4c, 0x69, + 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x64, 0x41, + 0x70, 0x70, 0x73, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x64, 0x41, 0x70, 0x70, 0x73, + 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x64, 0x41, 0x70, 0x70, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x30, 0x0a, 0x07, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, + 0x68, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, + 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x19, 0x47, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x22, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x6e, 0x64, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x64, 0x73, + 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x41, + 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, + 0x70, 0x62, 0x64, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x00, 0x12, 0x46, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x73, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, + 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x10, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x19, 0x2e, + 0x70, 0x62, 0x64, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, + 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, + 0x62, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x00, 0x12, 0x57, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x64, 0x73, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, + 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, + 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x16, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, + 0x6f, 0x70, 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, 0x70, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x63, 0x6f, + 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d, 0x4c, 0x69, 0x73, + 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x64, + 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x36, 0x0a, + 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x0d, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x50, 0x69, 0x6e, + 0x67, 0x4d, 0x73, 0x67, 0x1a, 0x0d, 0x2e, 0x70, 0x62, 0x64, 0x73, 0x2e, 0x50, 0x69, 0x6e, 0x67, + 0x4d, 0x73, 0x67, 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x22, 0x05, 0x2f, 0x70, 0x69, + 0x6e, 0x67, 0x3a, 0x01, 0x2a, 0x42, 0x28, 0x5a, 0x26, 0x62, 0x73, 0x63, 0x70, 0x2e, 0x69, 0x6f, + 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x64, 0x61, + 0x74, 0x61, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3b, 0x70, 0x62, 0x64, 0x73, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -7595,7 +6228,7 @@ func file_data_service_proto_rawDescGZIP() []byte { return file_data_service_proto_rawDescData } -var file_data_service_proto_msgTypes = make([]protoimpl.MessageInfo, 106) +var file_data_service_proto_msgTypes = make([]protoimpl.MessageInfo, 87) var file_data_service_proto_goTypes = []interface{}{ (*UpdateCredentialScopesReq)(nil), // 0: pbds.UpdateCredentialScopesReq (*UpdateCredentialScopesResp)(nil), // 1: pbds.UpdateCredentialScopesResp @@ -7611,612 +6244,336 @@ var file_data_service_proto_goTypes = []interface{}{ (*DeleteCredentialReq)(nil), // 11: pbds.DeleteCredentialReq (*EnableCredentialReq)(nil), // 12: pbds.EnableCredentialReq (*CreateResp)(nil), // 13: pbds.CreateResp - (*UpdateConfigHookReq)(nil), // 14: pbds.UpdateConfigHookReq - (*GetConfigHookReq)(nil), // 15: pbds.GetConfigHookReq - (*CreateAppReq)(nil), // 16: pbds.CreateAppReq - (*UpdateAppReq)(nil), // 17: pbds.UpdateAppReq - (*DeleteAppReq)(nil), // 18: pbds.DeleteAppReq - (*GetAppReq)(nil), // 19: pbds.GetAppReq - (*GetAppByIDReq)(nil), // 20: pbds.GetAppByIDReq - (*GetAppByNameReq)(nil), // 21: pbds.GetAppByNameReq - (*ListAppsRestReq)(nil), // 22: pbds.ListAppsRestReq - (*ListAppsResp)(nil), // 23: pbds.ListAppsResp - (*ListAppsByIDsReq)(nil), // 24: pbds.ListAppsByIDsReq - (*ListAppsByIDsResp)(nil), // 25: pbds.ListAppsByIDsResp - (*CreateConfigItemReq)(nil), // 26: pbds.CreateConfigItemReq - (*BatchUpsertConfigItemsReq)(nil), // 27: pbds.BatchUpsertConfigItemsReq - (*UpdateConfigItemReq)(nil), // 28: pbds.UpdateConfigItemReq - (*DeleteConfigItemReq)(nil), // 29: pbds.DeleteConfigItemReq - (*GetConfigItemReq)(nil), // 30: pbds.GetConfigItemReq - (*ListConfigItemsReq)(nil), // 31: pbds.ListConfigItemsReq - (*ListConfigItemsResp)(nil), // 32: pbds.ListConfigItemsResp - (*ListConfigItemCountReq)(nil), // 33: pbds.ListConfigItemCountReq - (*ListConfigItemCountResp)(nil), // 34: pbds.ListConfigItemCountResp - (*CreateConfigHookReq)(nil), // 35: pbds.CreateConfigHookReq - (*CreateContentReq)(nil), // 36: pbds.CreateContentReq - (*GetContentReq)(nil), // 37: pbds.GetContentReq - (*ListContentsReq)(nil), // 38: pbds.ListContentsReq - (*ListContentsResp)(nil), // 39: pbds.ListContentsResp - (*CreateCommitReq)(nil), // 40: pbds.CreateCommitReq - (*GetLatestCommitReq)(nil), // 41: pbds.GetLatestCommitReq - (*ListCommitsReq)(nil), // 42: pbds.ListCommitsReq - (*ListCommitsResp)(nil), // 43: pbds.ListCommitsResp - (*CreateReleaseReq)(nil), // 44: pbds.CreateReleaseReq - (*ListReleasesReq)(nil), // 45: pbds.ListReleasesReq - (*ListReleasesResp)(nil), // 46: pbds.ListReleasesResp - (*GetReleasedCIReq)(nil), // 47: pbds.GetReleasedCIReq - (*ListReleasedCIsReq)(nil), // 48: pbds.ListReleasedCIsReq - (*ListReleasedCIsResp)(nil), // 49: pbds.ListReleasedCIsResp - (*CreateHookReq)(nil), // 50: pbds.CreateHookReq - (*ListHookTagReq)(nil), // 51: pbds.ListHookTagReq - (*GetHookReq)(nil), // 52: pbds.GetHookReq - (*GetHookResp)(nil), // 53: pbds.GetHookResp - (*GetHookInfoSpec)(nil), // 54: pbds.GetHookInfoSpec - (*ListHooksReq)(nil), // 55: pbds.ListHooksReq - (*ListHooksResp)(nil), // 56: pbds.ListHooksResp - (*ListHookTagResp)(nil), // 57: pbds.ListHookTagResp - (*DeleteHookReq)(nil), // 58: pbds.DeleteHookReq - (*CreateHookReleaseReq)(nil), // 59: pbds.CreateHookReleaseReq - (*ListHookReleasesReq)(nil), // 60: pbds.ListHookReleasesReq - (*ListHookReleasesResp)(nil), // 61: pbds.ListHookReleasesResp - (*GetHookReleaseByIdReq)(nil), // 62: pbds.GetHookReleaseByIdReq - (*DeleteHookReleaseReq)(nil), // 63: pbds.DeleteHookReleaseReq - (*PublishHookReleaseReq)(nil), // 64: pbds.PublishHookReleaseReq - (*GetByPubStateReq)(nil), // 65: pbds.GetByPubStateReq - (*UpdateHookReleaseReq)(nil), // 66: pbds.UpdateHookReleaseReq - (*ListHookReleasesReferencesReq)(nil), // 67: pbds.ListHookReleasesReferencesReq - (*ListHookReleasesReferencesResp)(nil), // 68: pbds.ListHookReleasesReferencesResp - (*CreateTemplateSpaceReq)(nil), // 69: pbds.CreateTemplateSpaceReq - (*ListTemplateSpacesReq)(nil), // 70: pbds.ListTemplateSpacesReq - (*ListTemplateSpacesResp)(nil), // 71: pbds.ListTemplateSpacesResp - (*UpdateTemplateSpaceReq)(nil), // 72: pbds.UpdateTemplateSpaceReq - (*DeleteTemplateSpaceReq)(nil), // 73: pbds.DeleteTemplateSpaceReq - (*CreateTemplateReq)(nil), // 74: pbds.CreateTemplateReq - (*ListTemplatesReq)(nil), // 75: pbds.ListTemplatesReq - (*ListTemplatesResp)(nil), // 76: pbds.ListTemplatesResp - (*UpdateTemplateReq)(nil), // 77: pbds.UpdateTemplateReq - (*DeleteTemplateReq)(nil), // 78: pbds.DeleteTemplateReq - (*CreateTemplateReleaseReq)(nil), // 79: pbds.CreateTemplateReleaseReq - (*ListTemplateReleasesReq)(nil), // 80: pbds.ListTemplateReleasesReq - (*ListTemplateReleasesResp)(nil), // 81: pbds.ListTemplateReleasesResp - (*DeleteTemplateReleaseReq)(nil), // 82: pbds.DeleteTemplateReleaseReq - (*CreateGroupReq)(nil), // 83: pbds.CreateGroupReq - (*ListGroupsReq)(nil), // 84: pbds.ListGroupsReq - (*ListGroupsResp)(nil), // 85: pbds.ListGroupsResp - (*ListAppGroupsReq)(nil), // 86: pbds.ListAppGroupsReq - (*ListAppGroupsResp)(nil), // 87: pbds.ListAppGroupsResp - (*UpdateGroupReq)(nil), // 88: pbds.UpdateGroupReq - (*DeleteGroupReq)(nil), // 89: pbds.DeleteGroupReq - (*CountGroupsReleasedAppsReq)(nil), // 90: pbds.CountGroupsReleasedAppsReq - (*CountGroupsReleasedAppsResp)(nil), // 91: pbds.CountGroupsReleasedAppsResp - (*ListGroupRleasesdAppsReq)(nil), // 92: pbds.ListGroupRleasesdAppsReq - (*ListGroupRleasesdAppsResp)(nil), // 93: pbds.ListGroupRleasesdAppsResp - (*PublishReq)(nil), // 94: pbds.PublishReq - (*GenerateReleaseAndPublishReq)(nil), // 95: pbds.GenerateReleaseAndPublishReq - (*PublishResp)(nil), // 96: pbds.PublishResp - (*ListInstancesReq)(nil), // 97: pbds.ListInstancesReq - (*ListInstancesResp)(nil), // 98: pbds.ListInstancesResp - (*InstanceResource)(nil), // 99: pbds.InstanceResource - (*PingMsg)(nil), // 100: pbds.PingMsg - (*BatchUpsertConfigItemsReq_ConfigItem)(nil), // 101: pbds.BatchUpsertConfigItemsReq.ConfigItem - (*GetHookInfoSpec_Releases)(nil), // 102: pbds.GetHookInfoSpec.Releases - (*ListAppGroupsResp_ListAppGroupsData)(nil), // 103: pbds.ListAppGroupsResp.ListAppGroupsData - (*CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData)(nil), // 104: pbds.CountGroupsReleasedAppsResp.CountGroupsReleasedAppsData - (*ListGroupRleasesdAppsResp_ListGroupReleasedAppsData)(nil), // 105: pbds.ListGroupRleasesdAppsResp.ListGroupReleasedAppsData - (*credential_scope.UpdateScopeSpec)(nil), // 106: pbcrs.UpdateScopeSpec - (*credential_scope.CredentialScopeAttachment)(nil), // 107: pbcrs.CredentialScopeAttachment - (*credential_scope.CredentialScopeList)(nil), // 108: pbcrs.CredentialScopeList - (*credential.CredentialAttachment)(nil), // 109: pbcredential.CredentialAttachment - (*credential.CredentialSpec)(nil), // 110: pbcredential.CredentialSpec - (*credential.CredentialList)(nil), // 111: pbcredential.CredentialList - (*config_hook.ConfigHookAttachment)(nil), // 112: pbch.ConfigHookAttachment - (*config_hook.ConfigHookSpec)(nil), // 113: pbch.ConfigHookSpec - (*app.AppSpec)(nil), // 114: pbapp.AppSpec - (*app.App)(nil), // 115: pbapp.App - (*config_item.ConfigItemAttachment)(nil), // 116: pbci.ConfigItemAttachment - (*config_item.ConfigItemSpec)(nil), // 117: pbci.ConfigItemSpec - (*content.ContentSpec)(nil), // 118: pbcontent.ContentSpec - (*config_item.ConfigItem)(nil), // 119: pbci.ConfigItem - (*config_item.ListConfigItemCounts)(nil), // 120: pbci.ListConfigItemCounts - (*content.ContentAttachment)(nil), // 121: pbcontent.ContentAttachment - (*structpb.Struct)(nil), // 122: google.protobuf.Struct - (*base.BasePage)(nil), // 123: pbbase.BasePage - (*content.Content)(nil), // 124: pbcontent.Content - (*commit.CommitAttachment)(nil), // 125: pbcommit.CommitAttachment - (*commit.Commit)(nil), // 126: pbcommit.Commit - (*release.ReleaseAttachment)(nil), // 127: pbrelease.ReleaseAttachment - (*release.ReleaseSpec)(nil), // 128: pbrelease.ReleaseSpec - (*release.Release)(nil), // 129: pbrelease.Release - (*released_ci.ReleasedConfigItem)(nil), // 130: pbrci.ReleasedConfigItem - (*hook.HookAttachment)(nil), // 131: pbhook.HookAttachment - (*hook.HookSpec)(nil), // 132: pbhook.HookSpec - (*base.Revision)(nil), // 133: pbbase.Revision - (*hook.Hook)(nil), // 134: pbhook.Hook - (*hook.CountHookTags)(nil), // 135: pbhook.CountHookTags - (*hook_release.HookReleaseAttachment)(nil), // 136: pbhr.HookReleaseAttachment - (*hook_release.HookReleaseSpec)(nil), // 137: pbhr.HookReleaseSpec - (*hook_release.HookRelease)(nil), // 138: pbhr.HookRelease - (*hook_release.ListHookReleasesReferencesDetails)(nil), // 139: pbhr.ListHookReleasesReferencesDetails - (*template_space.TemplateSpaceAttachment)(nil), // 140: pbts.TemplateSpaceAttachment - (*template_space.TemplateSpaceSpec)(nil), // 141: pbts.TemplateSpaceSpec - (*template_space.TemplateSpace)(nil), // 142: pbts.TemplateSpace - (*template.TemplateAttachment)(nil), // 143: pbtemplate.TemplateAttachment - (*template.TemplateSpec)(nil), // 144: pbtemplate.TemplateSpec - (*template_release.TemplateReleaseSpec)(nil), // 145: pbtr.TemplateReleaseSpec - (*template.Template)(nil), // 146: pbtemplate.Template - (*template_release.TemplateReleaseAttachment)(nil), // 147: pbtr.TemplateReleaseAttachment - (*template_release.TemplateRelease)(nil), // 148: pbtr.TemplateRelease - (*group.GroupAttachment)(nil), // 149: pbgroup.GroupAttachment - (*group.GroupSpec)(nil), // 150: pbgroup.GroupSpec - (*group.Group)(nil), // 151: pbgroup.Group - (*base.EmptyResp)(nil), // 152: pbbase.EmptyResp - (*config_hook.ConfigHook)(nil), // 153: pbch.ConfigHook -} -var file_data_service_proto_depIdxs = []int32{ - 106, // 0: pbds.UpdateCredentialScopesReq.updated:type_name -> pbcrs.UpdateScopeSpec - 107, // 1: pbds.DeleteCredentialScopesReq.attachment:type_name -> pbcrs.CredentialScopeAttachment - 108, // 2: pbds.ListCredentialScopesResp.details:type_name -> pbcrs.CredentialScopeList - 107, // 3: pbds.CreateCredentialScopeReq.attachment:type_name -> pbcrs.CredentialScopeAttachment - 109, // 4: pbds.CreateCredentialReq.attachment:type_name -> pbcredential.CredentialAttachment - 110, // 5: pbds.CreateCredentialReq.spec:type_name -> pbcredential.CredentialSpec - 111, // 6: pbds.ListCredentialResp.details:type_name -> pbcredential.CredentialList - 109, // 7: pbds.UpdateCredentialReq.attachment:type_name -> pbcredential.CredentialAttachment - 110, // 8: pbds.UpdateCredentialReq.spec:type_name -> pbcredential.CredentialSpec - 109, // 9: pbds.DeleteCredentialReq.attachment:type_name -> pbcredential.CredentialAttachment - 112, // 10: pbds.UpdateConfigHookReq.attachment:type_name -> pbch.ConfigHookAttachment - 113, // 11: pbds.UpdateConfigHookReq.spec:type_name -> pbch.ConfigHookSpec - 114, // 12: pbds.CreateAppReq.spec:type_name -> pbapp.AppSpec - 114, // 13: pbds.UpdateAppReq.spec:type_name -> pbapp.AppSpec - 115, // 14: pbds.ListAppsResp.details:type_name -> pbapp.App - 115, // 15: pbds.ListAppsByIDsResp.details:type_name -> pbapp.App - 116, // 16: pbds.CreateConfigItemReq.config_item_attachment:type_name -> pbci.ConfigItemAttachment - 117, // 17: pbds.CreateConfigItemReq.config_item_spec:type_name -> pbci.ConfigItemSpec - 118, // 18: pbds.CreateConfigItemReq.content_spec:type_name -> pbcontent.ContentSpec - 101, // 19: pbds.BatchUpsertConfigItemsReq.items:type_name -> pbds.BatchUpsertConfigItemsReq.ConfigItem - 116, // 20: pbds.UpdateConfigItemReq.attachment:type_name -> pbci.ConfigItemAttachment - 117, // 21: pbds.UpdateConfigItemReq.spec:type_name -> pbci.ConfigItemSpec - 116, // 22: pbds.DeleteConfigItemReq.attachment:type_name -> pbci.ConfigItemAttachment - 119, // 23: pbds.ListConfigItemsResp.details:type_name -> pbci.ConfigItem - 120, // 24: pbds.ListConfigItemCountResp.details:type_name -> pbci.ListConfigItemCounts - 112, // 25: pbds.CreateConfigHookReq.attachment:type_name -> pbch.ConfigHookAttachment - 113, // 26: pbds.CreateConfigHookReq.spec:type_name -> pbch.ConfigHookSpec - 121, // 27: pbds.CreateContentReq.attachment:type_name -> pbcontent.ContentAttachment - 118, // 28: pbds.CreateContentReq.spec:type_name -> pbcontent.ContentSpec - 122, // 29: pbds.ListContentsReq.filter:type_name -> google.protobuf.Struct - 123, // 30: pbds.ListContentsReq.page:type_name -> pbbase.BasePage - 124, // 31: pbds.ListContentsResp.details:type_name -> pbcontent.Content - 125, // 32: pbds.CreateCommitReq.attachment:type_name -> pbcommit.CommitAttachment - 122, // 33: pbds.ListCommitsReq.filter:type_name -> google.protobuf.Struct - 123, // 34: pbds.ListCommitsReq.page:type_name -> pbbase.BasePage - 126, // 35: pbds.ListCommitsResp.details:type_name -> pbcommit.Commit - 127, // 36: pbds.CreateReleaseReq.attachment:type_name -> pbrelease.ReleaseAttachment - 128, // 37: pbds.CreateReleaseReq.spec:type_name -> pbrelease.ReleaseSpec - 122, // 38: pbds.ListReleasesReq.filter:type_name -> google.protobuf.Struct - 123, // 39: pbds.ListReleasesReq.page:type_name -> pbbase.BasePage - 129, // 40: pbds.ListReleasesResp.details:type_name -> pbrelease.Release - 122, // 41: pbds.ListReleasedCIsReq.filter:type_name -> google.protobuf.Struct - 123, // 42: pbds.ListReleasedCIsReq.page:type_name -> pbbase.BasePage - 130, // 43: pbds.ListReleasedCIsResp.details:type_name -> pbrci.ReleasedConfigItem - 131, // 44: pbds.CreateHookReq.attachment:type_name -> pbhook.HookAttachment - 132, // 45: pbds.CreateHookReq.spec:type_name -> pbhook.HookSpec - 54, // 46: pbds.GetHookResp.spec:type_name -> pbds.GetHookInfoSpec - 131, // 47: pbds.GetHookResp.attachment:type_name -> pbhook.HookAttachment - 133, // 48: pbds.GetHookResp.revision:type_name -> pbbase.Revision - 102, // 49: pbds.GetHookInfoSpec.releases:type_name -> pbds.GetHookInfoSpec.Releases - 134, // 50: pbds.ListHooksResp.details:type_name -> pbhook.Hook - 135, // 51: pbds.ListHookTagResp.details:type_name -> pbhook.CountHookTags - 131, // 52: pbds.DeleteHookReq.attachment:type_name -> pbhook.HookAttachment - 136, // 53: pbds.CreateHookReleaseReq.attachment:type_name -> pbhr.HookReleaseAttachment - 137, // 54: pbds.CreateHookReleaseReq.spec:type_name -> pbhr.HookReleaseSpec - 138, // 55: pbds.ListHookReleasesResp.details:type_name -> pbhr.HookRelease - 136, // 56: pbds.UpdateHookReleaseReq.attachment:type_name -> pbhr.HookReleaseAttachment - 137, // 57: pbds.UpdateHookReleaseReq.spec:type_name -> pbhr.HookReleaseSpec - 139, // 58: pbds.ListHookReleasesReferencesResp.details:type_name -> pbhr.ListHookReleasesReferencesDetails - 140, // 59: pbds.CreateTemplateSpaceReq.attachment:type_name -> pbts.TemplateSpaceAttachment - 141, // 60: pbds.CreateTemplateSpaceReq.spec:type_name -> pbts.TemplateSpaceSpec - 142, // 61: pbds.ListTemplateSpacesResp.details:type_name -> pbts.TemplateSpace - 140, // 62: pbds.UpdateTemplateSpaceReq.attachment:type_name -> pbts.TemplateSpaceAttachment - 141, // 63: pbds.UpdateTemplateSpaceReq.spec:type_name -> pbts.TemplateSpaceSpec - 140, // 64: pbds.DeleteTemplateSpaceReq.attachment:type_name -> pbts.TemplateSpaceAttachment - 143, // 65: pbds.CreateTemplateReq.attachment:type_name -> pbtemplate.TemplateAttachment - 144, // 66: pbds.CreateTemplateReq.spec:type_name -> pbtemplate.TemplateSpec - 145, // 67: pbds.CreateTemplateReq.tr_spec:type_name -> pbtr.TemplateReleaseSpec - 146, // 68: pbds.ListTemplatesResp.details:type_name -> pbtemplate.Template - 143, // 69: pbds.UpdateTemplateReq.attachment:type_name -> pbtemplate.TemplateAttachment - 144, // 70: pbds.UpdateTemplateReq.spec:type_name -> pbtemplate.TemplateSpec - 143, // 71: pbds.DeleteTemplateReq.attachment:type_name -> pbtemplate.TemplateAttachment - 147, // 72: pbds.CreateTemplateReleaseReq.attachment:type_name -> pbtr.TemplateReleaseAttachment - 145, // 73: pbds.CreateTemplateReleaseReq.spec:type_name -> pbtr.TemplateReleaseSpec - 148, // 74: pbds.ListTemplateReleasesResp.details:type_name -> pbtr.TemplateRelease - 147, // 75: pbds.DeleteTemplateReleaseReq.attachment:type_name -> pbtr.TemplateReleaseAttachment - 149, // 76: pbds.CreateGroupReq.attachment:type_name -> pbgroup.GroupAttachment - 150, // 77: pbds.CreateGroupReq.spec:type_name -> pbgroup.GroupSpec - 122, // 78: pbds.ListGroupsReq.filter:type_name -> google.protobuf.Struct - 123, // 79: pbds.ListGroupsReq.page:type_name -> pbbase.BasePage - 151, // 80: pbds.ListGroupsResp.details:type_name -> pbgroup.Group - 103, // 81: pbds.ListAppGroupsResp.details:type_name -> pbds.ListAppGroupsResp.ListAppGroupsData - 149, // 82: pbds.UpdateGroupReq.attachment:type_name -> pbgroup.GroupAttachment - 150, // 83: pbds.UpdateGroupReq.spec:type_name -> pbgroup.GroupSpec - 149, // 84: pbds.DeleteGroupReq.attachment:type_name -> pbgroup.GroupAttachment - 104, // 85: pbds.CountGroupsReleasedAppsResp.data:type_name -> pbds.CountGroupsReleasedAppsResp.CountGroupsReleasedAppsData - 105, // 86: pbds.ListGroupRleasesdAppsResp.details:type_name -> pbds.ListGroupRleasesdAppsResp.ListGroupReleasedAppsData - 122, // 87: pbds.ListInstancesReq.filter:type_name -> google.protobuf.Struct - 123, // 88: pbds.ListInstancesReq.page:type_name -> pbbase.BasePage - 99, // 89: pbds.ListInstancesResp.details:type_name -> pbds.InstanceResource - 116, // 90: pbds.BatchUpsertConfigItemsReq.ConfigItem.config_item_attachment:type_name -> pbci.ConfigItemAttachment - 117, // 91: pbds.BatchUpsertConfigItemsReq.ConfigItem.config_item_spec:type_name -> pbci.ConfigItemSpec - 118, // 92: pbds.BatchUpsertConfigItemsReq.ConfigItem.content_spec:type_name -> pbcontent.ContentSpec - 122, // 93: pbds.ListAppGroupsResp.ListAppGroupsData.old_selector:type_name -> google.protobuf.Struct - 122, // 94: pbds.ListAppGroupsResp.ListAppGroupsData.new_selector:type_name -> google.protobuf.Struct - 16, // 95: pbds.Data.CreateApp:input_type -> pbds.CreateAppReq - 17, // 96: pbds.Data.UpdateApp:input_type -> pbds.UpdateAppReq - 18, // 97: pbds.Data.DeleteApp:input_type -> pbds.DeleteAppReq - 19, // 98: pbds.Data.GetApp:input_type -> pbds.GetAppReq - 20, // 99: pbds.Data.GetAppByID:input_type -> pbds.GetAppByIDReq - 21, // 100: pbds.Data.GetAppByName:input_type -> pbds.GetAppByNameReq - 22, // 101: pbds.Data.ListAppsRest:input_type -> pbds.ListAppsRestReq - 24, // 102: pbds.Data.ListAppsByIDs:input_type -> pbds.ListAppsByIDsReq - 26, // 103: pbds.Data.CreateConfigItem:input_type -> pbds.CreateConfigItemReq - 27, // 104: pbds.Data.BatchUpsertConfigItems:input_type -> pbds.BatchUpsertConfigItemsReq - 28, // 105: pbds.Data.UpdateConfigItem:input_type -> pbds.UpdateConfigItemReq - 29, // 106: pbds.Data.DeleteConfigItem:input_type -> pbds.DeleteConfigItemReq - 30, // 107: pbds.Data.GetConfigItem:input_type -> pbds.GetConfigItemReq - 31, // 108: pbds.Data.ListConfigItems:input_type -> pbds.ListConfigItemsReq - 33, // 109: pbds.Data.ListConfigItemCount:input_type -> pbds.ListConfigItemCountReq - 35, // 110: pbds.Data.CreateConfigHook:input_type -> pbds.CreateConfigHookReq - 14, // 111: pbds.Data.UpdateConfigHook:input_type -> pbds.UpdateConfigHookReq - 15, // 112: pbds.Data.GetConfigHook:input_type -> pbds.GetConfigHookReq - 36, // 113: pbds.Data.CreateContent:input_type -> pbds.CreateContentReq - 37, // 114: pbds.Data.GetContent:input_type -> pbds.GetContentReq - 38, // 115: pbds.Data.ListContents:input_type -> pbds.ListContentsReq - 40, // 116: pbds.Data.CreateCommit:input_type -> pbds.CreateCommitReq - 41, // 117: pbds.Data.GetLatestCommit:input_type -> pbds.GetLatestCommitReq - 42, // 118: pbds.Data.ListCommits:input_type -> pbds.ListCommitsReq - 44, // 119: pbds.Data.CreateRelease:input_type -> pbds.CreateReleaseReq - 45, // 120: pbds.Data.ListReleases:input_type -> pbds.ListReleasesReq - 47, // 121: pbds.Data.GetReleasedConfigItem:input_type -> pbds.GetReleasedCIReq - 48, // 122: pbds.Data.ListReleasedConfigItems:input_type -> pbds.ListReleasedCIsReq - 50, // 123: pbds.Data.CreateHook:input_type -> pbds.CreateHookReq - 55, // 124: pbds.Data.ListHooks:input_type -> pbds.ListHooksReq - 58, // 125: pbds.Data.DeleteHook:input_type -> pbds.DeleteHookReq - 51, // 126: pbds.Data.ListHookTags:input_type -> pbds.ListHookTagReq - 52, // 127: pbds.Data.GetHook:input_type -> pbds.GetHookReq - 59, // 128: pbds.Data.CreateHookRelease:input_type -> pbds.CreateHookReleaseReq - 60, // 129: pbds.Data.ListHookReleases:input_type -> pbds.ListHookReleasesReq - 62, // 130: pbds.Data.GetHookReleaseByID:input_type -> pbds.GetHookReleaseByIdReq - 63, // 131: pbds.Data.DeleteHookRelease:input_type -> pbds.DeleteHookReleaseReq - 64, // 132: pbds.Data.PublishHookRelease:input_type -> pbds.PublishHookReleaseReq - 65, // 133: pbds.Data.GetHookReleaseByPubState:input_type -> pbds.GetByPubStateReq - 66, // 134: pbds.Data.UpdateHookRelease:input_type -> pbds.UpdateHookReleaseReq - 67, // 135: pbds.Data.ListHookReleasesReferences:input_type -> pbds.ListHookReleasesReferencesReq - 69, // 136: pbds.Data.CreateTemplateSpace:input_type -> pbds.CreateTemplateSpaceReq - 70, // 137: pbds.Data.ListTemplateSpaces:input_type -> pbds.ListTemplateSpacesReq - 72, // 138: pbds.Data.UpdateTemplateSpace:input_type -> pbds.UpdateTemplateSpaceReq - 73, // 139: pbds.Data.DeleteTemplateSpace:input_type -> pbds.DeleteTemplateSpaceReq - 74, // 140: pbds.Data.CreateTemplate:input_type -> pbds.CreateTemplateReq - 75, // 141: pbds.Data.ListTemplates:input_type -> pbds.ListTemplatesReq - 77, // 142: pbds.Data.UpdateTemplate:input_type -> pbds.UpdateTemplateReq - 78, // 143: pbds.Data.DeleteTemplate:input_type -> pbds.DeleteTemplateReq - 79, // 144: pbds.Data.CreateTemplateRelease:input_type -> pbds.CreateTemplateReleaseReq - 80, // 145: pbds.Data.ListTemplateReleases:input_type -> pbds.ListTemplateReleasesReq - 82, // 146: pbds.Data.DeleteTemplateRelease:input_type -> pbds.DeleteTemplateReleaseReq - 83, // 147: pbds.Data.CreateGroup:input_type -> pbds.CreateGroupReq - 84, // 148: pbds.Data.ListGroups:input_type -> pbds.ListGroupsReq - 86, // 149: pbds.Data.ListAppGroups:input_type -> pbds.ListAppGroupsReq - 88, // 150: pbds.Data.UpdateGroup:input_type -> pbds.UpdateGroupReq - 89, // 151: pbds.Data.DeleteGroup:input_type -> pbds.DeleteGroupReq - 90, // 152: pbds.Data.CountGroupsReleasedApps:input_type -> pbds.CountGroupsReleasedAppsReq - 92, // 153: pbds.Data.ListGroupRleasesdApps:input_type -> pbds.ListGroupRleasesdAppsReq - 94, // 154: pbds.Data.Publish:input_type -> pbds.PublishReq - 95, // 155: pbds.Data.GenerateReleaseAndPublish:input_type -> pbds.GenerateReleaseAndPublishReq - 7, // 156: pbds.Data.CreateCredential:input_type -> pbds.CreateCredentialReq - 8, // 157: pbds.Data.ListCredentials:input_type -> pbds.ListCredentialReq - 11, // 158: pbds.Data.DeleteCredential:input_type -> pbds.DeleteCredentialReq - 10, // 159: pbds.Data.UpdateCredential:input_type -> pbds.UpdateCredentialReq - 4, // 160: pbds.Data.ListCredentialScopes:input_type -> pbds.ListCredentialScopesReq - 0, // 161: pbds.Data.UpdateCredentialScopes:input_type -> pbds.UpdateCredentialScopesReq - 97, // 162: pbds.Data.ListInstances:input_type -> pbds.ListInstancesReq - 100, // 163: pbds.Data.Ping:input_type -> pbds.PingMsg - 13, // 164: pbds.Data.CreateApp:output_type -> pbds.CreateResp - 152, // 165: pbds.Data.UpdateApp:output_type -> pbbase.EmptyResp - 152, // 166: pbds.Data.DeleteApp:output_type -> pbbase.EmptyResp - 115, // 167: pbds.Data.GetApp:output_type -> pbapp.App - 115, // 168: pbds.Data.GetAppByID:output_type -> pbapp.App - 115, // 169: pbds.Data.GetAppByName:output_type -> pbapp.App - 23, // 170: pbds.Data.ListAppsRest:output_type -> pbds.ListAppsResp - 25, // 171: pbds.Data.ListAppsByIDs:output_type -> pbds.ListAppsByIDsResp - 13, // 172: pbds.Data.CreateConfigItem:output_type -> pbds.CreateResp - 152, // 173: pbds.Data.BatchUpsertConfigItems:output_type -> pbbase.EmptyResp - 152, // 174: pbds.Data.UpdateConfigItem:output_type -> pbbase.EmptyResp - 152, // 175: pbds.Data.DeleteConfigItem:output_type -> pbbase.EmptyResp - 119, // 176: pbds.Data.GetConfigItem:output_type -> pbci.ConfigItem - 32, // 177: pbds.Data.ListConfigItems:output_type -> pbds.ListConfigItemsResp - 34, // 178: pbds.Data.ListConfigItemCount:output_type -> pbds.ListConfigItemCountResp - 13, // 179: pbds.Data.CreateConfigHook:output_type -> pbds.CreateResp - 152, // 180: pbds.Data.UpdateConfigHook:output_type -> pbbase.EmptyResp - 153, // 181: pbds.Data.GetConfigHook:output_type -> pbch.ConfigHook - 13, // 182: pbds.Data.CreateContent:output_type -> pbds.CreateResp - 124, // 183: pbds.Data.GetContent:output_type -> pbcontent.Content - 39, // 184: pbds.Data.ListContents:output_type -> pbds.ListContentsResp - 13, // 185: pbds.Data.CreateCommit:output_type -> pbds.CreateResp - 126, // 186: pbds.Data.GetLatestCommit:output_type -> pbcommit.Commit - 43, // 187: pbds.Data.ListCommits:output_type -> pbds.ListCommitsResp - 13, // 188: pbds.Data.CreateRelease:output_type -> pbds.CreateResp - 46, // 189: pbds.Data.ListReleases:output_type -> pbds.ListReleasesResp - 130, // 190: pbds.Data.GetReleasedConfigItem:output_type -> pbrci.ReleasedConfigItem - 49, // 191: pbds.Data.ListReleasedConfigItems:output_type -> pbds.ListReleasedCIsResp - 13, // 192: pbds.Data.CreateHook:output_type -> pbds.CreateResp - 56, // 193: pbds.Data.ListHooks:output_type -> pbds.ListHooksResp - 152, // 194: pbds.Data.DeleteHook:output_type -> pbbase.EmptyResp - 57, // 195: pbds.Data.ListHookTags:output_type -> pbds.ListHookTagResp - 53, // 196: pbds.Data.GetHook:output_type -> pbds.GetHookResp - 13, // 197: pbds.Data.CreateHookRelease:output_type -> pbds.CreateResp - 61, // 198: pbds.Data.ListHookReleases:output_type -> pbds.ListHookReleasesResp - 138, // 199: pbds.Data.GetHookReleaseByID:output_type -> pbhr.HookRelease - 152, // 200: pbds.Data.DeleteHookRelease:output_type -> pbbase.EmptyResp - 152, // 201: pbds.Data.PublishHookRelease:output_type -> pbbase.EmptyResp - 138, // 202: pbds.Data.GetHookReleaseByPubState:output_type -> pbhr.HookRelease - 152, // 203: pbds.Data.UpdateHookRelease:output_type -> pbbase.EmptyResp - 68, // 204: pbds.Data.ListHookReleasesReferences:output_type -> pbds.ListHookReleasesReferencesResp - 13, // 205: pbds.Data.CreateTemplateSpace:output_type -> pbds.CreateResp - 71, // 206: pbds.Data.ListTemplateSpaces:output_type -> pbds.ListTemplateSpacesResp - 152, // 207: pbds.Data.UpdateTemplateSpace:output_type -> pbbase.EmptyResp - 152, // 208: pbds.Data.DeleteTemplateSpace:output_type -> pbbase.EmptyResp - 13, // 209: pbds.Data.CreateTemplate:output_type -> pbds.CreateResp - 76, // 210: pbds.Data.ListTemplates:output_type -> pbds.ListTemplatesResp - 152, // 211: pbds.Data.UpdateTemplate:output_type -> pbbase.EmptyResp - 152, // 212: pbds.Data.DeleteTemplate:output_type -> pbbase.EmptyResp - 13, // 213: pbds.Data.CreateTemplateRelease:output_type -> pbds.CreateResp - 81, // 214: pbds.Data.ListTemplateReleases:output_type -> pbds.ListTemplateReleasesResp - 152, // 215: pbds.Data.DeleteTemplateRelease:output_type -> pbbase.EmptyResp - 13, // 216: pbds.Data.CreateGroup:output_type -> pbds.CreateResp - 85, // 217: pbds.Data.ListGroups:output_type -> pbds.ListGroupsResp - 87, // 218: pbds.Data.ListAppGroups:output_type -> pbds.ListAppGroupsResp - 152, // 219: pbds.Data.UpdateGroup:output_type -> pbbase.EmptyResp - 152, // 220: pbds.Data.DeleteGroup:output_type -> pbbase.EmptyResp - 91, // 221: pbds.Data.CountGroupsReleasedApps:output_type -> pbds.CountGroupsReleasedAppsResp - 93, // 222: pbds.Data.ListGroupRleasesdApps:output_type -> pbds.ListGroupRleasesdAppsResp - 96, // 223: pbds.Data.Publish:output_type -> pbds.PublishResp - 96, // 224: pbds.Data.GenerateReleaseAndPublish:output_type -> pbds.PublishResp - 13, // 225: pbds.Data.CreateCredential:output_type -> pbds.CreateResp - 9, // 226: pbds.Data.ListCredentials:output_type -> pbds.ListCredentialResp - 152, // 227: pbds.Data.DeleteCredential:output_type -> pbbase.EmptyResp - 152, // 228: pbds.Data.UpdateCredential:output_type -> pbbase.EmptyResp - 5, // 229: pbds.Data.ListCredentialScopes:output_type -> pbds.ListCredentialScopesResp - 1, // 230: pbds.Data.UpdateCredentialScopes:output_type -> pbds.UpdateCredentialScopesResp - 98, // 231: pbds.Data.ListInstances:output_type -> pbds.ListInstancesResp - 100, // 232: pbds.Data.Ping:output_type -> pbds.PingMsg - 164, // [164:233] is the sub-list for method output_type - 95, // [95:164] is the sub-list for method input_type - 95, // [95:95] is the sub-list for extension type_name - 95, // [95:95] is the sub-list for extension extendee - 0, // [0:95] is the sub-list for field type_name -} - -func init() { file_data_service_proto_init() } -func file_data_service_proto_init() { - if File_data_service_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_data_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateCredentialScopesReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateCredentialScopesResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteCredentialScopesReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteCredentialScopesResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCredentialScopesReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCredentialScopesResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateCredentialScopeReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateCredentialReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCredentialReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCredentialResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateCredentialReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteCredentialReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EnableCredentialReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateConfigHookReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetConfigHookReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAppReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateAppReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteAppReq); i { + (*CreateAppReq)(nil), // 14: pbds.CreateAppReq + (*UpdateAppReq)(nil), // 15: pbds.UpdateAppReq + (*DeleteAppReq)(nil), // 16: pbds.DeleteAppReq + (*GetAppReq)(nil), // 17: pbds.GetAppReq + (*GetAppByIDReq)(nil), // 18: pbds.GetAppByIDReq + (*GetAppByNameReq)(nil), // 19: pbds.GetAppByNameReq + (*ListAppsReq)(nil), // 20: pbds.ListAppsReq + (*ListAppsRestReq)(nil), // 21: pbds.ListAppsRestReq + (*ListAppsResp)(nil), // 22: pbds.ListAppsResp + (*CreateConfigItemReq)(nil), // 23: pbds.CreateConfigItemReq + (*BatchUpsertConfigItemsReq)(nil), // 24: pbds.BatchUpsertConfigItemsReq + (*UpdateConfigItemReq)(nil), // 25: pbds.UpdateConfigItemReq + (*DeleteConfigItemReq)(nil), // 26: pbds.DeleteConfigItemReq + (*GetConfigItemReq)(nil), // 27: pbds.GetConfigItemReq + (*ListConfigItemsReq)(nil), // 28: pbds.ListConfigItemsReq + (*ListConfigItemsResp)(nil), // 29: pbds.ListConfigItemsResp + (*ListConfigItemCountReq)(nil), // 30: pbds.ListConfigItemCountReq + (*ListConfigItemCountResp)(nil), // 31: pbds.ListConfigItemCountResp + (*CreateContentReq)(nil), // 32: pbds.CreateContentReq + (*GetContentReq)(nil), // 33: pbds.GetContentReq + (*ListContentsReq)(nil), // 34: pbds.ListContentsReq + (*ListContentsResp)(nil), // 35: pbds.ListContentsResp + (*CreateCommitReq)(nil), // 36: pbds.CreateCommitReq + (*GetLatestCommitReq)(nil), // 37: pbds.GetLatestCommitReq + (*ListCommitsReq)(nil), // 38: pbds.ListCommitsReq + (*ListCommitsResp)(nil), // 39: pbds.ListCommitsResp + (*CreateReleaseReq)(nil), // 40: pbds.CreateReleaseReq + (*ListReleasesReq)(nil), // 41: pbds.ListReleasesReq + (*ListReleasesResp)(nil), // 42: pbds.ListReleasesResp + (*GetReleasedCIReq)(nil), // 43: pbds.GetReleasedCIReq + (*ListReleasedCIsReq)(nil), // 44: pbds.ListReleasedCIsReq + (*ListReleasedCIsResp)(nil), // 45: pbds.ListReleasedCIsResp + (*CreateHookReq)(nil), // 46: pbds.CreateHookReq + (*ListHooksReq)(nil), // 47: pbds.ListHooksReq + (*ListHooksResp)(nil), // 48: pbds.ListHooksResp + (*UpdateHookReq)(nil), // 49: pbds.UpdateHookReq + (*DeleteHookReq)(nil), // 50: pbds.DeleteHookReq + (*CreateTemplateSpaceReq)(nil), // 51: pbds.CreateTemplateSpaceReq + (*ListTemplateSpacesReq)(nil), // 52: pbds.ListTemplateSpacesReq + (*ListTemplateSpacesResp)(nil), // 53: pbds.ListTemplateSpacesResp + (*UpdateTemplateSpaceReq)(nil), // 54: pbds.UpdateTemplateSpaceReq + (*DeleteTemplateSpaceReq)(nil), // 55: pbds.DeleteTemplateSpaceReq + (*CreateTemplateReq)(nil), // 56: pbds.CreateTemplateReq + (*ListTemplatesReq)(nil), // 57: pbds.ListTemplatesReq + (*ListTemplatesResp)(nil), // 58: pbds.ListTemplatesResp + (*UpdateTemplateReq)(nil), // 59: pbds.UpdateTemplateReq + (*DeleteTemplateReq)(nil), // 60: pbds.DeleteTemplateReq + (*CreateTemplateReleaseReq)(nil), // 61: pbds.CreateTemplateReleaseReq + (*ListTemplateReleasesReq)(nil), // 62: pbds.ListTemplateReleasesReq + (*ListTemplateReleasesResp)(nil), // 63: pbds.ListTemplateReleasesResp + (*DeleteTemplateReleaseReq)(nil), // 64: pbds.DeleteTemplateReleaseReq + (*CreateGroupReq)(nil), // 65: pbds.CreateGroupReq + (*ListGroupsReq)(nil), // 66: pbds.ListGroupsReq + (*ListGroupsResp)(nil), // 67: pbds.ListGroupsResp + (*ListAppGroupsReq)(nil), // 68: pbds.ListAppGroupsReq + (*ListAppGroupsResp)(nil), // 69: pbds.ListAppGroupsResp + (*UpdateGroupReq)(nil), // 70: pbds.UpdateGroupReq + (*DeleteGroupReq)(nil), // 71: pbds.DeleteGroupReq + (*CountGroupsReleasedAppsReq)(nil), // 72: pbds.CountGroupsReleasedAppsReq + (*CountGroupsReleasedAppsResp)(nil), // 73: pbds.CountGroupsReleasedAppsResp + (*ListGroupRleasesdAppsReq)(nil), // 74: pbds.ListGroupRleasesdAppsReq + (*ListGroupRleasesdAppsResp)(nil), // 75: pbds.ListGroupRleasesdAppsResp + (*PublishReq)(nil), // 76: pbds.PublishReq + (*GenerateReleaseAndPublishReq)(nil), // 77: pbds.GenerateReleaseAndPublishReq + (*PublishResp)(nil), // 78: pbds.PublishResp + (*ListInstancesReq)(nil), // 79: pbds.ListInstancesReq + (*ListInstancesResp)(nil), // 80: pbds.ListInstancesResp + (*InstanceResource)(nil), // 81: pbds.InstanceResource + (*PingMsg)(nil), // 82: pbds.PingMsg + (*BatchUpsertConfigItemsReq_ConfigItem)(nil), // 83: pbds.BatchUpsertConfigItemsReq.ConfigItem + (*ListAppGroupsResp_ListAppGroupsData)(nil), // 84: pbds.ListAppGroupsResp.ListAppGroupsData + (*CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData)(nil), // 85: pbds.CountGroupsReleasedAppsResp.CountGroupsReleasedAppsData + (*ListGroupRleasesdAppsResp_ListGroupReleasedAppsData)(nil), // 86: pbds.ListGroupRleasesdAppsResp.ListGroupReleasedAppsData + (*credential_scope.UpdateScopeSpec)(nil), // 87: pbcrs.UpdateScopeSpec + (*credential_scope.CredentialScopeAttachment)(nil), // 88: pbcrs.CredentialScopeAttachment + (*credential_scope.CredentialScopeList)(nil), // 89: pbcrs.CredentialScopeList + (*credential.CredentialAttachment)(nil), // 90: pbcredential.CredentialAttachment + (*credential.CredentialSpec)(nil), // 91: pbcredential.CredentialSpec + (*base.BasePage)(nil), // 92: pbbase.BasePage + (*structpb.Struct)(nil), // 93: google.protobuf.Struct + (*credential.CredentialList)(nil), // 94: pbcredential.CredentialList + (*app.AppSpec)(nil), // 95: pbapp.AppSpec + (*app.App)(nil), // 96: pbapp.App + (*config_item.ConfigItemAttachment)(nil), // 97: pbci.ConfigItemAttachment + (*config_item.ConfigItemSpec)(nil), // 98: pbci.ConfigItemSpec + (*content.ContentSpec)(nil), // 99: pbcontent.ContentSpec + (*config_item.ConfigItem)(nil), // 100: pbci.ConfigItem + (*config_item.ListConfigItemCounts)(nil), // 101: pbci.ListConfigItemCounts + (*content.ContentAttachment)(nil), // 102: pbcontent.ContentAttachment + (*content.Content)(nil), // 103: pbcontent.Content + (*commit.CommitAttachment)(nil), // 104: pbcommit.CommitAttachment + (*commit.Commit)(nil), // 105: pbcommit.Commit + (*release.ReleaseAttachment)(nil), // 106: pbrelease.ReleaseAttachment + (*release.ReleaseSpec)(nil), // 107: pbrelease.ReleaseSpec + (*release.Release)(nil), // 108: pbrelease.Release + (*released_ci.ReleasedConfigItem)(nil), // 109: pbrci.ReleasedConfigItem + (*hook.HookAttachment)(nil), // 110: pbhook.HookAttachment + (*hook.HookSpec)(nil), // 111: pbhook.HookSpec + (*hook.Hook)(nil), // 112: pbhook.Hook + (*template_space.TemplateSpaceAttachment)(nil), // 113: pbts.TemplateSpaceAttachment + (*template_space.TemplateSpaceSpec)(nil), // 114: pbts.TemplateSpaceSpec + (*template_space.TemplateSpace)(nil), // 115: pbts.TemplateSpace + (*template.TemplateAttachment)(nil), // 116: pbtemplate.TemplateAttachment + (*template.TemplateSpec)(nil), // 117: pbtemplate.TemplateSpec + (*template_release.TemplateReleaseSpec)(nil), // 118: pbtr.TemplateReleaseSpec + (*template.Template)(nil), // 119: pbtemplate.Template + (*template_release.TemplateReleaseAttachment)(nil), // 120: pbtr.TemplateReleaseAttachment + (*template_release.TemplateRelease)(nil), // 121: pbtr.TemplateRelease + (*group.GroupAttachment)(nil), // 122: pbgroup.GroupAttachment + (*group.GroupSpec)(nil), // 123: pbgroup.GroupSpec + (*group.Group)(nil), // 124: pbgroup.Group + (*base.EmptyResp)(nil), // 125: pbbase.EmptyResp +} +var file_data_service_proto_depIdxs = []int32{ + 87, // 0: pbds.UpdateCredentialScopesReq.updated:type_name -> pbcrs.UpdateScopeSpec + 88, // 1: pbds.DeleteCredentialScopesReq.attachment:type_name -> pbcrs.CredentialScopeAttachment + 89, // 2: pbds.ListCredentialScopesResp.details:type_name -> pbcrs.CredentialScopeList + 88, // 3: pbds.CreateCredentialScopeReq.attachment:type_name -> pbcrs.CredentialScopeAttachment + 90, // 4: pbds.CreateCredentialReq.attachment:type_name -> pbcredential.CredentialAttachment + 91, // 5: pbds.CreateCredentialReq.spec:type_name -> pbcredential.CredentialSpec + 92, // 6: pbds.ListCredentialReq.page:type_name -> pbbase.BasePage + 93, // 7: pbds.ListCredentialReq.filter:type_name -> google.protobuf.Struct + 94, // 8: pbds.ListCredentialResp.details:type_name -> pbcredential.CredentialList + 90, // 9: pbds.UpdateCredentialReq.attachment:type_name -> pbcredential.CredentialAttachment + 91, // 10: pbds.UpdateCredentialReq.spec:type_name -> pbcredential.CredentialSpec + 90, // 11: pbds.DeleteCredentialReq.attachment:type_name -> pbcredential.CredentialAttachment + 95, // 12: pbds.CreateAppReq.spec:type_name -> pbapp.AppSpec + 95, // 13: pbds.UpdateAppReq.spec:type_name -> pbapp.AppSpec + 93, // 14: pbds.ListAppsReq.filter:type_name -> google.protobuf.Struct + 92, // 15: pbds.ListAppsReq.page:type_name -> pbbase.BasePage + 96, // 16: pbds.ListAppsResp.details:type_name -> pbapp.App + 97, // 17: pbds.CreateConfigItemReq.config_item_attachment:type_name -> pbci.ConfigItemAttachment + 98, // 18: pbds.CreateConfigItemReq.config_item_spec:type_name -> pbci.ConfigItemSpec + 99, // 19: pbds.CreateConfigItemReq.content_spec:type_name -> pbcontent.ContentSpec + 83, // 20: pbds.BatchUpsertConfigItemsReq.items:type_name -> pbds.BatchUpsertConfigItemsReq.ConfigItem + 97, // 21: pbds.UpdateConfigItemReq.attachment:type_name -> pbci.ConfigItemAttachment + 98, // 22: pbds.UpdateConfigItemReq.spec:type_name -> pbci.ConfigItemSpec + 97, // 23: pbds.DeleteConfigItemReq.attachment:type_name -> pbci.ConfigItemAttachment + 100, // 24: pbds.ListConfigItemsResp.details:type_name -> pbci.ConfigItem + 101, // 25: pbds.ListConfigItemCountResp.details:type_name -> pbci.ListConfigItemCounts + 102, // 26: pbds.CreateContentReq.attachment:type_name -> pbcontent.ContentAttachment + 99, // 27: pbds.CreateContentReq.spec:type_name -> pbcontent.ContentSpec + 93, // 28: pbds.ListContentsReq.filter:type_name -> google.protobuf.Struct + 92, // 29: pbds.ListContentsReq.page:type_name -> pbbase.BasePage + 103, // 30: pbds.ListContentsResp.details:type_name -> pbcontent.Content + 104, // 31: pbds.CreateCommitReq.attachment:type_name -> pbcommit.CommitAttachment + 93, // 32: pbds.ListCommitsReq.filter:type_name -> google.protobuf.Struct + 92, // 33: pbds.ListCommitsReq.page:type_name -> pbbase.BasePage + 105, // 34: pbds.ListCommitsResp.details:type_name -> pbcommit.Commit + 106, // 35: pbds.CreateReleaseReq.attachment:type_name -> pbrelease.ReleaseAttachment + 107, // 36: pbds.CreateReleaseReq.spec:type_name -> pbrelease.ReleaseSpec + 93, // 37: pbds.ListReleasesReq.filter:type_name -> google.protobuf.Struct + 92, // 38: pbds.ListReleasesReq.page:type_name -> pbbase.BasePage + 108, // 39: pbds.ListReleasesResp.details:type_name -> pbrelease.Release + 93, // 40: pbds.ListReleasedCIsReq.filter:type_name -> google.protobuf.Struct + 92, // 41: pbds.ListReleasedCIsReq.page:type_name -> pbbase.BasePage + 109, // 42: pbds.ListReleasedCIsResp.details:type_name -> pbrci.ReleasedConfigItem + 110, // 43: pbds.CreateHookReq.attachment:type_name -> pbhook.HookAttachment + 111, // 44: pbds.CreateHookReq.spec:type_name -> pbhook.HookSpec + 93, // 45: pbds.ListHooksReq.filter:type_name -> google.protobuf.Struct + 92, // 46: pbds.ListHooksReq.page:type_name -> pbbase.BasePage + 112, // 47: pbds.ListHooksResp.details:type_name -> pbhook.Hook + 110, // 48: pbds.UpdateHookReq.attachment:type_name -> pbhook.HookAttachment + 111, // 49: pbds.UpdateHookReq.spec:type_name -> pbhook.HookSpec + 110, // 50: pbds.DeleteHookReq.attachment:type_name -> pbhook.HookAttachment + 113, // 51: pbds.CreateTemplateSpaceReq.attachment:type_name -> pbts.TemplateSpaceAttachment + 114, // 52: pbds.CreateTemplateSpaceReq.spec:type_name -> pbts.TemplateSpaceSpec + 115, // 53: pbds.ListTemplateSpacesResp.details:type_name -> pbts.TemplateSpace + 113, // 54: pbds.UpdateTemplateSpaceReq.attachment:type_name -> pbts.TemplateSpaceAttachment + 114, // 55: pbds.UpdateTemplateSpaceReq.spec:type_name -> pbts.TemplateSpaceSpec + 113, // 56: pbds.DeleteTemplateSpaceReq.attachment:type_name -> pbts.TemplateSpaceAttachment + 116, // 57: pbds.CreateTemplateReq.attachment:type_name -> pbtemplate.TemplateAttachment + 117, // 58: pbds.CreateTemplateReq.spec:type_name -> pbtemplate.TemplateSpec + 118, // 59: pbds.CreateTemplateReq.tr_spec:type_name -> pbtr.TemplateReleaseSpec + 119, // 60: pbds.ListTemplatesResp.details:type_name -> pbtemplate.Template + 116, // 61: pbds.UpdateTemplateReq.attachment:type_name -> pbtemplate.TemplateAttachment + 117, // 62: pbds.UpdateTemplateReq.spec:type_name -> pbtemplate.TemplateSpec + 116, // 63: pbds.DeleteTemplateReq.attachment:type_name -> pbtemplate.TemplateAttachment + 120, // 64: pbds.CreateTemplateReleaseReq.attachment:type_name -> pbtr.TemplateReleaseAttachment + 118, // 65: pbds.CreateTemplateReleaseReq.spec:type_name -> pbtr.TemplateReleaseSpec + 121, // 66: pbds.ListTemplateReleasesResp.details:type_name -> pbtr.TemplateRelease + 120, // 67: pbds.DeleteTemplateReleaseReq.attachment:type_name -> pbtr.TemplateReleaseAttachment + 122, // 68: pbds.CreateGroupReq.attachment:type_name -> pbgroup.GroupAttachment + 123, // 69: pbds.CreateGroupReq.spec:type_name -> pbgroup.GroupSpec + 93, // 70: pbds.ListGroupsReq.filter:type_name -> google.protobuf.Struct + 92, // 71: pbds.ListGroupsReq.page:type_name -> pbbase.BasePage + 124, // 72: pbds.ListGroupsResp.details:type_name -> pbgroup.Group + 84, // 73: pbds.ListAppGroupsResp.details:type_name -> pbds.ListAppGroupsResp.ListAppGroupsData + 122, // 74: pbds.UpdateGroupReq.attachment:type_name -> pbgroup.GroupAttachment + 123, // 75: pbds.UpdateGroupReq.spec:type_name -> pbgroup.GroupSpec + 122, // 76: pbds.DeleteGroupReq.attachment:type_name -> pbgroup.GroupAttachment + 85, // 77: pbds.CountGroupsReleasedAppsResp.data:type_name -> pbds.CountGroupsReleasedAppsResp.CountGroupsReleasedAppsData + 86, // 78: pbds.ListGroupRleasesdAppsResp.details:type_name -> pbds.ListGroupRleasesdAppsResp.ListGroupReleasedAppsData + 93, // 79: pbds.ListInstancesReq.filter:type_name -> google.protobuf.Struct + 92, // 80: pbds.ListInstancesReq.page:type_name -> pbbase.BasePage + 81, // 81: pbds.ListInstancesResp.details:type_name -> pbds.InstanceResource + 97, // 82: pbds.BatchUpsertConfigItemsReq.ConfigItem.config_item_attachment:type_name -> pbci.ConfigItemAttachment + 98, // 83: pbds.BatchUpsertConfigItemsReq.ConfigItem.config_item_spec:type_name -> pbci.ConfigItemSpec + 99, // 84: pbds.BatchUpsertConfigItemsReq.ConfigItem.content_spec:type_name -> pbcontent.ContentSpec + 93, // 85: pbds.ListAppGroupsResp.ListAppGroupsData.old_selector:type_name -> google.protobuf.Struct + 93, // 86: pbds.ListAppGroupsResp.ListAppGroupsData.new_selector:type_name -> google.protobuf.Struct + 14, // 87: pbds.Data.CreateApp:input_type -> pbds.CreateAppReq + 15, // 88: pbds.Data.UpdateApp:input_type -> pbds.UpdateAppReq + 16, // 89: pbds.Data.DeleteApp:input_type -> pbds.DeleteAppReq + 17, // 90: pbds.Data.GetApp:input_type -> pbds.GetAppReq + 18, // 91: pbds.Data.GetAppByID:input_type -> pbds.GetAppByIDReq + 19, // 92: pbds.Data.GetAppByName:input_type -> pbds.GetAppByNameReq + 20, // 93: pbds.Data.ListApps:input_type -> pbds.ListAppsReq + 21, // 94: pbds.Data.ListAppsRest:input_type -> pbds.ListAppsRestReq + 23, // 95: pbds.Data.CreateConfigItem:input_type -> pbds.CreateConfigItemReq + 24, // 96: pbds.Data.BatchUpsertConfigItems:input_type -> pbds.BatchUpsertConfigItemsReq + 25, // 97: pbds.Data.UpdateConfigItem:input_type -> pbds.UpdateConfigItemReq + 26, // 98: pbds.Data.DeleteConfigItem:input_type -> pbds.DeleteConfigItemReq + 27, // 99: pbds.Data.GetConfigItem:input_type -> pbds.GetConfigItemReq + 28, // 100: pbds.Data.ListConfigItems:input_type -> pbds.ListConfigItemsReq + 30, // 101: pbds.Data.ListConfigItemCount:input_type -> pbds.ListConfigItemCountReq + 32, // 102: pbds.Data.CreateContent:input_type -> pbds.CreateContentReq + 33, // 103: pbds.Data.GetContent:input_type -> pbds.GetContentReq + 34, // 104: pbds.Data.ListContents:input_type -> pbds.ListContentsReq + 36, // 105: pbds.Data.CreateCommit:input_type -> pbds.CreateCommitReq + 37, // 106: pbds.Data.GetLatestCommit:input_type -> pbds.GetLatestCommitReq + 38, // 107: pbds.Data.ListCommits:input_type -> pbds.ListCommitsReq + 40, // 108: pbds.Data.CreateRelease:input_type -> pbds.CreateReleaseReq + 41, // 109: pbds.Data.ListReleases:input_type -> pbds.ListReleasesReq + 43, // 110: pbds.Data.GetReleasedConfigItem:input_type -> pbds.GetReleasedCIReq + 44, // 111: pbds.Data.ListReleasedConfigItems:input_type -> pbds.ListReleasedCIsReq + 46, // 112: pbds.Data.CreateHook:input_type -> pbds.CreateHookReq + 47, // 113: pbds.Data.ListHooks:input_type -> pbds.ListHooksReq + 49, // 114: pbds.Data.UpdateHook:input_type -> pbds.UpdateHookReq + 50, // 115: pbds.Data.DeleteHook:input_type -> pbds.DeleteHookReq + 51, // 116: pbds.Data.CreateTemplateSpace:input_type -> pbds.CreateTemplateSpaceReq + 52, // 117: pbds.Data.ListTemplateSpaces:input_type -> pbds.ListTemplateSpacesReq + 54, // 118: pbds.Data.UpdateTemplateSpace:input_type -> pbds.UpdateTemplateSpaceReq + 55, // 119: pbds.Data.DeleteTemplateSpace:input_type -> pbds.DeleteTemplateSpaceReq + 56, // 120: pbds.Data.CreateTemplate:input_type -> pbds.CreateTemplateReq + 57, // 121: pbds.Data.ListTemplates:input_type -> pbds.ListTemplatesReq + 59, // 122: pbds.Data.UpdateTemplate:input_type -> pbds.UpdateTemplateReq + 60, // 123: pbds.Data.DeleteTemplate:input_type -> pbds.DeleteTemplateReq + 61, // 124: pbds.Data.CreateTemplateRelease:input_type -> pbds.CreateTemplateReleaseReq + 62, // 125: pbds.Data.ListTemplateReleases:input_type -> pbds.ListTemplateReleasesReq + 64, // 126: pbds.Data.DeleteTemplateRelease:input_type -> pbds.DeleteTemplateReleaseReq + 65, // 127: pbds.Data.CreateGroup:input_type -> pbds.CreateGroupReq + 66, // 128: pbds.Data.ListGroups:input_type -> pbds.ListGroupsReq + 68, // 129: pbds.Data.ListAppGroups:input_type -> pbds.ListAppGroupsReq + 70, // 130: pbds.Data.UpdateGroup:input_type -> pbds.UpdateGroupReq + 71, // 131: pbds.Data.DeleteGroup:input_type -> pbds.DeleteGroupReq + 72, // 132: pbds.Data.CountGroupsReleasedApps:input_type -> pbds.CountGroupsReleasedAppsReq + 74, // 133: pbds.Data.ListGroupRleasesdApps:input_type -> pbds.ListGroupRleasesdAppsReq + 76, // 134: pbds.Data.Publish:input_type -> pbds.PublishReq + 77, // 135: pbds.Data.GenerateReleaseAndPublish:input_type -> pbds.GenerateReleaseAndPublishReq + 7, // 136: pbds.Data.CreateCredential:input_type -> pbds.CreateCredentialReq + 8, // 137: pbds.Data.ListCredentials:input_type -> pbds.ListCredentialReq + 11, // 138: pbds.Data.DeleteCredential:input_type -> pbds.DeleteCredentialReq + 10, // 139: pbds.Data.UpdateCredential:input_type -> pbds.UpdateCredentialReq + 4, // 140: pbds.Data.ListCredentialScopes:input_type -> pbds.ListCredentialScopesReq + 0, // 141: pbds.Data.UpdateCredentialScopes:input_type -> pbds.UpdateCredentialScopesReq + 79, // 142: pbds.Data.ListInstances:input_type -> pbds.ListInstancesReq + 82, // 143: pbds.Data.Ping:input_type -> pbds.PingMsg + 13, // 144: pbds.Data.CreateApp:output_type -> pbds.CreateResp + 125, // 145: pbds.Data.UpdateApp:output_type -> pbbase.EmptyResp + 125, // 146: pbds.Data.DeleteApp:output_type -> pbbase.EmptyResp + 96, // 147: pbds.Data.GetApp:output_type -> pbapp.App + 96, // 148: pbds.Data.GetAppByID:output_type -> pbapp.App + 96, // 149: pbds.Data.GetAppByName:output_type -> pbapp.App + 22, // 150: pbds.Data.ListApps:output_type -> pbds.ListAppsResp + 22, // 151: pbds.Data.ListAppsRest:output_type -> pbds.ListAppsResp + 13, // 152: pbds.Data.CreateConfigItem:output_type -> pbds.CreateResp + 125, // 153: pbds.Data.BatchUpsertConfigItems:output_type -> pbbase.EmptyResp + 125, // 154: pbds.Data.UpdateConfigItem:output_type -> pbbase.EmptyResp + 125, // 155: pbds.Data.DeleteConfigItem:output_type -> pbbase.EmptyResp + 100, // 156: pbds.Data.GetConfigItem:output_type -> pbci.ConfigItem + 29, // 157: pbds.Data.ListConfigItems:output_type -> pbds.ListConfigItemsResp + 31, // 158: pbds.Data.ListConfigItemCount:output_type -> pbds.ListConfigItemCountResp + 13, // 159: pbds.Data.CreateContent:output_type -> pbds.CreateResp + 103, // 160: pbds.Data.GetContent:output_type -> pbcontent.Content + 35, // 161: pbds.Data.ListContents:output_type -> pbds.ListContentsResp + 13, // 162: pbds.Data.CreateCommit:output_type -> pbds.CreateResp + 105, // 163: pbds.Data.GetLatestCommit:output_type -> pbcommit.Commit + 39, // 164: pbds.Data.ListCommits:output_type -> pbds.ListCommitsResp + 13, // 165: pbds.Data.CreateRelease:output_type -> pbds.CreateResp + 42, // 166: pbds.Data.ListReleases:output_type -> pbds.ListReleasesResp + 109, // 167: pbds.Data.GetReleasedConfigItem:output_type -> pbrci.ReleasedConfigItem + 45, // 168: pbds.Data.ListReleasedConfigItems:output_type -> pbds.ListReleasedCIsResp + 13, // 169: pbds.Data.CreateHook:output_type -> pbds.CreateResp + 48, // 170: pbds.Data.ListHooks:output_type -> pbds.ListHooksResp + 125, // 171: pbds.Data.UpdateHook:output_type -> pbbase.EmptyResp + 125, // 172: pbds.Data.DeleteHook:output_type -> pbbase.EmptyResp + 13, // 173: pbds.Data.CreateTemplateSpace:output_type -> pbds.CreateResp + 53, // 174: pbds.Data.ListTemplateSpaces:output_type -> pbds.ListTemplateSpacesResp + 125, // 175: pbds.Data.UpdateTemplateSpace:output_type -> pbbase.EmptyResp + 125, // 176: pbds.Data.DeleteTemplateSpace:output_type -> pbbase.EmptyResp + 13, // 177: pbds.Data.CreateTemplate:output_type -> pbds.CreateResp + 58, // 178: pbds.Data.ListTemplates:output_type -> pbds.ListTemplatesResp + 125, // 179: pbds.Data.UpdateTemplate:output_type -> pbbase.EmptyResp + 125, // 180: pbds.Data.DeleteTemplate:output_type -> pbbase.EmptyResp + 13, // 181: pbds.Data.CreateTemplateRelease:output_type -> pbds.CreateResp + 63, // 182: pbds.Data.ListTemplateReleases:output_type -> pbds.ListTemplateReleasesResp + 125, // 183: pbds.Data.DeleteTemplateRelease:output_type -> pbbase.EmptyResp + 13, // 184: pbds.Data.CreateGroup:output_type -> pbds.CreateResp + 67, // 185: pbds.Data.ListGroups:output_type -> pbds.ListGroupsResp + 69, // 186: pbds.Data.ListAppGroups:output_type -> pbds.ListAppGroupsResp + 125, // 187: pbds.Data.UpdateGroup:output_type -> pbbase.EmptyResp + 125, // 188: pbds.Data.DeleteGroup:output_type -> pbbase.EmptyResp + 73, // 189: pbds.Data.CountGroupsReleasedApps:output_type -> pbds.CountGroupsReleasedAppsResp + 75, // 190: pbds.Data.ListGroupRleasesdApps:output_type -> pbds.ListGroupRleasesdAppsResp + 78, // 191: pbds.Data.Publish:output_type -> pbds.PublishResp + 78, // 192: pbds.Data.GenerateReleaseAndPublish:output_type -> pbds.PublishResp + 13, // 193: pbds.Data.CreateCredential:output_type -> pbds.CreateResp + 9, // 194: pbds.Data.ListCredentials:output_type -> pbds.ListCredentialResp + 125, // 195: pbds.Data.DeleteCredential:output_type -> pbbase.EmptyResp + 125, // 196: pbds.Data.UpdateCredential:output_type -> pbbase.EmptyResp + 5, // 197: pbds.Data.ListCredentialScopes:output_type -> pbds.ListCredentialScopesResp + 1, // 198: pbds.Data.UpdateCredentialScopes:output_type -> pbds.UpdateCredentialScopesResp + 80, // 199: pbds.Data.ListInstances:output_type -> pbds.ListInstancesResp + 82, // 200: pbds.Data.Ping:output_type -> pbds.PingMsg + 144, // [144:201] is the sub-list for method output_type + 87, // [87:144] is the sub-list for method input_type + 87, // [87:87] is the sub-list for extension type_name + 87, // [87:87] is the sub-list for extension extendee + 0, // [0:87] is the sub-list for field type_name +} + +func init() { file_data_service_proto_init() } +func file_data_service_proto_init() { + if File_data_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_data_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateCredentialScopesReq); i { case 0: return &v.state case 1: @@ -8227,8 +6584,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAppReq); i { + file_data_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateCredentialScopesResp); i { case 0: return &v.state case 1: @@ -8239,8 +6596,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAppByIDReq); i { + file_data_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteCredentialScopesReq); i { case 0: return &v.state case 1: @@ -8251,8 +6608,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAppByNameReq); i { + file_data_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteCredentialScopesResp); i { case 0: return &v.state case 1: @@ -8263,8 +6620,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAppsRestReq); i { + file_data_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCredentialScopesReq); i { case 0: return &v.state case 1: @@ -8275,8 +6632,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAppsResp); i { + file_data_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCredentialScopesResp); i { case 0: return &v.state case 1: @@ -8287,8 +6644,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAppsByIDsReq); i { + file_data_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCredentialScopeReq); i { case 0: return &v.state case 1: @@ -8299,8 +6656,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAppsByIDsResp); i { + file_data_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCredentialReq); i { case 0: return &v.state case 1: @@ -8311,8 +6668,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateConfigItemReq); i { + file_data_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCredentialReq); i { case 0: return &v.state case 1: @@ -8323,8 +6680,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BatchUpsertConfigItemsReq); i { + file_data_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCredentialResp); i { case 0: return &v.state case 1: @@ -8335,8 +6692,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateConfigItemReq); i { + file_data_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateCredentialReq); i { case 0: return &v.state case 1: @@ -8347,8 +6704,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteConfigItemReq); i { + file_data_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteCredentialReq); i { case 0: return &v.state case 1: @@ -8359,8 +6716,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetConfigItemReq); i { + file_data_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EnableCredentialReq); i { case 0: return &v.state case 1: @@ -8371,8 +6728,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListConfigItemsReq); i { + file_data_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateResp); i { case 0: return &v.state case 1: @@ -8383,8 +6740,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListConfigItemsResp); i { + file_data_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateAppReq); i { case 0: return &v.state case 1: @@ -8395,8 +6752,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListConfigItemCountReq); i { + file_data_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateAppReq); i { case 0: return &v.state case 1: @@ -8407,8 +6764,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListConfigItemCountResp); i { + file_data_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteAppReq); i { case 0: return &v.state case 1: @@ -8419,8 +6776,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateConfigHookReq); i { + file_data_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAppReq); i { case 0: return &v.state case 1: @@ -8431,8 +6788,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateContentReq); i { + file_data_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAppByIDReq); i { case 0: return &v.state case 1: @@ -8443,8 +6800,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetContentReq); i { + file_data_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAppByNameReq); i { case 0: return &v.state case 1: @@ -8455,8 +6812,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListContentsReq); i { + file_data_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAppsReq); i { case 0: return &v.state case 1: @@ -8467,8 +6824,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListContentsResp); i { + file_data_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAppsRestReq); i { case 0: return &v.state case 1: @@ -8479,8 +6836,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateCommitReq); i { + file_data_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAppsResp); i { case 0: return &v.state case 1: @@ -8491,8 +6848,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLatestCommitReq); i { + file_data_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateConfigItemReq); i { case 0: return &v.state case 1: @@ -8503,8 +6860,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCommitsReq); i { + file_data_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchUpsertConfigItemsReq); i { case 0: return &v.state case 1: @@ -8515,8 +6872,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCommitsResp); i { + file_data_service_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateConfigItemReq); i { case 0: return &v.state case 1: @@ -8527,8 +6884,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateReleaseReq); i { + file_data_service_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteConfigItemReq); i { case 0: return &v.state case 1: @@ -8539,8 +6896,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListReleasesReq); i { + file_data_service_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetConfigItemReq); i { case 0: return &v.state case 1: @@ -8551,8 +6908,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListReleasesResp); i { + file_data_service_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListConfigItemsReq); i { case 0: return &v.state case 1: @@ -8563,8 +6920,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetReleasedCIReq); i { + file_data_service_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListConfigItemsResp); i { case 0: return &v.state case 1: @@ -8575,8 +6932,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListReleasedCIsReq); i { + file_data_service_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListConfigItemCountReq); i { case 0: return &v.state case 1: @@ -8587,8 +6944,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListReleasedCIsResp); i { + file_data_service_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListConfigItemCountResp); i { case 0: return &v.state case 1: @@ -8599,8 +6956,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateHookReq); i { + file_data_service_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateContentReq); i { case 0: return &v.state case 1: @@ -8611,8 +6968,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHookTagReq); i { + file_data_service_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetContentReq); i { case 0: return &v.state case 1: @@ -8623,8 +6980,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetHookReq); i { + file_data_service_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListContentsReq); i { case 0: return &v.state case 1: @@ -8635,8 +6992,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetHookResp); i { + file_data_service_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListContentsResp); i { case 0: return &v.state case 1: @@ -8647,8 +7004,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetHookInfoSpec); i { + file_data_service_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCommitReq); i { case 0: return &v.state case 1: @@ -8659,8 +7016,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHooksReq); i { + file_data_service_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetLatestCommitReq); i { case 0: return &v.state case 1: @@ -8671,8 +7028,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHooksResp); i { + file_data_service_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommitsReq); i { case 0: return &v.state case 1: @@ -8683,8 +7040,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHookTagResp); i { + file_data_service_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommitsResp); i { case 0: return &v.state case 1: @@ -8695,8 +7052,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteHookReq); i { + file_data_service_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateReleaseReq); i { case 0: return &v.state case 1: @@ -8707,8 +7064,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateHookReleaseReq); i { + file_data_service_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReleasesReq); i { case 0: return &v.state case 1: @@ -8719,8 +7076,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHookReleasesReq); i { + file_data_service_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReleasesResp); i { case 0: return &v.state case 1: @@ -8731,8 +7088,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHookReleasesResp); i { + file_data_service_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetReleasedCIReq); i { case 0: return &v.state case 1: @@ -8743,8 +7100,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetHookReleaseByIdReq); i { + file_data_service_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReleasedCIsReq); i { case 0: return &v.state case 1: @@ -8755,8 +7112,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteHookReleaseReq); i { + file_data_service_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReleasedCIsResp); i { case 0: return &v.state case 1: @@ -8767,8 +7124,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PublishHookReleaseReq); i { + file_data_service_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateHookReq); i { case 0: return &v.state case 1: @@ -8779,8 +7136,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetByPubStateReq); i { + file_data_service_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListHooksReq); i { case 0: return &v.state case 1: @@ -8791,8 +7148,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateHookReleaseReq); i { + file_data_service_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListHooksResp); i { case 0: return &v.state case 1: @@ -8803,8 +7160,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHookReleasesReferencesReq); i { + file_data_service_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateHookReq); i { case 0: return &v.state case 1: @@ -8815,8 +7172,8 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListHookReleasesReferencesResp); i { + file_data_service_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteHookReq); i { case 0: return &v.state case 1: @@ -8827,7 +7184,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateTemplateSpaceReq); i { case 0: return &v.state @@ -8839,7 +7196,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListTemplateSpacesReq); i { case 0: return &v.state @@ -8851,7 +7208,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListTemplateSpacesResp); i { case 0: return &v.state @@ -8863,7 +7220,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateTemplateSpaceReq); i { case 0: return &v.state @@ -8875,7 +7232,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteTemplateSpaceReq); i { case 0: return &v.state @@ -8887,7 +7244,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateTemplateReq); i { case 0: return &v.state @@ -8899,7 +7256,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListTemplatesReq); i { case 0: return &v.state @@ -8911,7 +7268,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListTemplatesResp); i { case 0: return &v.state @@ -8923,7 +7280,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateTemplateReq); i { case 0: return &v.state @@ -8935,7 +7292,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteTemplateReq); i { case 0: return &v.state @@ -8947,7 +7304,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateTemplateReleaseReq); i { case 0: return &v.state @@ -8959,7 +7316,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListTemplateReleasesReq); i { case 0: return &v.state @@ -8971,7 +7328,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListTemplateReleasesResp); i { case 0: return &v.state @@ -8983,7 +7340,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteTemplateReleaseReq); i { case 0: return &v.state @@ -8995,7 +7352,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGroupReq); i { case 0: return &v.state @@ -9007,7 +7364,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[84].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListGroupsReq); i { case 0: return &v.state @@ -9019,7 +7376,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[85].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListGroupsResp); i { case 0: return &v.state @@ -9031,7 +7388,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[86].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAppGroupsReq); i { case 0: return &v.state @@ -9043,7 +7400,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[87].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAppGroupsResp); i { case 0: return &v.state @@ -9055,7 +7412,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[88].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateGroupReq); i { case 0: return &v.state @@ -9067,7 +7424,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[89].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteGroupReq); i { case 0: return &v.state @@ -9079,7 +7436,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[90].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CountGroupsReleasedAppsReq); i { case 0: return &v.state @@ -9091,7 +7448,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[91].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CountGroupsReleasedAppsResp); i { case 0: return &v.state @@ -9103,7 +7460,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[92].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListGroupRleasesdAppsReq); i { case 0: return &v.state @@ -9115,7 +7472,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[93].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListGroupRleasesdAppsResp); i { case 0: return &v.state @@ -9127,7 +7484,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[94].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PublishReq); i { case 0: return &v.state @@ -9139,7 +7496,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[95].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenerateReleaseAndPublishReq); i { case 0: return &v.state @@ -9151,7 +7508,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[96].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PublishResp); i { case 0: return &v.state @@ -9163,7 +7520,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[97].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListInstancesReq); i { case 0: return &v.state @@ -9175,7 +7532,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[98].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListInstancesResp); i { case 0: return &v.state @@ -9187,7 +7544,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[99].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InstanceResource); i { case 0: return &v.state @@ -9199,7 +7556,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[100].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PingMsg); i { case 0: return &v.state @@ -9211,7 +7568,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[101].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchUpsertConfigItemsReq_ConfigItem); i { case 0: return &v.state @@ -9223,19 +7580,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[102].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetHookInfoSpec_Releases); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_data_service_proto_msgTypes[103].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[84].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListAppGroupsResp_ListAppGroupsData); i { case 0: return &v.state @@ -9247,7 +7592,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[104].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[85].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CountGroupsReleasedAppsResp_CountGroupsReleasedAppsData); i { case 0: return &v.state @@ -9259,7 +7604,7 @@ func file_data_service_proto_init() { return nil } } - file_data_service_proto_msgTypes[105].Exporter = func(v interface{}, i int) interface{} { + file_data_service_proto_msgTypes[86].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListGroupRleasesdAppsResp_ListGroupReleasedAppsData); i { case 0: return &v.state @@ -9278,7 +7623,7 @@ func file_data_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_data_service_proto_rawDesc, NumEnums: 0, - NumMessages: 106, + NumMessages: 87, NumExtensions: 0, NumServices: 1, }, diff --git a/bcs-services/bcs-bscp/pkg/protocol/data-service/data_service.proto b/bcs-services/bcs-bscp/pkg/protocol/data-service/data_service.proto index 0ca7cf2128..5036092f90 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/data-service/data_service.proto +++ b/bcs-services/bcs-bscp/pkg/protocol/data-service/data_service.proto @@ -9,13 +9,11 @@ import "bscp.io/pkg/protocol/core/credential/credential.proto"; import "bscp.io/pkg/protocol/core/credential-scope/credential-scope.proto"; import "bscp.io/pkg/protocol/core/group/group.proto"; import "bscp.io/pkg/protocol/core/hook/hook.proto"; -import "bscp.io/pkg/protocol/core/hook-release/hook_release.proto"; import "bscp.io/pkg/protocol/core/release/release.proto"; import "bscp.io/pkg/protocol/core/released-ci/released_ci.proto"; import "bscp.io/pkg/protocol/core/template/template.proto"; import "bscp.io/pkg/protocol/core/template-space/template_space.proto"; import "bscp.io/pkg/protocol/core/template-release/template_release.proto"; -import "bscp.io/pkg/protocol/core/config-hook/config_hook.proto"; import "google/api/annotations.proto"; import "google/protobuf/struct.proto"; @@ -31,8 +29,8 @@ service Data { rpc GetApp(GetAppReq) returns (pbapp.App) {} rpc GetAppByID(GetAppByIDReq) returns (pbapp.App) {} rpc GetAppByName(GetAppByNameReq) returns (pbapp.App) {} + rpc ListApps(ListAppsReq) returns (ListAppsResp) {} rpc ListAppsRest(ListAppsRestReq) returns (ListAppsResp) {} - rpc ListAppsByIDs(ListAppsByIDsReq) returns (ListAppsByIDsResp) {} // config item related interface. rpc CreateConfigItem(CreateConfigItemReq) returns (CreateResp) {} @@ -43,11 +41,6 @@ service Data { rpc ListConfigItems(ListConfigItemsReq) returns (ListConfigItemsResp) {} rpc ListConfigItemCount(ListConfigItemCountReq) returns (ListConfigItemCountResp) {} - // config hook related interface. - rpc CreateConfigHook(CreateConfigHookReq) returns (CreateResp) {} - rpc UpdateConfigHook(UpdateConfigHookReq) returns (pbbase.EmptyResp) {} - rpc GetConfigHook(GetConfigHookReq) returns (pbch.ConfigHook) {} - // content related interface. rpc CreateContent(CreateContentReq) returns (CreateResp) {} rpc GetContent(GetContentReq) returns (pbcontent.Content) {} @@ -69,19 +62,8 @@ service Data { // hook related interface. rpc CreateHook(CreateHookReq) returns (CreateResp) {} rpc ListHooks(ListHooksReq) returns (ListHooksResp) {} + rpc UpdateHook(UpdateHookReq) returns (pbbase.EmptyResp) {} rpc DeleteHook(DeleteHookReq) returns (pbbase.EmptyResp) {} - rpc ListHookTags(ListHookTagReq) returns (ListHookTagResp) {} - rpc GetHook(GetHookReq) returns (GetHookResp) {} - - // hook release interface. - rpc CreateHookRelease(CreateHookReleaseReq) returns (CreateResp) {} - rpc ListHookReleases(ListHookReleasesReq) returns (ListHookReleasesResp) {} - rpc GetHookReleaseByID(GetHookReleaseByIdReq) returns (pbhr.HookRelease){} - rpc DeleteHookRelease(DeleteHookReleaseReq) returns (pbbase.EmptyResp){} - rpc PublishHookRelease(PublishHookReleaseReq) returns (pbbase.EmptyResp){} - rpc GetHookReleaseByPubState(GetByPubStateReq) returns (pbhr.HookRelease){} - rpc UpdateHookRelease(UpdateHookReleaseReq) returns (pbbase.EmptyResp) {} - rpc ListHookReleasesReferences(ListHookReleasesReferencesReq) returns (ListHookReleasesReferencesResp) {} // template space related interface. rpc CreateTemplateSpace(CreateTemplateSpaceReq) returns (CreateResp) {} @@ -173,10 +155,9 @@ message CreateCredentialReq { } message ListCredentialReq { - uint32 biz_id = 1; - string searchKey = 2; - uint32 start = 3; - uint32 limit = 4; + uint32 biz_id = 1; + pbbase.BasePage page = 2; + google.protobuf.Struct filter = 3; } message ListCredentialResp{ @@ -205,17 +186,6 @@ message CreateResp { uint32 id = 1; } -message UpdateConfigHookReq { - uint32 id = 1; - pbch.ConfigHookAttachment attachment = 2; - pbch.ConfigHookSpec spec = 3; -} - -message GetConfigHookReq { - uint32 biz_id = 1; - uint32 app_id = 2; -} - message CreateAppReq { uint32 biz_id = 1; pbapp.AppSpec spec = 2; @@ -246,6 +216,12 @@ message GetAppByNameReq { string app_name = 2; } +message ListAppsReq { + uint32 biz_id = 1; + google.protobuf.Struct filter = 2; + pbbase.BasePage page = 3; +} + message ListAppsRestReq { string biz_id = 1; // 多个以逗号分割 uint32 start = 2; @@ -259,14 +235,6 @@ message ListAppsResp { repeated pbapp.App details = 2; } -message ListAppsByIDsReq { - repeated uint32 ids = 1; -} - -message ListAppsByIDsResp { - repeated pbapp.App details = 1; -} - message CreateConfigItemReq { pbci.ConfigItemAttachment config_item_attachment = 1; pbci.ConfigItemSpec config_item_spec = 2; @@ -325,11 +293,6 @@ message ListConfigItemCountResp { repeated pbci.ListConfigItemCounts details = 1; } -message CreateConfigHookReq { - pbch.ConfigHookAttachment attachment = 1; - pbch.ConfigHookSpec spec = 2; -} - message CreateContentReq { pbcontent.ContentAttachment attachment = 1; pbcontent.ContentSpec spec = 2; @@ -418,42 +381,11 @@ message CreateHookReq { pbhook.HookSpec spec = 2; } -message ListHookTagReq { - uint32 biz_id = 1; -} - -message GetHookReq { - uint32 biz_id = 1; - uint32 hook_id = 2; -} - -message GetHookResp { - uint32 id = 1; - GetHookInfoSpec spec = 2; - pbhook.HookAttachment attachment = 3; - pbbase.Revision revision = 4; -} - -message GetHookInfoSpec { - string name = 1; - string type = 3; - string tag = 4; - string memo = 5; - uint32 publish_num = 7; - message Releases { - uint32 not_release_id = 1; - } - Releases releases = 8; -} - message ListHooksReq { - uint32 biz_id = 1; - string name = 2; - string tag = 3; - bool all = 5; - bool not_tag = 6; - uint32 start = 7; - uint32 limit = 8; + uint32 biz_id = 1; + uint32 app_id = 2; + google.protobuf.Struct filter = 3; + pbbase.BasePage page = 4; } message ListHooksResp { @@ -461,8 +393,10 @@ message ListHooksResp { repeated pbhook.Hook details = 2; } -message ListHookTagResp { - repeated pbhook.CountHookTags details = 1; +message UpdateHookReq { + uint32 id = 1; + pbhook.HookAttachment attachment = 2; + pbhook.HookSpec spec = 3; } message DeleteHookReq { @@ -470,69 +404,6 @@ message DeleteHookReq { pbhook.HookAttachment attachment = 2; } -message CreateHookReleaseReq { - pbhr.HookReleaseAttachment attachment = 1; - pbhr.HookReleaseSpec spec = 2; -} - -message ListHookReleasesReq { - uint32 biz_id = 1; - uint32 hook_id = 2; - string search_key = 3; - uint32 start = 4; - uint32 limit = 5; - bool all = 6; - string state = 7; -} - -message ListHookReleasesResp { - uint32 count = 1; - repeated pbhr.HookRelease details = 2; -} - -message GetHookReleaseByIdReq { - uint32 biz_id = 1; - uint32 hook_id = 2; - uint32 id = 3; -} - -message DeleteHookReleaseReq { - uint32 biz_id = 1; - uint32 hook_id = 2; - uint32 id = 3; -} - -message PublishHookReleaseReq { - uint32 biz_id = 1; - uint32 hook_id = 2; - uint32 id = 3; -} - -message GetByPubStateReq { - uint32 biz_id = 1; - uint32 hook_id = 2; - string state = 3; -} - -message UpdateHookReleaseReq { - uint32 id = 1; - pbhr.HookReleaseAttachment attachment = 2; - pbhr.HookReleaseSpec spec = 3; -} - -message ListHookReleasesReferencesReq { - uint32 biz_id = 1; - uint32 hook_id = 2; - uint32 releases_id = 3; - uint32 start = 4; - uint32 limit = 5; -} - -message ListHookReleasesReferencesResp { - uint32 count = 1; - repeated pbhr.ListHookReleasesReferencesDetails details = 2; -} - message CreateTemplateSpaceReq { pbts.TemplateSpaceAttachment attachment = 1; pbts.TemplateSpaceSpec spec = 2; diff --git a/bcs-services/bcs-bscp/pkg/protocol/data-service/data_service_grpc.pb.go b/bcs-services/bcs-bscp/pkg/protocol/data-service/data_service_grpc.pb.go index f69d919c34..a3b598c4ea 100644 --- a/bcs-services/bcs-bscp/pkg/protocol/data-service/data_service_grpc.pb.go +++ b/bcs-services/bcs-bscp/pkg/protocol/data-service/data_service_grpc.pb.go @@ -10,10 +10,8 @@ import ( app "bscp.io/pkg/protocol/core/app" base "bscp.io/pkg/protocol/core/base" commit "bscp.io/pkg/protocol/core/commit" - config_hook "bscp.io/pkg/protocol/core/config-hook" config_item "bscp.io/pkg/protocol/core/config-item" content "bscp.io/pkg/protocol/core/content" - hook_release "bscp.io/pkg/protocol/core/hook-release" released_ci "bscp.io/pkg/protocol/core/released-ci" context "context" grpc "google.golang.org/grpc" @@ -27,75 +25,63 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Data_CreateApp_FullMethodName = "/pbds.Data/CreateApp" - Data_UpdateApp_FullMethodName = "/pbds.Data/UpdateApp" - Data_DeleteApp_FullMethodName = "/pbds.Data/DeleteApp" - Data_GetApp_FullMethodName = "/pbds.Data/GetApp" - Data_GetAppByID_FullMethodName = "/pbds.Data/GetAppByID" - Data_GetAppByName_FullMethodName = "/pbds.Data/GetAppByName" - Data_ListAppsRest_FullMethodName = "/pbds.Data/ListAppsRest" - Data_ListAppsByIDs_FullMethodName = "/pbds.Data/ListAppsByIDs" - Data_CreateConfigItem_FullMethodName = "/pbds.Data/CreateConfigItem" - Data_BatchUpsertConfigItems_FullMethodName = "/pbds.Data/BatchUpsertConfigItems" - Data_UpdateConfigItem_FullMethodName = "/pbds.Data/UpdateConfigItem" - Data_DeleteConfigItem_FullMethodName = "/pbds.Data/DeleteConfigItem" - Data_GetConfigItem_FullMethodName = "/pbds.Data/GetConfigItem" - Data_ListConfigItems_FullMethodName = "/pbds.Data/ListConfigItems" - Data_ListConfigItemCount_FullMethodName = "/pbds.Data/ListConfigItemCount" - Data_CreateConfigHook_FullMethodName = "/pbds.Data/CreateConfigHook" - Data_UpdateConfigHook_FullMethodName = "/pbds.Data/UpdateConfigHook" - Data_GetConfigHook_FullMethodName = "/pbds.Data/GetConfigHook" - Data_CreateContent_FullMethodName = "/pbds.Data/CreateContent" - Data_GetContent_FullMethodName = "/pbds.Data/GetContent" - Data_ListContents_FullMethodName = "/pbds.Data/ListContents" - Data_CreateCommit_FullMethodName = "/pbds.Data/CreateCommit" - Data_GetLatestCommit_FullMethodName = "/pbds.Data/GetLatestCommit" - Data_ListCommits_FullMethodName = "/pbds.Data/ListCommits" - Data_CreateRelease_FullMethodName = "/pbds.Data/CreateRelease" - Data_ListReleases_FullMethodName = "/pbds.Data/ListReleases" - Data_GetReleasedConfigItem_FullMethodName = "/pbds.Data/GetReleasedConfigItem" - Data_ListReleasedConfigItems_FullMethodName = "/pbds.Data/ListReleasedConfigItems" - Data_CreateHook_FullMethodName = "/pbds.Data/CreateHook" - Data_ListHooks_FullMethodName = "/pbds.Data/ListHooks" - Data_DeleteHook_FullMethodName = "/pbds.Data/DeleteHook" - Data_ListHookTags_FullMethodName = "/pbds.Data/ListHookTags" - Data_GetHook_FullMethodName = "/pbds.Data/GetHook" - Data_CreateHookRelease_FullMethodName = "/pbds.Data/CreateHookRelease" - Data_ListHookReleases_FullMethodName = "/pbds.Data/ListHookReleases" - Data_GetHookReleaseByID_FullMethodName = "/pbds.Data/GetHookReleaseByID" - Data_DeleteHookRelease_FullMethodName = "/pbds.Data/DeleteHookRelease" - Data_PublishHookRelease_FullMethodName = "/pbds.Data/PublishHookRelease" - Data_GetHookReleaseByPubState_FullMethodName = "/pbds.Data/GetHookReleaseByPubState" - Data_UpdateHookRelease_FullMethodName = "/pbds.Data/UpdateHookRelease" - Data_ListHookReleasesReferences_FullMethodName = "/pbds.Data/ListHookReleasesReferences" - Data_CreateTemplateSpace_FullMethodName = "/pbds.Data/CreateTemplateSpace" - Data_ListTemplateSpaces_FullMethodName = "/pbds.Data/ListTemplateSpaces" - Data_UpdateTemplateSpace_FullMethodName = "/pbds.Data/UpdateTemplateSpace" - Data_DeleteTemplateSpace_FullMethodName = "/pbds.Data/DeleteTemplateSpace" - Data_CreateTemplate_FullMethodName = "/pbds.Data/CreateTemplate" - Data_ListTemplates_FullMethodName = "/pbds.Data/ListTemplates" - Data_UpdateTemplate_FullMethodName = "/pbds.Data/UpdateTemplate" - Data_DeleteTemplate_FullMethodName = "/pbds.Data/DeleteTemplate" - Data_CreateTemplateRelease_FullMethodName = "/pbds.Data/CreateTemplateRelease" - Data_ListTemplateReleases_FullMethodName = "/pbds.Data/ListTemplateReleases" - Data_DeleteTemplateRelease_FullMethodName = "/pbds.Data/DeleteTemplateRelease" - Data_CreateGroup_FullMethodName = "/pbds.Data/CreateGroup" - Data_ListGroups_FullMethodName = "/pbds.Data/ListGroups" - Data_ListAppGroups_FullMethodName = "/pbds.Data/ListAppGroups" - Data_UpdateGroup_FullMethodName = "/pbds.Data/UpdateGroup" - Data_DeleteGroup_FullMethodName = "/pbds.Data/DeleteGroup" - Data_CountGroupsReleasedApps_FullMethodName = "/pbds.Data/CountGroupsReleasedApps" - Data_ListGroupRleasesdApps_FullMethodName = "/pbds.Data/ListGroupRleasesdApps" - Data_Publish_FullMethodName = "/pbds.Data/Publish" - Data_GenerateReleaseAndPublish_FullMethodName = "/pbds.Data/GenerateReleaseAndPublish" - Data_CreateCredential_FullMethodName = "/pbds.Data/CreateCredential" - Data_ListCredentials_FullMethodName = "/pbds.Data/ListCredentials" - Data_DeleteCredential_FullMethodName = "/pbds.Data/DeleteCredential" - Data_UpdateCredential_FullMethodName = "/pbds.Data/UpdateCredential" - Data_ListCredentialScopes_FullMethodName = "/pbds.Data/ListCredentialScopes" - Data_UpdateCredentialScopes_FullMethodName = "/pbds.Data/UpdateCredentialScopes" - Data_ListInstances_FullMethodName = "/pbds.Data/ListInstances" - Data_Ping_FullMethodName = "/pbds.Data/Ping" + Data_CreateApp_FullMethodName = "/pbds.Data/CreateApp" + Data_UpdateApp_FullMethodName = "/pbds.Data/UpdateApp" + Data_DeleteApp_FullMethodName = "/pbds.Data/DeleteApp" + Data_GetApp_FullMethodName = "/pbds.Data/GetApp" + Data_GetAppByID_FullMethodName = "/pbds.Data/GetAppByID" + Data_GetAppByName_FullMethodName = "/pbds.Data/GetAppByName" + Data_ListApps_FullMethodName = "/pbds.Data/ListApps" + Data_ListAppsRest_FullMethodName = "/pbds.Data/ListAppsRest" + Data_CreateConfigItem_FullMethodName = "/pbds.Data/CreateConfigItem" + Data_BatchUpsertConfigItems_FullMethodName = "/pbds.Data/BatchUpsertConfigItems" + Data_UpdateConfigItem_FullMethodName = "/pbds.Data/UpdateConfigItem" + Data_DeleteConfigItem_FullMethodName = "/pbds.Data/DeleteConfigItem" + Data_GetConfigItem_FullMethodName = "/pbds.Data/GetConfigItem" + Data_ListConfigItems_FullMethodName = "/pbds.Data/ListConfigItems" + Data_ListConfigItemCount_FullMethodName = "/pbds.Data/ListConfigItemCount" + Data_CreateContent_FullMethodName = "/pbds.Data/CreateContent" + Data_GetContent_FullMethodName = "/pbds.Data/GetContent" + Data_ListContents_FullMethodName = "/pbds.Data/ListContents" + Data_CreateCommit_FullMethodName = "/pbds.Data/CreateCommit" + Data_GetLatestCommit_FullMethodName = "/pbds.Data/GetLatestCommit" + Data_ListCommits_FullMethodName = "/pbds.Data/ListCommits" + Data_CreateRelease_FullMethodName = "/pbds.Data/CreateRelease" + Data_ListReleases_FullMethodName = "/pbds.Data/ListReleases" + Data_GetReleasedConfigItem_FullMethodName = "/pbds.Data/GetReleasedConfigItem" + Data_ListReleasedConfigItems_FullMethodName = "/pbds.Data/ListReleasedConfigItems" + Data_CreateHook_FullMethodName = "/pbds.Data/CreateHook" + Data_ListHooks_FullMethodName = "/pbds.Data/ListHooks" + Data_UpdateHook_FullMethodName = "/pbds.Data/UpdateHook" + Data_DeleteHook_FullMethodName = "/pbds.Data/DeleteHook" + Data_CreateTemplateSpace_FullMethodName = "/pbds.Data/CreateTemplateSpace" + Data_ListTemplateSpaces_FullMethodName = "/pbds.Data/ListTemplateSpaces" + Data_UpdateTemplateSpace_FullMethodName = "/pbds.Data/UpdateTemplateSpace" + Data_DeleteTemplateSpace_FullMethodName = "/pbds.Data/DeleteTemplateSpace" + Data_CreateTemplate_FullMethodName = "/pbds.Data/CreateTemplate" + Data_ListTemplates_FullMethodName = "/pbds.Data/ListTemplates" + Data_UpdateTemplate_FullMethodName = "/pbds.Data/UpdateTemplate" + Data_DeleteTemplate_FullMethodName = "/pbds.Data/DeleteTemplate" + Data_CreateTemplateRelease_FullMethodName = "/pbds.Data/CreateTemplateRelease" + Data_ListTemplateReleases_FullMethodName = "/pbds.Data/ListTemplateReleases" + Data_DeleteTemplateRelease_FullMethodName = "/pbds.Data/DeleteTemplateRelease" + Data_CreateGroup_FullMethodName = "/pbds.Data/CreateGroup" + Data_ListGroups_FullMethodName = "/pbds.Data/ListGroups" + Data_ListAppGroups_FullMethodName = "/pbds.Data/ListAppGroups" + Data_UpdateGroup_FullMethodName = "/pbds.Data/UpdateGroup" + Data_DeleteGroup_FullMethodName = "/pbds.Data/DeleteGroup" + Data_CountGroupsReleasedApps_FullMethodName = "/pbds.Data/CountGroupsReleasedApps" + Data_ListGroupRleasesdApps_FullMethodName = "/pbds.Data/ListGroupRleasesdApps" + Data_Publish_FullMethodName = "/pbds.Data/Publish" + Data_GenerateReleaseAndPublish_FullMethodName = "/pbds.Data/GenerateReleaseAndPublish" + Data_CreateCredential_FullMethodName = "/pbds.Data/CreateCredential" + Data_ListCredentials_FullMethodName = "/pbds.Data/ListCredentials" + Data_DeleteCredential_FullMethodName = "/pbds.Data/DeleteCredential" + Data_UpdateCredential_FullMethodName = "/pbds.Data/UpdateCredential" + Data_ListCredentialScopes_FullMethodName = "/pbds.Data/ListCredentialScopes" + Data_UpdateCredentialScopes_FullMethodName = "/pbds.Data/UpdateCredentialScopes" + Data_ListInstances_FullMethodName = "/pbds.Data/ListInstances" + Data_Ping_FullMethodName = "/pbds.Data/Ping" ) // DataClient is the client API for Data service. @@ -109,8 +95,8 @@ type DataClient interface { GetApp(ctx context.Context, in *GetAppReq, opts ...grpc.CallOption) (*app.App, error) GetAppByID(ctx context.Context, in *GetAppByIDReq, opts ...grpc.CallOption) (*app.App, error) GetAppByName(ctx context.Context, in *GetAppByNameReq, opts ...grpc.CallOption) (*app.App, error) + ListApps(ctx context.Context, in *ListAppsReq, opts ...grpc.CallOption) (*ListAppsResp, error) ListAppsRest(ctx context.Context, in *ListAppsRestReq, opts ...grpc.CallOption) (*ListAppsResp, error) - ListAppsByIDs(ctx context.Context, in *ListAppsByIDsReq, opts ...grpc.CallOption) (*ListAppsByIDsResp, error) // config item related interface. CreateConfigItem(ctx context.Context, in *CreateConfigItemReq, opts ...grpc.CallOption) (*CreateResp, error) BatchUpsertConfigItems(ctx context.Context, in *BatchUpsertConfigItemsReq, opts ...grpc.CallOption) (*base.EmptyResp, error) @@ -119,10 +105,6 @@ type DataClient interface { GetConfigItem(ctx context.Context, in *GetConfigItemReq, opts ...grpc.CallOption) (*config_item.ConfigItem, error) ListConfigItems(ctx context.Context, in *ListConfigItemsReq, opts ...grpc.CallOption) (*ListConfigItemsResp, error) ListConfigItemCount(ctx context.Context, in *ListConfigItemCountReq, opts ...grpc.CallOption) (*ListConfigItemCountResp, error) - // config hook related interface. - CreateConfigHook(ctx context.Context, in *CreateConfigHookReq, opts ...grpc.CallOption) (*CreateResp, error) - UpdateConfigHook(ctx context.Context, in *UpdateConfigHookReq, opts ...grpc.CallOption) (*base.EmptyResp, error) - GetConfigHook(ctx context.Context, in *GetConfigHookReq, opts ...grpc.CallOption) (*config_hook.ConfigHook, error) // content related interface. CreateContent(ctx context.Context, in *CreateContentReq, opts ...grpc.CallOption) (*CreateResp, error) GetContent(ctx context.Context, in *GetContentReq, opts ...grpc.CallOption) (*content.Content, error) @@ -140,18 +122,8 @@ type DataClient interface { // hook related interface. CreateHook(ctx context.Context, in *CreateHookReq, opts ...grpc.CallOption) (*CreateResp, error) ListHooks(ctx context.Context, in *ListHooksReq, opts ...grpc.CallOption) (*ListHooksResp, error) + UpdateHook(ctx context.Context, in *UpdateHookReq, opts ...grpc.CallOption) (*base.EmptyResp, error) DeleteHook(ctx context.Context, in *DeleteHookReq, opts ...grpc.CallOption) (*base.EmptyResp, error) - ListHookTags(ctx context.Context, in *ListHookTagReq, opts ...grpc.CallOption) (*ListHookTagResp, error) - GetHook(ctx context.Context, in *GetHookReq, opts ...grpc.CallOption) (*GetHookResp, error) - // hook release interface. - CreateHookRelease(ctx context.Context, in *CreateHookReleaseReq, opts ...grpc.CallOption) (*CreateResp, error) - ListHookReleases(ctx context.Context, in *ListHookReleasesReq, opts ...grpc.CallOption) (*ListHookReleasesResp, error) - GetHookReleaseByID(ctx context.Context, in *GetHookReleaseByIdReq, opts ...grpc.CallOption) (*hook_release.HookRelease, error) - DeleteHookRelease(ctx context.Context, in *DeleteHookReleaseReq, opts ...grpc.CallOption) (*base.EmptyResp, error) - PublishHookRelease(ctx context.Context, in *PublishHookReleaseReq, opts ...grpc.CallOption) (*base.EmptyResp, error) - GetHookReleaseByPubState(ctx context.Context, in *GetByPubStateReq, opts ...grpc.CallOption) (*hook_release.HookRelease, error) - UpdateHookRelease(ctx context.Context, in *UpdateHookReleaseReq, opts ...grpc.CallOption) (*base.EmptyResp, error) - ListHookReleasesReferences(ctx context.Context, in *ListHookReleasesReferencesReq, opts ...grpc.CallOption) (*ListHookReleasesReferencesResp, error) // template space related interface. CreateTemplateSpace(ctx context.Context, in *CreateTemplateSpaceReq, opts ...grpc.CallOption) (*CreateResp, error) ListTemplateSpaces(ctx context.Context, in *ListTemplateSpacesReq, opts ...grpc.CallOption) (*ListTemplateSpacesResp, error) @@ -254,18 +226,18 @@ func (c *dataClient) GetAppByName(ctx context.Context, in *GetAppByNameReq, opts return out, nil } -func (c *dataClient) ListAppsRest(ctx context.Context, in *ListAppsRestReq, opts ...grpc.CallOption) (*ListAppsResp, error) { +func (c *dataClient) ListApps(ctx context.Context, in *ListAppsReq, opts ...grpc.CallOption) (*ListAppsResp, error) { out := new(ListAppsResp) - err := c.cc.Invoke(ctx, Data_ListAppsRest_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Data_ListApps_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *dataClient) ListAppsByIDs(ctx context.Context, in *ListAppsByIDsReq, opts ...grpc.CallOption) (*ListAppsByIDsResp, error) { - out := new(ListAppsByIDsResp) - err := c.cc.Invoke(ctx, Data_ListAppsByIDs_FullMethodName, in, out, opts...) +func (c *dataClient) ListAppsRest(ctx context.Context, in *ListAppsRestReq, opts ...grpc.CallOption) (*ListAppsResp, error) { + out := new(ListAppsResp) + err := c.cc.Invoke(ctx, Data_ListAppsRest_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -335,33 +307,6 @@ func (c *dataClient) ListConfigItemCount(ctx context.Context, in *ListConfigItem return out, nil } -func (c *dataClient) CreateConfigHook(ctx context.Context, in *CreateConfigHookReq, opts ...grpc.CallOption) (*CreateResp, error) { - out := new(CreateResp) - err := c.cc.Invoke(ctx, Data_CreateConfigHook_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dataClient) UpdateConfigHook(ctx context.Context, in *UpdateConfigHookReq, opts ...grpc.CallOption) (*base.EmptyResp, error) { - out := new(base.EmptyResp) - err := c.cc.Invoke(ctx, Data_UpdateConfigHook_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dataClient) GetConfigHook(ctx context.Context, in *GetConfigHookReq, opts ...grpc.CallOption) (*config_hook.ConfigHook, error) { - out := new(config_hook.ConfigHook) - err := c.cc.Invoke(ctx, Data_GetConfigHook_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *dataClient) CreateContent(ctx context.Context, in *CreateContentReq, opts ...grpc.CallOption) (*CreateResp, error) { out := new(CreateResp) err := c.cc.Invoke(ctx, Data_CreateContent_FullMethodName, in, out, opts...) @@ -470,99 +415,18 @@ func (c *dataClient) ListHooks(ctx context.Context, in *ListHooksReq, opts ...gr return out, nil } -func (c *dataClient) DeleteHook(ctx context.Context, in *DeleteHookReq, opts ...grpc.CallOption) (*base.EmptyResp, error) { - out := new(base.EmptyResp) - err := c.cc.Invoke(ctx, Data_DeleteHook_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dataClient) ListHookTags(ctx context.Context, in *ListHookTagReq, opts ...grpc.CallOption) (*ListHookTagResp, error) { - out := new(ListHookTagResp) - err := c.cc.Invoke(ctx, Data_ListHookTags_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dataClient) GetHook(ctx context.Context, in *GetHookReq, opts ...grpc.CallOption) (*GetHookResp, error) { - out := new(GetHookResp) - err := c.cc.Invoke(ctx, Data_GetHook_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dataClient) CreateHookRelease(ctx context.Context, in *CreateHookReleaseReq, opts ...grpc.CallOption) (*CreateResp, error) { - out := new(CreateResp) - err := c.cc.Invoke(ctx, Data_CreateHookRelease_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dataClient) ListHookReleases(ctx context.Context, in *ListHookReleasesReq, opts ...grpc.CallOption) (*ListHookReleasesResp, error) { - out := new(ListHookReleasesResp) - err := c.cc.Invoke(ctx, Data_ListHookReleases_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dataClient) GetHookReleaseByID(ctx context.Context, in *GetHookReleaseByIdReq, opts ...grpc.CallOption) (*hook_release.HookRelease, error) { - out := new(hook_release.HookRelease) - err := c.cc.Invoke(ctx, Data_GetHookReleaseByID_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dataClient) DeleteHookRelease(ctx context.Context, in *DeleteHookReleaseReq, opts ...grpc.CallOption) (*base.EmptyResp, error) { +func (c *dataClient) UpdateHook(ctx context.Context, in *UpdateHookReq, opts ...grpc.CallOption) (*base.EmptyResp, error) { out := new(base.EmptyResp) - err := c.cc.Invoke(ctx, Data_DeleteHookRelease_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dataClient) PublishHookRelease(ctx context.Context, in *PublishHookReleaseReq, opts ...grpc.CallOption) (*base.EmptyResp, error) { - out := new(base.EmptyResp) - err := c.cc.Invoke(ctx, Data_PublishHookRelease_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dataClient) GetHookReleaseByPubState(ctx context.Context, in *GetByPubStateReq, opts ...grpc.CallOption) (*hook_release.HookRelease, error) { - out := new(hook_release.HookRelease) - err := c.cc.Invoke(ctx, Data_GetHookReleaseByPubState_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Data_UpdateHook_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *dataClient) UpdateHookRelease(ctx context.Context, in *UpdateHookReleaseReq, opts ...grpc.CallOption) (*base.EmptyResp, error) { +func (c *dataClient) DeleteHook(ctx context.Context, in *DeleteHookReq, opts ...grpc.CallOption) (*base.EmptyResp, error) { out := new(base.EmptyResp) - err := c.cc.Invoke(ctx, Data_UpdateHookRelease_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dataClient) ListHookReleasesReferences(ctx context.Context, in *ListHookReleasesReferencesReq, opts ...grpc.CallOption) (*ListHookReleasesReferencesResp, error) { - out := new(ListHookReleasesReferencesResp) - err := c.cc.Invoke(ctx, Data_ListHookReleasesReferences_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Data_DeleteHook_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -832,8 +696,8 @@ type DataServer interface { GetApp(context.Context, *GetAppReq) (*app.App, error) GetAppByID(context.Context, *GetAppByIDReq) (*app.App, error) GetAppByName(context.Context, *GetAppByNameReq) (*app.App, error) + ListApps(context.Context, *ListAppsReq) (*ListAppsResp, error) ListAppsRest(context.Context, *ListAppsRestReq) (*ListAppsResp, error) - ListAppsByIDs(context.Context, *ListAppsByIDsReq) (*ListAppsByIDsResp, error) // config item related interface. CreateConfigItem(context.Context, *CreateConfigItemReq) (*CreateResp, error) BatchUpsertConfigItems(context.Context, *BatchUpsertConfigItemsReq) (*base.EmptyResp, error) @@ -842,10 +706,6 @@ type DataServer interface { GetConfigItem(context.Context, *GetConfigItemReq) (*config_item.ConfigItem, error) ListConfigItems(context.Context, *ListConfigItemsReq) (*ListConfigItemsResp, error) ListConfigItemCount(context.Context, *ListConfigItemCountReq) (*ListConfigItemCountResp, error) - // config hook related interface. - CreateConfigHook(context.Context, *CreateConfigHookReq) (*CreateResp, error) - UpdateConfigHook(context.Context, *UpdateConfigHookReq) (*base.EmptyResp, error) - GetConfigHook(context.Context, *GetConfigHookReq) (*config_hook.ConfigHook, error) // content related interface. CreateContent(context.Context, *CreateContentReq) (*CreateResp, error) GetContent(context.Context, *GetContentReq) (*content.Content, error) @@ -863,18 +723,8 @@ type DataServer interface { // hook related interface. CreateHook(context.Context, *CreateHookReq) (*CreateResp, error) ListHooks(context.Context, *ListHooksReq) (*ListHooksResp, error) + UpdateHook(context.Context, *UpdateHookReq) (*base.EmptyResp, error) DeleteHook(context.Context, *DeleteHookReq) (*base.EmptyResp, error) - ListHookTags(context.Context, *ListHookTagReq) (*ListHookTagResp, error) - GetHook(context.Context, *GetHookReq) (*GetHookResp, error) - // hook release interface. - CreateHookRelease(context.Context, *CreateHookReleaseReq) (*CreateResp, error) - ListHookReleases(context.Context, *ListHookReleasesReq) (*ListHookReleasesResp, error) - GetHookReleaseByID(context.Context, *GetHookReleaseByIdReq) (*hook_release.HookRelease, error) - DeleteHookRelease(context.Context, *DeleteHookReleaseReq) (*base.EmptyResp, error) - PublishHookRelease(context.Context, *PublishHookReleaseReq) (*base.EmptyResp, error) - GetHookReleaseByPubState(context.Context, *GetByPubStateReq) (*hook_release.HookRelease, error) - UpdateHookRelease(context.Context, *UpdateHookReleaseReq) (*base.EmptyResp, error) - ListHookReleasesReferences(context.Context, *ListHookReleasesReferencesReq) (*ListHookReleasesReferencesResp, error) // template space related interface. CreateTemplateSpace(context.Context, *CreateTemplateSpaceReq) (*CreateResp, error) ListTemplateSpaces(context.Context, *ListTemplateSpacesReq) (*ListTemplateSpacesResp, error) @@ -937,12 +787,12 @@ func (UnimplementedDataServer) GetAppByID(context.Context, *GetAppByIDReq) (*app func (UnimplementedDataServer) GetAppByName(context.Context, *GetAppByNameReq) (*app.App, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAppByName not implemented") } +func (UnimplementedDataServer) ListApps(context.Context, *ListAppsReq) (*ListAppsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListApps not implemented") +} func (UnimplementedDataServer) ListAppsRest(context.Context, *ListAppsRestReq) (*ListAppsResp, error) { return nil, status.Errorf(codes.Unimplemented, "method ListAppsRest not implemented") } -func (UnimplementedDataServer) ListAppsByIDs(context.Context, *ListAppsByIDsReq) (*ListAppsByIDsResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListAppsByIDs not implemented") -} func (UnimplementedDataServer) CreateConfigItem(context.Context, *CreateConfigItemReq) (*CreateResp, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateConfigItem not implemented") } @@ -964,15 +814,6 @@ func (UnimplementedDataServer) ListConfigItems(context.Context, *ListConfigItems func (UnimplementedDataServer) ListConfigItemCount(context.Context, *ListConfigItemCountReq) (*ListConfigItemCountResp, error) { return nil, status.Errorf(codes.Unimplemented, "method ListConfigItemCount not implemented") } -func (UnimplementedDataServer) CreateConfigHook(context.Context, *CreateConfigHookReq) (*CreateResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateConfigHook not implemented") -} -func (UnimplementedDataServer) UpdateConfigHook(context.Context, *UpdateConfigHookReq) (*base.EmptyResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateConfigHook not implemented") -} -func (UnimplementedDataServer) GetConfigHook(context.Context, *GetConfigHookReq) (*config_hook.ConfigHook, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetConfigHook not implemented") -} func (UnimplementedDataServer) CreateContent(context.Context, *CreateContentReq) (*CreateResp, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateContent not implemented") } @@ -1009,39 +850,12 @@ func (UnimplementedDataServer) CreateHook(context.Context, *CreateHookReq) (*Cre func (UnimplementedDataServer) ListHooks(context.Context, *ListHooksReq) (*ListHooksResp, error) { return nil, status.Errorf(codes.Unimplemented, "method ListHooks not implemented") } +func (UnimplementedDataServer) UpdateHook(context.Context, *UpdateHookReq) (*base.EmptyResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateHook not implemented") +} func (UnimplementedDataServer) DeleteHook(context.Context, *DeleteHookReq) (*base.EmptyResp, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteHook not implemented") } -func (UnimplementedDataServer) ListHookTags(context.Context, *ListHookTagReq) (*ListHookTagResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListHookTags not implemented") -} -func (UnimplementedDataServer) GetHook(context.Context, *GetHookReq) (*GetHookResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetHook not implemented") -} -func (UnimplementedDataServer) CreateHookRelease(context.Context, *CreateHookReleaseReq) (*CreateResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateHookRelease not implemented") -} -func (UnimplementedDataServer) ListHookReleases(context.Context, *ListHookReleasesReq) (*ListHookReleasesResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListHookReleases not implemented") -} -func (UnimplementedDataServer) GetHookReleaseByID(context.Context, *GetHookReleaseByIdReq) (*hook_release.HookRelease, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetHookReleaseByID not implemented") -} -func (UnimplementedDataServer) DeleteHookRelease(context.Context, *DeleteHookReleaseReq) (*base.EmptyResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteHookRelease not implemented") -} -func (UnimplementedDataServer) PublishHookRelease(context.Context, *PublishHookReleaseReq) (*base.EmptyResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method PublishHookRelease not implemented") -} -func (UnimplementedDataServer) GetHookReleaseByPubState(context.Context, *GetByPubStateReq) (*hook_release.HookRelease, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetHookReleaseByPubState not implemented") -} -func (UnimplementedDataServer) UpdateHookRelease(context.Context, *UpdateHookReleaseReq) (*base.EmptyResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateHookRelease not implemented") -} -func (UnimplementedDataServer) ListHookReleasesReferences(context.Context, *ListHookReleasesReferencesReq) (*ListHookReleasesReferencesResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListHookReleasesReferences not implemented") -} func (UnimplementedDataServer) CreateTemplateSpace(context.Context, *CreateTemplateSpaceReq) (*CreateResp, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateTemplateSpace not implemented") } @@ -1246,38 +1060,38 @@ func _Data_GetAppByName_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } -func _Data_ListAppsRest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListAppsRestReq) +func _Data_ListApps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAppsReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(DataServer).ListAppsRest(ctx, in) + return srv.(DataServer).ListApps(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Data_ListAppsRest_FullMethodName, + FullMethod: Data_ListApps_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).ListAppsRest(ctx, req.(*ListAppsRestReq)) + return srv.(DataServer).ListApps(ctx, req.(*ListAppsReq)) } return interceptor(ctx, in, info, handler) } -func _Data_ListAppsByIDs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListAppsByIDsReq) +func _Data_ListAppsRest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAppsRestReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(DataServer).ListAppsByIDs(ctx, in) + return srv.(DataServer).ListAppsRest(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Data_ListAppsByIDs_FullMethodName, + FullMethod: Data_ListAppsRest_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).ListAppsByIDs(ctx, req.(*ListAppsByIDsReq)) + return srv.(DataServer).ListAppsRest(ctx, req.(*ListAppsRestReq)) } return interceptor(ctx, in, info, handler) } @@ -1408,60 +1222,6 @@ func _Data_ListConfigItemCount_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _Data_CreateConfigHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateConfigHookReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DataServer).CreateConfigHook(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Data_CreateConfigHook_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).CreateConfigHook(ctx, req.(*CreateConfigHookReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Data_UpdateConfigHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateConfigHookReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DataServer).UpdateConfigHook(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Data_UpdateConfigHook_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).UpdateConfigHook(ctx, req.(*UpdateConfigHookReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Data_GetConfigHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetConfigHookReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DataServer).GetConfigHook(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Data_GetConfigHook_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).GetConfigHook(ctx, req.(*GetConfigHookReq)) - } - return interceptor(ctx, in, info, handler) -} - func _Data_CreateContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateContentReq) if err := dec(in); err != nil { @@ -1678,200 +1438,38 @@ func _Data_ListHooks_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } -func _Data_DeleteHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteHookReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DataServer).DeleteHook(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Data_DeleteHook_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).DeleteHook(ctx, req.(*DeleteHookReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Data_ListHookTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListHookTagReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DataServer).ListHookTags(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Data_ListHookTags_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).ListHookTags(ctx, req.(*ListHookTagReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Data_GetHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetHookReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DataServer).GetHook(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Data_GetHook_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).GetHook(ctx, req.(*GetHookReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Data_CreateHookRelease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateHookReleaseReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DataServer).CreateHookRelease(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Data_CreateHookRelease_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).CreateHookRelease(ctx, req.(*CreateHookReleaseReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Data_ListHookReleases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListHookReleasesReq) +func _Data_UpdateHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateHookReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(DataServer).ListHookReleases(ctx, in) + return srv.(DataServer).UpdateHook(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Data_ListHookReleases_FullMethodName, + FullMethod: Data_UpdateHook_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).ListHookReleases(ctx, req.(*ListHookReleasesReq)) + return srv.(DataServer).UpdateHook(ctx, req.(*UpdateHookReq)) } return interceptor(ctx, in, info, handler) } -func _Data_GetHookReleaseByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetHookReleaseByIdReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DataServer).GetHookReleaseByID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Data_GetHookReleaseByID_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).GetHookReleaseByID(ctx, req.(*GetHookReleaseByIdReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Data_DeleteHookRelease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteHookReleaseReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DataServer).DeleteHookRelease(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Data_DeleteHookRelease_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).DeleteHookRelease(ctx, req.(*DeleteHookReleaseReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Data_PublishHookRelease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PublishHookReleaseReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DataServer).PublishHookRelease(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Data_PublishHookRelease_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).PublishHookRelease(ctx, req.(*PublishHookReleaseReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Data_GetHookReleaseByPubState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetByPubStateReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DataServer).GetHookReleaseByPubState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Data_GetHookReleaseByPubState_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).GetHookReleaseByPubState(ctx, req.(*GetByPubStateReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Data_UpdateHookRelease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateHookReleaseReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DataServer).UpdateHookRelease(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Data_UpdateHookRelease_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).UpdateHookRelease(ctx, req.(*UpdateHookReleaseReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Data_ListHookReleasesReferences_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListHookReleasesReferencesReq) +func _Data_DeleteHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteHookReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(DataServer).ListHookReleasesReferences(ctx, in) + return srv.(DataServer).DeleteHook(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Data_ListHookReleasesReferences_FullMethodName, + FullMethod: Data_DeleteHook_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).ListHookReleasesReferences(ctx, req.(*ListHookReleasesReferencesReq)) + return srv.(DataServer).DeleteHook(ctx, req.(*DeleteHookReq)) } return interceptor(ctx, in, info, handler) } @@ -2412,12 +2010,12 @@ var Data_ServiceDesc = grpc.ServiceDesc{ Handler: _Data_GetAppByName_Handler, }, { - MethodName: "ListAppsRest", - Handler: _Data_ListAppsRest_Handler, + MethodName: "ListApps", + Handler: _Data_ListApps_Handler, }, { - MethodName: "ListAppsByIDs", - Handler: _Data_ListAppsByIDs_Handler, + MethodName: "ListAppsRest", + Handler: _Data_ListAppsRest_Handler, }, { MethodName: "CreateConfigItem", @@ -2447,18 +2045,6 @@ var Data_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListConfigItemCount", Handler: _Data_ListConfigItemCount_Handler, }, - { - MethodName: "CreateConfigHook", - Handler: _Data_CreateConfigHook_Handler, - }, - { - MethodName: "UpdateConfigHook", - Handler: _Data_UpdateConfigHook_Handler, - }, - { - MethodName: "GetConfigHook", - Handler: _Data_GetConfigHook_Handler, - }, { MethodName: "CreateContent", Handler: _Data_CreateContent_Handler, @@ -2508,48 +2094,12 @@ var Data_ServiceDesc = grpc.ServiceDesc{ Handler: _Data_ListHooks_Handler, }, { - MethodName: "DeleteHook", - Handler: _Data_DeleteHook_Handler, - }, - { - MethodName: "ListHookTags", - Handler: _Data_ListHookTags_Handler, - }, - { - MethodName: "GetHook", - Handler: _Data_GetHook_Handler, - }, - { - MethodName: "CreateHookRelease", - Handler: _Data_CreateHookRelease_Handler, + MethodName: "UpdateHook", + Handler: _Data_UpdateHook_Handler, }, { - MethodName: "ListHookReleases", - Handler: _Data_ListHookReleases_Handler, - }, - { - MethodName: "GetHookReleaseByID", - Handler: _Data_GetHookReleaseByID_Handler, - }, - { - MethodName: "DeleteHookRelease", - Handler: _Data_DeleteHookRelease_Handler, - }, - { - MethodName: "PublishHookRelease", - Handler: _Data_PublishHookRelease_Handler, - }, - { - MethodName: "GetHookReleaseByPubState", - Handler: _Data_GetHookReleaseByPubState_Handler, - }, - { - MethodName: "UpdateHookRelease", - Handler: _Data_UpdateHookRelease_Handler, - }, - { - MethodName: "ListHookReleasesReferences", - Handler: _Data_ListHookReleasesReferences_Handler, + MethodName: "DeleteHook", + Handler: _Data_DeleteHook_Handler, }, { MethodName: "CreateTemplateSpace", diff --git a/bcs-services/bcs-bscp/pkg/rest/response.go b/bcs-services/bcs-bscp/pkg/rest/response.go index ec5c847d8a..d6f74a08ea 100644 --- a/bcs-services/bcs-bscp/pkg/rest/response.go +++ b/bcs-services/bcs-bscp/pkg/rest/response.go @@ -160,8 +160,8 @@ type ErrorResponse struct { Err error `json:"-"` // low-level runtime error HTTPStatusCode int `json:"-"` // http response status code Error *ErrorPayload `json:"error"` - loginURL string - loginPlainURL string + loginURL string `json:"-"` // login plain url + loginPlainURL string `json:"-"` // login url } // Render go-chi/render Renderer interface implement diff --git a/bcs-services/bcs-bscp/pkg/runtime/brpc/pool.go b/bcs-services/bcs-bscp/pkg/runtime/brpc/pool.go index 8ec9a29d60..0a7f31b893 100644 --- a/bcs-services/bcs-bscp/pkg/runtime/brpc/pool.go +++ b/bcs-services/bcs-bscp/pkg/runtime/brpc/pool.go @@ -73,7 +73,7 @@ func (p *pool) Pick() interface{} { if p.curIndex == p.maxIndex { p.curIndex = 0 } else { - p.curIndex++ + p.curIndex += 1 } return picked @@ -114,7 +114,7 @@ func newOneClient(opt PoolOption) (interface{}, error) { return nil, fmt.Errorf("dial service %s failed, err: %v", opt.ServiceName, err) } - // Note: add ping test and wait for service ready. + // TODO: add ping test and wait for service ready. return opt.NewClient(conn), nil } diff --git a/bcs-services/bcs-bscp/pkg/runtime/ctl/cmd/write.go b/bcs-services/bcs-bscp/pkg/runtime/ctl/cmd/write.go index 63b476bd83..d37c227d7d 100644 --- a/bcs-services/bcs-bscp/pkg/runtime/ctl/cmd/write.go +++ b/bcs-services/bcs-bscp/pkg/runtime/ctl/cmd/write.go @@ -79,7 +79,7 @@ func WithDisableWriteAuthAccess(opt *options.DisableWriteOption) Cmd { if len(bizIDElement) == 1 { bizID, err := strconv.ParseUint(bizIDElement, 10, 64) if err != nil { - logs.Errorf("parse biz id %s failed, err: %v, rid: %s", bizIDElement, err, kt.Rid) + logs.Errorf("parse biz id %s failed, err: %v, rid: %s", bizIDElement[0], err, kt.Rid) return nil, err } diff --git a/bcs-services/bcs-bscp/pkg/runtime/filter/warehouse.go b/bcs-services/bcs-bscp/pkg/runtime/filter/warehouse.go index 2583c92d8b..190c898edc 100644 --- a/bcs-services/bcs-bscp/pkg/runtime/filter/warehouse.go +++ b/bcs-services/bcs-bscp/pkg/runtime/filter/warehouse.go @@ -419,7 +419,6 @@ func ruleType(rules gjson.Result) (RuleType, error) { return AtomType, nil } -// SqlJoint .. func SqlJoint(sql []string) string { buff := bytes.NewBuffer([]byte{}) for _, value := range sql { diff --git a/bcs-services/bcs-bscp/pkg/runtime/lock/lock.go b/bcs-services/bcs-bscp/pkg/runtime/lock/lock.go index 4d27a9f11e..dded51358b 100644 --- a/bcs-services/bcs-bscp/pkg/runtime/lock/lock.go +++ b/bcs-services/bcs-bscp/pkg/runtime/lock/lock.go @@ -64,7 +64,7 @@ func New(opt Option) Interface { } // resLock is used to manage the lock of different kind of resources. -// Note: add capacity limit, limit the max number of the resource's +// TODO: add capacity limit, limit the max number of the resource's // kind, if overhead of the max limit, then return with an error. type resLock struct { lo sync.Mutex diff --git a/bcs-services/bcs-bscp/pkg/thirdparty/repo/client.go b/bcs-services/bcs-bscp/pkg/thirdparty/repo/client.go index abc99b001f..ecfda98a72 100644 --- a/bcs-services/bcs-bscp/pkg/thirdparty/repo/client.go +++ b/bcs-services/bcs-bscp/pkg/thirdparty/repo/client.go @@ -384,6 +384,32 @@ func NewClientS3(repoSetting *cc.Repository, reg prometheus.Registerer) (*Client }, nil } +// CreateRepo create new repository in s3. +func (c *ClientS3) CreateRepo(ctx context.Context, s3 *CreateRepoReq) error { + found, _ := c.Client.BucketExists(context.Background(), s3.Name) + + if found { + return nil + } + if err := c.Client.MakeBucket(ctx, s3.Name, minio.MakeBucketOptions{}); err != nil { + return err + } + for !found { + found, _ = c.Client.BucketExists(context.Background(), s3.Name) + } + return nil +} + +// DeleteRepo delete repository in repo. param force: whether to force deletion. +// If false, the warehouse cannot be deleted when there are files in the warehouse +func (c *ClientS3) DeleteRepo(ctx context.Context, bizID uint32, forced bool) error { + err := c.Client.RemoveBucket(ctx, c.Config.S3.BucketName) + if err != nil { + return err + } + return nil +} + // IsNodeExist judge repo node already exist. func (c *ClientS3) IsNodeExist(ctx context.Context, bucketName, nodePath string) (bool, error) { _, err := c.Client.StatObject(ctx, bucketName, nodePath, minio.StatObjectOptions{}) diff --git a/bcs-services/bcs-bscp/pkg/thirdparty/repo/types.go b/bcs-services/bcs-bscp/pkg/thirdparty/repo/types.go index 4aceb99884..f43360c92a 100644 --- a/bcs-services/bcs-bscp/pkg/thirdparty/repo/types.go +++ b/bcs-services/bcs-bscp/pkg/thirdparty/repo/types.go @@ -133,20 +133,6 @@ type UploadFileReq struct { Content string `json:"content"` } -// UploadResp upload response -// Docs https://github.com/TencentBlueKing/bk-repo/blob/master/docs/apidoc/generic/simple.md -type UploadResp struct { - Code int `json:"code"` - Message string `json:"message"` - Data *UploadData `json:"data"` -} - -// UploadResp upload data -type UploadData struct { - Size int64 `json:"size"` // bkrepo always return 0 - Sha256 string `json:"sha256"` -} - // DownloadFileReq is repo download file request struct type DownloadFileReq struct { // BizID is business ID @@ -246,19 +232,19 @@ type NodeOption struct { // normal path format: /generic/{project}/bscp-{version}-{biz_id}/file/{file sha256} func GenNodePath(opt *NodeOption) (string, error) { if opt == nil { - return "", errors.New("option is nil") + return "", errf.New(errf.InvalidParameter, "option is nil") } if len(opt.Project) == 0 { - return "", errors.New("project should > 0") + return "", errf.New(errf.InvalidParameter, "project should > 0") } if opt.BizID == 0 { - return "", errors.New("biz_id should > 0") + return "", errf.New(errf.InvalidParameter, "biz_id should > 0") } if len(opt.Sign) != 64 { - return "", errors.New("file sha256 is not standard format") + return "", errf.New(errf.InvalidParameter, "file sha256 is not standard format") } repoName, err := GenRepoName(opt.BizID) @@ -392,27 +378,19 @@ func (de *Decorator) RelativePath(sign string) string { return nodeFrontPath + sign } -// Url .. func (de *Decorator) Url() string { return "" } - -// AccessKeyID .. func (de *Decorator) AccessKeyID() string { return "" } - -// SecretAccessKey .. func (de *Decorator) SecretAccessKey() string { return "" } - -// GetRepositoryType .. func (de *Decorator) GetRepositoryType() cc.StorageMode { return cc.BkRepo } -// DecoratorInter .. type DecoratorInter interface { Root() string RepoName() string @@ -424,7 +402,6 @@ type DecoratorInter interface { GetRepositoryType() cc.StorageMode } -// RepositoryTypeInter .. type RepositoryTypeInter interface { //IsProjectExist(ctx context.Context) error CreateRepo(ctx context.Context, req *CreateRepoReq) error @@ -434,20 +411,21 @@ type RepositoryTypeInter interface { QueryMetadata(ctx context.Context, opt *NodeOption) (map[string]string, error) } -// GenS3NodeFullPath .. -func GenS3NodeFullPath(bizID uint32, sign string) (string, error) { +func GenS3NodeFullPath(path, sign string) (string, error) { + + if len(path) == 0 { + return "", errf.New(errf.InvalidParameter, "path is required") + } if len(sign) == 0 { - return "", errors.New("sign is required") + return "", errf.New(errf.InvalidParameter, "sign is required") } if len(sign) != 64 { - return "", errors.New("file sha256 is not standard format") + return "", errf.New(errf.InvalidParameter, "file sha256 is not standard format") } - repoName := fmt.Sprintf("bscp-%s-biz-%d", version, bizID) - return fmt.Sprintf("/%s%s%s", repoName, nodeFrontPath, sign), nil + return fmt.Sprintf("/%s%s%s", path, nodeFrontPath, sign), nil } -// UriDecoratorInter .. type UriDecoratorInter interface { Init(bizID uint32) DecoratorInter } @@ -486,17 +464,12 @@ type DecoratorS3 struct { secretAccessKey string } -// Url .. func (de *DecoratorS3) Url() string { return de.url } - -// AccessKeyID .. func (de *DecoratorS3) AccessKeyID() string { return de.accessKeyID } - -// SecretAccessKey .. func (de *DecoratorS3) SecretAccessKey() string { return de.secretAccessKey } @@ -521,7 +494,6 @@ func (de *DecoratorS3) RelativePath(sign string) string { return nodeFrontPath + sign } -// GetRepositoryType .. func (de *DecoratorS3) GetRepositoryType() cc.StorageMode { return cc.S3 } diff --git a/bcs-services/bcs-bscp/pkg/tools/http.go b/bcs-services/bcs-bscp/pkg/tools/http.go deleted file mode 100644 index 99a6eb3ea7..0000000000 --- a/bcs-services/bcs-bscp/pkg/tools/http.go +++ /dev/null @@ -1,122 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 tools - -import ( - "fmt" - "net/http" - "net/url" - "time" - - "github.com/dustin/go-humanize" - "k8s.io/klog/v2" - - "bscp.io/pkg/criteria/constant" -) - -var ( - // maskKeys 敏感参数和头部key - maskKeys = map[string]struct{}{ - "bk_app_secret": {}, - "bk_token": {}, - "Authorization": {}, - } -) - -// RequestIDValue 获取 RequestId 值 -func RequestIDValue(req *http.Request) string { - for _, k := range constant.RidKeys { - v := req.Header.Get(k) - if v != "" { - return v - } - } - return "" -} - -// reqToCurl curl 格式的请求日志 -func reqToCurl(r *http.Request) string { - headers := "" - for key, values := range r.Header { - for _, value := range values { - if _, ok := maskKeys[key]; ok { - value = "" - } - headers += fmt.Sprintf(" -H %q", fmt.Sprintf("%s: %s", key, value)) - } - } - - // 过滤掉敏感信息 - rawURL := *r.URL - queryValue := rawURL.Query() - for key := range queryValue { - if _, ok := maskKeys[key]; ok { - queryValue.Set(key, "") - } - } - rawURL.RawQuery = queryValue.Encode() - - reqMsg := fmt.Sprintf("curl -X %s '%s'%s", r.Method, rawURL.String(), headers) - if r.Body != nil { - reqMsg += " -d (io.Reader)" - } - - if r.Form.Encode() != "" { - encodeStr := r.Form.Encode() - reqMsg += fmt.Sprintf(" -d %q", encodeStr) - rawStr, _ := url.QueryUnescape(encodeStr) - reqMsg += fmt.Sprintf(" -raw `%s`", rawStr) - } - - return reqMsg -} - -// respToCurl 返回日志 -func respToCurl(resp *http.Response, st time.Time) string { - respMsg := fmt.Sprintf("[%s] size=%s waiting=%s", resp.Status, humanize.Bytes(uint64(resp.ContentLength)), time.Since(st)) - return respMsg -} - -// curlLogTransport print curl log transport -type curlLogTransport struct { - Transport http.RoundTripper -} - -// RoundTrip curlLog Transport -func (t *curlLogTransport) RoundTrip(req *http.Request) (*http.Response, error) { - st := time.Now() - rid := RequestIDValue(req) - klog.Infof("[%s] REQ: %s", rid, reqToCurl(req)) - - resp, err := t.transport(req).RoundTrip(req) - - if err != nil { - klog.Infof("[%s] RESP: [err] %s", rid, err) - } else { - klog.Infof("[%s] RESP: %s", rid, respToCurl(resp, st)) - } - - return resp, err -} - -func (t *curlLogTransport) transport(req *http.Request) http.RoundTripper { - if t.Transport != nil { - return t.Transport - } - return http.DefaultTransport -} - -// NewCurlLogTransport make a new curl log transport, default transport can be nil -func NewCurlLogTransport(transport http.RoundTripper) http.RoundTripper { - return &curlLogTransport{Transport: transport} -} diff --git a/bcs-services/bcs-bscp/pkg/tools/sha.go b/bcs-services/bcs-bscp/pkg/tools/sha.go index bd780cbdee..f93f193f44 100644 --- a/bcs-services/bcs-bscp/pkg/tools/sha.go +++ b/bcs-services/bcs-bscp/pkg/tools/sha.go @@ -28,13 +28,6 @@ func SHA256(data string) string { return fmt.Sprintf("%x", hash.Sum(nil)) } -// ByteSHA256 returns a sha256 string of the data byte. -func ByteSHA256(data []byte) string { - hash := sha256.New() - hash.Write(data) - return fmt.Sprintf("%x", hash.Sum(nil)) -} - // FileSHA256 returns sha256 string of the file. func FileSHA256(file string) (string, error) { f, err := os.Open(file) diff --git a/bcs-services/bcs-bscp/pkg/types/app.go b/bcs-services/bcs-bscp/pkg/types/app.go new file mode 100644 index 0000000000..6b120159fd --- /dev/null +++ b/bcs-services/bcs-bscp/pkg/types/app.go @@ -0,0 +1,63 @@ +/* +Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. +Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except +in compliance with the License. You may obtain a copy of the License at +http://opensource.org/licenses/MIT +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 types + +import ( + "bscp.io/pkg/criteria/errf" + "bscp.io/pkg/dal/table" + "bscp.io/pkg/runtime/filter" +) + +// ListAppsOption defines options to list apps. +type ListAppsOption struct { + BizList []int `json:"-"` // 跨 spaces 查询需要 + BizID uint32 `json:"biz_id"` + Filter *filter.Expression `json:"filter"` + Page *BasePage `json:"page"` +} + +// Validate the list app options +func (lao *ListAppsOption) Validate(po *PageOption) error { + if lao.BizID <= 0 { + return errf.New(errf.InvalidParameter, "invalid biz id, should >= 1") + } + + if lao.Filter == nil { + return errf.New(errf.InvalidParameter, "filter is nil") + } + + exprOpt := &filter.ExprOption{ + // remove biz_id because it's a required field in the option. + RuleFields: table.AppColumns.WithoutColumn("biz_id"), + } + if err := lao.Filter.Validate(exprOpt); err != nil { + return err + } + + if lao.Page == nil { + return errf.New(errf.InvalidParameter, "page is null") + } + + if err := lao.Page.Validate(po); err != nil { + return err + } + + return nil +} + +// ListAppDetails defines the response details of +// requested ListAppsOption +type ListAppDetails struct { + Count uint32 `json:"count"` + Details []*table.App `json:"details"` +} diff --git a/bcs-services/bcs-bscp/pkg/types/credential.go b/bcs-services/bcs-bscp/pkg/types/credential.go new file mode 100644 index 0000000000..593f872dff --- /dev/null +++ b/bcs-services/bcs-bscp/pkg/types/credential.go @@ -0,0 +1,42 @@ +package types + +import ( + "bscp.io/pkg/criteria/errf" + "bscp.io/pkg/dal/table" + "bscp.io/pkg/runtime/filter" +) + +// ListCredentialsOption credential option +type ListCredentialsOption struct { + BizID uint32 `json:"biz_id"` + Filter *filter.Expression `json:"filter"` + Page *BasePage `json:"page"` +} + +// Validate the list group options +func (opt *ListCredentialsOption) Validate(po *PageOption) error { + if opt.BizID <= 0 { + return errf.New(errf.InvalidParameter, "invalid biz id, should >= 1") + } + + if opt.Page == nil { + return errf.New(errf.InvalidParameter, "page is null") + } + exprOpt := &filter.ExprOption{ + RuleFields: table.CredentialColumns.WithoutColumn("biz_id"), + } + if err := opt.Filter.Validate(exprOpt); err != nil { + return err + } + if err := opt.Page.Validate(po); err != nil { + return err + } + + return nil +} + +// ListCredentialDetails return credential details +type ListCredentialDetails struct { + Count uint32 `json:"count"` + Details []*table.Credential `json:"details"` +} diff --git a/bcs-services/bcs-bscp/pkg/types/credential_scope.go b/bcs-services/bcs-bscp/pkg/types/credential_scope.go new file mode 100644 index 0000000000..89901b1f03 --- /dev/null +++ b/bcs-services/bcs-bscp/pkg/types/credential_scope.go @@ -0,0 +1,17 @@ +package types + +import ( + "bscp.io/pkg/dal/table" +) + +// ListCredentialScopeDetails list credential scope details +type ListCredentialScopeDetails struct { + Count uint32 `json:"count"` + Details []*table.CredentialScope `json:"details"` +} + +// ListCredentialScopesOption credential scopes option +type ListCredentialScopesOption struct { + BizID uint32 `json:"biz_id"` + CredentialId uint32 `json:"credential_id"` +} diff --git a/bcs-services/bcs-bscp/pkg/types/event.go b/bcs-services/bcs-bscp/pkg/types/event.go index 33893f71cd..5d4afdb1f1 100644 --- a/bcs-services/bcs-bscp/pkg/types/event.go +++ b/bcs-services/bcs-bscp/pkg/types/event.go @@ -15,7 +15,9 @@ package types import ( "errors" + "bscp.io/pkg/criteria/errf" "bscp.io/pkg/dal/table" + "bscp.io/pkg/runtime/filter" ) // Event defines a event's details info. @@ -53,3 +55,41 @@ func (e Event) Validate() error { return nil } + +// ListEventsOption defines options to list event. +type ListEventsOption struct { + Filter *filter.Expression `json:"filter"` + Page *BasePage `json:"page"` +} + +// Validate the list event options +func (lao *ListEventsOption) Validate(po *PageOption) error { + + if lao.Filter == nil { + return errf.New(errf.InvalidParameter, "filter is nil") + } + + exprOpt := &filter.ExprOption{ + // remove biz_id because it's a required field in the option. + RuleFields: table.EventColumns.WithoutColumn("biz_id"), + } + if err := lao.Filter.Validate(exprOpt); err != nil { + return err + } + + if lao.Page == nil { + return errf.New(errf.InvalidParameter, "page is null") + } + + if err := lao.Page.Validate(po); err != nil { + return err + } + + return nil +} + +// ListEventDetails defines the response details of requested ListEventsOption +type ListEventDetails struct { + Count uint32 `json:"count"` + Details []*table.Event `json:"details"` +} diff --git a/bcs-services/bcs-bscp/pkg/types/hook.go b/bcs-services/bcs-bscp/pkg/types/hook.go index 17fd228ff3..67d002fa12 100644 --- a/bcs-services/bcs-bscp/pkg/types/hook.go +++ b/bcs-services/bcs-bscp/pkg/types/hook.go @@ -13,29 +13,43 @@ limitations under the License. package types import ( - "errors" - + "bscp.io/pkg/criteria/errf" "bscp.io/pkg/dal/table" + "bscp.io/pkg/runtime/filter" ) // ListHooksOption defines options to list group. type ListHooksOption struct { - BizID uint32 `json:"biz_id"` - Name string `json:"name"` - Tag string `json:"tag"` - All bool `json:"all"` - NotTag bool `json:"not_tag"` - Page *BasePage `json:"page"` + BizID uint32 `json:"biz_id"` + AppID uint32 `json:"app_id"` + Filter *filter.Expression `json:"filter"` + Page *BasePage `json:"page"` } // Validate the list group options func (opt *ListHooksOption) Validate(po *PageOption) error { if opt.BizID <= 0 { - return errors.New("invalid biz id, should >= 1") + return errf.New(errf.InvalidParameter, "invalid biz id, should >= 1") + } + + if opt.AppID <= 0 { + return errf.New(errf.InvalidParameter, "invalid app id, should >= 1") + } + + if opt.Filter == nil { + return errf.New(errf.InvalidParameter, "filter is nil") + } + + exprOpt := &filter.ExprOption{ + // remove biz_id,app_id because it's a required field in the option. + RuleFields: table.HookColumns.WithoutColumn("biz_id", "app_id"), + } + if err := opt.Filter.Validate(exprOpt); err != nil { + return err } if opt.Page == nil { - return errors.New("page is null") + return errf.New(errf.InvalidParameter, "page is null") } if err := opt.Page.Validate(po); err != nil { @@ -50,9 +64,3 @@ type ListHookDetails struct { Count uint32 `json:"count"` Details []*table.Hook `json:"details"` } - -// HookTagCount defines the response details of requested CountHookTag. -type HookTagCount struct { - Tag string `db:"tag" json:"tag"` - Counts uint32 `db:"counts" json:"counts"` -} diff --git a/bcs-services/bcs-bscp/pkg/types/hook_release.go b/bcs-services/bcs-bscp/pkg/types/hook_release.go deleted file mode 100644 index 057df01a4b..0000000000 --- a/bcs-services/bcs-bscp/pkg/types/hook_release.go +++ /dev/null @@ -1,125 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 types - -import ( - "errors" - - "bscp.io/pkg/dal/table" -) - -// ListHookReleasesOption defines the response details of requested ListHookReleasesOption. -type ListHookReleasesOption struct { - BizID uint32 `json:"biz_id"` - HookID uint32 `json:"hook_id"` - Page *BasePage `json:"page"` - SearchKey string `json:"search_key"` - State table.HookReleaseStatus `json:"state"` -} - -// ListHookReleaseDetails defines the response details of requested ListHooksReleaseOption. -type ListHookReleaseDetails struct { - Count uint32 `json:"count"` - Details []*table.HookRelease `json:"details"` -} - -// Validate the list release options -func (opt *ListHookReleasesOption) Validate(po *PageOption) error { - if opt.BizID <= 0 { - return errors.New("invalid biz id, should >= 1") - } - - if opt.HookID <= 0 { - return errors.New("invalid hook id id, should >= 1") - } - - if opt.Page == nil { - return errors.New("page is null") - } - - if err := opt.Page.Validate(po); err != nil { - return err - } - - if opt.State.String() != "" { - if err := opt.State.Validate(); err != nil { - return err - } - } - - return nil -} - -// GetByPubStateOption defines options to get hr by State -type GetByPubStateOption struct { - BizID uint32 - HookID uint32 - State table.HookReleaseStatus -} - -// Validate the get ByPubState option -func (opt *GetByPubStateOption) Validate() error { - if opt.BizID <= 0 { - return errors.New("invalid biz id, should >= 1") - } - - if opt.HookID <= 0 { - return errors.New("invalid hook id id, should >= 1") - } - - if err := opt.State.Validate(); err != nil { - return err - } - - return nil -} - -// ListHookReleasesReferencesOption defines the response details of requested ListHookReleasesReferencesOption. -type ListHookReleasesReferencesOption struct { - BizID uint32 `json:"biz_id"` - HookID uint32 `json:"hook_id"` - HookReleasesID uint32 `json:"hook_releases_id"` - Page *BasePage `json:"page"` -} - -// ListHookReleasesReferences defines the response details of requested ListHookReleasesReferencesOption. -type ListHookReleasesReferences struct { - AppID uint32 `json:"app_id"` - ConfigReleaseName string `json:"config_release_name"` - ConfigReleaseID uint32 `json:"config_release_id"` - HookReleaseName string `json:"hook_release_name"` - HookReleaseID uint32 `json:"hook_release_id"` - AppName string `json:"app_name"` - PubSate string `json:"pub_sate"` -} - -// Validate the list release options -func (opt *ListHookReleasesReferencesOption) Validate(po *PageOption) error { - if opt.BizID <= 0 { - return errors.New("invalid biz id, should >= 1") - } - - if opt.HookID <= 0 { - return errors.New("invalid hook id id, should >= 1") - } - - if opt.Page == nil { - return errors.New("page is null") - } - - if err := opt.Page.Validate(po); err != nil { - return err - } - - return nil -} diff --git a/bcs-services/bcs-bscp/pkg/types/pull_resource.go b/bcs-services/bcs-bscp/pkg/types/pull_resource.go index 7819e72ce6..23ebbb1813 100644 --- a/bcs-services/bcs-bscp/pkg/types/pull_resource.go +++ b/bcs-services/bcs-bscp/pkg/types/pull_resource.go @@ -40,6 +40,14 @@ func (o *ListInstancesOption) Validate(po *PageOption) error { return errf.New(errf.InvalidParameter, "filter is required") } + exprOpt := &filter.ExprOption{ + // remove biz_id because it's a required field in the option. + RuleFields: table.AppColumns.WithoutColumn("biz_id"), + } + if err := o.Filter.Validate(exprOpt); err != nil { + return err + } + if o.Page == nil { return errf.New(errf.InvalidParameter, "page is required") } diff --git a/bcs-services/bcs-bscp/scripts/gen/main.go b/bcs-services/bcs-bscp/scripts/gen/main.go index 3cc3c27f8e..40f34fc61d 100644 --- a/bcs-services/bcs-bscp/scripts/gen/main.go +++ b/bcs-services/bcs-bscp/scripts/gen/main.go @@ -29,23 +29,7 @@ func main() { g.ApplyBasic( table.IDGenerator{}, table.Audit{}, - table.App{}, - table.ArchivedApp{}, - table.Event{}, - table.Credential{}, - table.CredentialScope{}, - table.Strategy{}, - table.Group{}, - table.ReleasedGroup{}, - table.GroupAppBind{}, - table.Release{}, - table.ReleasedConfigItem{}, table.TemplateSpace{}, - table.Hook{}, - table.HookRelease{}, - table.Release{}, - table.ConfigHook{}, - table.App{}, table.Template{}, table.TemplateRelease{}, ) diff --git a/bcs-services/bcs-bscp/test/benchmark/case/api-server/repo.go b/bcs-services/bcs-bscp/test/benchmark/case/api-server/repo.go deleted file mode 100644 index 63a6ffcedb..0000000000 --- a/bcs-services/bcs-bscp/test/benchmark/case/api-server/repo.go +++ /dev/null @@ -1,125 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 main - -import ( - "bytes" - "context" - "crypto/sha256" - "fmt" - "io" - "net/http" - "os" - "sync" - "time" - - "k8s.io/klog/v2" - - "bscp.io/pkg/tools" -) - -// dd if=/dev/urandom of=/tmp/100Mib.bin bs=1M count=100 -func upload(ctx context.Context, host string, bizID, appID string, fileContentID string, body io.Reader) (*http.Response, error) { - u := fmt.Sprintf("http://%s/api/v1/api/create/content/upload/biz_id/%s/app_id/%s", host, bizID, appID) - req, err := http.NewRequestWithContext(ctx, "PUT", u, body) - if err != nil { - return nil, err - } - - req.Header.Set("X-Bkapi-File-Content-Id", fileContentID) - resp, err := http.DefaultClient.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - if resp.StatusCode != 200 { - body, err := io.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("%d != 200", resp.StatusCode) - } - return nil, fmt.Errorf("%d != 200, body: %s", resp.StatusCode, body) - } - return resp, nil -} - -func download(ctx context.Context, host string, bizID, appID string, fileContentID string, body io.Reader) (*http.Response, error) { - u := fmt.Sprintf("http://%s/api/v1/api/get/content/download/biz_id/%s/app_id/%s", host, bizID, appID) - req, err := http.NewRequestWithContext(ctx, "GET", u, nil) - if err != nil { - return nil, err - } - - req.Header.Set("X-Bkapi-File-Content-Id", fileContentID) - resp, err := http.DefaultClient.Do(req) - if err != nil { - return nil, err - } - - if resp.StatusCode != 200 { - body, err := io.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("%d != 200", resp.StatusCode) - } - return nil, fmt.Errorf("%d != 200, body: %s", resp.StatusCode, body) - } - return resp, nil -} - -func main() { - filename := os.Getenv("filename") - if filename == "" { - filename = "/tmp/100Mib.bin" - } - host := os.Getenv("host") - if host == "" { - host = "localhost:8080" - } - bizID := os.Getenv("biz_id") - appID := os.Getenv("app_id") - - wg := &sync.WaitGroup{} - - d, err := os.ReadFile(filename) - if err != nil { - panic(err) - } - fileContentID := tools.ByteSHA256(d) - klog.InfoS("file", "id", fileContentID) - - c := 1 - for i := 0; i < c; i++ { - wg.Add(1) - go func(idx int) { - defer wg.Done() - for { - st := time.Now() - resp, err := upload(context.Background(), host, bizID, appID, fileContentID, bytes.NewReader(d)) - // resp, err := download(context.Background(), host, bizID, appID, fileContentID, bytes.NewReader(d)) - if err != nil { - klog.ErrorS(err, "idx", idx, "resp", resp) - continue - } - - hasher := sha256.New() - io.Copy(hasher, resp.Body) - klog.InfoS("resp", "idx", idx, "duration", time.Since(st), "id", fmt.Sprintf("%x", hasher.Sum(nil))) - resp.Body.Close() - - time.Sleep(time.Millisecond * 100) - } - - }(i) - } - wg.Wait() -} diff --git a/bcs-services/bcs-bscp/test/benchmark/case/api-server/repo_test.go b/bcs-services/bcs-bscp/test/benchmark/case/api-server/repo_test.go deleted file mode 100644 index 663ee8ab46..0000000000 --- a/bcs-services/bcs-bscp/test/benchmark/case/api-server/repo_test.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 main - -import ( - "context" - "os" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestUpload(t *testing.T) { - filename := os.Getenv("filename") - host := os.Getenv("host") - if host == "" { - host = "localhost:8080" - } - bizID := os.Getenv("biz_id") - appID := os.Getenv("app_id") - - resp, err := upload(context.Background(), filename, host, bizID, appID, nil) - assert.NoError(t, err) - assert.NotNil(t, resp) -} - -func TestDownload(t *testing.T) { - -} diff --git a/bcs-services/bcs-bscp/test/benchmark/case/cache-service/cs_test.go b/bcs-services/bcs-bscp/test/benchmark/case/cache-service/cs_test.go index 433b2a1ffb..015ad49f56 100644 --- a/bcs-services/bcs-bscp/test/benchmark/case/cache-service/cs_test.go +++ b/bcs-services/bcs-bscp/test/benchmark/case/cache-service/cs_test.go @@ -65,7 +65,7 @@ func (p *pool) Pick() pbcs.CacheClient { return p.conn[p.idx] } - p.idx++ + p.idx += 1 return p.conn[p.idx] } @@ -107,14 +107,14 @@ func init() { // TestReport perform routine stress tests and generate stress test reports. func TestReport(t *testing.T) { TestBenchAppMeta(t) - // NOTE: strategy related test depends on group, add group test first + // TODO: strategy related test depends on group, add group test first //TestBenchAppCPS(t) TestBenchAppCRIMeta(t) TestBenchReleasedCI(t) TestGetAppMeta(t) TestGetReleasedCI(t) TestGetAppInstanceRelease(t) - // NOTE: strategy related test depends on group, add group test first + // TODO: strategy related test depends on group, add group test first //TestGetAppReleasedStrategy(t) if err := run.GenReport(outputPath); err != nil { diff --git a/bcs-services/bcs-bscp/test/benchmark/case/feed-server/fs_http_test.go b/bcs-services/bcs-bscp/test/benchmark/case/feed-server/fs_http_test.go index 2ed5c4d556..fb7964d17f 100644 --- a/bcs-services/bcs-bscp/test/benchmark/case/feed-server/fs_http_test.go +++ b/bcs-services/bcs-bscp/test/benchmark/case/feed-server/fs_http_test.go @@ -121,7 +121,7 @@ func init() { // TestReport bench scene 1-10. func TestReport(t *testing.T) { TestScene3(t) - // Note: strategy related test depends on group, add group test first + //TODO: strategy related test depends on group, add group test first //TestScene12(t) if err := run.GenReport(outputPath); err != nil { diff --git a/bcs-services/bcs-bscp/test/benchmark/run/stats.go b/bcs-services/bcs-bscp/test/benchmark/run/stats.go index 16751f6811..a45834a322 100644 --- a/bcs-services/bcs-bscp/test/benchmark/run/stats.go +++ b/bcs-services/bcs-bscp/test/benchmark/run/stats.go @@ -54,17 +54,17 @@ func (s *Statistic) CollectStatus(status *Status) { // IncreaseRequest total request. func (s *Statistic) IncreaseRequest() { - s.TotalRequest++ + s.TotalRequest += 1 } // IncreaseSuccess success request. func (s *Statistic) IncreaseSuccess() { - s.TotalSucceed++ + s.TotalSucceed += 1 } // IncreaseFailed failed request. func (s *Statistic) IncreaseFailed() { - s.TotalFailed++ + s.TotalFailed += 1 } // UpdateCostDuration only update success request data diff --git a/bcs-services/bcs-bscp/test/benchmark/tools/gen-data/base_data.go b/bcs-services/bcs-bscp/test/benchmark/tools/gen-data/base_data.go index 3dc5bab90d..4bd11c900b 100644 --- a/bcs-services/bcs-bscp/test/benchmark/tools/gen-data/base_data.go +++ b/bcs-services/bcs-bscp/test/benchmark/tools/gen-data/base_data.go @@ -98,7 +98,7 @@ func genAppData(bizID uint32) error { return fmt.Errorf("create release err, %v, rid: %s", err, rid) } - // NOTE: strategy related test depends on group, add group test first + // TODO: strategy related test depends on group, add group test first //// create strategy set. //setReq := &pbcs.CreateStrategySetReq{ // BizId: bizID, diff --git a/bcs-services/bcs-bscp/test/benchmark/tools/gen-data/main.go b/bcs-services/bcs-bscp/test/benchmark/tools/gen-data/main.go index 9cc8288292..f511aa0a5e 100644 --- a/bcs-services/bcs-bscp/test/benchmark/tools/gen-data/main.go +++ b/bcs-services/bcs-bscp/test/benchmark/tools/gen-data/main.go @@ -81,7 +81,7 @@ func main() { return } - // NOTE: strategy related test depends on group, add group test first + // TODO: strategy related test depends on group, add group test first //if err := genSceneData2(); err != nil { // log.Println(err) // return diff --git a/bcs-services/bcs-bscp/test/benchmark/tools/gen-data/scene_data_1.go b/bcs-services/bcs-bscp/test/benchmark/tools/gen-data/scene_data_1.go index ed14c399a8..8937ebe723 100644 --- a/bcs-services/bcs-bscp/test/benchmark/tools/gen-data/scene_data_1.go +++ b/bcs-services/bcs-bscp/test/benchmark/tools/gen-data/scene_data_1.go @@ -57,7 +57,7 @@ func genSceneData1() error { return fmt.Errorf("create release err, %v, rid: %s", err, rid) } - // NOTE: strategy related test depends on group, add group test first + // TODO: strategy related test depends on group, add group test first //// create strategy set. //setReq := &pbcs.CreateStrategySetReq{ // BizId: stressBizId, diff --git a/bcs-services/bcs-bscp/test/suite/cases/api/api_test.go b/bcs-services/bcs-bscp/test/suite/cases/api/api_test.go index 8a624332f1..60b3c923d3 100644 --- a/bcs-services/bcs-bscp/test/suite/cases/api/api_test.go +++ b/bcs-services/bcs-bscp/test/suite/cases/api/api_test.go @@ -42,7 +42,7 @@ func TestApi(t *testing.T) { TestCommit(t) TestRelease(t) TestStrategySet(t) - // NOTE: strategy related test depends on group, add group test first + // TODO: strategy related test depends on group, add group test first //TestStrategy(t) //TestPublish(t) TestInstance(t) diff --git a/bcs-services/bcs-bscp/test/suite/cases/api/commit_test.go b/bcs-services/bcs-bscp/test/suite/cases/api/commit_test.go index 951772a319..677c369cba 100644 --- a/bcs-services/bcs-bscp/test/suite/cases/api/commit_test.go +++ b/bcs-services/bcs-bscp/test/suite/cases/api/commit_test.go @@ -47,7 +47,6 @@ func TestCommit(t *testing.T) { // get content from db req, err := cases.GenListContentByIdsReq(cases.TBizID, appId, []uint32{ctId}) - So(err, ShouldBeNil) ctx, header := cases.GenApiCtxHeader() resp, err := cli.Content.List(ctx, header, req) So(err, ShouldBeNil) @@ -87,12 +86,9 @@ func TestCommit(t *testing.T) { So(resp.Id, ShouldNotEqual, uint32(0)) // verify by list_commit - var listReq *pbcs.ListCommitsReq - listReq, err = cases.GenListCommitByIdsReq(cases.TBizID, appId, []uint32{resp.Id}) - So(err, ShouldBeNil) + listReq, err := cases.GenListCommitByIdsReq(cases.TBizID, appId, []uint32{resp.Id}) ctx, header = cases.GenApiCtxHeader() - var listResp *pbcs.ListCommitsResp - listResp, err = cli.Commit.List(ctx, header, listReq) + listResp, err := cli.Commit.List(ctx, header, listReq) So(err, ShouldBeNil) So(listResp, ShouldNotBeNil) So(len(listResp.Details), ShouldEqual, 1) diff --git a/bcs-services/bcs-bscp/test/suite/cases/api/content_test.go b/bcs-services/bcs-bscp/test/suite/cases/api/content_test.go index 634374be18..a6dd98058f 100644 --- a/bcs-services/bcs-bscp/test/suite/cases/api/content_test.go +++ b/bcs-services/bcs-bscp/test/suite/cases/api/content_test.go @@ -79,12 +79,9 @@ func TestContent(t *testing.T) { // due to byte_size in response is string type, so it will cause unmarshal err, we skip it for a while // verify by list content - var listReq *pbcs.ListContentsReq - listReq, err = cases.GenListContentByIdsReq(cases.TBizID, appId, []uint32{resp.Id}) - So(err, ShouldBeNil) + listReq, err := cases.GenListContentByIdsReq(cases.TBizID, appId, []uint32{resp.Id}) ctx, header = cases.GenApiCtxHeader() - var listResp *pbcs.ListContentsResp - listResp, err = cli.Content.List(ctx, header, listReq) + listResp, err := cli.Content.List(ctx, header, listReq) So(err, ShouldBeNil) So(listResp, ShouldNotBeNil) So(len(listResp.Details), ShouldEqual, 1) diff --git a/bcs-services/bcs-bscp/test/suite/cases/cache/cache_test.go b/bcs-services/bcs-bscp/test/suite/cases/cache/cache_test.go index d7c93d9366..846019d678 100644 --- a/bcs-services/bcs-bscp/test/suite/cases/cache/cache_test.go +++ b/bcs-services/bcs-bscp/test/suite/cases/cache/cache_test.go @@ -47,7 +47,7 @@ func TestCache(t *testing.T) { nmApp pbapp.App nmConfigItem pbci.ConfigItem nmContent pbcontent.Content - // NOTE: strategy related test depends on group, add group test first + // TODO: strategy related test depends on group, add group test first //nmStrategy pbstrategy.Strategy // The following ids need to be assigned after generating resources. @@ -97,7 +97,7 @@ func TestCache(t *testing.T) { }, } - // NOTE: strategy related test depends on group, add group test first + // TODO: strategy related test depends on group, add group test first // normal mode strategy. //nmStrategy = pbstrategy.Strategy{ // Spec: &pbstrategy.StrategySpec{ @@ -222,7 +222,7 @@ func TestCache(t *testing.T) { So(nmStgSetResp, ShouldNotBeNil) So(nmStgSetResp.Id, ShouldNotEqual, uint32(0)) - // NOTE: strategy related test depends on group, add group test first + // TODO: strategy related test depends on group, add group test first //// create strategy in normal mode //nmStgReq := &pbconfig.CreateStrategyReq{ // BizId: cases.TBizID, diff --git a/bcs-services/bcs-bscp/test/suite/cases/feed/feed_test.go b/bcs-services/bcs-bscp/test/suite/cases/feed/feed_test.go index ff557e6475..68b76eb1ab 100644 --- a/bcs-services/bcs-bscp/test/suite/cases/feed/feed_test.go +++ b/bcs-services/bcs-bscp/test/suite/cases/feed/feed_test.go @@ -214,7 +214,7 @@ func TestFeed(t *testing.T) { So(nmStgSetResp, ShouldNotBeNil) So(nmStgSetResp.Id, ShouldNotEqual, uint32(0)) - // NOTE: strategy related test depends on group, add group test first + // TODO: strategy related test depends on group, add group test first //// create strategy //nmStgReq := &pbcs.CreateStrategyReq{ // BizId: cases.TBizID, @@ -407,7 +407,7 @@ func TestFeed(t *testing.T) { // normal test { reqs := []*types.ListFileAppLatestReleaseMetaReq{ - // NOTE: strategy related test depends on group, add group test first + // TODO: strategy related test depends on group, add group test first //{ // Publish with strategy, and hit main strategy // BizId: cases.TBizID, // AppId: nmApp.Id, @@ -541,7 +541,7 @@ func TestFeed(t *testing.T) { }) - // NOTE: strategy related test depends on group, add group test first + // TODO: strategy related test depends on group, add group test first //// 2. Namespace Mode App Base Request Test: in namespace mode app under, feed server handle test right and not //// right request params, return response data is expected. //Convey("2. Namespace Mode App Base Request Test", func() { diff --git a/bcs-services/bcs-bscp/test/suite/cases/feed/gen_data.go b/bcs-services/bcs-bscp/test/suite/cases/feed/gen_data.go index 5b1fb2a01d..24578e432b 100644 --- a/bcs-services/bcs-bscp/test/suite/cases/feed/gen_data.go +++ b/bcs-services/bcs-bscp/test/suite/cases/feed/gen_data.go @@ -101,7 +101,7 @@ func (g *Generator) GenBaseNormalData(ctx context.Context, header http.Header) e } } - // NOTE: strategy related test depends on group, add group test first + // TODO: strategy related test depends on group, add group test first //stgSetSpec := &table.StrategySetSpec{ // Name: cases.RandName("strategy_set"), //} @@ -161,7 +161,7 @@ func (g *Generator) GenBaseNamespaceData(ctx context.Context, header http.Header } } - // NOTE: strategy related test depends on group, add group test first + // TODO: strategy related test depends on group, add group test first //stgSetSpec := &table.StrategySetSpec{ // Name: cases.RandName("strategy_set"), //} diff --git a/bcs-services/bcs-bscp/test/suite/cases/resource_manager.go b/bcs-services/bcs-bscp/test/suite/cases/resource_manager.go index a2c7cdad06..ff3958532b 100644 --- a/bcs-services/bcs-bscp/test/suite/cases/resource_manager.go +++ b/bcs-services/bcs-bscp/test/suite/cases/resource_manager.go @@ -126,12 +126,11 @@ func (rm *ResourceManager) AddContent(configItemId, contentId uint32) { // GetContent get a created content id func (rm *ResourceManager) GetContent(configItemId uint32) uint32 { - value, ok := rm.Content[configItemId] - if ok { + if value, ok := rm.Content[configItemId]; !ok { + return 0 + } else { return value } - - return 0 } // AddCommit add a created commit id @@ -141,12 +140,11 @@ func (rm *ResourceManager) AddCommit(contentId, commitId uint32) { // GetCommit get a created commit id func (rm *ResourceManager) GetCommit(contentId uint32) uint32 { - value, ok := rm.Commit[contentId] - if ok { + if value, ok := rm.Commit[contentId]; !ok { + return 0 + } else { return value } - - return 0 } // AddRelease add a created release id @@ -156,12 +154,11 @@ func (rm *ResourceManager) AddRelease(appId, releaseId uint32) { // GetRelease get a created release id func (rm *ResourceManager) GetRelease(appId uint32) uint32 { - value, ok := rm.Release[appId] - if ok { + if value, ok := rm.Release[appId]; !ok { + return 0 + } else { return value } - - return 0 } // GetAppToRelease get an app id and release id, when app has release @@ -184,12 +181,11 @@ func (rm *ResourceManager) AddStrategySet(appId, stgSetId uint32) { // GetStrategySet get a created strategy set id func (rm *ResourceManager) GetStrategySet(appId uint32) uint32 { - value, ok := rm.StrategySet[appId] - if ok { + if value, ok := rm.StrategySet[appId]; !ok { + return 0 + } else { return value } - - return 0 } // GetAppToStrategySet get an app id and strategy set id, when app has strategy set diff --git a/bcs-services/bcs-bscp/test/suite/cases/sidecar/gen_data.go b/bcs-services/bcs-bscp/test/suite/cases/sidecar/gen_data.go index 32081752e4..7a447be030 100644 --- a/bcs-services/bcs-bscp/test/suite/cases/sidecar/gen_data.go +++ b/bcs-services/bcs-bscp/test/suite/cases/sidecar/gen_data.go @@ -110,7 +110,7 @@ func (g *generator) SimulationData(kt *kit.Kit) error { return err } - // NOTE: strategy related test depends on group, add group test first + // TODO: strategy related test depends on group, add group test first //if err := g.simulationApp3(kt.Ctx, header); err != nil { // return err //} @@ -208,7 +208,7 @@ func (g *generator) initApp2(ctx context.Context, header http.Header) error { return err } - // NOTE: strategy related test depends on group, add group test first + // TODO: strategy related test depends on group, add group test first //stgSetSpec := &table.StrategySetSpec{ // Name: cases.RandName("strategy_set"), //} diff --git a/bcs-services/bcs-bscp/test/suite/tools/template.go b/bcs-services/bcs-bscp/test/suite/tools/template.go index 9d112138ed..75d6822b20 100644 --- a/bcs-services/bcs-bscp/test/suite/tools/template.go +++ b/bcs-services/bcs-bscp/test/suite/tools/template.go @@ -1,15 +1,3 @@ -/* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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 main import ( @@ -91,7 +79,7 @@ const htmlTemplate = `

{{.Failed}}

{{ end }} - + {{ with .FailedInfos }} diff --git a/bcs-services/bcs-bscp/test/util/util.go b/bcs-services/bcs-bscp/test/util/util.go index 5e99d0d8a2..7aef6eff42 100644 --- a/bcs-services/bcs-bscp/test/util/util.go +++ b/bcs-services/bcs-bscp/test/util/util.go @@ -1,14 +1,15 @@ /* -Tencent is pleased to support the open source community by making Basic Service Configuration Platform available. -Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -Licensed under the MIT License (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at -http://opensource.org/licenses/MIT -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. -*/ + * Tencent is pleased to support the open source community by making Blueking Container Service available. + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * Licensed under the MIT License (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * http://opensource.org/licenses/MIT + * 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 @@ -24,7 +25,6 @@ import ( // LogConfig is log config type LogConfig struct { - // Verbosity is verbosity of log Verbosity uint } @@ -60,28 +60,54 @@ func NewDB(dbCfg DBConfig) *sqlx.DB { // ClearDB clear bscp database func ClearDB(db *sqlx.DB) error { - // get all tables to delete - tables := []string{ - table.AppTable.Name(), - table.ArchivedAppTable.Name(), - string(table.HookTable), - string(table.ContentTable), - table.ConfigItemTable.Name(), - table.CommitsTable.Name(), - table.ReleaseTable.Name(), - table.ReleasedConfigItemTable.Name(), - table.StrategyTable.Name(), - table.EventTable.Name(), - table.AuditTable.Name(), - table.ResourceLockTable.Name(), + if _, err := db.Exec("truncate table " + table.AppTable.Name()); err != nil { + return err } - - for _, t := range tables { - if _, err := db.Exec("truncate table " + t); err != nil { - return err - } + if _, err := db.Exec("truncate table " + table.ArchivedAppTable.Name()); err != nil { + return err + } + if _, err := db.Exec("truncate table " + string(table.HookTable)); err != nil { + return err + } + if _, err := db.Exec("truncate table " + string(table.ContentTable)); err != nil { + return err + } + if _, err := db.Exec("truncate table " + table.ConfigItemTable.Name()); err != nil { + return err + } + if _, err := db.Exec("truncate table " + table.CommitsTable.Name()); err != nil { + return err + } + if _, err := db.Exec("truncate table " + table.ReleaseTable.Name()); err != nil { + return err + } + if _, err := db.Exec("truncate table " + table.ReleasedConfigItemTable.Name()); err != nil { + return err + } + if _, err := db.Exec("truncate table " + table.StrategySetTable.Name()); err != nil { + return err + } + if _, err := db.Exec("truncate table " + table.StrategyTable.Name()); err != nil { + return err + } + if _, err := db.Exec("truncate table " + table.CurrentPublishedStrategyTable.Name()); err != nil { + return err + } + if _, err := db.Exec("truncate table " + table.PublishedStrategyHistoryTable.Name()); err != nil { + return err + } + if _, err := db.Exec("truncate table " + table.CurrentReleasedInstanceTable.Name()); err != nil { + return err + } + if _, err := db.Exec("truncate table " + table.EventTable.Name()); err != nil { + return err + } + if _, err := db.Exec("truncate table " + table.AuditTable.Name()); err != nil { + return err + } + if _, err := db.Exec("truncate table " + table.ResourceLockTable.Name()); err != nil { + return err } - if _, err := db.Exec("update " + table.IDGeneratorTable.Name() + " t1 set t1.max_id = 0 where resource != 'events'"); err != nil { return err diff --git a/bcs-services/bcs-bscp/ui/src/api/config.ts b/bcs-services/bcs-bscp/ui/src/api/config.ts index 452e70d614..b148105e93 100644 --- a/bcs-services/bcs-bscp/ui/src/api/config.ts +++ b/bcs-services/bcs-bscp/ui/src/api/config.ts @@ -129,25 +129,4 @@ export const publishVersion = (bizId: string, appId: number, releaseId: number, memo: string; }) => { return http.post(`/config/update/strategy/publish/publish/release_id/${releaseId}/app_id/${appId}/biz_id/${bizId}`, data) -} - -/** - * 获取服务下初始化脚本引用配置 - * @param bizId 业务ID - * @param appId 应用ID - * @returns - */ -export const getConfigInitScript = (bizId: string, appId: number) => { - return http.get(`/config/biz/${bizId}/apps/${appId}/config_hooks`) -} - -/** - * 更新服务下初始化脚本引用配置 - * @param bizId 业务ID - * @param appId 应用ID - * @param params 配置数据 - * @returns - */ -export const updateConfigInitScript = (bizId: string, appId: number, params: { pre_hook_id: number; post_hook_id: number; }) => { - return http.put(`/config/biz/${bizId}/apps/${appId}/config_hooks`, params) -} +} \ No newline at end of file diff --git a/bcs-services/bcs-bscp/ui/src/api/script.ts b/bcs-services/bcs-bscp/ui/src/api/script.ts deleted file mode 100644 index 1bf453e362..0000000000 --- a/bcs-services/bcs-bscp/ui/src/api/script.ts +++ /dev/null @@ -1,144 +0,0 @@ -import http from "../request" -import { IScriptEditingForm, IScriptCiteQuery, IScriptListQuery } from '../../types/script' - -/** - * 创建脚本 - * @param biz_id 空间ID - * @returns - */ -export const createScript = (biz_id: string, params: IScriptEditingForm) => { - return http.post(`/config/biz/${biz_id}/hooks`, params).then(res => res.data) -} - -/** - * 获取脚本列表 - * @param biz_id 空间ID - * @param params 查询参数 - * @returns - */ - -export const getScriptList = (biz_id: string, params: IScriptListQuery) => { - return http.get(`/config/biz/${biz_id}/hooks`, { params }).then(res => res.data); -} - -/** - * 获取脚本详情 - * @param biz_id 空间ID - * @param id 脚本ID - * @returns - */ -export const getScriptDetail = (biz_id: string, id: number) => { - return http.get(`/config/biz/${biz_id}/hooks/${id}`).then(res => res.data); -} - -/** - * 获取脚本某个版本下详情 - * @param biz_id 空间ID - * @param id 脚本ID - * @param release_id 版本ID - * @returns - */ -export const getScriptVersionDetail = (biz_id: string, id: number, release_id: number) => { - return http.get(`/config/biz/${biz_id}/hooks/${id}/hook_releases/${release_id}`).then(res => res.data); -} - -/** - * 删除脚本 - * @param biz_id 空间ID - * @param id 脚本ID - * @returns - */ -export const deleteScript = (biz_id: string, id: number) => { - return http.delete(`/config/biz/${biz_id}/hooks/${id}`).then(res => res.data); -} - -/** - * 获取脚本标签列表 - * @param biz_id 空间ID - * @param params 查询参数 - * @returns - */ -export const getScriptTagList = (biz_id: string) => { - return http.get(`/config/biz/${biz_id}/hook_tags`).then(res => res.data); -} - -/** - * 获取脚本版本列表 - * @param biz_id 空间ID - * @param hook_id 脚本ID - * @param params 查询参数 - * @returns - */ -export const getScriptVersionList = (biz_id: string, hook_id: number, params: { start: number; limit?: number; searchKey?: string; }) => { - return http.get(`/config/biz/${biz_id}/hooks/${hook_id}/hook_releases`, { params }).then(res => res.data); -} - -/** - * 创建脚本版本 - * @param biz_id 空间ID - * @param hook_id 脚本ID - * @param params 查询参数 - * @returns - */ -export const createScriptVersion = (biz_id: string, hook_id: number, params: { name: string; memo: string; content: string; }) => { - return http.post(`/config/biz/${biz_id}/hooks/${hook_id}/hook_releases`, params).then(res => res.data); -} - -/** - * 更新脚本版本 - * @param biz_id 空间ID - * @param hook_id 脚本ID - * @param params 查询参数 - * @returns - */ -export const updateScriptVersion = (biz_id: string, hook_id: number, release_id: number, params: { name: string; memo: string; content: string; }) => { - return http.put(`/config/biz/${biz_id}/hooks/${hook_id}/hook_releases/${release_id}`, params).then(res => res.data); -} - -/** - * 删除脚本版本 - * @param biz_id 空间ID - * @param hook_id 脚本ID - * @param release_id 版本ID - * @returns - */ -export const deleteScriptVersion = (biz_id: string, hook_id: number, release_id: number) => { - return http.delete(`/config/biz/${biz_id}/hooks/${hook_id}/hook_releases/${release_id}`).then(res => res.data); -} - -/** - * 上线版本 - * @param biz_id 空间ID - * @param hook_id 脚本ID - * @param release_id 版本ID - * @returns - */ -export const publishVersion = (biz_id: string, hook_id: number, release_id: number) => { - return http.put(`/config/biz/${biz_id}/hooks/${hook_id}/hook_releases/${release_id}/publish`).then(res => res.data); -} - -/** - * 获取脚本被引用列表 - * @param biz_id 空间ID - * @param hook_id 脚本ID - * @param params 查询参数 - * @returns - */ -export const getScriptCiteList = (biz_id: string, hook_id: number, params: IScriptCiteQuery) => { - return http.get(`/config/biz/${biz_id}/hooks/${hook_id}/references`, { params }).then(res => res.data); -} - -// 获取服务初始化脚本 -export const getConfigInitScript = (biz_id: string, app_id: number) => { - return http.get(`/config/biz/${biz_id}/apps/${app_id}/config_hooks`) -} - -// 配置服务初始化脚本 -export const createConfigInitScript = (biz_id: string, app_id: number) => { - return http.post(`/config/biz/${biz_id}/apps/${app_id}/config_hooks`) -} - -// 更新服务初始化脚本 -export const updateConfigInitScript = (biz_id: string, app_id: number) => { - return http.post(`/config/biz/${biz_id}/apps/${app_id}/config_hooks`) -} diff --git a/bcs-services/bcs-bscp/ui/src/assets/fonts/iconcool.eot b/bcs-services/bcs-bscp/ui/src/assets/fonts/iconcool.eot index b190a0a993..7d3e5ea618 100644 Binary files a/bcs-services/bcs-bscp/ui/src/assets/fonts/iconcool.eot and b/bcs-services/bcs-bscp/ui/src/assets/fonts/iconcool.eot differ diff --git a/bcs-services/bcs-bscp/ui/src/assets/fonts/iconcool.svg b/bcs-services/bcs-bscp/ui/src/assets/fonts/iconcool.svg index b4564b0fe7..076cf77ea1 100644 --- a/bcs-services/bcs-bscp/ui/src/assets/fonts/iconcool.svg +++ b/bcs-services/bcs-bscp/ui/src/assets/fonts/iconcool.svg @@ -59,12 +59,6 @@ - - - - - - diff --git a/bcs-services/bcs-bscp/ui/src/assets/fonts/iconcool.ttf b/bcs-services/bcs-bscp/ui/src/assets/fonts/iconcool.ttf index dc65aa06f1..71998a7623 100644 Binary files a/bcs-services/bcs-bscp/ui/src/assets/fonts/iconcool.ttf and b/bcs-services/bcs-bscp/ui/src/assets/fonts/iconcool.ttf differ diff --git a/bcs-services/bcs-bscp/ui/src/assets/fonts/iconcool.woff b/bcs-services/bcs-bscp/ui/src/assets/fonts/iconcool.woff index a9db94704a..e8f95f95e9 100644 Binary files a/bcs-services/bcs-bscp/ui/src/assets/fonts/iconcool.woff and b/bcs-services/bcs-bscp/ui/src/assets/fonts/iconcool.woff differ diff --git a/bcs-services/bcs-bscp/ui/src/components/code-editor/index.vue b/bcs-services/bcs-bscp/ui/src/components/code-editor/index.vue index 86894d7f7e..2c5bd9251a 100644 --- a/bcs-services/bcs-bscp/ui/src/components/code-editor/index.vue +++ b/bcs-services/bcs-bscp/ui/src/components/code-editor/index.vue @@ -26,15 +26,13 @@ } const props = withDefaults(defineProps<{ - modelValue: string; - editable?: boolean; - language?: string; + modelValue: string, + editable?: boolean }>(), { - editable: true, - language: '' + editable: true }) - const emit = defineEmits(['update:modelValue', 'change']) + const emit = defineEmits(['update:modelValue']) const codeEditorRef = ref() let editor: monaco.editor.IStandaloneCodeEditor @@ -46,28 +44,18 @@ } }) - watch(() => props.language, (val) => { - monaco.editor.setModelLanguage(editor.getModel(), val) - }) - - watch(() => props.editable, val => { - editor.updateOptions({ readOnly: !val }) - }) - onMounted(() => { if (!editor) { editor = monaco.editor.create(codeEditorRef.value as HTMLElement, { value: localVal.value, theme: 'vs-dark', automaticLayout: true, - language: props.language, readOnly: !props.editable }) } editor.onDidChangeModelContent((val:any) => { localVal.value = editor.getValue(); emit('update:modelValue', localVal.value) - emit('change', localVal.value) }) }) diff --git a/bcs-services/bcs-bscp/ui/src/components/diff/text.vue b/bcs-services/bcs-bscp/ui/src/components/diff/text.vue index 44b5e8532a..78ccfbc739 100644 --- a/bcs-services/bcs-bscp/ui/src/components/diff/text.vue +++ b/bcs-services/bcs-bscp/ui/src/components/diff/text.vue @@ -25,47 +25,28 @@ } } - const props = withDefaults(defineProps<{ - base: string; - baseLanguage?: string; - current: string; - currentLanguage?: string; - }>(), { - baseLanguage: '', - currentLanguage: '' - }) + const props = defineProps<{ + current: string, + base: string + }>() const textDiffRef = ref() let diffEditor: monaco.editor.IStandaloneDiffEditor - watch(() => [props.base, props.current], () => { - createDiffEditor() - }) - - watch(() => [props.baseLanguage, props.currentLanguage], () => { - createDiffEditor() - }) - onMounted(() => { - createDiffEditor() - }) - - const createDiffEditor = () => { - if (diffEditor) { - diffEditor.dispose() + if (!diffEditor) { + const originalModel = monaco.editor.createModel(props.base) + const modifiedModel = monaco.editor.createModel(props.current) + diffEditor = monaco.editor.createDiffEditor(textDiffRef.value as HTMLElement, { + theme: 'vs-dark', + automaticLayout: true + }) + diffEditor.setModel({ + original: originalModel, + modified: modifiedModel + }) } - const originalModel = monaco.editor.createModel(props.base, props.baseLanguage) - const modifiedModel = monaco.editor.createModel(props.current, props.currentLanguage) - diffEditor = monaco.editor.createDiffEditor(textDiffRef.value as HTMLElement, { - theme: 'vs-dark', - automaticLayout: true, - readOnly: true - }) - diffEditor.setModel({ - original: originalModel, - modified: modifiedModel - }) - } + }) onBeforeUnmount(() => { diffEditor.dispose() diff --git a/bcs-services/bcs-bscp/ui/src/components/head.vue b/bcs-services/bcs-bscp/ui/src/components/head.vue index 9f3f0f98c9..7fe90dd1c9 100644 --- a/bcs-services/bcs-bscp/ui/src/components/head.vue +++ b/bcs-services/bcs-bscp/ui/src/components/head.vue @@ -15,7 +15,7 @@ const navList = [ { id: 'service-mine', module: 'service', name: '服务管理'}, { id: 'groups-management', module: 'groups', name: '分组管理'}, - { id: 'script-list', module: 'scripts', name: '脚本管理'}, + // { id: 'scripts-management', module: 'scripts', name: '脚本管理'}, { id: 'credentials-management', module: 'credentials', name: '服务密钥'} ] diff --git a/bcs-services/bcs-bscp/ui/src/constants/config.ts b/bcs-services/bcs-bscp/ui/src/constants/config.ts index 6798426fb3..2f19de0606 100644 --- a/bcs-services/bcs-bscp/ui/src/constants/config.ts +++ b/bcs-services/bcs-bscp/ui/src/constants/config.ts @@ -30,12 +30,6 @@ export const GET_UNNAMED_VERSION_DATE = () => { spec: { name: '未命名版本', memo: '', - hook: { - post_hook_id: 0, - post_hook_release_id: 0, - pre_hook_id: 0, - pre_hook_release_id: 0, - }, deprecated: false, publish_num: 0, }, diff --git a/bcs-services/bcs-bscp/ui/src/css/font.css b/bcs-services/bcs-bscp/ui/src/css/font.css index 142631451e..4c8d1b21a0 100644 --- a/bcs-services/bcs-bscp/ui/src/css/font.css +++ b/bcs-services/bcs-bscp/ui/src/css/font.css @@ -53,9 +53,3 @@ url("../assets/fonts/iconcool.eot?#iefix") format("embedded-opentype"); .icon-revoke:before { content: "\e10b"; } -.icon-tags:before { - content: "\e10c"; -} -.icon-block-shape:before { - content: "\e10d"; -} diff --git a/bcs-services/bcs-bscp/ui/src/router.ts b/bcs-services/bcs-bscp/ui/src/router.ts index e730c34bad..aa32f10de9 100644 --- a/bcs-services/bcs-bscp/ui/src/router.ts +++ b/bcs-services/bcs-bscp/ui/src/router.ts @@ -48,14 +48,6 @@ const routes = [ navModule: 'service' }, component: () => import('./views/space/service/detail/config/index.vue') - }, - { - path: 'script', - name: 'init-script', - meta: { - navModule: 'service' - }, - component: () => import('./views/space/service/detail/init-script/index.vue') } ] }, @@ -75,25 +67,7 @@ const routes = [ meta: { navModule: 'scripts' }, - component: () => import('./views/space/scripts/index.vue'), - children: [ - { - path: 'list', - name: 'script-list', - meta: { - navModule: 'scripts' - }, - component: () => import('./views/space/scripts/list/script-list.vue') - }, - { - path: 'version_manage/:scriptId', - name: 'script-version-manage', - meta: { - navModule: 'scripts', - }, - component: () => import('./views/space/scripts/version-manage/index.vue') - } - ] + component: () => import('./views/space/scripts/index.vue') }, { path: 'credentials', diff --git a/bcs-services/bcs-bscp/ui/src/store/script.ts b/bcs-services/bcs-bscp/ui/src/store/script.ts deleted file mode 100644 index 42af7dc38a..0000000000 --- a/bcs-services/bcs-bscp/ui/src/store/script.ts +++ /dev/null @@ -1,10 +0,0 @@ -// 服务实例的pinia数据 -import { ref } from 'vue' -import { defineStore } from "pinia"; - -export const useScriptStore = defineStore('script', () => { - // 脚本配置页面是否需要打开编辑版本面板 - const versionListPageShouldOpenEdit = ref(false) - - return { versionListPageShouldOpenEdit } -}) \ No newline at end of file diff --git a/bcs-services/bcs-bscp/ui/src/utils/index.ts b/bcs-services/bcs-bscp/ui/src/utils/index.ts index 622505b6ec..fd32ea3c97 100644 --- a/bcs-services/bcs-bscp/ui/src/utils/index.ts +++ b/bcs-services/bcs-bscp/ui/src/utils/index.ts @@ -32,14 +32,3 @@ export const copyToClipBoard = (content: string) => { document.body.removeChild($textarea) } } - -// 将数字拆分为单个数字组成的数组 -export const splitToDigit = (n: number) => { - let num = n - const list = [] - while (num > 0) { - list.push(num % 10) - num = Math.floor(num / 10) - } - return list.reverse() -} \ No newline at end of file diff --git a/bcs-services/bcs-bscp/ui/src/views/space/groups/services-to-published.vue b/bcs-services/bcs-bscp/ui/src/views/space/groups/services-to-published.vue index c5ff99589f..c890781713 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/groups/services-to-published.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/groups/services-to-published.vue @@ -45,9 +45,9 @@ loading.value = false } - const getHref = (service: IGroupBindService) => { - const { href } = router.resolve({ name: 'service-config', params: { spaceId: spaceId.value, appId: service.app_id } }) - return href + const goToConfigPage = (service: IGroupBindService) => { + const route = router.resolve({ name: 'service-config', params: { spaceId: spaceId.value, appId: service.app_id } }) + window.open(route.href, '__blank') } const handlePageLimitChange = (val: number) => { @@ -78,7 +78,7 @@ @@ -120,9 +120,6 @@ background: #ffffff; } } - .link-btn { - font-size: 12px; - } .table-list-pagination { padding: 12px; border: 1px solid #dcdee5; diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/components/detail-layout.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/components/detail-layout.vue deleted file mode 100644 index 77ed05a0f8..0000000000 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/components/detail-layout.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - \ No newline at end of file diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/components/script-editor.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/components/script-editor.vue deleted file mode 100644 index 8da336930e..0000000000 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/components/script-editor.vue +++ /dev/null @@ -1,130 +0,0 @@ - - - \ No newline at end of file diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/index.vue index b6e30cd19d..189283a532 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/scripts/index.vue @@ -1,5 +1,118 @@ - + - + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/create-script.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/create-script.vue deleted file mode 100644 index 24f8935804..0000000000 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/create-script.vue +++ /dev/null @@ -1,159 +0,0 @@ - - - \ No newline at end of file diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/script-cited.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/script-cited.vue deleted file mode 100644 index 3793e0cb44..0000000000 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/script-cited.vue +++ /dev/null @@ -1,169 +0,0 @@ - - - \ No newline at end of file diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/script-list.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/script-list.vue deleted file mode 100644 index 3ba5535a1b..0000000000 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/script-list.vue +++ /dev/null @@ -1,313 +0,0 @@ - - - diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/create-version.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/create-version.vue deleted file mode 100644 index 6a9a3fa7f3..0000000000 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/create-version.vue +++ /dev/null @@ -1,132 +0,0 @@ - - - - \ No newline at end of file diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/index.vue deleted file mode 100644 index d652229580..0000000000 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/index.vue +++ /dev/null @@ -1,375 +0,0 @@ - - - \ No newline at end of file diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/script-version-diff.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/script-version-diff.vue deleted file mode 100644 index 5c4552dc40..0000000000 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/script-version-diff.vue +++ /dev/null @@ -1,136 +0,0 @@ - - - \ No newline at end of file diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-edit.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-edit.vue deleted file mode 100644 index ecc4860878..0000000000 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-edit.vue +++ /dev/null @@ -1,187 +0,0 @@ - - - \ No newline at end of file diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-list-full-table.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-list-full-table.vue deleted file mode 100644 index c909162d36..0000000000 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-list-full-table.vue +++ /dev/null @@ -1,115 +0,0 @@ - - - \ No newline at end of file diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-list-simple-table.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-list-simple-table.vue deleted file mode 100644 index 328ce6fb88..0000000000 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-list-simple-table.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - \ No newline at end of file diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/detail-header.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/detail-header.vue index 021092ac2a..554bcce0b6 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/detail-header.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/detail-header.vue @@ -1,23 +1,21 @@ \ No newline at end of file diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list.vue index f768d5a529..1a427ab932 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list.vue @@ -52,24 +52,18 @@ } } - const handleEditConfigOpen = (config: IConfigItem) => { - if (config.file_state === 'DELETE') { - return - } + const handleEditConfigOpen = (id: number) => { editDialogShow.value = true - configId.value = config.id + configId.value = id }