From 2b2b097f77482255cb0955ed6b67426dd1334d8c Mon Sep 17 00:00:00 2001 From: Zone <78101209+haha-zwx-ooo@users.noreply.github.com> Date: Tue, 19 Sep 2023 11:41:51 +0800 Subject: [PATCH] Upgrade the document format (#118) repo-sync-2023-09-19T11:28:29+0800 --- .bazelrc | 80 + .bazelversion | 1 + .gitignore | 9 +- BUILD.bazel | 13 + WORKSPACE | 20 + cmd/kuscia/autonomy/autonomy.go | 2 +- cmd/kuscia/lite/lite.go | 1 + cmd/kuscia/master/master.go | 3 +- cmd/kuscia/modules/confmanager.go | 163 ++ cmd/kuscia/modules/datamesh.go | 7 +- cmd/kuscia/modules/kusciaapi.go | 9 +- cmd/kuscia/modules/modules.go | 2 + docs/conf.py | 7 +- .../deploy_master_lite_cn.md | 25 +- .../deploy => deployment}/deploy_p2p_cn.md | 4 +- .../deploy => deployment}/index.rst | 5 +- .../{reference => deployment}/operation_cn.md | 11 +- docs/development/index.rst | 7 +- docs/getting_started/index.rst | 14 +- docs/getting_started/quickstart_cn.md | 26 +- .../run_secretflow_cn.md | 51 +- docs/index.md | 97 + docs/index.rst | 28 - docs/reference/api_whitelist_config_cn.md | 6 +- docs/reference/apis/datamesh/domaindata_cn.md | 8 +- docs/reference/apis/datamesh/summary_cn.md | 4 +- docs/reference/apis/domain_cn.md | 181 ++ docs/reference/apis/domaindata_cn.md | 239 +++ docs/reference/apis/domainroute_cn.md | 193 ++ .../apis/{kusciaapis => }/health_cn.md | 2 +- docs/reference/apis/index.rst | 21 +- docs/reference/apis/kusciaapis/domain_cn.md | 181 -- .../apis/kusciaapis/domaindata_cn.md | 237 --- .../apis/kusciaapis/domainroute_cn.md | 191 -- docs/reference/apis/kusciaapis/index.rst | 14 - .../reference/apis/kusciaapis/kusciajob_cn.md | 269 --- docs/reference/apis/kusciajob_cn.md | 269 +++ .../apis/{kusciaapis => }/summary_cn.md | 32 +- docs/reference/architecture_cn.md | 14 +- docs/reference/concepts/domaindata_cn.md | 2 +- docs/reference/concepts/index.rst | 6 +- docs/reference/index.rst | 9 +- docs/tutorial/index.rst | 14 +- docs/tutorial/run_bfia_job_cn.md | 2 +- docs/tutorial/run_secretflow_with_api_cn.md | 167 +- etc/kuscia.yaml | 4 +- pkg/confmanager/bean/grpc_server_bean.go | 96 + pkg/confmanager/bean/http_server_bean.go | 142 ++ pkg/confmanager/commands/root.go | 60 + pkg/confmanager/config/confmanager_config.go | 82 + pkg/confmanager/errorcode/error_code.go | 29 + .../handler/grpchandler/configuration.go | 57 + .../httphandler/configuration/common.go | 16 + .../httphandler/configuration/create.go | 56 + .../httphandler/configuration/query.go | 56 + pkg/confmanager/interceptor/tls_cert.go | 67 + pkg/confmanager/secretbackend/backend.go | 53 + pkg/confmanager/secretbackend/backend_test.go | 100 + pkg/confmanager/secretbackend/mem/mem.go | 50 + pkg/confmanager/service/configuration.go | 203 +++ pkg/confmanager/service/configuration_test.go | 178 ++ .../clusterdomainroute/controller.go | 7 - pkg/controllers/clusterdomainroute/rolling.go | 6 - pkg/controllers/domain/controller.go | 5 - pkg/controllers/kusciajob/controller.go | 7 - .../kusciajob/handler/failed_handler.go | 2 - .../kusciajob/handler/succeeded_handler.go | 2 - pkg/controllers/kusciatask/controller.go | 8 - pkg/controllers/kusciatask/handler/factory.go | 2 +- .../kusciatask/handler/failed_handler.go | 4 - .../kusciatask/handler/failed_handler_test.go | 7 - .../kusciatask/handler/pending_handler.go | 2 +- .../handler/pending_handler_test.go | 2 +- .../kusciatask/handler/succeeded_handler.go | 8 +- .../handler/succeeded_handler_test.go | 8 +- .../taskresourcegroup/controller.go | 6 - pkg/gateway/clusters/master.go | 6 +- pkg/gateway/config/cluster_config.go | 2 +- pkg/gateway/config/inner_config.go | 2 +- pkg/gateway/controller/handshake.go | 3 +- pkg/utils/kusciaconfig/service_config.go | 4 +- pkg/web/constants/constants.go | 3 + pkg/web/errorcode/errs.go | 7 + pkg/web/framework/beans/gin_bean.go | 9 +- proto/api/v1alpha1/appconfig/BUILD.bazel | 14 + .../app_config.pb.go} | 202 +-- .../app_config.proto} | 8 +- proto/api/v1alpha1/common.pb.go | 87 +- proto/api/v1alpha1/common.proto | 10 +- .../v1alpha1/confmanager/configuration.pb.go | 536 ++++++ .../v1alpha1/confmanager/configuration.proto | 54 + .../confmanager/configuration_grpc.pb.go | 160 ++ proto/api/v1alpha1/datamesh/domaindata.pb.go | 139 +- proto/api/v1alpha1/datamesh/domaindata.proto | 3 + .../v1alpha1/datamesh/domaindatasource.pb.go | 550 ++++-- .../v1alpha1/datamesh/domaindatasource.proto | 34 +- proto/api/v1alpha1/datamesh/flightdm.pb.go | 1611 +++++++++++++++++ proto/api/v1alpha1/datamesh/flightdm.proto | 139 ++ proto/api/v1alpha1/datamesh/flightinner.pb.go | 312 ++++ proto/api/v1alpha1/datamesh/flightinner.proto | 35 + scripts/deploy/init_confmanager_cert.sh | 41 + scripts/deploy/start_autonomy.sh | 2 +- scripts/deploy/start_standalone.sh | 2 + scripts/test/suite/center/base.sh | 12 +- scripts/test/suite/core/functions.sh | 33 +- scripts/test/suite/p2p/base.sh | 26 +- .../user/create_confmanager_client_cert.sh | 36 + 107 files changed, 6432 insertions(+), 1621 deletions(-) create mode 100644 .bazelrc create mode 100644 .bazelversion create mode 100644 BUILD.bazel create mode 100644 WORKSPACE create mode 100644 cmd/kuscia/modules/confmanager.go rename docs/{getting_started/deploy => deployment}/deploy_master_lite_cn.md (87%) rename docs/{getting_started/deploy => deployment}/deploy_p2p_cn.md (98%) rename docs/{getting_started/deploy => deployment}/index.rst (76%) rename docs/{reference => deployment}/operation_cn.md (94%) rename docs/{tutorial => getting_started}/run_secretflow_cn.md (89%) create mode 100644 docs/index.md delete mode 100644 docs/index.rst create mode 100644 docs/reference/apis/domain_cn.md create mode 100644 docs/reference/apis/domaindata_cn.md create mode 100644 docs/reference/apis/domainroute_cn.md rename docs/reference/apis/{kusciaapis => }/health_cn.md (92%) delete mode 100644 docs/reference/apis/kusciaapis/domain_cn.md delete mode 100644 docs/reference/apis/kusciaapis/domaindata_cn.md delete mode 100644 docs/reference/apis/kusciaapis/domainroute_cn.md delete mode 100644 docs/reference/apis/kusciaapis/index.rst delete mode 100644 docs/reference/apis/kusciaapis/kusciajob_cn.md create mode 100644 docs/reference/apis/kusciajob_cn.md rename docs/reference/apis/{kusciaapis => }/summary_cn.md (76%) create mode 100644 pkg/confmanager/bean/grpc_server_bean.go create mode 100644 pkg/confmanager/bean/http_server_bean.go create mode 100644 pkg/confmanager/commands/root.go create mode 100644 pkg/confmanager/config/confmanager_config.go create mode 100644 pkg/confmanager/errorcode/error_code.go create mode 100644 pkg/confmanager/handler/grpchandler/configuration.go create mode 100644 pkg/confmanager/handler/httphandler/configuration/common.go create mode 100644 pkg/confmanager/handler/httphandler/configuration/create.go create mode 100644 pkg/confmanager/handler/httphandler/configuration/query.go create mode 100644 pkg/confmanager/interceptor/tls_cert.go create mode 100644 pkg/confmanager/secretbackend/backend.go create mode 100644 pkg/confmanager/secretbackend/backend_test.go create mode 100644 pkg/confmanager/secretbackend/mem/mem.go create mode 100644 pkg/confmanager/service/configuration.go create mode 100644 pkg/confmanager/service/configuration_test.go create mode 100644 proto/api/v1alpha1/appconfig/BUILD.bazel rename proto/api/v1alpha1/{kusciatask/kuscia_task.pb.go => appconfig/app_config.pb.go} (51%) rename proto/api/v1alpha1/{kusciatask/kuscia_task.proto => appconfig/app_config.proto} (90%) create mode 100644 proto/api/v1alpha1/confmanager/configuration.pb.go create mode 100644 proto/api/v1alpha1/confmanager/configuration.proto create mode 100644 proto/api/v1alpha1/confmanager/configuration_grpc.pb.go create mode 100644 proto/api/v1alpha1/datamesh/flightdm.pb.go create mode 100644 proto/api/v1alpha1/datamesh/flightdm.proto create mode 100644 proto/api/v1alpha1/datamesh/flightinner.pb.go create mode 100644 proto/api/v1alpha1/datamesh/flightinner.proto create mode 100755 scripts/deploy/init_confmanager_cert.sh create mode 100755 scripts/user/create_confmanager_client_cert.sh diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 000000000..40f4b502c --- /dev/null +++ b/.bazelrc @@ -0,0 +1,80 @@ +# Copyright 2023 Ant Group Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +common --experimental_repo_remote_exec + +build --incompatible_new_actions_api=false +build --copt=-fdiagnostics-color=always +build --enable_platform_specific_config + +build --cxxopt=-std=c++17 +build --host_cxxopt=-std=c++17 + +# Binary safety flags +build --host_copt=-fPIE +build --host_copt=-fstack-protector-strong +build:linux --host_copt=-Wl,-z,noexecstack +build:macos --host_copt=-Wa,--noexecstack + +# platform specific config +# Bazel will automatic pick platform config since we have enable_platform_specific_config set + +build:macos --features=-supports_dynamic_linker +build:macos --cxxopt -Wno-deprecated-enum-enum-conversion +build:macos --cxxopt -Wno-deprecated-anon-enum-enum-conversion + +build:asan --strip=never +build:asan --copt -fno-sanitize-recover=all +build:asan --copt -fsanitize=address +build:asan --copt -Og +build:asan --copt -g +build:asan --copt -fno-omit-frame-pointer +build:asan --linkopt -fsanitize=address + +build:ubsan --strip=never +build:ubsan --copt -fno-sanitize-recover=all +build:ubsan --copt -fsanitize=undefined +build:ubsan --copt -Og +build:ubsan --copt -g +build:ubsan --copt -fno-omit-frame-pointer +build:ubsan --linkopt -fsanitize=undefined + +# see https://github.com/bazelbuild/bazel/issues/6932, _FORTIFY_SOURCE=1 is enabled by default +# on Mac OS, which breaks ASAN. bazel has officially added sanitizer support to Apple Platforms, +# see commit: https://github.com/bazelbuild/bazel/commit/6ab161e2d5b8ad9cf191be1b362cd4619f3bb956 +build:macos-asan --features=asan +build:macos-ubsan --features=ubsan + + +test --keep_going +test --test_output=errors +test --test_timeout=180 + +test:asan --strip=never +test:asan --copt -fno-sanitize-recover=all +test:asan --copt -fsanitize=address +test:asan --copt -O0 +test:asan --copt -g +test:asan --copt -fno-omit-frame-pointer +test:asan --linkopt -fsanitize=address +test:asan --linkopt -static-libasan + +test:ubsan --strip=never +test:ubsan --copt -fno-sanitize-recover=all +test:ubsan --copt -fsanitize=undefined +test:ubsan --copt -O0 +test:ubsan --copt -g +test:ubsan --copt -fno-omit-frame-pointer +test:ubsan --linkopt -fsanitize=undefined +test:ubsan --linkopt -static-libubsan diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 000000000..ade65226e --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +5.4.1 diff --git a/.gitignore b/.gitignore index 7f5c70f5f..8899404c8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,11 @@ .vscode /test-results/ /docs/_build/ -/thirdparty/fate/build/apps/ \ No newline at end of file +/thirdparty/fate/build/apps/ + +# bazel +bazel-* + +# Python virtualenv +.venv +.DS_Store diff --git a/BUILD.bazel b/BUILD.bazel new file mode 100644 index 000000000..7832e7327 --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1,13 @@ +# Copyright 2023 Ant Group Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 000000000..55631f03f --- /dev/null +++ b/WORKSPACE @@ -0,0 +1,20 @@ +workspace(name = "kuscia") + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") + + +maybe( + http_archive, + name = "com_google_protobuf", + sha256 = "ba0650be1b169d24908eeddbe6107f011d8df0da5b1a5a4449a913b10e578faf", + strip_prefix = "protobuf-3.19.4", + type = "tar.gz", + urls = [ + "https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protobuf-all-3.19.4.tar.gz", + ], +) + +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + +protobuf_deps() diff --git a/cmd/kuscia/autonomy/autonomy.go b/cmd/kuscia/autonomy/autonomy.go index 32394d1e8..c38507bf1 100644 --- a/cmd/kuscia/autonomy/autonomy.go +++ b/cmd/kuscia/autonomy/autonomy.go @@ -78,7 +78,7 @@ func getInitConfig(flagConfigFile string, flagDomainID string) *modules.Dependen KubeConfig: conf.KubeconfigFile, Endpoint: conf.ApiserverEndpoint, }, - ApiWhitelist: conf.KusciaConfig.Master.ApiWhitelist, + APIWhitelist: conf.KusciaConfig.Master.APIWhitelist, } hostIP, err := network.GetHostIP() diff --git a/cmd/kuscia/lite/lite.go b/cmd/kuscia/lite/lite.go index 4b13e25af..f42531467 100644 --- a/cmd/kuscia/lite/lite.go +++ b/cmd/kuscia/lite/lite.go @@ -125,6 +125,7 @@ func NewLiteCommand(ctx context.Context) *cobra.Command { wg.Wait() modules.RunAgent(runCtx, cancel, conf) + modules.RunConfManager(runCtx, cancel, conf) modules.RunDataMesh(runCtx, cancel, conf) if debug { utils.SetupPprof(debugPort) diff --git a/cmd/kuscia/master/master.go b/cmd/kuscia/master/master.go index 667c7fc9c..bed7bcedd 100644 --- a/cmd/kuscia/master/master.go +++ b/cmd/kuscia/master/master.go @@ -78,7 +78,7 @@ func getInitConfig(configFile string, flagDomainID string) *modules.Dependencies KubeConfig: conf.KubeconfigFile, Endpoint: conf.ApiserverEndpoint, }, - ApiWhitelist: conf.KusciaConfig.Master.ApiWhitelist, + APIWhitelist: conf.KusciaConfig.Master.APIWhitelist, } err = modules.EnsureDir(conf) if err != nil { @@ -128,6 +128,7 @@ func NewMasterCommand(ctx context.Context) *cobra.Command { // wait any controller failed } else { modules.RunK3s(runctx, cancel, conf) + modules.RunConfManager(runctx, cancel, conf) // use the current context in kubeconfig clients, err := kubeconfig.CreateClientSetsFromKubeconfig(conf.KubeconfigFile, conf.ApiserverEndpoint) diff --git a/cmd/kuscia/modules/confmanager.go b/cmd/kuscia/modules/confmanager.go new file mode 100644 index 000000000..4017bb36e --- /dev/null +++ b/cmd/kuscia/modules/confmanager.go @@ -0,0 +1,163 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package modules + +import ( + "bytes" + "context" + "crypto/tls" + "encoding/json" + "fmt" + "io" + "time" + + "github.com/secretflow/kuscia/pkg/confmanager/commands" + "github.com/secretflow/kuscia/pkg/confmanager/config" + "github.com/secretflow/kuscia/pkg/utils/nlog" + tlsutils "github.com/secretflow/kuscia/pkg/utils/tls" + "github.com/secretflow/kuscia/pkg/web/constants" + "github.com/secretflow/kuscia/pkg/web/utils" + "github.com/secretflow/kuscia/proto/api/v1alpha1/kusciaapi" +) + +type confManagerModule struct { + conf *config.ConfManagerConfig +} + +func NewConfManager(d *Dependencies) Module { + // overwrite config + conf := config.NewDefaultConfManagerConfig(d.RootDir) + if d.ConfManager.HTTPPort != 0 { + conf.HTTPPort = d.ConfManager.HTTPPort + } + if d.ConfManager.GRPCPort != 0 { + conf.GRPCPort = d.ConfManager.GRPCPort + } + if d.ConfManager.ConnectTimeout != 0 { + conf.ConnectTimeout = d.ConfManager.ConnectTimeout + } + if d.ConfManager.ReadTimeout != 0 { + conf.ReadTimeout = d.ConfManager.ReadTimeout + } + if d.ConfManager.WriteTimeout != 0 { + conf.WriteTimeout = d.ConfManager.WriteTimeout + } + if d.ConfManager.IdleTimeout != 0 { + conf.IdleTimeout = d.ConfManager.IdleTimeout + } + if d.ConfManager.EnableConfAuth != false { + conf.EnableConfAuth = d.ConfManager.EnableConfAuth + } + if d.ConfManager.TLSConfig != nil { + conf.TLSConfig = d.ConfManager.TLSConfig + } + if d.ConfManager.SecretBackend != nil && d.ConfManager.SecretBackend.Driver != "" { + conf.SecretBackend = d.ConfManager.SecretBackend + } + + // set namespace + nlog.Infof("ConfManager namespace:%s.", d.DomainID) + return &confManagerModule{ + conf: conf, + } +} + +func (m confManagerModule) Run(ctx context.Context) error { + return commands.Run(ctx, m.conf) +} + +func (m confManagerModule) WaitReady(ctx context.Context) error { + timeoutTicker := time.NewTicker(30 * time.Second) + checkTicker := time.NewTicker(1 * time.Second) + for { + select { + case <-checkTicker.C: + if m.readyZ() { + return nil + } + case <-ctx.Done(): + return ctx.Err() + case <-timeoutTicker.C: + return fmt.Errorf("wait confmanager ready timeout") + } + } +} + +func (m confManagerModule) Name() string { + return "confmanager" +} + +func (m confManagerModule) readyZ() bool { + var clientTLSConfig *tls.Config + var err error + // init client tls config + tlsConfig := m.conf.TLSConfig + clientTLSConfig, err = tlsutils.BuildClientTLSConfig(tlsConfig.RootCAFile, tlsConfig.ServerCertFile, tlsConfig.ServerKeyFile) + if err != nil { + nlog.Errorf("local tls config error: %v", err) + return false + } + + // check http server ready + httpClient := utils.BuildHTTPClient(clientTLSConfig) + httpURL := fmt.Sprintf("%s://%s:%d%s", constants.SchemaHTTPS, constants.LocalhostIP, m.conf.HTTPPort, constants.HealthAPI) + body, err := json.Marshal(&kusciaapi.HealthRequest{}) + if err != nil { + nlog.Errorf("marshal health request error: %v", err) + return false + } + resp, err := httpClient.Post(httpURL, constants.HTTPDefaultContentType, bytes.NewReader(body)) + if err != nil { + nlog.Errorf("send health request error: %v", err) + return false + } + if resp == nil || resp.Body == nil { + nlog.Error("resp must has body") + return false + } + defer resp.Body.Close() + healthResp := &kusciaapi.HealthResponse{} + respBytes, err := io.ReadAll(resp.Body) + if err != nil { + nlog.Errorf("read response body error: %v", err) + return false + } + if err = json.Unmarshal(respBytes, healthResp); err != nil { + nlog.Errorf("Unmarshal health response error: %v", err) + return false + } + if healthResp.Data == nil || !healthResp.Data.Ready { + return false + } + nlog.Infof("http server is ready") + return true +} + +func RunConfManager(ctx context.Context, cancel context.CancelFunc, conf *Dependencies) Module { + m := NewConfManager(conf) + go func() { + if err := m.Run(ctx); err != nil { + nlog.Error(err) + cancel() + } + }() + if err := m.WaitReady(ctx); err != nil { + nlog.Error(err) + cancel() + } else { + nlog.Info("confmanager is ready") + } + return m +} diff --git a/cmd/kuscia/modules/datamesh.go b/cmd/kuscia/modules/datamesh.go index 4da7ca829..42f02eeb0 100644 --- a/cmd/kuscia/modules/datamesh.go +++ b/cmd/kuscia/modules/datamesh.go @@ -82,8 +82,7 @@ func (m dataMeshModule) Name() string { func (m dataMeshModule) readyZ() bool { var clientTLSConfig *tls.Config var err error - host := "127.0.0.1" - schema := "http" + schema := constants.SchemaHTTP // init client tls config tlsConfig := m.conf.TLSConfig if tlsConfig != nil { @@ -92,12 +91,12 @@ func (m dataMeshModule) readyZ() bool { nlog.Errorf("local tls config error: %v", err) return false } - schema = "https" + schema = constants.SchemaHTTPS } // check http server ready httpClient := utils.BuildHTTPClient(clientTLSConfig) - httpURL := fmt.Sprintf("%s://%s:%d%s", schema, host, m.conf.HTTPPort, constants.HealthAPI) + httpURL := fmt.Sprintf("%s://%s:%d%s", schema, constants.LocalhostIP, m.conf.HTTPPort, constants.HealthAPI) body, err := json.Marshal(&kusciaapi.HealthRequest{}) if err != nil { nlog.Errorf("marshal health request error: %v", err) diff --git a/cmd/kuscia/modules/kusciaapi.go b/cmd/kuscia/modules/kusciaapi.go index 5eb981898..b5a8dfffe 100644 --- a/cmd/kuscia/modules/kusciaapi.go +++ b/cmd/kuscia/modules/kusciaapi.go @@ -93,8 +93,7 @@ func (m kusciaAPIModule) Name() string { func (m kusciaAPIModule) readyZ() bool { var clientTLSConfig *tls.Config var err error - host := "127.0.0.1" - schema := "http" + schema := constants.SchemaHTTP // init client tls config tlsConfig := m.conf.TLSConfig if tlsConfig != nil { @@ -103,7 +102,7 @@ func (m kusciaAPIModule) readyZ() bool { nlog.Errorf("local tls config error: %v", err) return false } - schema = "https" + schema = constants.SchemaHTTPS } // token auth @@ -121,7 +120,7 @@ func (m kusciaAPIModule) readyZ() bool { // check http server ready httpClient := utils.BuildHTTPClient(clientTLSConfig) - httpURL := fmt.Sprintf("%s://%s:%d%s", schema, host, m.conf.HTTPPort, constants.HealthAPI) + httpURL := fmt.Sprintf("%s://%s:%d%s", schema, constants.LocalhostIP, m.conf.HTTPPort, constants.HealthAPI) body, err := json.Marshal(&kusciaapi.HealthRequest{}) if err != nil { nlog.Errorf("marshal health request error: %v", err) @@ -174,7 +173,7 @@ func (m kusciaAPIModule) readyZ() bool { dialOpts = append(dialOpts, grpc.WithUnaryInterceptor(interceptor.GrpcClientTokenInterceptor(token))) } - grpcAddr := fmt.Sprintf("%s:%d", host, m.conf.GRPCPort) + grpcAddr := fmt.Sprintf("%s:%d", constants.LocalhostIP, m.conf.GRPCPort) grpcConn, err := grpc.Dial(grpcAddr, dialOpts...) if err != nil { nlog.Fatalf("did not connect: %v", err) diff --git a/cmd/kuscia/modules/modules.go b/cmd/kuscia/modules/modules.go index 6790e90a7..7d179b7d3 100644 --- a/cmd/kuscia/modules/modules.go +++ b/cmd/kuscia/modules/modules.go @@ -26,6 +26,7 @@ import ( "path/filepath" "github.com/secretflow/kuscia/pkg/agent/config" + cmconf "github.com/secretflow/kuscia/pkg/confmanager/config" "github.com/secretflow/kuscia/pkg/gateway/utils" "github.com/secretflow/kuscia/pkg/utils/kubeconfig" "github.com/secretflow/kuscia/pkg/utils/kusciaconfig" @@ -63,6 +64,7 @@ type KusciaConfig struct { CAFile string `yaml:"caFile,omitempty"` Agent KusciaAgentConfig `yaml:"agent,omitempty"` Master *kusciaconfig.MasterConfig `yaml:"master,omitempty"` + ConfManager cmconf.ConfManagerConfig `yaml:"confManager,omitempty"` ExternalTLS *kusciaconfig.TLSConfig `yaml:"externalTLS,omitempty"` IsMaster bool } diff --git a/docs/conf.py b/docs/conf.py index 415cf3354..edfd35240 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -129,11 +129,12 @@ "attrs_block", ] -suppress_warnings = ["myst.header"] +suppress_warnings = ["autosectionlabel", "myst.header"] +# Enable all MyST features myst_gfm_only = False -myst_heading_anchors = 1 -myst_title_to_header = True +# Enable anchors for heading level h1 through h6 +myst_heading_anchors = 6 # app setup hook diff --git a/docs/getting_started/deploy/deploy_master_lite_cn.md b/docs/deployment/deploy_master_lite_cn.md similarity index 87% rename from docs/getting_started/deploy/deploy_master_lite_cn.md rename to docs/deployment/deploy_master_lite_cn.md index a79942c9f..2c785d615 100644 --- a/docs/getting_started/deploy/deploy_master_lite_cn.md +++ b/docs/deployment/deploy_master_lite_cn.md @@ -2,7 +2,7 @@ ## 前言 -本教程帮助你在多台机器上使用 [中心化组网模式](../../reference/architecture_cn.md#centralized) 来部署 Kuscia 集群。 +本教程帮助你在多台机器上使用 [中心化组网模式](../reference/architecture_cn.md#中心化组网模式) 来部署 Kuscia 集群。 ## 部署流程(基于TOKEN认证) @@ -43,9 +43,16 @@ alias km="docker exec -it ${USER}-kuscia-master" 你可以选择在任一台机器上部署 lite 节点 。 #### 部署 lite 节点 alice -在部署 alice 节点之前,我们需要在 master 上注册 alice 节点并获取部署时需要用到的 token(以abcdefg为例)。 -``` +在部署 alice 节点之前,我们需要在 master 上注册 alice 节点并获取部署时需要用到的 token 。 +执行以下命令,完成节点注册并从返回中得到 token (下文将以abcdefg为例)。 +```bash docker exec -it ${USER}-kuscia-master sh scripts/deploy/add_domain_lite.sh alice +abcdefg +``` +如果token遗忘了,可以通过该命令重新获取 +```bash +docker exec -it ${USER}-kuscia-master kubectl get domain alice -o=jsonpath='{.status.deployTokenStatuses[?(@.state=="unused")].token}' && echo +abcdefg ``` 接下来,登录到安装 alice 的机器上,假设对外ip是2.2.2.2。 @@ -73,11 +80,17 @@ docker run --rm $KUSCIA_IMAGE cat /home/kuscia/scripts/deploy/deploy.sh > deploy #### 部署 lite 节点 bob -在部署 bob 节点之前,我们需要在 master 注册 bob 节点,并获取到部署时需要用到的 token 以hijklmn为例)。 -``` +在部署 bob 节点之前,我们需要在 master 注册 bob 节点,并获取到部署时需要用到的 token 。 +执行以下命令,完成节点注册并从返回中得到 token (下文将以hijklmn为例)。 +```bash docker exec -it ${USER}-kuscia-master sh scripts/deploy/add_domain_lite.sh bob +hijklmn +``` +如果token遗忘了,可以通过该命令重新获取 +```bash +docker exec -it ${USER}-kuscia-master kubectl get domain bob -o=jsonpath='{.status.deployTokenStatuses[?(@.state=="unused")].token}' && echo +hijklmn ``` - 接下来,登录到安装 bob 的机器上,假设对外ip是3.3.3.3。 指定 kuscia 版本: diff --git a/docs/getting_started/deploy/deploy_p2p_cn.md b/docs/deployment/deploy_p2p_cn.md similarity index 98% rename from docs/getting_started/deploy/deploy_p2p_cn.md rename to docs/deployment/deploy_p2p_cn.md index cd48bc49b..8bc575d48 100644 --- a/docs/getting_started/deploy/deploy_p2p_cn.md +++ b/docs/deployment/deploy_p2p_cn.md @@ -2,7 +2,7 @@ ## 前言 -本教程帮助你在多台机器上使用 [点对点组网模式](../../reference/architecture_cn.md#peer-to-peer) 来部署 Kuscia 集群。 +本教程帮助你在多台机器上使用 [点对点组网模式](../reference/architecture_cn.md#点对点组网模式) 来部署 Kuscia 集群。 当前 Kuscia 节点之间只支持 MTLS 的身份认证方式,在跨机器部署的场景下流程较为繁琐,后续本教程会持续更新优化。 @@ -43,7 +43,7 @@ docker run --rm $KUSCIA_IMAGE cat /home/kuscia/scripts/deploy/deploy.sh > deploy 你可以选择在另一台机器上部署 bob 节点,详细步骤参考上述 alice 节点部署的流程,唯一不同的是在部署前准备参数时配置 bob 节点相关的参数。假定节点ID为 bob ,对外可访问的ip是 2.2.2.2,对外可访问的port是 8082 。 - +{#配置授权} ### 配置授权 diff --git a/docs/getting_started/deploy/index.rst b/docs/deployment/index.rst similarity index 76% rename from docs/getting_started/deploy/index.rst rename to docs/deployment/index.rst index 4a0436818..a791e0725 100644 --- a/docs/getting_started/deploy/index.rst +++ b/docs/deployment/index.rst @@ -1,10 +1,9 @@ -.. _deploy: - 部署 -=========== +======== .. toctree:: :maxdepth: 2 deploy_p2p_cn deploy_master_lite_cn + operation_cn diff --git a/docs/reference/operation_cn.md b/docs/deployment/operation_cn.md similarity index 94% rename from docs/reference/operation_cn.md rename to docs/deployment/operation_cn.md index 38f593c79..82c121bbd 100644 --- a/docs/reference/operation_cn.md +++ b/docs/deployment/operation_cn.md @@ -1,4 +1,4 @@ -# 运维 +# 运维操作 ## 宿主机 @@ -155,7 +155,7 @@ status: ``` 其中,我们需要关注`.status.nodeStatuses[].status`,这个字段记录了 Domain 下的节点是否正常。 有关 Domain -的更多信息,请查看 [Domain](./concepts/domain_cn.md) 。 +的更多信息,请查看 [Domain](../reference/concepts/domain_cn.md) 。 ### DomainRoute @@ -201,7 +201,7 @@ kubectl get dr {domain_router_name} -o yaml -n {domain_name} kubectl get dr alice-bob -o yaml -n alice ``` -有关 DomainRoute 的更多信息,请查看 [DomainRoute](./concepts/domainroute_cn.md) 。 +有关 DomainRoute 的更多信息,请查看 [DomainRoute](../reference/concepts/domainroute_cn.md) 。 ### AppImage @@ -227,12 +227,11 @@ kubectl get aimg {aimg-name} -o yaml kubectl get aimg secretflow-image -o yaml ``` -有关 AppImage 的更多信息,请查看 [AppImage](./concepts/appimage_cn.md) 。 +有关 AppImage 的更多信息,请查看 [AppImage](../reference/concepts/appimage_cn.md) 。 ### KusciaJob & KusciaTask -关于如何配置、运行和查看 KusciaJob 和 KusciaTask,请参考 [如何运行一个 secretflow 作业](../tutorial/run_secretflow_cn.md) -和 [KusciaJob](./concepts/kusciajob_cn.md) 。 +关于如何配置、运行和查看 KusciaJob 和 KusciaTask,请参考 [如何运行一个 SecretFlow 作业](../getting_started/run_secretflow_cn.md) 和 [KusciaJob](../reference/concepts/kusciajob_cn.md) 。 ## 节点容器 diff --git a/docs/development/index.rst b/docs/development/index.rst index e58a0fc75..d8e1baae1 100644 --- a/docs/development/index.rst +++ b/docs/development/index.rst @@ -1,9 +1,8 @@ -开发 -===== - +开发 Kuscia +================ .. toctree:: :maxdepth: 2 build_kuscia_cn - register_custom_image \ No newline at end of file + register_custom_image diff --git a/docs/getting_started/index.rst b/docs/getting_started/index.rst index d133009ea..238621799 100644 --- a/docs/getting_started/index.rst +++ b/docs/getting_started/index.rst @@ -1,16 +1,8 @@ -.. _getting_started: - -准备开始 -========= - -.. warning:: - 本文档仅用于演示,请勿在生产环境直接使用。 +入门教程 +================ .. toctree:: :maxdepth: 2 quickstart_cn - ./deploy/index - - - + run_secretflow_cn diff --git a/docs/getting_started/quickstart_cn.md b/docs/getting_started/quickstart_cn.md index b9210d288..a73bf52ec 100644 --- a/docs/getting_started/quickstart_cn.md +++ b/docs/getting_started/quickstart_cn.md @@ -1,13 +1,15 @@ -# 快速入门 +# Kuscia 入门教程 —— 快速开始 -## 说明 +你将会在单台机器上准备 Kuscia 需要的环境、快速部署一个示例 Kuscia 集群,然后尝试运行一个 [SecretFlow] 作业。 -本教程帮助你在单台机器上快速部署 Kuscia 集群并体验 SecretFlow。 +[SecretFlow]: https://www.secretflow.org.cn/docs/secretflow + +## 部署模式:说明 在部署时有两种组网模式可供选择: -- [中心化组网模式](../reference/architecture_cn.md#centralized):启动一个控制平面(master)容器和两个 Lite 节点(alice 和 bob)容器 -- [点对点组网模式](../reference/architecture_cn.md#peer-to-peer):启动两个 Autonomy 节点(alice 和 bob)容器 +- [中心化组网模式](../reference/architecture_cn.md#中心化组网模式):启动一个控制平面(master)容器和两个 Lite 节点(alice 和 bob)容器 +- [点对点组网模式](../reference/architecture_cn.md#点对点组网模式):启动两个 Autonomy 节点(alice 和 bob)容器 你可以选择其中任意一种或两种模式进行部署体验,在单台机器上可以同时部署两种模式。 @@ -19,7 +21,7 @@ 资源:8 core / 16G memory / 200G hard disk -CPU架构:x86 +CPU 架构:x86 ### 环境准备 @@ -79,6 +81,8 @@ scripts/user/create_example_job.sh kubectl get kj ``` +:::{tip} + 如果希望体验隐语白屏功能([隐语白屏使用手册官方文档](https://www.secretflow.org.cn/docs/quickstart/mvp-platform)),请使用如下命令完成部署。 ```bash @@ -87,6 +91,8 @@ kubectl get kj ``` +::: + {#p2p-network-mode} ### 点对点组网模式 @@ -124,7 +130,7 @@ docker exec -it ${USER}-kuscia-lite-alice cat var/storage/data/psi-output.csv docker exec -it ${USER}-kuscia-autonomy-alice cat var/storage/data/psi-output.csv ``` -结果输出(仅前4行): +结果输出(仅前 4 行): ```bash id1,age,education,default,balance,housing,loan,day,duration,campaign,pdays,previous,job_blue-collar,job_entrepreneur,job_housemaid,job_management,job_retired,job_self-employed,job_services,job_student,job_technician,job_unemployed,marital_divorced,marital_married,marital_single @@ -181,8 +187,6 @@ docker run --rm $KUSCIA_IMAGE cat /home/kuscia/scripts/deploy/uninstall.sh > uni ## 接下来 -如果你希望使用自己的数据来执行作业,请参考[如何运行一个 Secretflow 作业](../tutorial/run_secretflow_cn.md)。 - -如果你希望使用互联互通银联 BFIA 协议来执行作业,请参考[如何运行一个互联互通银联 BFIA 协议作业](../tutorial/run_bfia_job_cn.md)。 +请继续阅读 [了解 KusciaJob][part-2] 章节,来了解示例作业背后的细节。 -如果你希望体验在安全沙箱中执行作业,请参考[如何启用安全沙箱](../tutorial/security_plan_cn.md)。 +[part-2]: ./run_secretflow_cn.md diff --git a/docs/tutorial/run_secretflow_cn.md b/docs/getting_started/run_secretflow_cn.md similarity index 89% rename from docs/tutorial/run_secretflow_cn.md rename to docs/getting_started/run_secretflow_cn.md index b1a945928..d6da97a2a 100644 --- a/docs/tutorial/run_secretflow_cn.md +++ b/docs/getting_started/run_secretflow_cn.md @@ -1,8 +1,12 @@ -# 如何运行一个 Secretflow 作业 +# Kuscia 入门教程 —— 了解 KusciaJob -## 准备节点 +你将会尝试自己配置并且提交一个作业,在这个过程中,你将会认识 Kuscia 中的重要概念 —— **KusciaJob**。 -准备节点请参考[快速入门](../getting_started/quickstart_cn.md)。 +## 准备集群 + +这里假设你已经在机器上部署并且启动了一个示例集群。如果你还没有这样做,请先按照 [快速开始][quickstart] 的指引启动一个集群。 + +[quickstart]: ./quickstart_cn.md ## 准备数据 @@ -88,14 +92,21 @@ spec: - domainID: bob ``` -### 使用你自己的数据配置 KusciaJob +:::{tip} -如果你要使用你自己的数据,可以将两个算子中的`taskInputConfig.sf_node_eval_param`中的`inputs`和`output_uris`中的数据文件路径修改为你在 [准备你自己的数据](#prepare-your-own-data) 中的数据文件目标路径即可。 +更多有关 KusciaJob 配置的信息,请查看 [KusciaJob](../reference/concepts/kusciajob_cn.md)。 + +KusciaJob 的算子参数由 `taskInputConfig` 字段定义,对于不同的算子,算子的参数不同。 + +本教程使用的是 SecretFlow 的算子参数定义。关于该定义的更多细节,敬请查阅 [SecretFlow 的对应文档][secretflow-component-spec]。 + +[secretflow-component-spec]: https://www.secretflow.org.cn/docs/secretflow/latest/zh-Hans/component -### 更多相关 +::: -更多有关 KusciaJob 配置的信息,请查看 [KusciaJob](../reference/concepts/kusciajob_cn.md) 和 [算子参数描述](#input-config) 。 -前者描述了 KusciaJob 的定义和相关说明,后者描述了支持的算子和参数。 +### 使用你自己的数据配置 KusciaJob + +如果你要使用你自己的数据,可以将两个算子中的`taskInputConfig.sf_node_eval_param`中的`inputs`和`output_uris`中的数据文件路径修改为你在 [准备你自己的数据](#prepare-your-own-data) 中的数据文件目标路径即可。 ## 运行 KusciaJob @@ -217,11 +228,25 @@ kubectl delete kj job-best-effort-linear 当这个 KusciaJob 被清理时, 这个 KusciaJob 创建的 KusciaTask 也会一起被清理。 -{#input-config} +## 接下来 + +恭喜!你已经完成了 Kuscia 的入门教程。接下来,你可以: + +- 进一步阅读 [Kuscia 架构细节][architecture],了解 Kuscia 的设计思路和概念。 +- 了解 [Kuscia API][kuscia-api]。Kuscia API 是 Kuscia 的一个更上层封装,支持更方便地将 Kuscia 集成到其他系统中。 +- 了解 [多机器部署][deploy-p2p] 的更多信息。 +- 尝试运行其它算法或是引擎的作业,比如 [互联互通银联 BFIA 协议作业][tutorial-bfia] 或是 [FATE 作业][tutorial-fate]。 + +[architecture]: ../reference/architecture_cn.md +[kuscia-api]: ../reference/apis/summary_cn.md +[deploy-p2p]: ../deployment/deploy_p2p_cn.md +[tutorial-bfia]: ../tutorial/run_bfia_job_cn.md +[tutorial-fate]: ../tutorial/run_fate_cn.md + +:::{tip} -## 算子参数描述 +如果你想要停止并清理入门教程使用的示例集群,可以查阅 [相关指引][stop-and-uninstall]。 -KusciaJob 的算子参数由`taskInputConfig`字段定义,对于不同的算子,算子的参数不同。 +[stop-and-uninstall]: ./quickstart_cn.md#停止体验集群 -[//]: # (链接未就绪) -对于 secretflow ,请参考:[Secretflow官网](https://www.secretflow.org.cn/) +::: diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 000000000..9a448c47f --- /dev/null +++ b/docs/index.md @@ -0,0 +1,97 @@ +# Kuscia + +Kuscia(Kubernetes-based Secure Collaborative InfrA)是一款基于 K8s 的隐私计算任务编排框架,旨在屏蔽异构基础设施和协议,并提供统一的隐私计算底座。通过 Kuscia: + +- 你可以快速体验隐私计算功能。 +- 你可以获得完整的隐私计算生产能力。 +- 你可以与行业内多种隐私计算系统进行互联互通。 +- 你可以使用不同的中心化或点对点业务组网模式。 + +## 入门 + +从零到一运行你的第一个 SecretFlow 作业! + +1. [安装 Kuscia 并运行示例任务][quickstart] +2. [提交 KusciaJob][run-secretflow] + +[quickstart]: ./getting_started/quickstart_cn.md +[run-secretflow]: ./getting_started/run_secretflow_cn.md + +## 架构及设计 + +理解 Kuscia 架构以及重要概念。 + +- [架构总览][architecture] +- Kuscia 概念:[Domain][concept-domain] | [DomainRoute][concept-domainroute] | [DomainData][concept-domaindata] | [KusciaJob][concept-kusciajob] | [KusciaTask][concept-kusciatask] | [AppImage][concept-appimage] | [InteropConfig][concept-interopconfig] + +[architecture]: ./reference/architecture_cn.md +[concept-domain]: ./reference/concepts/domain_cn.md +[concept-domainroute]: ./reference/concepts/domainroute_cn.md +[concept-domaindata]: ./reference/concepts/domaindata_cn.md +[concept-kusciajob]: ./reference/concepts/kusciajob_cn.md +[concept-kusciatask]: ./reference/concepts/kusciatask_cn.md +[concept-appimage]: ./reference/concepts/appimage_cn.md +[concept-interopconfig]: ./reference/concepts/interopconfig_cn.md + +## Kuscia API + +- [Kuscia API 介绍][api-overview] | [教程:用 Kuscia API 运行 SecretFlow 作业][api-tutorial] +- API 参考:[请求和响应][api-request-and-response] | [Domain][api-domain] | [DomainRoute][api-domainroute] | [DomainData][api-domaindata] | [KusciaJob][api-kusciajob] | [Health][api-health] + +[api-overview]: ./reference/apis/summary_cn.md +[api-tutorial]: ./tutorial/run_secretflow_with_api_cn.md +[api-request-and-response]: ./reference/apis/summary_cn.md#请求和响应约定 +[api-domain]: ./reference/apis/domain_cn.md +[api-domainroute]: ./reference/apis/domainroute_cn.md +[api-domaindata]: ./reference/apis/domaindata_cn.md +[api-kusciajob]: ./reference/apis/kusciajob_cn.md +[api-health]: ./reference/apis/health_cn.md + +## 部署 + +- [指南:多机器部署中心化集群][deploy-p2p] +- [指南:多机器部署点对点集群][deploy-master-lite] +- [常见运维操作][ops-cheatsheet] + +[deploy-master-lite]: ./deployment/deploy_master_lite_cn.md +[deploy-p2p]: ./deployment/deploy_p2p_cn.md +[ops-cheatsheet]: ./deployment/operation_cn.md + +## 更多指南 + +- [如何运行一个互联互通银联 BFIA 协议作业][how-to-bfia] +- [如何运行一个 FATE 作业][how-to-fate] +- [安全加固方案][how-to-security-plan] + +[how-to-bfia]: ./tutorial/run_bfia_job_cn.md +[how-to-fate]: ./tutorial/run_fate_cn.md +[how-to-security-plan]: ./tutorial/security_plan_cn.md + +## 获得帮助 + +使用 Kuscia 时遇到问题?在这里找到获得帮助的方式。 + +- [常见问题(FAQ)][faq] +- Kuscia 的 [Issues] 和 [讨论区] + +[faq]: ./reference/faq_cn.md +[Issues]: https://github.com/secretflow/kuscia/issues +[讨论区]: https://github.com/secretflow/kuscia/discussions + +## 开发 Kuscia + +- [构建 Kuscia][build-kuscia] +- [注册自定义算法镜像][custom-image] + +[build-kuscia]: ./development/build_kuscia_cn.md +[custom-image]: ./development/register_custom_image.md + +```{toctree} +:hidden: + +getting_started/index +reference/index +deployment/index +tutorial/index +development/index +``` diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index 98f706a0d..000000000 --- a/docs/index.rst +++ /dev/null @@ -1,28 +0,0 @@ -.. Kuscia documentation master file, created by - sphinx-quickstart on Fri Mar 10 10:10:10 2023. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - - -Kuscia -================== - -Kuscia(Kubernetes-based Secure Collaborative InfrA)是一款基于 K8s 的隐私计算任务编排框架,旨在屏蔽异构基础设施和协议,并提供统一的隐私计算底座。通过 Kuscia: - -* 你可以快速体验隐私计算功能。 -* 你可以获得完整的隐私计算生产能力。 -* 你可以与行业内多种隐私计算系统进行互联互通。 -* 你可以使用不同的中心化或点对点业务组网模式。 - -有关详细的 Kuscia 设计,请参考 :ref:`Kuscia 架构 `。 - -内容 -------- - -.. toctree:: - :maxdepth: 2 - - getting_started/index - reference/index - tutorial/index - development/index diff --git a/docs/reference/api_whitelist_config_cn.md b/docs/reference/api_whitelist_config_cn.md index 7c387ee4d..890e7f524 100644 --- a/docs/reference/api_whitelist_config_cn.md +++ b/docs/reference/api_whitelist_config_cn.md @@ -5,19 +5,19 @@ K3S API白名单会过滤由envoy转发的K3S API请求,不在白名单中的 如果配置列表为空,则默认放行所有请求。 ## 配置方法 -配置文件位于/home/kuscia/etc/kuscia.yaml,配置项位于master.api-whitelist节点下,由多个正则表达式组成,多个正则表达式之间是`或`的关系。 +配置文件位于/home/kuscia/etc/kuscia.yaml,配置项位于master.apiWhitelist节点下,由多个正则表达式组成,多个正则表达式之间是`或`的关系。 下面2个配置的效果是一样的: ```yaml # config 1 master: - api-whitelist: + apiWhitelist: - /(api(s)?(/[0-9A-Za-z_.-]+)?/v1(alpha1)?/namespaces/[0-9A-Za-z_.-]+/(pods|gateways|domainroutes|endpoints|services|events|configmaps|leases|taskresources|secrets|domaindatas|domaindatagrants|domaindatasources)(/[0-9A-Za-z_.-]+(/status$)?)?) - /api/v1/namespaces/[0-9A-Za-z_.-]+ - /api/v1/nodes(/.*)? # config 2 master: - api-whitelist: + apiWhitelist: - (/(api(s)?(/[0-9A-Za-z_.-]+)?/v1(alpha1)?/namespaces/[0-9A-Za-z_.-]+/(pods|gateways|domainroutes|endpoints|services|events|configmaps|leases|taskresources|secrets|domaindatas|domaindatagrants|domaindatasources)(/[0-9A-Za-z_.-]+(/status$)?)?))|(/api/v1/namespaces/[0-9A-Za-z_.-]+)|(/api/v1/nodes(/.*)?) ``` \ No newline at end of file diff --git a/docs/reference/apis/datamesh/domaindata_cn.md b/docs/reference/apis/datamesh/domaindata_cn.md index d42fbaeaf..5a6e4cde8 100644 --- a/docs/reference/apis/datamesh/domaindata_cn.md +++ b/docs/reference/apis/datamesh/domaindata_cn.md @@ -29,7 +29,7 @@ protobuf 文件。 | 字段 | 类型 | 可选 | 描述 | |---------------|-----------------------------------------------|----|----------------------------------------------------------------------------------------------------------------------------------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | | domaindata_id | string | 是 | 数据对象ID,满足 [DNS 子域名规则要求](https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names) | | name | string | 否 | 名称 | | type | string | 否 | 类型,\[table,model,rule,report,unknown],大小写敏感 | @@ -61,7 +61,7 @@ protobuf 文件。 | 字段 | 类型 | 可选 | 描述 | |---------------|-----------------------------------------------|----|------------------------------------------------------------------------------------------------------------------------------------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | +| header | [RequestHeader](summary_cn.md#请求和响应约定) | 是 | 自定义请求内容 | | domaindata_id | string | 否 | 数据对象ID | | name | string | 否 | 名称 | | type | string | 否 | 类型,\[table,model,rule,report,unknown],大小写敏感 | @@ -89,7 +89,7 @@ protobuf 文件。 | 字段 | 类型 | 可选 | 描述 | |---------------|-----------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | | domaindata_id | string | 否 | 数据对象ID | #### 响应(DeleteDomainDataResponse) @@ -109,7 +109,7 @@ protobuf 文件。 | 字段 | 类型 | 可选 | 描述 | |---------------|-----------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | | domaindata_id | string | 否 | 查询内容 | #### 响应(QueryDomainResponse) diff --git a/docs/reference/apis/datamesh/summary_cn.md b/docs/reference/apis/datamesh/summary_cn.md index 6c13d6f84..8d4ee6a33 100644 --- a/docs/reference/apis/datamesh/summary_cn.md +++ b/docs/reference/apis/datamesh/summary_cn.md @@ -15,9 +15,9 @@ protobuf ### 请求和响应约定 -请求总是携带会一个 header 字段,类型为 [RequestHeader](#request-header) , 如 [CreateDomainDataRequest](domaindata_cn.md#create-domain-data-request) , 该字段可以携带你自定义的一些数据。 +请求总是携带会一个 header 字段,类型为 [RequestHeader](#request-header) , 如 [CreateDomainDataRequest](domaindata_cn.md#请求createdomaindatarequest) , 该字段可以携带你自定义的一些数据。 -响应总是携带一个 status 字段,类型为 [Status](#status) , 如 [CreateDomainDataResponse](domaindata_cn.md#create-domain-data-response) , 该字段描述了响应的状态信息。 +响应总是携带一个 status 字段,类型为 [Status](#status) , 如 [CreateDomainDataResponse](domaindata_cn.md#响应createdomaindataresponse) , 该字段描述了响应的状态信息。 {#request-header} diff --git a/docs/reference/apis/domain_cn.md b/docs/reference/apis/domain_cn.md new file mode 100644 index 000000000..fe4eea78d --- /dev/null +++ b/docs/reference/apis/domain_cn.md @@ -0,0 +1,181 @@ +# Domain + +在 Kuscia 中将隐私计算的节点称为 Domain,一个 Domain 中可以包含多个 K8s +的工作节点(Node)。详情请参考 [Domain](../concepts/domain_cn.md) 。 +你可以从 [这里](https://github.com/secretflow/kuscia/tree/main/proto/api/v1alpha1/kusciaapi/domain.proto) 找到对应的 +protobuf 文件。 + +## 接口总览 + +| 方法名 | 请求类型 | 响应类型 | 描述 | +| ---------------------------------------------------- | ----------------------------- | ------------------------------ | ---------------- | +| [CreateDomain](#create-domain) | CreateDomainRequest | CreateDomainResponse | 创建节点 | +| [UpdateDomain](#update-domain) | UpdateDomainRequest | UpdateDomainResponse | 更新节点 | +| [DeleteDomain](#delete-domain) | DeleteDomainRequest | DeleteDomainResponse | 删除节点 | +| [QueryDomain](#query-domain) | QueryDomainRequest | QueryDomainResponse | 查询节点 | +| [BatchQueryDomainStatus](#batch-query-domain-status) | BatchQueryDomainStatusRequest | BatchQueryDomainStatusResponse | 批量查询节点状态 | + +## 接口详情 + +{#create-domain} + +### 创建节点 + +#### HTTP 路径 + +/api/v1/domain/create + +#### 请求(CreateDomainRequest) + +| 字段 | 类型 | 可选 | 描述 | +| ----------- | -------------------------------------------- | ---- | -------------------------------------------------------------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| domain_id | string | 否 | 节点 ID | +| role | string | 是 | 角色:\["", "partner"],参考 [Domain 概念](../concepts/domain_cn.md) | +| cert | string | 是 | BASE64 的计算节点证书,参考 [Domain 概念](../concepts/domain_cn.md) | +| auth_center | [AuthCenter](#auth-center) | 是 | 节点到中心的授权模式 | + +#### 响应(CreateDomainResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ------ | ------------------------------ | ---- | -------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | + +{#update-domain} + +### 更新节点 + +#### HTTP 路径 + +/api/v1/domain/update + +#### 请求(UpdateDomainRequest) + +| 字段 | 类型 | 可选 | 描述 | +| --------- | -------------------------------------------- | ---- | -------------------------------------------------------------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| domain_id | string | 是 | 节点 ID | +| role | string | 是 | 角色:\["", "partner"],参考 [Domain 概念](../concepts/domain_cn.md) | +| cert | string | 是 | BASE64 的计算节点证书,参考 [Domain 概念](../concepts/domain_cn.md) | + +#### 响应(UpdateDomainResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ------ | ------------------------------ | ---- | -------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | + +{#delete-domain} + +### 删除节点 + +#### HTTP 路径 + +/api/v1/domain/delete + +#### 请求(DeleteDomainRequest) + +| 字段 | 类型 | 可选 | 描述 | +| --------- | -------------------------------------------- | ---- | -------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| domain_id | string | 否 | 节点 ID | + +#### 响应(DeleteDomainResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ------ | ------------------------------ | ---- | -------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | + +{#query-domain} + +### 查询节点 + +#### HTTP 路径 + +/api/v1/domain/query + +#### 请求(QueryDomainRequest) + +| 字段 | 类型 | 可选 | 描述 | +| --------- | -------------------------------------------- | ---- | -------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| domain_id | string | 否 | 节点 ID | + +#### 响应(QueryDomainResponse) + +| 字段 | 类型 | 可选 | 描述 | +| -------------------------- | ------------------------------------------- | ---- | -------------------------------------------------------------------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | +| data | QueryDomainResponseData | | | +| data.domain_id | string | 否 | 节点 ID | +| data.role | string | 否 | 角色:\["", "partner"],参考 [Domain 概念](../concepts/domain_cn.md) | +| data.cert | string | 是 | BASE64 的计算节点证书,参考 [Domain 概念](../concepts/domain_cn.md) | +| data.annotations | map[string]string | 是 | 节点的额外信息,比如是否是内置节点等 | +| data.auth_center | [AuthCenter](#auth-center) | 是 | 节点到中心的授权模式 | +| data.node_statuses | [NodeStatus](#node-status)[] | 否 | 物理节点状态 | +| data.deploy_token_statuses | [DeployTokenStatus](#deploy-token-status)[] | 否 | 部署令牌状态 | + +{#batch-query-domain-status} + +### 批量查询节点状态 + +#### HTTP 路径 + +/api/v1/domain/status/batchQuery + +#### 请求(BatchQueryDomainStatusRequest) + +| 字段 | 类型 | 可选 | 描述 | +| ---------- | -------------------------------------------- | ---- | -------------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| domain_ids | string[] | 否 | 待查询的节点 ID 列表 | + +#### 响应( BatchQueryDomainStatusResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ------------ | ---------------------------------- | ---- | -------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | +| data | BatchQueryDomainStatusResponseData | 否 | | +| data.domains | [DomainStatus](#domain-status)[] | 否 | 节点列表 | + +## 公共 + +{#domain-status} + +### DomainStatus + +| 字段 | 类型 | 可选 | 描述 | +| --------------------- | ------------------------------------------- | ---- | ---------------- | +| domain_id | string | 否 | 节点 ID | +| node_statuses | [NodeStatus](#node-status)[] | 否 | 真实物理节点状态 | +| deploy_token_statuses | [DeployTokenStatus](#deploy-token-status)[] | 否 | 部署令牌状态 | + +{#node-status} + +### NodeStatus + +| 字段 | 类型 | 可选 | 描述 | +| -------------------- | ------ | ---- | ------------------------------------------------------- | +| name | string | 否 | 节点名称 | +| status | string | 否 | 节点状态 | +| version | string | 否 | 节点 Agent 版本 | +| last_heartbeat_time | string | 否 | 最后心跳时间,RFC3339 格式(e.g. 2006-01-02T15:04:05Z) | +| last_transition_time | string | 否 | 最后更新时间,RFC3339 格式(e.g. 2006-01-02T15:04:05Z) | + +{#auth-center} + +### AuthCenter + +| 字段 | 类型 | 可选 | 描述 | +| ------------------- | ------ | ---- | ------------------------------------------------- | +| authentication_type | string | 否 | 节点到中心授权类型,目前仅支持 Token | +| token_gen_method | string | 否 | 节点到中心 Token 生成类型,目前仅支持 UID-RSA-GEN | + +{#deploy-token-status} + +### DeployTokenStatus + +| 字段 | 类型 | 可选 | 描述 | +| -------------------- | ------ | ---- | ------------------------------------------------------- | +| token | string | 否 | 部署令牌 | +| state | string | 否 | 部署令牌状态 used, unsed | +| last_transition_time | string | 否 | 最后更新时间,RFC3339 格式(e.g. 2006-01-02T15:04:05Z) | diff --git a/docs/reference/apis/domaindata_cn.md b/docs/reference/apis/domaindata_cn.md new file mode 100644 index 000000000..043b40f39 --- /dev/null +++ b/docs/reference/apis/domaindata_cn.md @@ -0,0 +1,239 @@ +# DomainData + +DomainData 表示被 Kuscia 管理的数据。请参考 [DomainData](../concepts/domaindata_cn.md)。 +你可以从 [这里](https://github.com/secretflow/kuscia/tree/main/proto/api/v1alpha1/kusciaapi/domaindata.proto) 找到对应的 +protobuf 文件。 + +Data Mesh API 提供了从 Domain 侧的管理 DomainData 的能力,详细 API 请参考 [Data Mesh](./datamesh/domaindata_cn.md)。 + +## 接口总览 + +| 方法名 | 请求类型 | 响应类型 | 描述 | +| ------------------------------------------------ | --------------------------- | ---------------------------- | ---------------- | +| [CreateDomainData](#create-domain-data) | CreateDomainDataRequest | CreateDomainDataResponse | 创建数据对象 | +| [UpdateDomainData](#update-domain-data) | UpdateDomainDataRequest | UpdateDomainDataResponse | 更新数据对象 | +| [DeleteDomainData](#delete-domain-data) | DeleteDomainDataRequest | DeleteDomainDataResponse | 删除数据对象 | +| [QueryDomainData](#query-domain-data) | QueryDomainDataRequest | QueryDomainDataResponse | 查询数据对象 | +| [BatchQueryDomainData](#batch-query-domain-data) | BatchQueryDomainDataRequest | BatchQueryDomainDataResponse | 批量查询数据对象 | +| [ListDomainData](#list-domain-data) | ListDomainDataRequest | ListDomainDataResponse | 列出数据对象 | + +## 接口详情 + +{#create-domain-data} + +### 创建数据对象 + +#### HTTP 路径 + +/api/v1/domaindata/create + +{#create-domain-data-request} + +#### 请求(CreateDomainDataRequest) + +| 字段 | 类型 | 可选 | 描述 | +| ------------- | -------------------------------------------- | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| domaindata_id | string | 是 | 数据对象 ID,满足 [DNS 子域名规则要求](https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names) | +| name | string | 否 | 名称 | +| type | string | 否 | 类型,\[table,model,rule,report,unknown],大小写敏感 | +| relative_uri | string | 否 | 相对数据源所在位置的路径,参考 [DomainData 概念](../concepts/domaindata_cn.md) | +| domain_id | string | 否 | 节点 ID | +| datasource_id | string | 是 | 数据源 ID,不填写则使用默认数据源,参考 [DomainData 概念](../concepts/domaindata_cn.md) | +| attributes | map | 是 | 自定义属性,用作用户或应用算法组件为数据对象添加扩展信息,参考 [DomainData 概念](../concepts/domaindata_cn.md) | +| partition | [Partition](#partition) | 是 | 暂不支持 | +| columns | [DataColumn](#data-column) array | 否 | 列信息 | +| vendor | string | 是 | 来源,用于查询接口筛选数据对象,参考 [ListDomainDataRequestData](#list-domain-data-request-data) 和 [DomainData 概念](../concepts/domaindata_cn.md) | + +{#create-domain-data-response} + +#### 响应(CreateDomainDataResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ------------------ | ------------------------------ | ---- | ----------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | +| data | CreateDomainDataResponseData | | | +| data.domaindata_id | string | 否 | 数据对象 ID | + +{#update-domain-data} + +### 更新数据对象 + +#### HTTP 路径 + +/api/v1/domaindata/update + +#### 请求(UpdateDomainDataRequest) + +| 字段 | 类型 | 可选 | 描述 | +| ------------- | -------------------------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| domaindata_id | string | 否 | 数据对象 ID | +| name | string | 否 | 名称 | +| type | string | 否 | 类型,\[table,model,rule,report,unknown],大小写敏感 | +| relative_uri | string | 否 | 相对数据源所在位置的路径,参考 [DomainData 概念](../concepts/domaindata_cn.md) | +| domain_id | string | 否 | 节点 ID | +| datasource_id | string | 是 | 数据源 ID,不填写则使用默认数据源,参考 [DomainData 概念](../concepts/domaindata_cn.md) | +| attributes | map | 是 | 自定义属性,用作用户或应用算法组件为数据对象添加扩展信息,参考 [DomainData 概念](../concepts/domaindata_cn.md) | +| partition | [Partition](#partition) | 是 | 暂不支持 | +| columns | [DataColumn](#data-column)[] | 否 | 列信息 | +| vendor | string | 是 | 来源,用于批量查询接口筛选数据对象,参考 [ListDomainDataRequestData](#list-domain-data-request-data) 和 [DomainData 概念](../concepts/domaindata_cn.md) | + +#### 响应(UpdateDomainDataResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ------ | ------------------------------ | ---- | -------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | + +{#delete-domain-data} + +### 删除数据对象 + +#### HTTP 路径 + +/api/v1/domaindata/delete + +#### 请求(DeleteDomainDataRequest) + +| 字段 | 类型 | 可选 | 描述 | +| ------------- | -------------------------------------------- | ---- | -------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| domain_id | string | 否 | 节点 ID | +| domaindata_id | string | 否 | 数据对象 ID | + +#### 响应(DeleteDomainDataResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ------ | ------------------------------ | ---- | -------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | + +{#query-domain-data} + +### 查询数据对象 + +#### HTTP 路径 + +/api/v1/domaindata/query + +#### 请求(QueryDomainRequest) + +| 字段 | 类型 | 可选 | 描述 | +| ------ | ------------------------------------------------------------- | ---- | -------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| data | [QueryDomainDataRequestData](#query-domain-data-request-data) | 否 | 查询内容 | + +#### 响应(QueryDomainResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ------ | --------------------------------- | ---- | -------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | +| data | [DomainData](#domain-data-entity) | | | + +{#batch-query-domain-data} + +### 批量查询数据对象 + +#### HTTP 路径 + +/api/v1/domaindata/batchQuery + +#### 请求(BatchQueryDomainDataRequest) + +| 字段 | 类型 | 可选 | 描述 | +| ------ | --------------------------------------------------------------- | ---- | -------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| data | [QueryDomainDataRequestData](#query-domain-data-request-data)[] | 否 | 查询内容 | + +#### 响应(BatchQueryDomainDataResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ------ | ----------------------------------- | ---- | -------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | +| data | [DomainDataList](#domain-data-list) | | | + +{#list-domain-data} + +### 列出数据对象 + +#### HTTP 路径 + +/api/v1/domaindata/list + +#### 请求(ListDomainDataRequest) + +| 字段 | 类型 | 可选 | 描述 | +| ------ | ----------------------------------------------------------- | ---- | -------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| data | [ListDomainDataRequestData](#list-domain-data-request-data) | 否 | 查询请求 | + +#### 响应(ListDomainDataResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ------ | ----------------------------------- | ---- | -------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | +| data | [DomainDataList](#domain-data-list) | | | + +## 公共 + +{#query-domain-data-request-data} + +### QueryDomainDataRequestData + +| 字段 | 类型 | 可选 | 描述 | +| ------------- | ------ | ---- | ----------- | +| domain_id | string | 否 | 节点 ID | +| domaindata_id | string | 否 | 数据对象 ID | + +{#list-domain-data-request-data} + +##### ListDomainDataRequestData + +| 字段 | 类型 | 可选 | 描述 | +| ----------------- | ------ | ---- | ------- | +| domain_id | string | 否 | 节点 ID | +| domaindata_type | string | 是 | 类型 | +| domaindata_vendor | string | 是 | 来源 | + +{#domain-data-list} + +### DomainDataList + +| 字段 | 类型 | 可选 | 描述 | +| --------------- | ----------------------------------- | ---- | ------------ | +| domaindata_list | [DomainData](#domain-data-entity)[] | 否 | 数据对象列表 | + +{#domain-data-entity} + +### DomainData + +| 字段 | 类型 | 可选 | 描述 | +| ------------- | ---------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| domaindata_id | string | 否 | 数据对象 ID | +| name | string | 否 | 名称 | +| type | string | 否 | 类型,\[table,model,rule,report,unknown],大小写敏感 | +| relative_uri | string | 否 | 相对数据源所在位置的路径,参考 [DomainData 概念](../concepts/domaindata_cn.md) | +| domain_id | string | 否 | 节点 ID | +| datasource_id | string | 否 | 数据源 ID,参考 [DomainData 概念](../concepts/domaindata_cn.md) | +| attributes | map | 是 | 自定义属性,用作用户或应用算法组件为数据对象添加扩展信息,参考 [DomainData 概念](../concepts/domaindata_cn.md) | +| partition | [Partition](#partition) | 是 | 暂不支持 | +| columns | [DataColumn](#data-column)[] | 否 | 列信息 | +| vendor | string | 是 | 来源,用于批量查询接口筛选数据对象,参考 [ListDomainDataRequestData](#list-domain-data-request-data) 和 [DomainData 概念](../concepts/domaindata_cn.md) | + +{#partition} + +### Partition + +| 字段 | 类型 | 可选 | 描述 | +| ------ | ---------------------------- | ---- | ------ | +| type | string | 否 | 类型 | +| fields | [DataColumn](#data-column)[] | 否 | 列信息 | + +{#data-column} + +### DataColumn + +| 字段 | 类型 | 可选 | 描述 | +| ------- | ------ | ---- | -------------------------------------------------------------------------------------------- | +| name | string | 否 | 列名称 | +| type | string | 否 | 类型,当前版本由应用算法组件定义和消费,参考 [DomainData 概念](../concepts/domaindata_cn.md) | +| comment | string | 是 | 列注释 | diff --git a/docs/reference/apis/domainroute_cn.md b/docs/reference/apis/domainroute_cn.md new file mode 100644 index 000000000..0551b37b2 --- /dev/null +++ b/docs/reference/apis/domainroute_cn.md @@ -0,0 +1,193 @@ +# DomainRoute + +DomainRoute 用于在中心化网络中配置 Lite 节点与 Master 之间的路由规则、Lite 节点之间的路由规则,以及点对点(P2P)网络中 +Autonomy 节点之间的路由规则。请参考 [DomainRoute](../concepts/domainroute_cn.md) 。 +你可以从 [这里](https://github.com/secretflow/kuscia/tree/main/proto/api/v1alpha1/kusciaapi/domainroute.proto) 找到对应的 +protobuf 文件。 + +## 接口总览 + +| 方法名 | 请求类型 | 响应类型 | 描述 | +| --------------------------------------------------------------- | ---------------------------------- | ----------------------------------- | -------------------- | +| [CreateDomainRoute](#create-domain-route) | CreateDomainRouteRequest | CreateDomainRouteResponse | 创建节点路由 | +| [DeleteDomainRoute](#delete-domain-route) | DeleteDomainRouteRequest | DeleteDomainRouteResponse | 查询节点路由 | +| [QueryDomainRoute](#query-domain-route) | QueryDomainRouteRequest | QueryDomainRouteResponse | 查询节点路由 | +| [BatchQueryDomainRouteStatus](#batch-query-domain-route-status) | BatchQueryDomainRouteStatusRequest | BatchQueryDomainRouteStatusResponse | 批量查询节点路由状态 | + +## 接口详情 + +{#create-domain-route} + +### 创建节点路由 + +#### HTTP 路径 + +/api/v1/route/create + +#### 请求(CreateDomainRouteRequest) + +| 字段 | 类型 | 可选 | 描述 | +| ------------------- | -------------------------------------------- | ---- | -------------------------------------------------------------------------------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| authentication_type | string | 否 | 认证类型:\[Token,MTLS,None],参考 [DomainRoute 概念](../concepts/domainroute_cn.md) | +| destination | string | 否 | 目标节点 | +| endpoint | [RouteEndpoint](#route-endpoint) | 否 | 目标节点的地址 | +| source | string | 否 | 源节点 | + +#### 响应(CreateDomainRouteResponse) + +| 字段 | 类型 | 可选 | 描述 | +| --------- | ------------------------------ | ---- | -------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | +| data | CreateDomainRouteResponseData | 否 | | +| data.name | string | 否 | 名称 | + +{#delete-domain-route} + +### 删除节点路由 + +#### HTTP 路径 + +/api/v1/route/delete + +#### 请求(DeleteDomainRequest) + +| 字段 | 类型 | 可选 | 描述 | +| ----------- | -------------------------------------------- | ---- | -------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| destination | string | 否 | 目标节点 | +| source | string | 否 | 源节点 | + +#### 响应(DeleteDomainResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ------ | ------------------------------ | ---- | -------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | + +{#query-domain-route} + +### 查询节点路由 + +#### HTTP 路径 + +/api/v1/route/query + +#### 请求(QueryDomainRouteRequest) + +| 字段 | 类型 | 可选 | 描述 | +| ----------- | -------------------------------------------- | ---- | -------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| destination | string | 否 | 目标地址 | +| source | string | 否 | 源地址 | + +#### 响应(QueryDomainRouteResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ------------------------ | -------------------------------- | ---- | -------------------------------------------------------------------------------------- | +| status | [Status](./summary_cn.md#status) | 否 | 状态信息 | +| data | QueryDomainRouteResponseData | 否 | | +| data.name | string | 否 | 节点名称 | +| data.authentication_type | string | 否 | 认证类型:\[Token,MTLS,None],参考 [DomainRoute 概念](../concepts/domainroute_cn.md) | +| data.destination | string | 否 | 目标节点 | +| data.endpoint | [RouteEndpoint](#route-endpoint) | 否 | 目标节点的地址,参考 [DomainRoute 概念](../concepts/domainroute_cn.md) | +| data.source | string | 否 | 源节点 | +| data.token_config | [TokenConfig](#token-config) | 是 | Token 配置 | +| data.mtls_config | [MTLSConfig](#mtls-config) | 是 | MTLS 配置 | +| data.status | [RouteStatus](#route-status) | 否 | 状态 | + +{#batch-query-domain-route-status} + +### 批量查询节点路由状态 + +#### HTTP 路径 + +/api/v1/route/status/batchQuery + +#### 请求(BatchQueryDomainRouteStatusRequest) + +| 字段 | 类型 | 可选 | 描述 | +| ---------- | -------------------------------------------- | ---- | -------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| route_keys | [DomainRouteKey](#domain-route-key) | 否 | 路由列表 | + +#### 响应(BatchQueryDomainRouteStatusResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ----------- | ------------------------------------------- | ---- | ------------ | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | +| data | BatchQueryDomainRouteStatusResponseData | | | +| data.routes | [DomainRouteStatus](#domain-route-status)[] | 否 | 授权路由列表 | + +## 公共 + +{#domain-route-key} + +### DomainRouteKey + +| 字段 | 类型 | 可选 | 描述 | +| ----------- | ------ | ---- | ----------- | +| source | string | 否 | 源节点 ID | +| destination | string | 否 | 目标节点 ID | + +{#domain-route-status} + +### DomainRouteStatus + +| 字段 | 类型 | 可选 | 描述 | +| ----------- | ---------------------------- | ---- | ----------- | +| name | string | 否 | 名称 | +| destination | string | 否 | 目标节点 ID | +| source | string | 否 | 源节点 ID | +| status | [RouteStatus](#route-status) | 否 | 状态 | + +{#endpoint-port} + +### EndpointPort + +| 字段 | 类型 | 可选 | 描述 | +| -------- | ------ | ---- | ----------------------- | +| port | int32 | 否 | 端口号 | +| protocol | string | 否 | 端口协议:\[HTTP, GRPC] | + +{#route-endpoint} + +### RouteEndpoint + +| 字段 | 类型 | 可选 | 描述 | +| ----- | -------------------------------- | ---- | -------- | +| host | string | 否 | 目标主机 | +| ports | [EndpointPort](#endpoint-port)[] | 否 | 目标端口 | + +{#route-status} + +### RouteStatus + +| 字段 | 类型 | 可选 | 描述 | +| ------ | ------ | ---- | ----------------------------- | +| status | string | 否 | 是否成功:\[Succeeded,Failed] | +| reason | string | 是 | 原因 | + +{#mtls-config} + +### MTLSConfig + +详细参考 [DomainRoute 概念](../concepts/domainroute_cn.md) 。 + +| 字段 | 类型 | 可选 | 描述 | +| ------------------------- | ------ | ---- | ---------------- | +| tls_ca | string | 否 | TLS 的 CA | +| source_client_private_key | string | 否 | 来源客户端的私钥 | +| source_client_cert | string | 否 | 来源客户端的证书 | + +{#token-config} + +### TokenConfig + +详细参考 [DomainRoute 概念](../concepts/domainroute_cn.md) 。 + +| 字段 | 类型 | 可选 | 描述 | +| ---------------------- | ------ | ---- | ------------------------------ | +| destination_public_key | string | 否 | 目标节点的公钥 | +| rolling_update_period | int64 | 否 | 滚动更新间隔,单位 秒 | +| source_public_key | string | 否 | 源节点的公钥 | +| token_gen_method | string | 否 | 签名方式:\[RSA-GEN, RAND-GEN] | diff --git a/docs/reference/apis/kusciaapis/health_cn.md b/docs/reference/apis/health_cn.md similarity index 92% rename from docs/reference/apis/kusciaapis/health_cn.md rename to docs/reference/apis/health_cn.md index b184d3340..083e1b103 100644 --- a/docs/reference/apis/kusciaapis/health_cn.md +++ b/docs/reference/apis/health_cn.md @@ -22,7 +22,7 @@ Health 提供了服务的健康检查,你可以借助这些 API 了解服务 | 字段 | 类型 | 可选 | 描述 | |--------|-----------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | #### 响应(HealthResponse) diff --git a/docs/reference/apis/index.rst b/docs/reference/apis/index.rst index 51e954a06..a5370264a 100644 --- a/docs/reference/apis/index.rst +++ b/docs/reference/apis/index.rst @@ -1,10 +1,19 @@ -.. _apis: - -接口定义 -=========== +Kuscia API +========== .. toctree:: :maxdepth: 2 - ./kusciaapis/index - ./datamesh/index + summary_cn + domain_cn + domainroute_cn + domaindata_cn + kusciajob_cn + health_cn + +.. Hide DataMesh-related docs until we figure out where to put them + +.. .. toctree:: +.. :hidden: + +.. datamesh/index diff --git a/docs/reference/apis/kusciaapis/domain_cn.md b/docs/reference/apis/kusciaapis/domain_cn.md deleted file mode 100644 index cb9108585..000000000 --- a/docs/reference/apis/kusciaapis/domain_cn.md +++ /dev/null @@ -1,181 +0,0 @@ -# Domain - -在 Kuscia 中将隐私计算的节点称为 Domain,一个 Domain 中可以包含多个 K8s -的工作节点(Node)。详情请参考 [Domain](../../concepts/domain_cn.md) 。 -你可以从 [这里](https://github.com/secretflow/kuscia/tree/main/proto/api/v1alpha1/kusciaapi/domain.proto) 找到对应的 -protobuf 文件。 - -## 接口总览 - -| 方法名 | 请求类型 | 响应类型 | 描述 | -|------------------------------------------------------|-------------------------------|--------------------------------|----------| -| [CreateDomain](#create-domain) | CreateDomainRequest | CreateDomainResponse | 创建节点 | -| [UpdateDomain](#update-domain) | UpdateDomainRequest | UpdateDomainResponse | 更新节点 | -| [DeleteDomain](#delete-domain) | DeleteDomainRequest | DeleteDomainResponse | 删除节点 | -| [QueryDomain](#query-domain) | QueryDomainRequest | QueryDomainResponse | 查询节点 | -| [BatchQueryDomainStatus](#batch-query-domain-status) | BatchQueryDomainStatusRequest | BatchQueryDomainStatusResponse | 批量查询节点状态 | - -## 接口详情 - -{#create-domain} - -### 创建节点 - -#### HTTP路径 -/api/v1/domain/create - -#### 请求(CreateDomainRequest) - -| 字段 | 类型 | 可选 | 描述 | -|-------------|-----------------------------------------------|----|----------------------------------------------------------------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| domain_id | string | 否 | 节点ID | -| role | string | 是 | 角色:\["", "partner"],参考 [Domain概念](../../concepts/domain_cn.md) | -| cert | string | 是 | BASE64的计算节点证书,参考 [Domain概念](../../concepts/domain_cn.md) | -| auth_center | [AuthCenter](#auth-center) | 是 | 节点到中心的授权模式 | - - -#### 响应(CreateDomainResponse) - -| 字段 | 类型 | 可选 | 描述 | -|--------|--------------------------------|----|------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | - -{#update-domain} - -### 更新节点 - -#### HTTP路径 -/api/v1/domain/update - -#### 请求(UpdateDomainRequest) - -| 字段 | 类型 | 可选 | 描述 | -|-----------|-----------------------------------------------|----|----------------------------------------------------------------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| domain_id | string | 是 | 节点ID | -| role | string | 是 | 角色:\["", "partner"],参考 [Domain概念](../../concepts/domain_cn.md) | -| cert | string | 是 | BASE64的计算节点证书,参考 [Domain概念](../../concepts/domain_cn.md) | - - -#### 响应(UpdateDomainResponse) - -| 字段 | 类型 | 可选 | 描述 | -|--------|--------------------------------|----|------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | - -{#delete-domain} - -### 删除节点 - -#### HTTP路径 -/api/v1/domain/delete - -#### 请求(DeleteDomainRequest) - -| 字段 | 类型 | 可选 | 描述 | -|-----------|-----------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| domain_id | string | 否 | 节点ID | - -#### 响应(DeleteDomainResponse) - -| 字段 | 类型 | 可选 | 描述 | -|--------|--------------------------------|----|------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | - -{#query-domain} - -### 查询节点 - -#### HTTP路径 -/api/v1/domain/query - -#### 请求(QueryDomainRequest) - -| 字段 | 类型 | 可选 | 描述 | -|-----------|-----------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| domain_id | string | 否 | 节点ID | - -#### 响应(QueryDomainResponse) - -| 字段 | 类型 | 可选 | 描述 | -|----------------------------|---------------------------------------------|----|----------------------------------------------------------------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | -| data | QueryDomainResponseData | | | -| data.domain_id | string | 否 | 节点ID | -| data.role | string | 否 | 角色:\["", "partner"],参考 [Domain概念](../../concepts/domain_cn.md) | -| data.cert | string | 是 | BASE64的计算节点证书,参考 [Domain概念](../../concepts/domain_cn.md) | -| data.annotations | map[string]string | 是 | 节点的额外信息,比如是否是内置节点等 | -| data.auth_center | [AuthCenter](#auth-center) | 是 | 节点到中心的授权模式 | -| data.node_statuses | [NodeStatus](#node-status)[] | 否 | 物理节点状态 | -| data.deploy_token_statuses | [DeployTokenStatus](#deploy-token-status)[] | 否 | 部署令牌状态 | - -{#batch-query-domain-status} - -### 批量查询节点状态 - -#### HTTP路径 -/api/v1/domain/status/batchQuery - -#### 请求(BatchQueryDomainStatusRequest) - -| 字段 | 类型 | 可选 | 描述 | -|------------|-----------------------------------------------|----|------------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| domain_ids | string[] | 否 | 待查询的节点ID列表 | - -#### 响应( BatchQueryDomainStatusResponse) - -| 字段 | 类型 | 可选 | 描述 | -|--------------|------------------------------------|----|------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | -| data | BatchQueryDomainStatusResponseData | 否 | | -| data.domains | [DomainStatus](#domain-status)[] | 否 | 节点列表 | - -## 公共 - -{#domain-status} - -### DomainStatus - -| 字段 | 类型 | 可选 | 描述 | -|-----------------------|---------------------------------------------|-----|----------| -| domain_id | string | 否 | 节点ID | -| node_statuses | [NodeStatus](#node-status)[] | 否 | 真实物理节点状态 | -| deploy_token_statuses | [DeployTokenStatus](#deploy-token-status)[] | 否 | 部署令牌状态 | - - -{#node-status} - -### NodeStatus - -| 字段 | 类型 | 可选 | 描述 | -|----------------------|--------|----|---------------------------------------------| -| name | string | 否 | 节点名称 | -| status | string | 否 | 节点状态 | -| version | string | 否 | 节点Agent版本 | -| last_heartbeat_time | string | 否 | 最后心跳时间,RFC3339格式(e.g. 2006-01-02T15:04:05Z) | -| last_transition_time | string | 否 | 最后更新时间,RFC3339格式(e.g. 2006-01-02T15:04:05Z) | - - -{#auth-center} - -### AuthCenter - -| 字段 | 类型 | 可选 | 描述 | -|----------------------|--------|----|-------------------------------------------| -| authentication_type | string | 否 | 节点到中心授权类型,目前仅支持 Token | -| token_gen_method | string | 否 | 节点到中心Token生成类型,目前仅支持 UID-RSA-GEN | - - -{#deploy-token-status} - -### DeployTokenStatus - -| 字段 | 类型 | 可选 | 描述 | -|----------------------|--------|----|---------------------------------------------| -| token | string | 否 | 部署令牌 | -| state | string | 否 | 部署令牌状态 used, unsed | -| last_transition_time | string | 否 | 最后更新时间,RFC3339格式(e.g. 2006-01-02T15:04:05Z) | \ No newline at end of file diff --git a/docs/reference/apis/kusciaapis/domaindata_cn.md b/docs/reference/apis/kusciaapis/domaindata_cn.md deleted file mode 100644 index 824f3c4d3..000000000 --- a/docs/reference/apis/kusciaapis/domaindata_cn.md +++ /dev/null @@ -1,237 +0,0 @@ -# DomainData - -DomainData 表示被 Kuscia 管理的数据。请参考 [DomainData](../../concepts/domaindata_cn.md)。 -你可以从 [这里](https://github.com/secretflow/kuscia/tree/main/proto/api/v1alpha1/kusciaapi/domaindata.proto) 找到对应的 -protobuf 文件。 - -Data Mesh API 提供了从 Domain 侧的管理 DomainData 的能力,详细 API 请参考 [Data Mesh](../datamesh/domaindata_cn.md)。 - -## 接口总览 - -| 方法名 | 请求类型 | 响应类型 | 描述 | -|--------------------------------------------------|-----------------------------|------------------------------|----------| -| [CreateDomainData](#create-domain-data) | CreateDomainDataRequest | CreateDomainDataResponse | 创建数据对象 | -| [UpdateDomainData](#update-domain-data) | UpdateDomainDataRequest | UpdateDomainDataResponse | 更新数据对象 | -| [DeleteDomainData](#delete-domain-data) | DeleteDomainDataRequest | DeleteDomainDataResponse | 删除数据对象 | -| [QueryDomainData](#query-domain-data) | QueryDomainDataRequest | QueryDomainDataResponse | 查询数据对象 | -| [BatchQueryDomainData](#batch-query-domain-data) | BatchQueryDomainDataRequest | BatchQueryDomainDataResponse | 批量查询数据对象 | -| [ListDomainData](#list-domain-data) | ListDomainDataRequest | ListDomainDataResponse | 列出数据对象 | - -## 接口详情 - -{#create-domain-data} - -### 创建数据对象 - -#### HTTP路径 -/api/v1/domaindata/create - -{#create-domain-data-request} - -#### 请求(CreateDomainDataRequest) - -| 字段 | 类型 | 可选 | 描述 | -|---------------|-----------------------------------------------|----|----------------------------------------------------------------------------------------------------------------------------------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| domaindata_id | string | 是 | 数据对象ID,满足 [DNS 子域名规则要求](https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names) | -| name | string | 否 | 名称 | -| type | string | 否 | 类型,\[table,model,rule,report,unknown],大小写敏感 | -| relative_uri | string | 否 | 相对数据源所在位置的路径,参考 [DomainData概念](../../concepts/domaindata_cn.md) | -| domain_id | string | 否 | 节点ID | -| datasource_id | string | 是 | 数据源ID,不填写则使用默认数据源,参考 [DomainData概念](../../concepts/domaindata_cn.md) | -| attributes | map | 是 | 自定义属性,用作用户或应用算法组件为数据对象添加扩展信息,参考 [DomainData概念](../../concepts/domaindata_cn.md) | -| partition | [Partition](#partition) | 是 | 暂不支持 | -| columns | [DataColumn](#data-column) array | 否 | 列信息 | -| vendor | string | 是 | 来源,用于查询接口筛选数据对象,参考 [ListDomainDataRequestData](#list-domain-data-request-data) 和 [DomainData概念](../../concepts/domaindata_cn.md) | - -{#create-domain-data-response} - -#### 响应(CreateDomainDataResponse) - -| 字段 | 类型 | 可选 | 描述 | -|--------------------|--------------------------------|----|--------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | -| data | CreateDomainDataResponseData | | | -| data.domaindata_id | string | 否 | 数据对象ID | - -{#update-domain-data} - -### 更新数据对象 - -#### HTTP路径 -/api/v1/domaindata/update - -#### 请求(UpdateDomainDataRequest) - -| 字段 | 类型 | 可选 | 描述 | -|---------------|-----------------------------------------------|----|------------------------------------------------------------------------------------------------------------------------------------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| domaindata_id | string | 否 | 数据对象ID | -| name | string | 否 | 名称 | -| type | string | 否 | 类型,\[table,model,rule,report,unknown],大小写敏感 | -| relative_uri | string | 否 | 相对数据源所在位置的路径,参考 [DomainData概念](../../concepts/domaindata_cn.md) | -| domain_id | string | 否 | 节点ID | -| datasource_id | string | 是 | 数据源ID,不填写则使用默认数据源,参考 [DomainData概念](../../concepts/domaindata_cn.md) | -| attributes | map | 是 | 自定义属性,用作用户或应用算法组件为数据对象添加扩展信息,参考 [DomainData概念](../../concepts/domaindata_cn.md) | -| partition | [Partition](#partition) | 是 | 暂不支持 | -| columns | [DataColumn](#data-column)[] | 否 | 列信息 | -| vendor | string | 是 | 来源,用于批量查询接口筛选数据对象,参考 [ListDomainDataRequestData](#list-domain-data-request-data) 和 [DomainData概念](../../concepts/domaindata_cn.md) | - -#### 响应(UpdateDomainDataResponse) - -| 字段 | 类型 | 可选 | 描述 | -|--------|--------------------------------|----|------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | - -{#delete-domain-data} - -### 删除数据对象 - -#### HTTP路径 -/api/v1/domaindata/delete - -#### 请求(DeleteDomainDataRequest) - -| 字段 | 类型 | 可选 | 描述 | -|---------------|-----------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| domain_id | string | 否 | 节点ID | -| domaindata_id | string | 否 | 数据对象ID | - -#### 响应(DeleteDomainDataResponse) - -| 字段 | 类型 | 可选 | 描述 | -|--------|--------------------------------|----|------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | - -{#query-domain-data} - -### 查询数据对象 - -#### HTTP路径 -/api/v1/domaindata/query - -#### 请求(QueryDomainRequest) - -| 字段 | 类型 | 可选 | 描述 | -|--------|---------------------------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| data | [QueryDomainDataRequestData](#query-domain-data-request-data) | 否 | 查询内容 | - -#### 响应(QueryDomainResponse) - -| 字段 | 类型 | 可选 | 描述 | -|--------|-----------------------------------|----|------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | -| data | [DomainData](#domain-data-entity) | | | - -{#batch-query-domain-data} - -### 批量查询数据对象 - -#### HTTP路径 -/api/v1/domaindata/batchQuery - -#### 请求(BatchQueryDomainDataRequest) - -| 字段 | 类型 | 可选 | 描述 | -|--------|-----------------------------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| data | [QueryDomainDataRequestData](#query-domain-data-request-data)[] | 否 | 查询内容 | - -#### 响应(BatchQueryDomainDataResponse) - -| 字段 | 类型 | 可选 | 描述 | -|--------|-------------------------------------|----|------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | -| data | [DomainDataList](#domain-data-list) | | | - -{#list-domain-data} - -### 列出数据对象 - -#### HTTP路径 -/api/v1/domaindata/list - -#### 请求(ListDomainDataRequest) - -| 字段 | 类型 | 可选 | 描述 | -|--------|-------------------------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| data | [ListDomainDataRequestData](#list-domain-data-request-data) | 否 | 查询请求 | - -#### 响应(ListDomainDataResponse) - -| 字段 | 类型 | 可选 | 描述 | -|--------|-------------------------------------|----|------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | -| data | [DomainDataList](#domain-data-list) | | | - - -## 公共 - -{#query-domain-data-request-data} - -### QueryDomainDataRequestData - -| 字段 | 类型 | 可选 | 描述 | -|---------------|-----------------------------------------------|----|--------| -| domain_id | string | 否 | 节点ID | -| domaindata_id | string | 否 | 数据对象ID | - -{#list-domain-data-request-data} - -##### ListDomainDataRequestData - -| 字段 | 类型 | 可选 | 描述 | -|-------------------|--------|----|------| -| domain_id | string | 否 | 节点ID | -| domaindata_type | string | 是 | 类型 | -| domaindata_vendor | string | 是 | 来源 | - -{#domain-data-list} - -### DomainDataList - -| 字段 | 类型 | 可选 | 描述 | -|-----------------|-------------------------------------|----|--------| -| domaindata_list | [DomainData](#domain-data-entity)[] | 否 | 数据对象列表 | - - -{#domain-data-entity} - -### DomainData - -| 字段 | 类型 | 可选 | 描述 | -|---------------|------------------------------|----|------------------------------------------------------------------------------------------------------------------------------------| -| domaindata_id | string | 否 | 数据对象ID | -| name | string | 否 | 名称 | -| type | string | 否 | 类型,\[table,model,rule,report,unknown],大小写敏感 | -| relative_uri | string | 否 | 相对数据源所在位置的路径,参考 [DomainData概念](../../concepts/domaindata_cn.md) | -| domain_id | string | 否 | 节点ID | -| datasource_id | string | 否 | 数据源ID,参考 [DomainData概念](../../concepts/domaindata_cn.md) | -| attributes | map | 是 | 自定义属性,用作用户或应用算法组件为数据对象添加扩展信息,参考 [DomainData概念](../../concepts/domaindata_cn.md) | -| partition | [Partition](#partition) | 是 | 暂不支持 | -| columns | [DataColumn](#data-column)[] | 否 | 列信息 | -| vendor | string | 是 | 来源,用于批量查询接口筛选数据对象,参考 [ListDomainDataRequestData](#list-domain-data-request-data) 和 [DomainData概念](../../concepts/domaindata_cn.md) | - - -{#partition} - -### Partition - -| 字段 | 类型 | 可选 | 描述 | -|--------|------------------------------|----|-----| -| type | string | 否 | 类型 | -| fields | [DataColumn](#data-column)[] | 否 | 列信息 | - - -{#data-column} - -### DataColumn - -| 字段 | 类型 | 可选 | 描述 | -|---------|--------|----|------------------------------------------------------------------------| -| name | string | 否 | 列名称 | -| type | string | 否 | 类型,当前版本由应用算法组件定义和消费,参考 [DomainData概念](../../concepts/domaindata_cn.md) | -| comment | string | 是 | 列注释 | \ No newline at end of file diff --git a/docs/reference/apis/kusciaapis/domainroute_cn.md b/docs/reference/apis/kusciaapis/domainroute_cn.md deleted file mode 100644 index bd4fb2b96..000000000 --- a/docs/reference/apis/kusciaapis/domainroute_cn.md +++ /dev/null @@ -1,191 +0,0 @@ -# DomainRoute - -DomainRoute 用于在中心化网络中配置 Lite 节点与 Master 之间的路由规则、Lite 节点之间的路由规则,以及点对点(P2P)网络中 -Autonomy 节点之间的路由规则。请参考 [DomainRoute](../../concepts/domainroute_cn.md) 。 -你可以从 [这里](https://github.com/secretflow/kuscia/tree/main/proto/api/v1alpha1/kusciaapi/domainroute.proto) 找到对应的 -protobuf 文件。 - -## 接口总览 - -| 方法名 | 请求类型 | 响应类型 | 描述 | -|-----------------------------------------------------------------|------------------------------------|-------------------------------------|------------| -| [CreateDomainRoute](#create-domain-route) | CreateDomainRouteRequest | CreateDomainRouteResponse | 创建节点路由 | -| [DeleteDomainRoute](#delete-domain-route) | DeleteDomainRouteRequest | DeleteDomainRouteResponse | 查询节点路由 | -| [QueryDomainRoute](#query-domain-route) | QueryDomainRouteRequest | QueryDomainRouteResponse | 查询节点路由 | -| [BatchQueryDomainRouteStatus](#batch-query-domain-route-status) | BatchQueryDomainRouteStatusRequest | BatchQueryDomainRouteStatusResponse | 批量查询节点路由状态 | - -## 接口详情 - -{#create-domain-route} - -### 创建节点路由 - -#### HTTP路径 -/api/v1/route/create - -#### 请求(CreateDomainRouteRequest) - -| 字段 | 类型 | 可选 | 描述 | -|---------------------|-----------------------------------------------|----|------------------------------------------------------------------------------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| authentication_type | string | 否 | 认证类型:\[Token,MTLS,None],参考 [DomainRoute概念](../../concepts/domainroute_cn.md) | -| destination | string | 否 | 目标节点 | -| endpoint | [RouteEndpoint](#route-endpoint) | 否 | 目标节点的地址 | -| source | string | 否 | 源节点 | - -#### 响应(CreateDomainRouteResponse) - -| 字段 | 类型 | 可选 | 描述 | -|-----------|--------------------------------|----|------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | -| data | CreateDomainRouteResponseData | 否 | | -| data.name | string | 否 | 名称 | - -{#delete-domain-route} - -### 删除节点路由 - -#### HTTP路径 -/api/v1/route/delete - -#### 请求(DeleteDomainRequest) - -| 字段 | 类型 | 可选 | 描述 | -|-------------|-----------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| destination | string | 否 | 目标节点 | -| source | string | 否 | 源节点 | - -#### 响应(DeleteDomainResponse) - -| 字段 | 类型 | 可选 | 描述 | -|--------|--------------------------------|----|------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | - - -{#query-domain-route} - -### 查询节点路由 - -#### HTTP路径 -/api/v1/route/query - -#### 请求(QueryDomainRouteRequest) - -| 字段 | 类型 | 可选 | 描述 | -|-------------|-----------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| destination | string | 否 | 目标地址 | -| source | string | 否 | 源地址 | - -#### 响应(QueryDomainRouteResponse) - -| 字段 | 类型 | 可选 | 描述 | -|--------------------------|----------------------------------|----|------------------------------------------------------------------------------| -| status | [Status](./summary.html#status) | 否 | 状态信息 | -| data | QueryDomainRouteResponseData | 否 | | -| data.name | string | 否 | 节点名称 | -| data.authentication_type | string | 否 | 认证类型:\[Token,MTLS,None],参考 [DomainRoute概念](../../concepts/domainroute_cn.md) | -| data.destination | string | 否 | 目标节点 | -| data.endpoint | [RouteEndpoint](#route-endpoint) | 否 | 目标节点的地址,参考 [DomainRoute概念](../../concepts/domainroute_cn.md) | -| data.source | string | 否 | 源节点 | -| data.token_config | [TokenConfig](#token-config) | 是 | Token配置 | -| data.mtls_config | [MTLSConfig](#mtls-config) | 是 | MTLS配置 | -| data.status | [RouteStatus](#route-status) | 否 | 状态 | - -{#batch-query-domain-route-status} - -### 批量查询节点路由状态 - -#### HTTP路径 -/api/v1/route/status/batchQuery - -#### 请求(BatchQueryDomainRouteStatusRequest) - -| 字段 | 类型 | 可选 | 描述 | -|------------|-----------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| route_keys | [DomainRouteKey](#domain-route-key) | 否 | 路由列表 | - -#### 响应(BatchQueryDomainRouteStatusResponse) - -| 字段 | 类型 | 可选 | 描述 | -|-------------|---------------------------------------------|----|--------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | -| data | BatchQueryDomainRouteStatusResponseData | | | -| data.routes | [DomainRouteStatus](#domain-route-status)[] | 否 | 授权路由列表 | - -## 公共 - -{#domain-route-key} - -### DomainRouteKey - -| 字段 | 类型 | 可选 | 描述 | -|-------------|--------|----|--------| -| source | string | 否 | 源节点ID | -| destination | string | 否 | 目标节点ID | - -{#domain-route-status} - -### DomainRouteStatus - -| 字段 | 类型 | 可选 | 描述 | -|-------------|------------------------------|----|--------| -| name | string | 否 | 名称 | -| destination | string | 否 | 目标节点ID | -| source | string | 否 | 源节点ID | -| status | [RouteStatus](#route-status) | 否 | 状态 | - -{#endpoint-port} - -### EndpointPort - -| 字段 | 类型 | 可选 | 描述 | -|----------|--------|----|--------------------| -| port | int32 | 否 | 端口号 | -| protocol | string | 否 | 端口协议:\[HTTP, GRPC] | - -{#route-endpoint} - -### RouteEndpoint - -| 字段 | 类型 | 可选 | 描述 | -|-------|----------------------------------|----|------| -| host | string | 否 | 目标主机 | -| ports | [EndpointPort](#endpoint-port)[] | 否 | 目标端口 | - -{#route-status} - -### RouteStatus - -| 字段 | 类型 | 可选 | 描述 | -|--------|--------|----|--------------------------| -| status | string | 否 | 是否成功:\[Succeeded,Failed] | -| reason | string | 是 | 原因 | - -{#mtls-config} - -### MTLSConfig - -详细参考 [DomainRoute概念](../../concepts/domainroute_cn.md) 。 - -| 字段 | 类型 | 可选 | 描述 | -|---------------------------|--------|----|----------| -| tls_ca | string | 否 | TLS的CA | -| source_client_private_key | string | 否 | 来源客户端的私钥 | -| source_client_cert | string | 否 | 来源客户端的证书 | - -{#token-config} - -### TokenConfig - -详细参考 [DomainRoute概念](../../concepts/domainroute_cn.md) 。 - -| 字段 | 类型 | 可选 | 描述 | -|------------------------|--------|----|---------------------------| -| destination_public_key | string | 否 | 目标节点的公钥 | -| rolling_update_period | int64 | 否 | 滚动更新间隔,单位 秒 | -| source_public_key | string | 否 | 源节点的公钥 | -| token_gen_method | string | 否 | 签名方式:\[RSA-GEN, RAND-GEN] | - diff --git a/docs/reference/apis/kusciaapis/index.rst b/docs/reference/apis/kusciaapis/index.rst deleted file mode 100644 index ba0ccd052..000000000 --- a/docs/reference/apis/kusciaapis/index.rst +++ /dev/null @@ -1,14 +0,0 @@ -.. _kusciaapis: - -KusciaAPI -=========== - -.. toctree:: - :maxdepth: 2 - - summary_cn - domain_cn - domainroute_cn - domaindata_cn - kusciajob_cn - health_cn \ No newline at end of file diff --git a/docs/reference/apis/kusciaapis/kusciajob_cn.md b/docs/reference/apis/kusciaapis/kusciajob_cn.md deleted file mode 100644 index d5d689eba..000000000 --- a/docs/reference/apis/kusciaapis/kusciajob_cn.md +++ /dev/null @@ -1,269 +0,0 @@ -# KusciaJob - -在 Kuscia 中,你可以使用 KusciaJob 来表示一个任务流程。请参考 [KusciaJob](../../concepts/kusciajob_cn.md) 。 -你可以从 [这里](https://github.com/secretflow/kuscia/tree/main/proto/api/v1alpha1/kusciaapi/job.proto) 找到对应的 -protobuf 文件。 - -## 接口总览 - -| 方法名 | 请求类型 | 响应类型 | 描述 | -|------------------------------------------------|----------------------------|------------------------------|-----------| -| [CreateJob](#create-job) | CreateJobRequest | CreateJobResponse | 创建Job | -| [QueryJob](#query-job) | QueryJobRequest | QueryJobResponse | 查询Job | -| [BatchQueryJobStatus](#batch-query-job-status) | BatchQueryJobStatusRequest | BatchQueryJobStatusResponse | 批量查询Job状态 | -| [DeleteJob](#delete-job) | DeleteJobRequest | DeleteJobResponse | 删除Job | -| [StopJob](#stop-job) | StopJobRequest | StopJobResponse | 停止Job | -| [WatchJob](#watch-job) | WatchJobRequest | WatchJobEventResponse stream | 监控Job | - -## 接口详情 - -{#create-job} - -### 创建Job - -#### HTTP路径 -/api/v1/job/create - -#### 请求(CreateJobRequest) - -| 字段 | 类型 | 可选 | 描述 | -|-----------------|-----------------------------------------------|----|----------------------------------------------------------------------------------------------------------------------------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| job_id | string | 否 | JobID,满足 [DNS 子域名规则要求](https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names) | -| initiator | string | 否 | 发起方节点ID | -| max_parallelism | int32 | 是 | 并发度,参考 [KusciaJob概念](../../concepts/kusciajob_cn.md) | -| tasks | [Task](#task)[] | 否 | 任务参数 | - -#### 响应(CreateJobResponse) - -| 字段 | 类型 | 可选 | 描述 | -|-------------|--------------------------------|----|-------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | -| data | CreateJobResponseData | | | -| data.job_id | string | 否 | JobID | - -{#query-job} - -### 查询Job - -#### HTTP路径 -/api/v1/job/query - -#### 请求(QueryJobRequest) - - -| 字段 | 类型 | 可选 | 描述 | -|--------|-----------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| job_id | string | 否 | JobID | - -#### 响应(QueryJobResponse) - -| 字段 | 类型 | 可选 | 描述 | -|----------------------|---------------------------------------|----|-------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | -| data | QueryJobResponseData | | | -| data.job_id | string | 否 | JobID | -| data.initiator | string | 否 | 发起方 | -| data.max_parallelism | int32 | 否 | 并发度 | -| data.tasks | [TaskConfig](#task-config)[] | 否 | 任务列表 | -| data.status | [JobStatusDetail](#job-status-detail) | 否 | Job状态 | - - -{#batch-query-job-status} - -### 批量查询Job状态 - -#### HTTP路径 -/api/v1/job/status/batchQuery - -#### 请求(BatchQueryJobStatusRequest) - -| 字段 | 类型 | 可选 | 描述 | -|---------|-----------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| job_ids | string[] | 否 | JobID列表 | - -#### 响应(BatchQueryJobStatusResponse) - -| 字段 | 类型 | 可选 | 描述 | -|-----------|---------------------------------|----|---------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | -| data | BatchQueryJobStatusResponseData | | | -| data.jobs | [JobStatus](#job-status)[] | 否 | Job状态列表 | - - -{#delete-job} - -### 删除Job - -#### HTTP路径 -/api/v1/job/delete - -#### 请求(DeleteJobRequest) - -| 字段 | 类型 | 可选 | 描述 | -|--------|-----------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| job_id | string | 否 | JobID | - -#### 响应(DeleteJobResponse) - -| 字段 | 类型 | 可选 | 描述 | -|-------------|--------------------------------|----|-------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | -| data | DeleteJobResponseData | | | -| data.job_id | string | 否 | JobID | - - -{#stop-job} - -### 停止Job - -#### HTTP路径 -/api/v1/job/stop - -#### 请求(StopJobRequest) - -| 字段 | 类型 | 可选 | 描述 | -|--------|-----------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| job_id | string | 否 | JobID | - -#### 响应(StopJobResponse) - -| 字段 | 类型 | 可选 | 描述 | -|-------------|--------------------------------|----|-------| -| status | [Status](summary_cn.md#status) | 否 | 状态信息 | -| data | StopJobResponseData | | | -| data.job_id | string | 否 | JobID | - - -{#watch-job} - -### 监控Job - -#### HTTP路径 -暂不支持 HTTP 接口。 - -#### 请求(WatchJobRequest) - -| 字段 | 类型 | 可选 | 描述 | -|-----------------|-----------------------------------------------|----|---------| -| header | [RequestHeader](summary_cn.md#request-header) | 是 | 自定义请求内容 | -| timeout_seconds | int64 | 是 | 超时时间 | - -#### 响应(WatchJobEventResponse) - -| 字段 | 类型 | 可选 | 描述 | -|--------|--------------------------|----|-------| -| 类型 | [EventType](#event-type) | 否 | 事件类型 | -| object | [JobStatus](#job-status) | 否 | Job状态 | - -## 公共 - -{#job-status} - -### JobStatus - -| 字段 | 类型 | 可选 | 描述 | -|--------|---------------------------------------|----|---------| -| job_id | string | 否 | JobID | -| status | [JobStatusDetail](#job-status-detail) | 否 | Job状态详情 | - -{#job-status-detail} - -### JobStatusDetail - -| 字段 | 类型 | 可选 | 描述 | -|-------------|------------------------------|----|------| -| state | string | 否 | 总体状态 | -| err_msg | string | 是 | 错误信息 | -| create_time | string | 否 | 创建时间 | -| start_time | string | 否 | 启动时间 | -| end_time | string | 是 | 结束时间 | -| tasks | [TaskStatus](#task-status)[] | 否 | 任务列表 | - -{#party} - -### Party - -| 字段 | 类型 | 可选 | 描述 | -|-----------|--------|----|----------| -| domain_id | string | 否 | DomainID | -| role | string | 是 | 角色 | - -{#party-status} - -### PartyStatus - -| 字段 | 类型 | 可选 | 描述 | -|-----------|--------------------------|----|------| -| domain_id | string | 否 | 节点ID | -| state | [TaskState](#task-state) | 否 | 总体状态 | -| err_msg | string | 是 | 错误信息 | - -{#task} - -### Task - -| 字段 | 类型 | 可选 | 描述 | -|-------------------|-------------------|----|---------------------------------------------------------------------------------------------------------------------------| -| app_image | string | 否 | 任务镜像 | -| parties | [Party](#party)[] | 否 | 参与方节点ID | -| alias | string | 否 | 任务别名 | -| task_id | string | 否 | 任务ID,满足 [DNS 子域名规则要求](https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names) | -| dependencies | string[] | 否 | 依赖任务 | -| task_input_config | string | 否 | 任务配置 | -| priority | string | 是 | 优先级,值越大优先级越高 | - - -{#task-config} - -### TaskConfig - -| 字段 | 类型 | 可选 | 描述 | -|-------------------|-------------------|----|--------------| -| app_image | string | 否 | 任务镜像 | -| parties | [Party](#party)[] | 否 | 参与方 | -| alias | string | 否 | 任务别名 | -| task_id | string | 否 | 任务ID | -| dependencies | string[] | 否 | 依赖任务 | -| task_input_config | string | 否 | 任务配置 | -| priority | string | 是 | 优先级,值越大优先级越高 | - -{#task-status} - -### TaskStatus - -| 字段 | 类型 | 可选 | 描述 | -|-------------|--------------------------------|----|----------------------------------| -| task_id | string | 是 | 任务ID | -| state | string | 否 | 任务状态,参考 [TaskState](#task-state) | -| err_msg | string | 是 | 错误信息 | -| create_time | string | 否 | 创建事件 | -| start_time | string | 否 | 开始事件 | -| end_time | string | 是 | 结束事件 | -| parties | [PartyStatus](#party-status)[] | 否 | 参与方 | - -{#event-type} - -### EventType - -| Name | Number | 描述 | -|----------|--------|------| -| ADDED | 0 | 增加事件 | -| MODIFIED | 1 | 修改事件 | -| DELETED | 2 | 删除事件 | -| ERROR | 3 | 错误事件 | - -{#task-state} - -### TaskState - -| Name | Number | 描述 | -|-----------|--------|-------| -| Pending | 0 | 未开始运行 | -| Running | 1 | 运行中 | -| Succeeded | 2 | 成功 | -| Failed | 3 | 失败 | diff --git a/docs/reference/apis/kusciajob_cn.md b/docs/reference/apis/kusciajob_cn.md new file mode 100644 index 000000000..e4d1f5825 --- /dev/null +++ b/docs/reference/apis/kusciajob_cn.md @@ -0,0 +1,269 @@ +# KusciaJob + +在 Kuscia 中,你可以使用 KusciaJob 来表示一个任务流程。请参考 [KusciaJob](../concepts/kusciajob_cn.md) 。 +你可以从 [这里](https://github.com/secretflow/kuscia/tree/main/proto/api/v1alpha1/kusciaapi/job.proto) 找到对应的 +protobuf 文件。 + +## 接口总览 + +| 方法名 | 请求类型 | 响应类型 | 描述 | +| ---------------------------------------------- | -------------------------- | ---------------------------- | ----------------- | +| [CreateJob](#create-job) | CreateJobRequest | CreateJobResponse | 创建 Job | +| [QueryJob](#query-job) | QueryJobRequest | QueryJobResponse | 查询 Job | +| [BatchQueryJobStatus](#batch-query-job-status) | BatchQueryJobStatusRequest | BatchQueryJobStatusResponse | 批量查询 Job 状态 | +| [DeleteJob](#delete-job) | DeleteJobRequest | DeleteJobResponse | 删除 Job | +| [StopJob](#stop-job) | StopJobRequest | StopJobResponse | 停止 Job | +| [WatchJob](#watch-job) | WatchJobRequest | WatchJobEventResponse stream | 监控 Job | + +## 接口详情 + +{#create-job} + +### 创建 Job + +#### HTTP 路径 + +/api/v1/job/create + +#### 请求(CreateJobRequest) + +| 字段 | 类型 | 可选 | 描述 | +| --------------- | -------------------------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------ | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| job_id | string | 否 | JobID,满足 [DNS 子域名规则要求](https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names) | +| initiator | string | 否 | 发起方节点 ID | +| max_parallelism | int32 | 是 | 并发度,参考 [KusciaJob 概念](../concepts/kusciajob_cn.md) | +| tasks | [Task](#task)[] | 否 | 任务参数 | + +#### 响应(CreateJobResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ----------- | ------------------------------ | ---- | -------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | +| data | CreateJobResponseData | | | +| data.job_id | string | 否 | JobID | + +{#query-job} + +### 查询 Job + +#### HTTP 路径 + +/api/v1/job/query + +#### 请求(QueryJobRequest) + +| 字段 | 类型 | 可选 | 描述 | +| ------ | -------------------------------------------- | ---- | -------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| job_id | string | 否 | JobID | + +#### 响应(QueryJobResponse) + +| 字段 | 类型 | 可选 | 描述 | +| -------------------- | ------------------------------------- | ---- | -------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | +| data | QueryJobResponseData | | | +| data.job_id | string | 否 | JobID | +| data.initiator | string | 否 | 发起方 | +| data.max_parallelism | int32 | 否 | 并发度 | +| data.tasks | [TaskConfig](#task-config)[] | 否 | 任务列表 | +| data.status | [JobStatusDetail](#job-status-detail) | 否 | Job 状态 | + +{#batch-query-job-status} + +### 批量查询 Job 状态 + +#### HTTP 路径 + +/api/v1/job/status/batchQuery + +#### 请求(BatchQueryJobStatusRequest) + +| 字段 | 类型 | 可选 | 描述 | +| ------- | -------------------------------------------- | ---- | -------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| job_ids | string[] | 否 | JobID 列表 | + +#### 响应(BatchQueryJobStatusResponse) + +| 字段 | 类型 | 可选 | 描述 | +| --------- | ------------------------------- | ---- | ------------ | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | +| data | BatchQueryJobStatusResponseData | | | +| data.jobs | [JobStatus](#job-status)[] | 否 | Job 状态列表 | + +{#delete-job} + +### 删除 Job + +#### HTTP 路径 + +/api/v1/job/delete + +#### 请求(DeleteJobRequest) + +| 字段 | 类型 | 可选 | 描述 | +| ------ | -------------------------------------------- | ---- | -------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| job_id | string | 否 | JobID | + +#### 响应(DeleteJobResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ----------- | ------------------------------ | ---- | -------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | +| data | DeleteJobResponseData | | | +| data.job_id | string | 否 | JobID | + +{#stop-job} + +### 停止 Job + +#### HTTP 路径 + +/api/v1/job/stop + +#### 请求(StopJobRequest) + +| 字段 | 类型 | 可选 | 描述 | +| ------ | -------------------------------------------- | ---- | -------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| job_id | string | 否 | JobID | + +#### 响应(StopJobResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ----------- | ------------------------------ | ---- | -------- | +| status | [Status](summary_cn.md#status) | 否 | 状态信息 | +| data | StopJobResponseData | | | +| data.job_id | string | 否 | JobID | + +{#watch-job} + +### 监控 Job + +#### HTTP 路径 + +暂不支持 HTTP 接口。 + +#### 请求(WatchJobRequest) + +| 字段 | 类型 | 可选 | 描述 | +| --------------- | -------------------------------------------- | ---- | -------------- | +| header | [RequestHeader](summary_cn.md#requestheader) | 是 | 自定义请求内容 | +| timeout_seconds | int64 | 是 | 超时时间 | + +#### 响应(WatchJobEventResponse) + +| 字段 | 类型 | 可选 | 描述 | +| ------ | ------------------------ | ---- | -------- | +| 类型 | [EventType](#event-type) | 否 | 事件类型 | +| object | [JobStatus](#job-status) | 否 | Job 状态 | + +## 公共 + +{#job-status} + +### JobStatus + +| 字段 | 类型 | 可选 | 描述 | +| ------ | ------------------------------------- | ---- | ------------ | +| job_id | string | 否 | JobID | +| status | [JobStatusDetail](#job-status-detail) | 否 | Job 状态详情 | + +{#job-status-detail} + +### JobStatusDetail + +| 字段 | 类型 | 可选 | 描述 | +| ----------- | ---------------------------- | ---- | -------- | +| state | string | 否 | 总体状态 | +| err_msg | string | 是 | 错误信息 | +| create_time | string | 否 | 创建时间 | +| start_time | string | 否 | 启动时间 | +| end_time | string | 是 | 结束时间 | +| tasks | [TaskStatus](#task-status)[] | 否 | 任务列表 | + +{#party} + +### Party + +| 字段 | 类型 | 可选 | 描述 | +| --------- | ------ | ---- | -------- | +| domain_id | string | 否 | DomainID | +| role | string | 是 | 角色 | + +{#party-status} + +### PartyStatus + +| 字段 | 类型 | 可选 | 描述 | +| --------- | ------------------------ | ---- | -------- | +| domain_id | string | 否 | 节点 ID | +| state | [TaskState](#task-state) | 否 | 总体状态 | +| err_msg | string | 是 | 错误信息 | + +{#task} + +### Task + +| 字段 | 类型 | 可选 | 描述 | +| ----------------- | ----------------- | ---- | -------------------------------------------------------------------------------------------------------------------------------------- | +| app_image | string | 否 | 任务镜像 | +| parties | [Party](#party)[] | 否 | 参与方节点 ID | +| alias | string | 否 | 任务别名 | +| task_id | string | 否 | 任务 ID,满足 [DNS 子域名规则要求](https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names) | +| dependencies | string[] | 否 | 依赖任务 | +| task_input_config | string | 否 | 任务配置 | +| priority | string | 是 | 优先级,值越大优先级越高 | + +{#task-config} + +### TaskConfig + +| 字段 | 类型 | 可选 | 描述 | +| ----------------- | ----------------- | ---- | ------------------------ | +| app_image | string | 否 | 任务镜像 | +| parties | [Party](#party)[] | 否 | 参与方 | +| alias | string | 否 | 任务别名 | +| task_id | string | 否 | 任务 ID | +| dependencies | string[] | 否 | 依赖任务 | +| task_input_config | string | 否 | 任务配置 | +| priority | string | 是 | 优先级,值越大优先级越高 | + +{#task-status} + +### TaskStatus + +| 字段 | 类型 | 可选 | 描述 | +| ----------- | ------------------------------ | ---- | --------------------------------------- | +| task_id | string | 是 | 任务 ID | +| state | string | 否 | 任务状态,参考 [TaskState](#task-state) | +| err_msg | string | 是 | 错误信息 | +| create_time | string | 否 | 创建事件 | +| start_time | string | 否 | 开始事件 | +| end_time | string | 是 | 结束事件 | +| parties | [PartyStatus](#party-status)[] | 否 | 参与方 | + +{#event-type} + +### EventType + +| Name | Number | 描述 | +| -------- | ------ | -------- | +| ADDED | 0 | 增加事件 | +| MODIFIED | 1 | 修改事件 | +| DELETED | 2 | 删除事件 | +| ERROR | 3 | 错误事件 | + +{#task-state} + +### TaskState + +| Name | Number | 描述 | +| --------- | ------ | ---------- | +| Pending | 0 | 未开始运行 | +| Running | 1 | 运行中 | +| Succeeded | 2 | 成功 | +| Failed | 3 | 失败 | diff --git a/docs/reference/apis/kusciaapis/summary_cn.md b/docs/reference/apis/summary_cn.md similarity index 76% rename from docs/reference/apis/kusciaapis/summary_cn.md rename to docs/reference/apis/summary_cn.md index 35f0feaea..d8f56f637 100644 --- a/docs/reference/apis/kusciaapis/summary_cn.md +++ b/docs/reference/apis/summary_cn.md @@ -6,7 +6,7 @@ Kuscia 提供了两套 API 接口,分别是 K8s API 和 Kuscia API。 -K8s API 是基于 K8s 接口,以 CRD 的形式提供,请参考 [概念](../../concepts/index) 。 +K8s API 是基于 K8s 接口,以 CRD 的形式提供,请参考 [概念](../concepts/index) 。 你可以通过 kubectl 或 类似于 [client-go](https://github.com/kubernetes/client-go) 这样的 Go 客户端 进行接入。 其他语言的接入方式,可以参考其他 K8s SDK 开源项目。 @@ -32,21 +32,21 @@ protobuf ### 请求和响应约定 -请求总是携带会一个 header 字段,类型为 [RequestHeader](#request-header) , -如 [CreateDomainDataRequest](domaindata_cn.md#create-domain-data-request) , 该字段可以携带你自定义的一些数据。 +请求总是携带会一个 header 字段,类型为 [RequestHeader](#requestheader) , +如 [CreateDomainDataRequest](domaindata_cn.md#请求createdomaindatarequest) , 该字段可以携带你自定义的一些数据。 响应总是携带一个 status 字段,类型为 [Status](#status) , -如 [CreateDomainDataResponse](domaindata_cn.md#create-domain-data-response) , 该字段描述了响应的状态信息。 +如 [CreateDomainDataResponse](domaindata_cn.md#响应createdomaindataresponse) , 该字段描述了响应的状态信息。 -{#request-header} +{#requestheader} #### RequestHeader RequestHeader 可以携带自定义的信息。 -| 字段 | 类型 | 可选 | 描述 | -|----------------|---------------------|----|---------| -| custom_headers | map | 是 | 自定义的键值对 | +| 字段 | 类型 | 可选 | 描述 | +| -------------- | ------------------- | ---- | -------------- | +| custom_headers | map | 是 | 自定义的键值对 | {#status} @@ -56,17 +56,17 @@ Status 携带请求响应的状态信息。 参考: [GRPC 的 Status 定义](https://github.com/grpc/grpc/blob/master/src/proto/grpc/status/status.proto) -| 字段 | 类型 | 可选 | 描述 | -|---------|-------------------------------------------------------------------------------|----|--------| -| code | int32 | | 错误码 | -| message | string | | 错误信息 | -| details | [google.protobuf.Any](https://protobuf.dev/programming-guides/proto3/#json)[] | | 错误详细描述 | +| 字段 | 类型 | 可选 | 描述 | +| ------- | ----------------------------------------------------------------------------- | ---- | ------------ | +| code | int32 | | 错误码 | +| message | string | | 错误信息 | +| details | [google.protobuf.Any](https://protobuf.dev/programming-guides/proto3/#json)[] | | 错误详细描述 | ## 如何使用 Kuscia API ### 获取 Kuscia API client 证书和私钥 -Kuscia master 部署完成之后,会默认生成一个 kuscia API client证书,你可以通过以下命令获取(以中心化组网模式为例): +Kuscia master 部署完成之后,会默认生成一个 kuscia API client 证书,你可以通过以下命令获取(以中心化组网模式为例): ```shell docker cp ${USER}-kuscia-master:/home/kuscia/etc/certs/kusciaapi-client.key . @@ -82,9 +82,9 @@ docker cp ${USER}-kuscia-master:/home/kuscia/etc/certs/token . 1. 从 [这里](https://github.com/secretflow/kuscia/tree/main/proto/api/v1alpha1/kusciaapi) 下载 Kuscia 的 protobuf 文件,使用 protoc 生成对应编程语言的客户端桩代码。 - 关于如何生成客户端桩代码,请参看 [Protobuf官方教程](https://protobuf.dev/getting-started/)。 + 关于如何生成客户端桩代码,请参看 [Protobuf 官方教程](https://protobuf.dev/getting-started/)。 2. 在初始化 GRPC 客户端时,设置 HTTPS 双向验证的配置。 -3. 在初始化 GRPC 客户端时,读取token文件内容,设置 Metadata:Token={token}。 +3. 在初始化 GRPC 客户端时,读取 token 文件内容,设置 Metadata:Token={token}。 4. 使用 GRPC 客户端发起请求。 GRPC 容器内端点默认在:kuscia-master 或者 autonomy 节点的 8083 端口。 diff --git a/docs/reference/architecture_cn.md b/docs/reference/architecture_cn.md index 75c0af39d..1bafcac4b 100644 --- a/docs/reference/architecture_cn.md +++ b/docs/reference/architecture_cn.md @@ -26,21 +26,20 @@ Kuscia 支持 Lite 节点与 Autonomy 节点、以及两个中心化网络互联 Kuscia 扩展了一组 Kubernetes 控制器,用于处理 Kuscia 的自定义资源,这些控制器包括: - - Job Controller:作业控制器,负责解析作业 DAG 的描述信息,进行 DAG 的编排与多任务调度、采集任务状态。 - Task Controller:任务控制器,负责解析任务的描述信息,实现多方任务的 Co-Scheduling 调度,对应作业 DAG 中的顶点。 - Kuscia Scheduler: Kuscia 调度器,负责多方 Pod 的 Co-Scheduling 调度,具备 All-or-Nothing 调度效果。 - Domain Controller:节点控制器,负责管理节点资源、为节点分配 Namespace。 -- DomainRoute Controller:路由控制器,负责管理节点与节点、节点与 Master的路由规则以及身份认证和鉴权策略。 +- DomainRoute Controller:路由控制器,负责管理节点与节点、节点与 Master 的路由规则以及身份认证和鉴权策略。 - InterConn Controllers:互联互通控制器,负责不同控制平面下的节点互通,从而协同完成多方任务调度,支持多种互联互通协议。 - Data Controller: 数据控制器,负责数据授权管理,暂未开源。 - Serving Controller:服务控制器,负责常驻任务流的编排和调度,暂未开源。 + #### Kuscia Storage -Kuscia Storage 是对 Kubernetes 原生集群存储的补充。Kubernetes 原生集群存储不适合存储大 value,因此对于大 value 的资源属性,如作业配置等,将存储在 Kuscia Storage +Kuscia Storage 是对 Kubernetes 原生集群存储的补充。Kubernetes 原生集群存储不适合存储大 value,因此对于大 value 的资源属性,如作业配置等,将存储在 Kuscia Storage 中。该模块暂未开源。 - #### Envoy [Envoy](https://www.Envoyproxy.io/) 是一个开源的边缘和服务代理。在控制平面中,Envoy 是节点与 Master、Master 与 Master 之间的流量代理,从 DomainRoute Controller 接收路由规则和身份认证、鉴权策略。 @@ -71,7 +70,7 @@ Agent 当前支持 RunC 运行时,后续还将支持 RunP 和 RunK 模式: #### NetworkMesh -NetworkMesh是算法容器之间进行网络通信的基础设施,包含CoreDNS、DomainRoute、Envoy、Transport四个组件。 +NetworkMesh 是算法容器之间进行网络通信的基础设施,包含 CoreDNS、DomainRoute、Envoy、Transport 四个组件。 ##### CoreDNS @@ -145,10 +144,11 @@ Kuscia 提供三种部署模式:Docker 模式、K8s 模式、K8s 控制器模 ![Deployment Mode](../imgs/job_schedule.png) 其中 Job 中的一个 Task 调度流程如下: + - Task Controller 在各参与方节点的 Namespace 下分别创建 TaskResource 对象和 PodGroup(包含一组 Label 相同的任务 Pod)。 -- 任务参与方的 InterConn Controller 从调度方集群中将本方的 TaskResource 和 PodGroup 同步到参与方集群中。参与方集群中的 TaskResource 和 PodGroup 的状态也会通过 +- 任务参与方的 InterConn Controller 从调度方集群中将本方的 TaskResource 和 PodGroup 同步到参与方集群中。参与方集群中的 TaskResource 和 PodGroup 的状态也会通过 InterConn Controller 同步到调度方集群中。 - Kuscia Scheduler 为各 PodGroup 中的 Pod 预留资源,当 PodGroup 中资源预留成功的 Pod 数量满足 MinReservedPods -阀值时,将 PodGroup 对应的 TaskResource 状态更新为 Reserved。在点对点(P2P)组网模式下,调度方的 Kuscia Scheduler 不会调度本集群中非本方的 Pod。 + 阀值时,将 PodGroup 对应的 TaskResource 状态更新为 Reserved。在点对点(P2P)组网模式下,调度方的 Kuscia Scheduler 不会调度本集群中非本方的 Pod。 - Task Controller 监听到 TaskResource 预留成功的数量满足 MinReservedMembers 阈值时,则将各参与方的 TaskResource 的状态更新为 Schedulable。 - Kuscia Scheduler 监听到 TaskResource 的状态变为 Schedulable 后,绑定 PodGroup 中的任务 Pod 到已分配的节点上。 diff --git a/docs/reference/concepts/domaindata_cn.md b/docs/reference/concepts/domaindata_cn.md index 8d5ad016e..e97d7f736 100644 --- a/docs/reference/concepts/domaindata_cn.md +++ b/docs/reference/concepts/domaindata_cn.md @@ -158,7 +158,7 @@ Error from server (NotFound): domaindatas.kuscia.secretflow "alice-table" not fo 你可以在 Domain 侧管理属于该 Domain 的 DomainData。Kuscia 在 Domain 侧提供了的 DataMesh API 来管理 DomainData。 Data Mesh API 提供 HTTP 和 GRPC 两种访问方法,分别位于 8070 和 8071 -端口,详情请参考 [Data Mesh API](../apis/datamesh/summary_cn.md#data-mesh-api)。 +端口,详情请参考 [Data Mesh API](../apis/datamesh/summary_cn.md#data-mesh-api-约定)。 1. 进入 alice 容器 `${USER}-kuscia-lite-alice` 容器中,查询 DomainData。 ```shell diff --git a/docs/reference/concepts/index.rst b/docs/reference/concepts/index.rst index 618e68ff8..834c03f63 100644 --- a/docs/reference/concepts/index.rst +++ b/docs/reference/concepts/index.rst @@ -1,7 +1,5 @@ -.. _concepts: - -概念 -========= +Kuscia 概念 +=============== .. toctree:: :maxdepth: 2 diff --git a/docs/reference/index.rst b/docs/reference/index.rst index 05b73c4c5..f51d10433 100644 --- a/docs/reference/index.rst +++ b/docs/reference/index.rst @@ -1,13 +1,10 @@ -.. _reference: - 参考手册 -========= +================ .. toctree:: :maxdepth: 2 architecture_cn - ./concepts/index - ./apis/index - operation_cn + concepts/index + apis/index faq_cn diff --git a/docs/tutorial/index.rst b/docs/tutorial/index.rst index ca39e449f..cd81083d5 100644 --- a/docs/tutorial/index.rst +++ b/docs/tutorial/index.rst @@ -1,13 +1,15 @@ -.. _tutorial: - -教程 -========= +指南 +======== .. toctree:: - :maxdepth: 2 + :maxdepth: 1 - run_secretflow_cn run_secretflow_with_api_cn run_bfia_job_cn run_fate_cn + +.. toctree:: + :maxdepth: 1 + :name: 安全 + security_plan_cn diff --git a/docs/tutorial/run_bfia_job_cn.md b/docs/tutorial/run_bfia_job_cn.md index 250780d97..a5fa9cb6b 100644 --- a/docs/tutorial/run_bfia_job_cn.md +++ b/docs/tutorial/run_bfia_job_cn.md @@ -10,7 +10,7 @@ ### 准备运行银联 BFIA 协议的节点 -部署运行银联 BFIA 协议的节点,请参考 [快速入门点对点组网模式](../getting_started/quickstart_cn.md/#p2p-network-mode)。 +部署运行银联 BFIA 协议的节点,请参考 [快速入门点对点组网模式](../getting_started/quickstart_cn.md/#点对点组网模式)。 在执行启动集群命令时,需要新增一个命令行参数`-p bfia`,详细命令如下: diff --git a/docs/tutorial/run_secretflow_with_api_cn.md b/docs/tutorial/run_secretflow_with_api_cn.md index aa5010ed5..95df1f010 100644 --- a/docs/tutorial/run_secretflow_with_api_cn.md +++ b/docs/tutorial/run_secretflow_with_api_cn.md @@ -1,4 +1,4 @@ -# 如何使用 Kuscia API 运行一个 Secretflow 作业 +# 如何使用 Kuscia API 运行一个 SecretFlow 作业 ## 准备节点 @@ -16,30 +16,28 @@ Kuscia API 使用双向 HTTPS,所以需要配置你的客户端库的双向 HT 证书文件在 ${USER}-kuscia-master 节点的`/home/kuscia/etc/certs/`目录下: - -| 文件名 | 文件功能 | -|------------------------------------------------|-----------------------------------| -| kusciaapi-client.key |客户端私钥文件 | -| kusciaapi-client.crt |客户端证书文件 | -| ca.crt |CA 证书文件 | -| token |认证 token ,在 headers 中添加 Token: { token 文件内容} | +| 文件名 | 文件功能 | +| -------------------- | ------------------------------------------------------- | +| kusciaapi-client.key | 客户端私钥文件 | +| kusciaapi-client.crt | 客户端证书文件 | +| ca.crt | CA 证书文件 | +| token | 认证 token ,在 headers 中添加 Token: { token 文件内容} | ### 点对点组网模式 -证书的配置参考[配置授权](../getting_started/deploy/deploy_p2p_cn) +证书的配置参考[配置授权](../deployment/deploy_p2p_cn.md#配置授权) 这里以 alice 节点为例,接口需要的证书文件在 ${USER}-kuscia-autonomy-alice 节点的`/home/kuscia/etc/certs/`目录下: -| 文件名 | 文件功能 | -|------------------------------------------------|-----------------------------------| -| kusciaapi-client.key |客户端私钥文件 | -| kusciaapi-client.crt |客户端证书文件 | -| ca.crt |CA 证书文件 | -| token |认证 token ,在 headers 中添加 Token: { token 文件内容} | +| 文件名 | 文件功能 | +| -------------------- | ------------------------------------------------------- | +| kusciaapi-client.key | 客户端私钥文件 | +| kusciaapi-client.crt | 客户端证书文件 | +| ca.crt | CA 证书文件 | +| token | 认证 token ,在 headers 中添加 Token: { token 文件内容} | 同时,还要保证节点间的授权证书配置正确,alice 节点和 bob 节点要完成授权的建立,否则双方无法共同参与计算任务。 - ## 准备数据 你可以使用 Kuscia 中自带的数据文件,或者使用你自己的数据文件。 @@ -103,7 +101,7 @@ docker exec -it ${USER}-kuscia-autonomy-alice 这个 KusciaJob 的名称为 job-best-effort-linear,在一个 Kuscia 集群中,这个名称必须是唯一的,由`job_id`指定。 -我们请求[创建 Job](../reference/apis/kusciaapis/kusciajob_cn.md#create-job) 接口来创建并运行这个 KusciaJob。 +我们请求[创建 Job](../reference/apis/kusciajob_cn.md#请求createjobrequest) 接口来创建并运行这个 KusciaJob。 在 kuscia-master 容器终端中,执行以下命令,内容如下: @@ -138,18 +136,18 @@ curl -X POST 'https://localhost:8082/api/v1/job/create' \ }' ``` -具体字段数据格式和含义请参考[创建 Job](../reference/apis/kusciaapis/kusciajob_cn.md#create-job) ,本文不再赘述。 +具体字段数据格式和含义请参考[创建 Job](../reference/apis/kusciajob_cn.md#请求createjobrequest) ,本文不再赘述。 如果你成功了,你将得到如下返回: + ```json -{"status":{"code":0, "message":"success", "details":[]}, "data":{"job_id":"job-best-effort-linear"}} +{ "status": { "code": 0, "message": "success", "details": [] }, "data": { "job_id": "job-best-effort-linear" } } ``` 恭喜,这说明 KusciaJob 已经成功创建并运行。 如果遇到 HTTP 错误(即 HTTP Code 不为 200),请参考 [HTTP Error Code 处理](#http-error-code)。 - ### 使用你自己的数据配置 KusciaJob 如果你要使用你自己的数据,可以将两个算子中的`tasks.task_input_config.sf_node_eval_param`的`inputs`和`output_uris`的数据文件路径修改为你在[准备你自己的数据](#prepare-your-own-data)中的数据文件目标路径即可。 @@ -161,14 +159,13 @@ curl -X POST 'https://localhost:8082/api/v1/job/create' \ ## 查看 KusciaJob 运行状态 - {#job-query} ### 查看运行中的 KusciaJob 的详细状态 job-best-effort-linear 是你在[配置 Job](#configure-kuscia-job) 中指定的 KusciaJob 的名称。 -我们请求[批量查询 Job 状态](../reference/apis/kusciaapis/kusciajob_cn.md#batch-query-job-status)接口来批量查询 KusciaJob +我们请求[批量查询 Job 状态](../reference/apis/kusciajob_cn.md#批量查询-job-状态)接口来批量查询 KusciaJob 的状态。 请求参数`job_ids`是一个 Array[String] ,需要列出所有待查询的 KusciaJob 名称。 @@ -189,80 +186,78 @@ curl -X POST 'https://localhost:8082/api/v1/job/status/batchQuery' \ ```json { - "status":{ - "code":0, - "message":"success", - "details":[ - - ] - }, - "data":{ - "jobs":[ + "status": { + "code": 0, + "message": "success", + "details": [] + }, + "data": { + "jobs": [ + { + "job_id": "job-best-effort-linear", + "status": { + "state": "Succeeded", + "err_msg": "", + "create_time": "2023-07-27T01:55:46Z", + "start_time": "2023-07-27T01:55:46Z", + "end_time": "2023-07-27T01:56:19Z", + "tasks": [ { - "job_id":"job-best-effort-linear", - "status":{ - "state":"Succeeded", - "err_msg":"", - "create_time":"2023-07-27T01:55:46Z", - "start_time":"2023-07-27T01:55:46Z", - "end_time":"2023-07-27T01:56:19Z", - "tasks":[ - { - "task_id":"job-psi", - "state":"Succeeded", - "err_msg":"", - "create_time":"2023-07-27T01:55:46Z", - "start_time":"2023-07-27T01:55:46Z", - "end_time":"2023-07-27T01:56:05Z", - "parties":[ - { - "domain_id":"alice", - "state":"Succeeded", - "err_msg":"" - }, - { - "domain_id":"bob", - "state":"Succeeded", - "err_msg":"" - } - ] - }, - { - "task_id":"job-split", - "state":"Succeeded", - "err_msg":"", - "create_time":"2023-07-27T01:56:05Z", - "start_time":"2023-07-27T01:56:05Z", - "end_time":"2023-07-27T01:56:19Z", - "parties":[ - { - "domain_id":"alice", - "state":"Succeeded", - "err_msg":"" - }, - { - "domain_id":"bob", - "state":"Succeeded", - "err_msg":"" - } - ] - } - ] + "task_id": "job-psi", + "state": "Succeeded", + "err_msg": "", + "create_time": "2023-07-27T01:55:46Z", + "start_time": "2023-07-27T01:55:46Z", + "end_time": "2023-07-27T01:56:05Z", + "parties": [ + { + "domain_id": "alice", + "state": "Succeeded", + "err_msg": "" + }, + { + "domain_id": "bob", + "state": "Succeeded", + "err_msg": "" } + ] + }, + { + "task_id": "job-split", + "state": "Succeeded", + "err_msg": "", + "create_time": "2023-07-27T01:56:05Z", + "start_time": "2023-07-27T01:56:05Z", + "end_time": "2023-07-27T01:56:19Z", + "parties": [ + { + "domain_id": "alice", + "state": "Succeeded", + "err_msg": "" + }, + { + "domain_id": "bob", + "state": "Succeeded", + "err_msg": "" + } + ] } - ] - } + ] + } + } + ] + } } ``` `data.jobs.status.state`字段记录了 KusciaJob 的运行状态,`data.jobs.status.tasks.state`则记录了每个 KusciaTask 的运行状态。 详细信息请参考 [KusciaJob](../reference/concepts/kusciajob_cn.md) -和[批量查询 Job 状态](../reference/apis/kusciaapis/kusciajob_cn.md#batch-query-job-status) +和[批量查询 Job 状态](../reference/apis/kusciajob_cn.md#批量查询-job-状态) ## 删除 KusciaJob -当你想清理这个 KusciaJob 时,我们请求[删除 Job](../reference/apis/kusciaapis/kusciajob_cn.md#delete-job) 接口来删除这个 +当你想清理这个 KusciaJob 时,我们请求[删除 Job](../reference/apis/kusciajob_cn.md#删除-job) 接口来删除这个 KusciaJob. ```shell @@ -280,7 +275,7 @@ curl -X POST 'https://localhost:8082/api/v1/job/delete' \ 如果任务成功了,你可以得到如下返回: ```json -{"status":{"code":0, "message":"success", "details":[]}, "data":{"job_id":"job-best-effort-linear"}} +{ "status": { "code": 0, "message": "success", "details": [] }, "data": { "job_id": "job-best-effort-linear" } } ``` 当这个 KusciaJob 被清理时, 这个 KusciaJob 创建的 KusciaTask 也会一起被清理。 @@ -291,7 +286,7 @@ curl -X POST 'https://localhost:8082/api/v1/job/delete' \ KusciaJob 的算子参数由`taskInputConfig`字段定义,对于不同的算子,算子的参数不同。 -对于 secretflow ,请参考:[Secretflow官网](https://www.secretflow.org.cn/)。 +对于 secretflow ,请参考:[Secretflow 官网](https://www.secretflow.org.cn/)。 {#http-client-error} diff --git a/etc/kuscia.yaml b/etc/kuscia.yaml index 80aba59f8..16a8e3985 100644 --- a/etc/kuscia.yaml +++ b/etc/kuscia.yaml @@ -12,7 +12,7 @@ master: apiserver: kubeconfigFile: etc/kubeconfig endpoint: http://127.0.0.1:1080 - api-whitelist: + apiWhitelist: - /(api(s)?(/[0-9A-Za-z_.-]+)?/v1(alpha1)?/namespaces/[0-9A-Za-z_.-]+/(pods|gateways|domainroutes|endpoints|services|events|configmaps|leases|taskresources|secrets|domaindatas|domaindatagrants|domaindatasources)(/[0-9A-Za-z_.-]+(/status$)?)?) - /api/v1/namespaces/[0-9A-Za-z_.-]+ - /api/v1/nodes(/.*)? @@ -20,4 +20,4 @@ agent: allowPrivileged: false externalTLS: certFile: etc/certs/external_tls.crt - keyFile: etc/certs/external_tls.key \ No newline at end of file + keyFile: etc/certs/external_tls.key diff --git a/pkg/confmanager/bean/grpc_server_bean.go b/pkg/confmanager/bean/grpc_server_bean.go new file mode 100644 index 000000000..f14782c25 --- /dev/null +++ b/pkg/confmanager/bean/grpc_server_bean.go @@ -0,0 +1,96 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package bean + +import ( + "context" + "fmt" + "net" + "time" + + "github.com/secretflow/kuscia/pkg/confmanager/config" + "github.com/secretflow/kuscia/pkg/confmanager/handler/grpchandler" + "github.com/secretflow/kuscia/pkg/confmanager/interceptor" + "github.com/secretflow/kuscia/pkg/confmanager/service" + "github.com/secretflow/kuscia/pkg/utils/nlog" + "github.com/secretflow/kuscia/pkg/utils/tls" + "github.com/secretflow/kuscia/pkg/web/errorcode" + "github.com/secretflow/kuscia/pkg/web/framework" + "github.com/secretflow/kuscia/proto/api/v1alpha1/confmanager" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/reflection" +) + +type grpcServerBean struct { + config config.ConfManagerConfig +} + +func NewGrpcServerBean(config *config.ConfManagerConfig) *grpcServerBean { // nolint: golint + return &grpcServerBean{ + config: *config, + } +} + +func (s *grpcServerBean) Validate(errs *errorcode.Errs) { + s.config.MustTLSEnables(errs) +} + +func (s *grpcServerBean) Init(e framework.ConfBeanRegistry) error { + return nil +} + +// Start grpcServerBean +func (s *grpcServerBean) Start(ctx context.Context, e framework.ConfBeanRegistry) error { + configurationService, err := service.NewConfigurationService(s.config) + if err != nil { + nlog.Fatalf("Failed to init configuration service : %v", err) + } + + // init grpc server opts + opts := []grpc.ServerOption{ + grpc.ConnectionTimeout(time.Duration(s.config.ConnectTimeout) * time.Second), + grpc.UnaryInterceptor(interceptor.GRPCTLSCertInfoInterceptor), + } + // tls must enabled + serverTLSConfig, err := tls.BuildServerTLSConfig(s.config.TLSConfig.RootCAFile, + s.config.TLSConfig.ServerCertFile, s.config.TLSConfig.ServerKeyFile) + if err != nil { + nlog.Fatalf("Failed to init server tls config: %v", err) + } + creds := credentials.NewTLS(serverTLSConfig) + opts = append(opts, grpc.Creds(creds)) + + // listen on grpc port + addr := fmt.Sprintf(":%d", s.config.GRPCPort) + lis, err := net.Listen("tcp", addr) + if err != nil { + nlog.Fatalf("Failed to listen on addr[%s]: %v", addr, err) + } + + // register grpc server + server := grpc.NewServer(opts...) + confmanager.RegisterConfigurationServiceServer(server, grpchandler.NewConfigurationHandler(configurationService)) + reflection.Register(server) + nlog.Infof("Grpc server listening on %s", addr) + + // serve grpc + return server.Serve(lis) +} + +func (s *grpcServerBean) ServerName() string { + return "ConfManagerGrpcServer" +} diff --git a/pkg/confmanager/bean/http_server_bean.go b/pkg/confmanager/bean/http_server_bean.go new file mode 100644 index 000000000..d59391b3a --- /dev/null +++ b/pkg/confmanager/bean/http_server_bean.go @@ -0,0 +1,142 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package bean + +import ( + "context" + "net/http" + + cmconfig "github.com/secretflow/kuscia/pkg/confmanager/config" + "github.com/secretflow/kuscia/pkg/confmanager/handler/httphandler/configuration" + "github.com/secretflow/kuscia/pkg/confmanager/interceptor" + "github.com/secretflow/kuscia/pkg/confmanager/service" + ecode "github.com/secretflow/kuscia/pkg/datamesh/errorcode" + "github.com/secretflow/kuscia/pkg/kusciaapi/handler/httphandler/health" + apisvc "github.com/secretflow/kuscia/pkg/kusciaapi/service" + "github.com/secretflow/kuscia/pkg/utils/nlog" + "github.com/secretflow/kuscia/pkg/web/api" + "github.com/secretflow/kuscia/pkg/web/constants" + "github.com/secretflow/kuscia/pkg/web/decorator" + "github.com/secretflow/kuscia/pkg/web/errorcode" + "github.com/secretflow/kuscia/pkg/web/framework" + "github.com/secretflow/kuscia/pkg/web/framework/beans" + frameworkconfig "github.com/secretflow/kuscia/pkg/web/framework/config" + "github.com/secretflow/kuscia/pkg/web/framework/router" + + "github.com/gin-gonic/gin" +) + +type httpServerBean struct { + config cmconfig.ConfManagerConfig + ginBean beans.GinBean +} + +func NewHTTPServerBean(config *cmconfig.ConfManagerConfig) *httpServerBean { // nolint: golint + return &httpServerBean{ + config: *config, + ginBean: beans.GinBean{ + Port: int(config.HTTPPort), + GinBeanConfig: convertToGinConf(config), + }, + } +} + +func (s *httpServerBean) Validate(errs *errorcode.Errs) { + s.ginBean.Validate(errs) + s.config.MustTLSEnables(errs) +} + +func (s *httpServerBean) Init(e framework.ConfBeanRegistry) error { + if err := s.ginBean.Init(e); err != nil { + return err + } + s.registerGroupRoutes(e) + return nil +} + +// Start httpServerBean +func (s *httpServerBean) Start(ctx context.Context, e framework.ConfBeanRegistry) error { + return s.ginBean.Start(ctx, e) +} + +func (s *httpServerBean) ServerName() string { + return "ConfManagerHttpServer" +} + +func (s *httpServerBean) registerGroupRoutes(e framework.ConfBeanRegistry) { + configurationService, err := service.NewConfigurationService(s.config) + if err != nil { + nlog.Fatalf("Failed to init configuration service : %v", err) + } + + healthService := apisvc.NewHealthService() + // define router groups + groupsRouters := []*router.GroupRouters{ + // configuration group routes + { + Group: "api/v1/cm/configuration", + Routes: []*router.Router{ + { + HTTPMethod: http.MethodPost, + RelativePath: "create", + Handlers: []gin.HandlerFunc{protoDecorator(e, configuration.NewCreateConfigurationHandler(configurationService))}, + }, + { + HTTPMethod: http.MethodPost, + RelativePath: "query", + Handlers: []gin.HandlerFunc{protoDecorator(e, configuration.NewQueryConfigurationHandler(configurationService))}, + }, + }, + GroupMiddleware: []gin.HandlerFunc{interceptor.HTTPTLSCertInfoInterceptor}, + }, + // health group routes + { + Group: "", + Routes: []*router.Router{ + { + HTTPMethod: http.MethodPost, + RelativePath: constants.HealthAPI, + Handlers: []gin.HandlerFunc{protoDecorator(e, health.NewReadyHandler(healthService))}, + }, + }, + }, + } + // register group + for _, gr := range groupsRouters { + s.ginBean.RegisterGroup(gr) + } +} + +// protoDecorator is used to wrap handler. +func protoDecorator(e framework.ConfBeanRegistry, handler api.ProtoHandler) gin.HandlerFunc { + return decorator.InterConnProtoDecoratorMaker(int32(ecode.ErrRequestInvalidate), int32(ecode.ErrForUnexpected))(e, handler) +} + +func convertToGinConf(conf *cmconfig.ConfManagerConfig) beans.GinBeanConfig { + tlsConf := &frameworkconfig.TLSConfig{ + EnableTLS: true, + CAPath: conf.TLSConfig.RootCAFile, + ServerCertPath: conf.TLSConfig.ServerCertFile, + ServerKeyPath: conf.TLSConfig.ServerKeyFile, + } + return beans.GinBeanConfig{ + Logger: nil, + ReadTimeout: &conf.ReadTimeout, + WriteTimeout: &conf.WriteTimeout, + IdleTimeout: &conf.IdleTimeout, + MaxHeaderBytes: nil, + TLSConfig: tlsConf, + } +} diff --git a/pkg/confmanager/commands/root.go b/pkg/confmanager/commands/root.go new file mode 100644 index 000000000..6d0f0110c --- /dev/null +++ b/pkg/confmanager/commands/root.go @@ -0,0 +1,60 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package commands + +import ( + "context" + "fmt" + + "github.com/secretflow/kuscia/pkg/confmanager/bean" + "github.com/secretflow/kuscia/pkg/confmanager/config" + "github.com/secretflow/kuscia/pkg/utils/meta" + "github.com/secretflow/kuscia/pkg/web/framework" + "github.com/secretflow/kuscia/pkg/web/framework/engine" + + // register mem driver + _ "github.com/secretflow/kuscia/pkg/confmanager/secretbackend/mem" +) + +func Run(ctx context.Context, conf *config.ConfManagerConfig) error { + // new app engine + appEngine := engine.New(&framework.AppConfig{ + Name: "ConfManager", + Usage: "ConfManager", + Version: meta.KusciaVersionString(), + }) + if err := injectBean(conf, appEngine); err != nil { + return err + } + return appEngine.Run(ctx) +} + +func injectBean(conf *config.ConfManagerConfig, appEngine *engine.Engine) error { + // inject http server bean + httpServer := bean.NewHTTPServerBean(conf) + serverName := httpServer.ServerName() + err := appEngine.UseBeanWithConfig(serverName, httpServer) + if err != nil { + return fmt.Errorf("inject bean %s failed: %v", serverName, err.Error()) + } + // inject grpc server bean + grpcServer := bean.NewGrpcServerBean(conf) + serverName = grpcServer.ServerName() + err = appEngine.UseBeanWithConfig(serverName, grpcServer) + if err != nil { + return fmt.Errorf("inject bean %s failed: %v", serverName, err.Error()) + } + return nil +} diff --git a/pkg/confmanager/config/confmanager_config.go b/pkg/confmanager/config/confmanager_config.go new file mode 100644 index 000000000..a12004d8f --- /dev/null +++ b/pkg/confmanager/config/confmanager_config.go @@ -0,0 +1,82 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package config + +import ( + "fmt" + "path" + + "github.com/secretflow/kuscia/pkg/kusciaapi/constants" + "github.com/secretflow/kuscia/pkg/web/errorcode" +) + +type ConfManagerConfig struct { + HTTPPort int32 `yaml:"HTTPPort,omitempty"` + GRPCPort int32 `yaml:"GRPCPort,omitempty"` + ConnectTimeout int `yaml:"connectTimeout,omitempty"` + ReadTimeout int `yaml:"readTimeout,omitempty"` + WriteTimeout int `yaml:"writeTimeout,omitempty"` + IdleTimeout int `yaml:"idleTimeout,omitempty"` + TLSConfig *TLSConfig `yaml:"tls,omitempty"` + EnableConfAuth bool `yaml:"enableConfAuth,omitempty"` + SecretBackend *SecretBackendConfig `yaml:"backend,omitempty"` +} + +type TLSConfig struct { + RootCAFile string `yaml:"rootCAFile"` + ServerCertFile string `yaml:"serverCertFile"` + ServerKeyFile string `yaml:"serverKeyFile"` +} + +type SecretBackendConfig struct { + Driver string `yaml:"driver"` + Params map[string]any `yaml:"params"` +} + +func NewDefaultConfManagerConfig(rootDir string) *ConfManagerConfig { + return &ConfManagerConfig{ + HTTPPort: 8060, + GRPCPort: 8061, + ConnectTimeout: 5, + ReadTimeout: 20, + WriteTimeout: 20, + IdleTimeout: 300, + TLSConfig: &TLSConfig{ + RootCAFile: path.Join(rootDir, constants.CertPathPrefix, "ca.crt"), + ServerKeyFile: path.Join(rootDir, constants.CertPathPrefix, "confmanager-server.key"), + ServerCertFile: path.Join(rootDir, constants.CertPathPrefix, "confmanager-server.crt"), + }, + EnableConfAuth: false, + SecretBackend: &SecretBackendConfig{ + Driver: "mem", + Params: map[string]any{}, + }, + } +} + +func (c ConfManagerConfig) MustTLSEnables(errs *errorcode.Errs) { + if c.TLSConfig == nil { + errs.AppendErr(fmt.Errorf("for confmanager, grpc must use tls")) + } + if c.TLSConfig.RootCAFile == "" { + errs.AppendErr(fmt.Errorf("for confmanager, grpc tls root ca file should not be empty")) + } + if c.TLSConfig.ServerCertFile == "" { + errs.AppendErr(fmt.Errorf("for confmanager, grpc tls server cert file should not be empty")) + } + if c.TLSConfig.ServerKeyFile == "" { + errs.AppendErr(fmt.Errorf("for confmanager, grpc tls server key file should not be empty")) + } +} diff --git a/pkg/confmanager/errorcode/error_code.go b/pkg/confmanager/errorcode/error_code.go new file mode 100644 index 000000000..215b523b9 --- /dev/null +++ b/pkg/confmanager/errorcode/error_code.go @@ -0,0 +1,29 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package errorcode + +import ( + "github.com/secretflow/kuscia/pkg/web/errorcode" +) + +const confManagerErrorCode = errorcode.KusciaErrorCode(2000) +const errorCodeInterval = 100 +const ( + ErrRequestInvalidate = confManagerErrorCode + iota + ErrForUnexpected + + ErrCreateConfiguration = confManagerErrorCode + errorCodeInterval + iota + ErrQueryConfiguration +) diff --git a/pkg/confmanager/handler/grpchandler/configuration.go b/pkg/confmanager/handler/grpchandler/configuration.go new file mode 100644 index 000000000..b64c68297 --- /dev/null +++ b/pkg/confmanager/handler/grpchandler/configuration.go @@ -0,0 +1,57 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package grpchandler + +import ( + "context" + + "github.com/secretflow/kuscia/pkg/confmanager/errorcode" + "github.com/secretflow/kuscia/pkg/confmanager/interceptor" + "github.com/secretflow/kuscia/pkg/confmanager/service" + "github.com/secretflow/kuscia/pkg/web/utils" + "github.com/secretflow/kuscia/proto/api/v1alpha1/confmanager" +) + +// ConfigurationHandler GRPC Handler +type configurationHandler struct { + configurationService service.IConfigurationService + confmanager.UnimplementedConfigurationServiceServer +} + +func NewConfigurationHandler(confService service.IConfigurationService) confmanager.ConfigurationServiceServer { + return &configurationHandler{ + configurationService: confService, + } +} + +func (h *configurationHandler) CreateConfiguration(ctx context.Context, request *confmanager.CreateConfigurationRequest) (*confmanager.CreateConfigurationResponse, error) { + tlsCert := interceptor.TLSCertFromGRPCContext(ctx) + if tlsCert == nil || len(tlsCert.OrganizationalUnit) == 0 { + return &confmanager.CreateConfigurationResponse{ + Status: utils.BuildErrorResponseStatus(errorcode.ErrRequestInvalidate, "require client tls ou"), + }, nil + } + return h.configurationService.CreateConfiguration(ctx, request, tlsCert.OrganizationalUnit[0]), nil +} + +func (h *configurationHandler) QueryConfiguration(ctx context.Context, request *confmanager.QueryConfigurationRequest) (*confmanager.QueryConfigurationResponse, error) { + tlsCert := interceptor.TLSCertFromGRPCContext(ctx) + if tlsCert == nil || len(tlsCert.OrganizationalUnit) == 0 { + return &confmanager.QueryConfigurationResponse{ + Status: utils.BuildErrorResponseStatus(errorcode.ErrRequestInvalidate, "require client tls ou"), + }, nil + } + return h.configurationService.QueryConfiguration(ctx, request, tlsCert.OrganizationalUnit[0]), nil +} diff --git a/pkg/confmanager/handler/httphandler/configuration/common.go b/pkg/confmanager/handler/httphandler/configuration/common.go new file mode 100644 index 000000000..84e431b4a --- /dev/null +++ b/pkg/confmanager/handler/httphandler/configuration/common.go @@ -0,0 +1,16 @@ +package configuration + +import ( + "fmt" + + "github.com/secretflow/kuscia/pkg/confmanager/interceptor" + "github.com/secretflow/kuscia/pkg/web/api" +) + +func validateTLSOu(context *api.BizContext) error { + tlsCert := interceptor.TLSCertFromGinContext(context.Context) + if tlsCert == nil || len(tlsCert.OrganizationalUnit) == 0 { + return fmt.Errorf("require client tls ou") + } + return nil +} diff --git a/pkg/confmanager/handler/httphandler/configuration/create.go b/pkg/confmanager/handler/httphandler/configuration/create.go new file mode 100644 index 000000000..510af1952 --- /dev/null +++ b/pkg/confmanager/handler/httphandler/configuration/create.go @@ -0,0 +1,56 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package configuration + +import ( + "fmt" + "reflect" + + "github.com/secretflow/kuscia/pkg/confmanager/interceptor" + "github.com/secretflow/kuscia/pkg/confmanager/service" + "github.com/secretflow/kuscia/pkg/web/api" + "github.com/secretflow/kuscia/pkg/web/errorcode" + "github.com/secretflow/kuscia/proto/api/v1alpha1/confmanager" +) + +type createConfigurationHandler struct { + configurationService service.IConfigurationService +} + +func NewCreateConfigurationHandler(configurationService service.IConfigurationService) api.ProtoHandler { + return &createConfigurationHandler{ + configurationService: configurationService, + } +} + +func (h createConfigurationHandler) Validate(context *api.BizContext, request api.ProtoRequest, errs *errorcode.Errs) { + createRequest, _ := request.(*confmanager.CreateConfigurationRequest) + if err := validateTLSOu(context); err != nil { + errs.AppendErr(err) + } + if createRequest.Id == "" { + errs.AppendErr(fmt.Errorf("confId must not empty")) + } +} + +func (h createConfigurationHandler) Handle(context *api.BizContext, request api.ProtoRequest) api.ProtoResponse { + createRequest, _ := request.(*confmanager.CreateConfigurationRequest) + tlsCert := interceptor.TLSCertFromGinContext(context.Context) + return h.configurationService.CreateConfiguration(context.Context, createRequest, tlsCert.OrganizationalUnit[0]) +} + +func (h createConfigurationHandler) GetType() (reqType, respType reflect.Type) { + return reflect.TypeOf(confmanager.CreateConfigurationRequest{}), reflect.TypeOf(confmanager.CreateConfigurationResponse{}) +} diff --git a/pkg/confmanager/handler/httphandler/configuration/query.go b/pkg/confmanager/handler/httphandler/configuration/query.go new file mode 100644 index 000000000..6f35889e8 --- /dev/null +++ b/pkg/confmanager/handler/httphandler/configuration/query.go @@ -0,0 +1,56 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package configuration + +import ( + "fmt" + "reflect" + + "github.com/secretflow/kuscia/pkg/confmanager/interceptor" + "github.com/secretflow/kuscia/pkg/confmanager/service" + "github.com/secretflow/kuscia/pkg/web/api" + "github.com/secretflow/kuscia/pkg/web/errorcode" + "github.com/secretflow/kuscia/proto/api/v1alpha1/confmanager" +) + +type queryConfigurationHandler struct { + configurationService service.IConfigurationService +} + +func NewQueryConfigurationHandler(configurationService service.IConfigurationService) api.ProtoHandler { + return &queryConfigurationHandler{ + configurationService: configurationService, + } +} + +func (h queryConfigurationHandler) Validate(context *api.BizContext, request api.ProtoRequest, errs *errorcode.Errs) { + queryRequest, _ := request.(*confmanager.QueryConfigurationRequest) + if err := validateTLSOu(context); err != nil { + errs.AppendErr(err) + } + if len(queryRequest.Ids) == 0 { + errs.AppendErr(fmt.Errorf("confIds must not empty")) + } +} + +func (h queryConfigurationHandler) Handle(context *api.BizContext, request api.ProtoRequest) api.ProtoResponse { + queryRequest, _ := request.(*confmanager.QueryConfigurationRequest) + tlsCert := interceptor.TLSCertFromGinContext(context.Context) + return h.configurationService.QueryConfiguration(context.Context, queryRequest, tlsCert.OrganizationalUnit[0]) +} + +func (h queryConfigurationHandler) GetType() (reqType, respType reflect.Type) { + return reflect.TypeOf(confmanager.QueryConfigurationRequest{}), reflect.TypeOf(confmanager.QueryConfigurationResponse{}) +} diff --git a/pkg/confmanager/interceptor/tls_cert.go b/pkg/confmanager/interceptor/tls_cert.go new file mode 100644 index 000000000..a1f451990 --- /dev/null +++ b/pkg/confmanager/interceptor/tls_cert.go @@ -0,0 +1,67 @@ +package interceptor + +import ( + "context" + "crypto/x509/pkix" + + "github.com/gin-gonic/gin" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/peer" +) + +var grpcTLSCertKey struct{} + +// TLSCertFromGRPCContext get tls cert info from grpc context. +func TLSCertFromGRPCContext(ctx context.Context) (p *pkix.Name) { + p, ok := ctx.Value(grpcTLSCertKey).(*pkix.Name) + if !ok { + return nil + } + return p +} + +func newTLSCertContext(ctx context.Context, tlsCert *pkix.Name) context.Context { + if tlsCert != nil { + return context.WithValue(ctx, grpcTLSCertKey, tlsCert) + } + return ctx +} + +// GRPCTLSCertInfoInterceptor is an interceptor for grpc.It catches tls cert info from grpc context.Context, and you can get tls cert info by TLSCertFromGRPCContext. +func GRPCTLSCertInfoInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { + certInfoFromContext := func(ctx context.Context) *pkix.Name { + if p, ok := peer.FromContext(ctx); ok { + if tlsInfo, ok := p.AuthInfo.(credentials.TLSInfo); ok { + if len(tlsInfo.State.VerifiedChains) > 0 && len(tlsInfo.State.VerifiedChains[0]) > 0 { + return &tlsInfo.State.VerifiedChains[0][0].Subject + } + } + } + return nil + } + + return handler(newTLSCertContext(ctx, certInfoFromContext(ctx)), req) +} + +const ( + httpTLSCertKey = "TLSCert" +) + +// TLSCertFromGinContext get tls cert info from gin context. +func TLSCertFromGinContext(c *gin.Context) *pkix.Name { + cert, exist := c.Get(httpTLSCertKey) + if !exist { + return nil + } + certPkix := cert.(pkix.Name) + return &certPkix +} + +// HTTPTLSCertInfoInterceptor is an interceptor for gin.It catches tls cert info from gin.Context, and you can get tls cert info by TLSCertFromGinContext. +func HTTPTLSCertInfoInterceptor(c *gin.Context) { + if c.Request.TLS != nil && len(c.Request.TLS.VerifiedChains) > 0 && len(c.Request.TLS.VerifiedChains[0]) > 0 { + c.Set(httpTLSCertKey, c.Request.TLS.VerifiedChains[0][0].Subject) + } + c.Next() +} diff --git a/pkg/confmanager/secretbackend/backend.go b/pkg/confmanager/secretbackend/backend.go new file mode 100644 index 000000000..91e1bf249 --- /dev/null +++ b/pkg/confmanager/secretbackend/backend.go @@ -0,0 +1,53 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package secretbackend + +import "fmt" + +// SecretDriver is actual secret manager system. It may be Vault, KMS, etc. +type SecretDriver interface { + // Set store confId/value to actual Secret Backend, Secret Backend may convert confId/value to another form. + Set(confID string, value string) error + // Get lookup value for confId, Secret Backend may reconvert value if it converts value to another form when Set. + Get(confID string) (string, error) + // GetByParams lookup value for confId, Secret Backend may reconvert value if it converts value to another form when Set. + GetByParams(confID string, params map[string]any) (string, error) +} + +type RegistryFactory func(config map[string]any) (SecretDriver, error) + +var globalRegistry = registry{ + backendFactory: map[string]RegistryFactory{}, +} + +type registry struct { + backendFactory map[string]RegistryFactory +} + +// Register SecretBackend driver, should be call be driver when package import init, the name should be unique. +// Driver will be overwritten when register with same name, and the last registration will win. +func Register(name string, factory RegistryFactory) { + globalRegistry.backendFactory[name] = factory + return +} + +// NewSecretBackendWith return a SecretBackend driver named params name. With a not-exist name, will return err. +func NewSecretBackendWith(name string, config map[string]any) (SecretDriver, error) { + _, exist := globalRegistry.backendFactory[name] + if !exist { + return nil, fmt.Errorf("can't find secret driver with name=%s", name) + } + return globalRegistry.backendFactory[name](config) +} diff --git a/pkg/confmanager/secretbackend/backend_test.go b/pkg/confmanager/secretbackend/backend_test.go new file mode 100644 index 000000000..30d11880b --- /dev/null +++ b/pkg/confmanager/secretbackend/backend_test.go @@ -0,0 +1,100 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package secretbackend + +import ( + "testing" +) + +func TestRegister(t *testing.T) { + type args struct { + name string + factory RegistryFactory + } + tests := []struct { + name string + args args + }{ + { + name: "register a fake driver should return no error", + args: args{ + name: "fake", + factory: NewFake, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + Register(tt.args.name, tt.args.factory) + }) + } +} + +func TestNewSecretBackendWith(t *testing.T) { + type args struct { + name string + config map[string]any + } + tests := []struct { + name string + args args + wantErr bool + }{ + { + name: "new fake secret backend should return no error", + args: args{ + name: "fake", + config: map[string]any{}, + }, + wantErr: false, + }, + { + name: "new fake2 secret backend should return error", + args: args{ + name: "fake2", + config: map[string]any{}, + }, + wantErr: true, + }, + } + Register("fake", NewFake) + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + _, err := NewSecretBackendWith(tt.args.name, tt.args.config) + if (err != nil) != tt.wantErr { + t.Errorf("NewSecretBackendWith() error = %v, wantErr %v", err, tt.wantErr) + return + } + }) + } +} + +type Fake struct{} + +func NewFake(configMap map[string]any) (SecretDriver, error) { + return &Fake{}, nil +} + +func (f *Fake) Set(confID string, value string) error { + return nil +} + +func (f *Fake) Get(confID string) (string, error) { + return "", nil +} + +func (f *Fake) GetByParams(confID string, params map[string]any) (string, error) { + return "", nil +} diff --git a/pkg/confmanager/secretbackend/mem/mem.go b/pkg/confmanager/secretbackend/mem/mem.go new file mode 100644 index 000000000..ce53b1f6e --- /dev/null +++ b/pkg/confmanager/secretbackend/mem/mem.go @@ -0,0 +1,50 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package mem + +import ( + "fmt" + + "github.com/secretflow/kuscia/pkg/confmanager/secretbackend" +) + +type Mem struct { + confs map[string]string +} + +func NewMem(configMap map[string]any) (secretbackend.SecretDriver, error) { + return &Mem{confs: map[string]string{}}, nil +} + +func (m *Mem) Set(confID string, value string) error { + m.confs[confID] = value + return nil +} + +func (m *Mem) Get(confID string) (string, error) { + return m.GetByParams(confID, nil) +} + +func (m *Mem) GetByParams(confID string, params map[string]any) (string, error) { + value, exist := m.confs[confID] + if !exist { + return "", fmt.Errorf("not exist") + } + return value, nil +} + +func init() { + secretbackend.Register("mem", NewMem) +} diff --git a/pkg/confmanager/service/configuration.go b/pkg/confmanager/service/configuration.go new file mode 100644 index 000000000..f0573588a --- /dev/null +++ b/pkg/confmanager/service/configuration.go @@ -0,0 +1,203 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package service + +import ( + "context" + "fmt" + + "github.com/secretflow/kuscia/pkg/confmanager/config" + "github.com/secretflow/kuscia/pkg/confmanager/errorcode" + "github.com/secretflow/kuscia/pkg/confmanager/secretbackend" + "github.com/secretflow/kuscia/pkg/utils/nlog" + "github.com/secretflow/kuscia/pkg/web/utils" + "github.com/secretflow/kuscia/proto/api/v1alpha1/confmanager" +) + +const ( + GroupKuscia = "kuscia" +) + +// IConfigurationService is service which manager conf from/to secret backend. It can be used by grpc-mtls/https/process-call. +type IConfigurationService interface { + // CreateConfiguration create a configuration with confID/content/cn. + CreateConfiguration(context.Context, *confmanager.CreateConfigurationRequest, string) *confmanager.CreateConfigurationResponse + // QueryConfiguration query a configuration with confIDs/cn. + QueryConfiguration(context.Context, *confmanager.QueryConfigurationRequest, string) *confmanager.QueryConfigurationResponse +} + +type configurationService struct { + conf config.ConfManagerConfig + backend secretbackend.SecretDriver +} + +func NewConfigurationService(config config.ConfManagerConfig) (IConfigurationService, error) { + nlog.Infof("Find secret config: type: %s, backendConfig: %+v", config.SecretBackend.Driver, config.SecretBackend.Params) + backend, err := secretbackend.NewSecretBackendWith(config.SecretBackend.Driver, config.SecretBackend.Params) + if err != nil { + nlog.Errorf("New secret backend with name=%s failed: %s", config.SecretBackend.Driver, err) + return nil, err + } + return &configurationService{ + conf: config, + backend: backend, + }, nil +} + +func (s configurationService) CreateConfiguration(ctx context.Context, request *confmanager.CreateConfigurationRequest, ou string) *confmanager.CreateConfigurationResponse { + if ou == "" { + return &confmanager.CreateConfigurationResponse{ + Status: utils.BuildErrorResponseStatus(errorcode.ErrRequestInvalidate, "tls ou must not be empty"), + } + } + + if request.Id == "" { + return &confmanager.CreateConfigurationResponse{ + Status: utils.BuildErrorResponseStatus(errorcode.ErrRequestInvalidate, "confID must not be empty"), + } + } + + if ou != GroupKuscia { + if err := s.backend.Set(s.groupPermissionKey(ou, request.Id), ""); err != nil { + return &confmanager.CreateConfigurationResponse{ + Status: utils.BuildErrorResponseStatus(errorcode.ErrCreateConfiguration, err.Error()), + } + } + } + + if err := s.backend.Set(request.Id, request.Content); err != nil { + return &confmanager.CreateConfigurationResponse{ + Status: utils.BuildErrorResponseStatus(errorcode.ErrCreateConfiguration, err.Error()), + } + } + + return &confmanager.CreateConfigurationResponse{ + Status: utils.BuildSuccessResponseStatus(), + } +} + +// QueryConfiguration query configuration +func (s configurationService) QueryConfiguration(ctx context.Context, request *confmanager.QueryConfigurationRequest, ou string) *confmanager.QueryConfigurationResponse { + if ou == "" { + return &confmanager.QueryConfigurationResponse{ + Status: utils.BuildErrorResponseStatus(errorcode.ErrRequestInvalidate, "tls ou must not be empty"), + } + } + + if len(request.GetIds()) == 0 { + return &confmanager.QueryConfigurationResponse{ + Status: utils.BuildErrorResponseStatus(errorcode.ErrRequestInvalidate, "ids length must not be zero"), + } + } + + return &confmanager.QueryConfigurationResponse{ + Status: utils.BuildSuccessResponseStatus(), + Configurations: s.GetConfs(ou, request.GetIds()), + } +} + +// GetConfs get multi confs by role. +// Params role should not be empty. +func (s configurationService) GetConfs(role string, confIDs []string) map[string]*confmanager.QueryConfigurationResult { + resultChannels := make([]<-chan getConfResultAsync, len(confIDs)) + for i, id := range confIDs { + resultChannels[i] = s.GetConfAsync(role, id) + } + results := make(map[string]*confmanager.QueryConfigurationResult, len(resultChannels)) + for _, c := range resultChannels { + result := <-c + if result.err != nil { + results[result.confID] = &confmanager.QueryConfigurationResult{ + Success: false, + ErrMsg: result.err.Error(), + } + } else { + results[result.confID] = &confmanager.QueryConfigurationResult{ + Success: true, + Content: result.value, + } + } + } + return results +} + +// GetConfAsync get conf for role async. The role should have permission for the key. +func (s configurationService) GetConfAsync(role string, confID string) <-chan getConfResultAsync { + resultChan := make(chan getConfResultAsync, 0) + go func() { + result, err := s.GetConf(role, confID) + resultChan <- getConfResultAsync{ + confID: confID, + value: result, + err: err, + } + }() + return resultChan +} + +// GetConf get conf for role. The role should have permission for the key. +func (s configurationService) GetConf(role string, confID string) (string, error) { + if role == "" || confID == "" { + return "", fmt.Errorf("role or confID should not be empty") + } + if s.conf.EnableConfAuth { + group := s.groupOf(role) + yes, err := s.hasPermissionFor(group, confID) + if err != nil { + nlog.Errorf("Check permission failed for role=%s and confID=%s failed: %v", role, confID, err) + return "", err + } + if !yes { + return "", fmt.Errorf("role=%s has no permission to confID=%s", role, confID) + } + } + value, err := s.backend.Get(confID) + if err != nil { + nlog.Errorf("Get key for confID=%s failed: %s", confID, err) + return "", err + } + return value, nil +} + +// hasPermissionFor check whether group has permission to access configuration. +func (s configurationService) hasPermissionFor(group string, confID string) (bool, error) { + // GroupKuscia has permission to access all configurations. + if group == GroupKuscia { + return true, nil + } + permissionKey := s.groupPermissionKey(group, confID) + _, err := s.backend.Get(permissionKey) + if err != nil { + nlog.Errorf("Get permission key for group=%s and confID=%s failed: %s", group, confID, err) + return false, nil + } + return true, nil +} + +// groupOf return group which the role joined. +func (s configurationService) groupOf(role string) string { + return role +} + +// groupPermissionKey return the permission key. +func (s configurationService) groupPermissionKey(group string, confID string) string { + return fmt.Sprintf("%s.%s", group, confID) +} + +type getConfResultAsync struct { + confID string + value string + err error +} diff --git a/pkg/confmanager/service/configuration_test.go b/pkg/confmanager/service/configuration_test.go new file mode 100644 index 000000000..fa4369f1c --- /dev/null +++ b/pkg/confmanager/service/configuration_test.go @@ -0,0 +1,178 @@ +package service + +import ( + "context" + _ "github.com/secretflow/kuscia/pkg/confmanager/secretbackend/mem" + "github.com/secretflow/kuscia/pkg/web/asserts" + "github.com/secretflow/kuscia/proto/api/v1alpha1/confmanager" + "reflect" + "testing" + + "github.com/secretflow/kuscia/pkg/confmanager/config" +) + +func newMemDriverConfigurationService() (IConfigurationService, error) { + srv, err := NewConfigurationService(config.ConfManagerConfig{ + SecretBackend: &config.SecretBackendConfig{ + Driver: "mem", + Params: map[string]any{}, + }, + }) + if err != nil { + return nil, err + } + return srv, nil +} + +func TestNewConfigurationService(t *testing.T) { + tests := []struct { + name string + wantErr bool + }{ + { + name: "new mem driver configuration service should return no error", + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + _, err := newMemDriverConfigurationService() + if (err != nil) != tt.wantErr { + t.Errorf("NewConfigurationService() error = %v, wantErr %v", err, tt.wantErr) + return + } + }) + } +} + +func Test_configurationService_CreateConfiguration(t *testing.T) { + type args struct { + ctx context.Context + request *confmanager.CreateConfigurationRequest + cn string + } + tests := []struct { + name string + args args + wantCode int32 + }{ + { + name: "new mem driver configuration service for alice cn set should success", + args: args{ + ctx: context.Background(), + request: &confmanager.CreateConfigurationRequest{ + Id: "alice", + Content: "alice", + }, + cn: "alice", + }, + wantCode: 0, + }, + { + name: "new mem driver configuration service for kuscia cn set should success", + args: args{ + ctx: context.Background(), + request: &confmanager.CreateConfigurationRequest{ + Id: "kuscia", + Content: "kuscia", + }, + cn: "kuscia", + }, + wantCode: 0, + }, + } + s, err := newMemDriverConfigurationService() + _ = asserts.IsNil(err, "new mem driver should return no error") + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := s.CreateConfiguration(tt.args.ctx, tt.args.request, tt.args.cn); !reflect.DeepEqual(got.Status.Code, tt.wantCode) { + t.Errorf("CreateConfiguration().Status.Code = %v, wantCode %v", got.Status.Code, tt.wantCode) + } + }) + } +} + +func Test_configurationService_QueryConfiguration(t *testing.T) { + type args struct { + ctx context.Context + request *confmanager.QueryConfigurationRequest + cn string + } + tests := []struct { + name string + args args + wantCode int32 + wantResult map[string]*confmanager.QueryConfigurationResult + }{ + { + name: "new mem driver set configuration for alice should success", + args: args{ + ctx: context.Background(), + request: &confmanager.QueryConfigurationRequest{ + Ids: []string{"alice", "kuscia"}, + }, + cn: "alice", + }, + wantCode: 0, + wantResult: map[string]*confmanager.QueryConfigurationResult{ + "alice": { + Success: true, + Content: "alice", + }, + "kuscia": { + Success: false, + }, + }, + }, + { + name: "new mem driver set configuration for kuscia should success", + args: args{ + ctx: context.Background(), + request: &confmanager.QueryConfigurationRequest{ + Ids: []string{"alice", "kuscia"}, + }, + cn: "kuscia", + }, + wantCode: 0, + wantResult: map[string]*confmanager.QueryConfigurationResult{ + "alice": { + Success: true, + Content: "alice", + }, + "kuscia": { + Success: true, + Content: "kuscia", + }, + }, + }, + } + s, err := newMemDriverConfigurationService() + _ = asserts.IsNil(err, "new mem driver should return no error") + response := s.CreateConfiguration(context.Background(), &confmanager.CreateConfigurationRequest{ + Id: "alice", + Content: "alice", + }, "alice") + _ = asserts.IsTrue(response.Status.Code == 0, "new mem driver set configuration for alice should success") + response = s.CreateConfiguration(context.Background(), &confmanager.CreateConfigurationRequest{ + Id: "kuscia", + Content: "kuscia", + }, "kuscia") + _ = asserts.IsTrue(response.Status.Code == 0, "new mem driver set configuration for kuscia should success") + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := s.QueryConfiguration(tt.args.ctx, tt.args.request, tt.args.cn) + if !reflect.DeepEqual(got.Status.Code, tt.wantCode) { + t.Errorf("QueryConfiguration().Status.Code = %v, want %v", got.Status.Code, tt.wantCode) + } + if len(got.Configurations) != len(tt.wantResult) { + t.Errorf("QueryConfiguration().len = %v, want %v", len(got.Configurations), len(tt.wantResult)) + } + for id, c := range got.Configurations { + _ = asserts.IsTrue(c.Success == tt.wantResult[id].Success, "confID=%s success should be equals") + if c.Success { + _ = asserts.IsTrue(c.Content == tt.wantResult[id].Content, "confID=%s content should be equals") + } + } + }) + } +} diff --git a/pkg/controllers/clusterdomainroute/controller.go b/pkg/controllers/clusterdomainroute/controller.go index afb9bdda5..7e1a95cac 100644 --- a/pkg/controllers/clusterdomainroute/controller.go +++ b/pkg/controllers/clusterdomainroute/controller.go @@ -24,7 +24,6 @@ import ( mrand "math/rand" "time" - corev1 "k8s.io/api/core/v1" apiextensionsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -346,7 +345,6 @@ func (c *Controller) checkDomainRoute(ctx context.Context, cdr *kusciaapisv1alph if !metav1.IsControlledBy(dr, cdr) { msg := fmt.Sprintf("DomainRoute %s already exists in namespace %s and is not managed by ClusterDomainRoute", drName, namespace) - c.recorder.Event(cdr, corev1.EventTypeWarning, errErrResourceExists, msg) return nil, fmt.Errorf("%s", msg) } @@ -385,10 +383,8 @@ func (c *Controller) syncHandler(ctx context.Context, key string) error { if err := c.doValidate(ctx, cdr); err != nil { nlog.Error(err.Error()) - c.recorder.Event(cdr, corev1.EventTypeNormal, doValidateReason, err.Error()) return nil } - c.recorder.Event(cdr, corev1.EventTypeNormal, doValidateReason, "Success") drName := common.GenDomainRouteName(cdr.Spec.Source, cdr.Spec.Destination) @@ -454,16 +450,13 @@ func (c *Controller) syncDomainPubKey(ctx context.Context, cdr *kusciaapisv1alph srcRsaPubData, err := c.getPublicKeyFromDomain(ctx, cdr.Name, cdr.Spec.Source) if err != nil { nlog.Warn(err) - c.recorder.Event(cdr, corev1.EventTypeNormal, syncDomainPubKeyReason, cdr.Spec.Source+":"+err.Error()) return } destRsaPubData, err := c.getPublicKeyFromDomain(ctx, cdr.Name, cdr.Spec.Destination) if err != nil { nlog.Warn(err) - c.recorder.Event(cdr, corev1.EventTypeNormal, syncDomainPubKeyReason, cdr.Spec.Destination+":"+err.Error()) return } - c.recorder.Event(cdr, corev1.EventTypeNormal, syncDomainPubKeyReason, "Success") cdrCopy := cdr.DeepCopy() cdrCopy.Spec.TokenConfig.SourcePublicKey = base64.StdEncoding.EncodeToString(srcRsaPubData) cdrCopy.Spec.TokenConfig.DestinationPublicKey = base64.StdEncoding.EncodeToString(destRsaPubData) diff --git a/pkg/controllers/clusterdomainroute/rolling.go b/pkg/controllers/clusterdomainroute/rolling.go index 2beaa444d..59ec785d3 100644 --- a/pkg/controllers/clusterdomainroute/rolling.go +++ b/pkg/controllers/clusterdomainroute/rolling.go @@ -60,7 +60,6 @@ func (c *Controller) preRollingClusterDomainRoute(ctx context.Context, cdr *kusc return err } - c.recorder.Event(cdr, corev1.EventTypeNormal, preRollingUpdateReason, msg) return nil } @@ -105,7 +104,6 @@ func (c *Controller) intraRollingClusterDomainRouteRand(ctx context.Context, cdr } msg := fmt.Sprintf("Source and destination domainroute rolling to next revision %d", cdr.Status.TokenStatus.Revision) - c.recorder.Event(cdr, corev1.EventTypeNormal, intraRollingUpdateReason, msg) nlog.Info(msg) return nil } @@ -153,7 +151,6 @@ func (c *Controller) intraRollingClusterDomainRouteRSA(ctx context.Context, cdr } msg := fmt.Sprintf("Source and destination domainroute rolling to next revision %d", cdr.Status.TokenStatus.Revision) - c.recorder.Event(cdr, corev1.EventTypeNormal, intraRollingUpdateReason, msg) nlog.Info(msg) return nil } @@ -184,7 +181,6 @@ func (c *Controller) postRollingClusterDomainRoute(ctx context.Context, cdr *kus return err } - c.recorder.Event(cdr, corev1.EventTypeNormal, postRollingUpdateReason, msg) } // update destination in advance @@ -197,7 +193,6 @@ func (c *Controller) postRollingClusterDomainRoute(ctx context.Context, cdr *kus nlog.Error(err) return err } - c.recorder.Event(cdr, corev1.EventTypeNormal, destinationTokenUpdateReason, msg) } if c.checkEffectiveInstances(destdr) { @@ -211,7 +206,6 @@ func (c *Controller) postRollingClusterDomainRoute(ctx context.Context, cdr *kus nlog.Error(err) return err } - c.recorder.Event(cdr, corev1.EventTypeNormal, sourceTokenUpdateReason, msg) } } diff --git a/pkg/controllers/domain/controller.go b/pkg/controllers/domain/controller.go index 5d693ce67..bcaba7e49 100644 --- a/pkg/controllers/domain/controller.go +++ b/pkg/controllers/domain/controller.go @@ -327,11 +327,6 @@ func (c *Controller) syncHandler(ctx context.Context, key string) (err error) { domain := rawDomain.DeepCopy() scheme.Scheme.Default(domain) - defer func() { - if err != nil { - c.recorder.Event(domain, apicorev1.EventTypeWarning, "ErrorHandleDomain", err.Error()) - } - }() if _, err = c.namespaceLister.Get(key); err != nil { if k8serrors.IsNotFound(err) { diff --git a/pkg/controllers/kusciajob/controller.go b/pkg/controllers/kusciajob/controller.go index ad6f74f24..08805eac8 100644 --- a/pkg/controllers/kusciajob/controller.go +++ b/pkg/controllers/kusciajob/controller.go @@ -19,7 +19,6 @@ import ( "fmt" "time" - v1 "k8s.io/api/core/v1" apiextensionsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -263,12 +262,6 @@ func (c *Controller) syncHandler(ctx context.Context, key string) (retErr error) // Set default for the new kusciaJob. kusciaJobDefault(curJob) - defer func() { - if retErr != nil { - c.recorder.Event(preJob, v1.EventTypeWarning, "ErrorHandleJob", retErr.Error()) - } - }() - // For kusciaJob that should not reconcile again, just return. if !handler.ShouldReconcile(curJob) { nlog.Infof("KusciaJob %q should not reconcile again, skipping", key) diff --git a/pkg/controllers/kusciajob/handler/failed_handler.go b/pkg/controllers/kusciajob/handler/failed_handler.go index bfced2a40..feddf5d43 100644 --- a/pkg/controllers/kusciajob/handler/failed_handler.go +++ b/pkg/controllers/kusciajob/handler/failed_handler.go @@ -15,7 +15,6 @@ package handler import ( - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" corelisters "k8s.io/client-go/listers/core/v1" "k8s.io/client-go/tools/record" @@ -86,7 +85,6 @@ func (h *FailedHandler) HandlePhase(kusciaJob *kusciaapisv1alpha1.KusciaJob) (ne } } - h.recorder.Event(kusciaJob, v1.EventTypeWarning, "KusciaJobFailed", "KusciaJob failed to run") metrics.JobResultStats.WithLabelValues(metrics.Failed).Inc() return needUpdate, nil } diff --git a/pkg/controllers/kusciajob/handler/succeeded_handler.go b/pkg/controllers/kusciajob/handler/succeeded_handler.go index 88272c62a..d7b71231d 100644 --- a/pkg/controllers/kusciajob/handler/succeeded_handler.go +++ b/pkg/controllers/kusciajob/handler/succeeded_handler.go @@ -15,7 +15,6 @@ package handler import ( - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" @@ -38,7 +37,6 @@ func NewSucceededHandler(deps *Dependencies) *SucceededHandler { // HandlePhase implements the KusciaJobPhaseHandler interface. // It will do some tail-in work when the job phase is Succeeded. func (h *SucceededHandler) HandlePhase(kusciaJob *kusciaapisv1alpha1.KusciaJob) (bool, error) { - h.recorder.Event(kusciaJob, v1.EventTypeNormal, "KusciaJobSucceeded", "KusciaJob ran successfully") now := metav1.Now() kusciaJob.Status.CompletionTime = &now kusciaJob.Status.LastReconcileTime = &now diff --git a/pkg/controllers/kusciatask/controller.go b/pkg/controllers/kusciatask/controller.go index a1ecd4b8f..3768aa30d 100644 --- a/pkg/controllers/kusciatask/controller.go +++ b/pkg/controllers/kusciatask/controller.go @@ -477,12 +477,6 @@ func (c *Controller) syncHandler(key string) (retErr error) { // Set default for the new kusciaTask. scheme.Scheme.Default(kusciaTask) - defer func() { - if retErr != nil { - c.recorder.Event(kusciaTask, v1.EventTypeWarning, "ErrorHandleTask", retErr.Error()) - } - }() - // Return if the task's unschedulable tag is true. if kusciaTask.Status.Phase != kusciaapisv1alpha1.TaskFailed && kusciaTask.Labels != nil && @@ -533,8 +527,6 @@ func (c *Controller) syncHandler(key string) (retErr error) { nlog.Infof("Finished syncing kusciatask %q (%v)", key, time.Since(startTime)) - c.recorder.Event(kusciaTask, v1.EventTypeNormal, kusciaTask.Status.Reason, - fmt.Sprintf("%v -> %v, %v", phase, kusciaTask.Status.Phase, kusciaTask.Status.Message)) return nil } diff --git a/pkg/controllers/kusciatask/handler/factory.go b/pkg/controllers/kusciatask/handler/factory.go index 79d2faaf1..0eefdab3d 100644 --- a/pkg/controllers/kusciatask/handler/factory.go +++ b/pkg/controllers/kusciatask/handler/factory.go @@ -47,7 +47,7 @@ func NewKusciaTaskPhaseHandlerFactory(deps *Dependencies) *KusciaTaskPhaseHandle finishedHandler := NewFinishedHandler(deps) runningHandler := NewRunningHandler(deps) pendingHandler := NewPendingHandler(deps) - succeededHandler := NewSucceededHandler(deps, finishedHandler) + succeededHandler := NewSucceededHandler(finishedHandler) failedHandler := NewFailedHandler(deps, finishedHandler) kusciaTaskStateHandlerMap := map[kusciaapisv1alpha1.KusciaTaskPhase]KusciaTaskPhaseHandler{ kusciaapisv1alpha1.TaskPending: pendingHandler, diff --git a/pkg/controllers/kusciatask/handler/failed_handler.go b/pkg/controllers/kusciatask/handler/failed_handler.go index 9df0764cd..5ef44deff 100644 --- a/pkg/controllers/kusciatask/handler/failed_handler.go +++ b/pkg/controllers/kusciatask/handler/failed_handler.go @@ -19,7 +19,6 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/tools/record" "github.com/secretflow/kuscia/pkg/controllers/kusciatask/metrics" kusciaapisv1alpha1 "github.com/secretflow/kuscia/pkg/crd/apis/kuscia/v1alpha1" @@ -34,7 +33,6 @@ type FailedHandler struct { *FinishedHandler kusciaClient kusciaclientset.Interface trgLister kuscialistersv1alpha1.TaskResourceGroupLister - recorder record.EventRecorder } // NewFailedHandler returns a FailedHandler instance. @@ -42,7 +40,6 @@ func NewFailedHandler(deps *Dependencies, finishedHandler *FinishedHandler) *Fai return &FailedHandler{ FinishedHandler: finishedHandler, kusciaClient: deps.KusciaClient, - recorder: deps.Recorder, trgLister: deps.TrgLister, } } @@ -55,7 +52,6 @@ func (h *FailedHandler) Handle(kusciaTask *kusciaapisv1alpha1.KusciaTask) (bool, if err != nil { return false, err } - h.recorder.Event(kusciaTask, v1.EventTypeWarning, "KusciaTaskFailed", "KusciaTask failed to run") metrics.TaskResultStats.WithLabelValues(metrics.Failed).Inc() return needUpdate, nil } diff --git a/pkg/controllers/kusciatask/handler/failed_handler_test.go b/pkg/controllers/kusciatask/handler/failed_handler_test.go index 57b275a8a..a5a5a796a 100644 --- a/pkg/controllers/kusciatask/handler/failed_handler_test.go +++ b/pkg/controllers/kusciatask/handler/failed_handler_test.go @@ -19,14 +19,11 @@ import ( "testing" "github.com/stretchr/testify/assert" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" kubeinformers "k8s.io/client-go/informers" kubefake "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/kubernetes/scheme" - typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1" - "k8s.io/client-go/tools/record" kusciaapisv1alpha1 "github.com/secretflow/kuscia/pkg/crd/apis/kuscia/v1alpha1" kusciafake "github.com/secretflow/kuscia/pkg/crd/clientset/versioned/fake" @@ -49,15 +46,11 @@ func TestFailedHandler_Handle(t *testing.T) { kusciaInformerFactory := kusciainformers.NewSharedInformerFactory(kusciaClient, 0) trgInformer := kusciaInformerFactory.Kuscia().V1alpha1().TaskResourceGroups() go kubeInformersFactory.Start(wait.NeverStop) - eventBroadcaster := record.NewBroadcaster() - eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{Interface: kubeClient.CoreV1().Events("default")}) - recorder := eventBroadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: "kuscia-task-controller"}) deps := &Dependencies{ KubeClient: kubeClient, KusciaClient: kusciaClient, PodsLister: kubeInformersFactory.Core().V1().Pods().Lister(), ConfigMapLister: kubeInformersFactory.Core().V1().ConfigMaps().Lister(), - Recorder: recorder, TrgLister: trgInformer.Lister(), } diff --git a/pkg/controllers/kusciatask/handler/pending_handler.go b/pkg/controllers/kusciatask/handler/pending_handler.go index 99d88acb1..afe8359e3 100644 --- a/pkg/controllers/kusciatask/handler/pending_handler.go +++ b/pkg/controllers/kusciatask/handler/pending_handler.go @@ -34,7 +34,7 @@ import ( kuscialistersv1alpha1 "github.com/secretflow/kuscia/pkg/crd/listers/kuscia/v1alpha1" "github.com/secretflow/kuscia/pkg/utils/nlog" utilsres "github.com/secretflow/kuscia/pkg/utils/resources" - proto "github.com/secretflow/kuscia/proto/api/v1alpha1/kusciatask" + proto "github.com/secretflow/kuscia/proto/api/v1alpha1/appconfig" ) // PendingHandler is used to handle kuscia task which phase is creating. diff --git a/pkg/controllers/kusciatask/handler/pending_handler_test.go b/pkg/controllers/kusciatask/handler/pending_handler_test.go index 54d2b2844..3cabf1214 100644 --- a/pkg/controllers/kusciatask/handler/pending_handler_test.go +++ b/pkg/controllers/kusciatask/handler/pending_handler_test.go @@ -33,7 +33,7 @@ import ( kusciafake "github.com/secretflow/kuscia/pkg/crd/clientset/versioned/fake" kusciainformers "github.com/secretflow/kuscia/pkg/crd/informers/externalversions" utilsres "github.com/secretflow/kuscia/pkg/utils/resources" - proto "github.com/secretflow/kuscia/proto/api/v1alpha1/kusciatask" + proto "github.com/secretflow/kuscia/proto/api/v1alpha1/appconfig" ) func makeTestPendingHandler() *PendingHandler { diff --git a/pkg/controllers/kusciatask/handler/succeeded_handler.go b/pkg/controllers/kusciatask/handler/succeeded_handler.go index d81a12807..ed4f3b6c3 100644 --- a/pkg/controllers/kusciatask/handler/succeeded_handler.go +++ b/pkg/controllers/kusciatask/handler/succeeded_handler.go @@ -15,9 +15,6 @@ package handler import ( - v1 "k8s.io/api/core/v1" - "k8s.io/client-go/tools/record" - "github.com/secretflow/kuscia/pkg/controllers/kusciatask/metrics" kusciaapisv1alpha1 "github.com/secretflow/kuscia/pkg/crd/apis/kuscia/v1alpha1" ) @@ -25,14 +22,12 @@ import ( // SucceededHandler is used to handle kuscia task which phase is Succeeded. type SucceededHandler struct { *FinishedHandler - recorder record.EventRecorder } // NewSucceededHandler returns a SucceededHandler instance. -func NewSucceededHandler(deps *Dependencies, finishedHandler *FinishedHandler) *SucceededHandler { +func NewSucceededHandler(finishedHandler *FinishedHandler) *SucceededHandler { return &SucceededHandler{ FinishedHandler: finishedHandler, - recorder: deps.Recorder, } } @@ -42,7 +37,6 @@ func (s *SucceededHandler) Handle(kusciaTask *kusciaapisv1alpha1.KusciaTask) (bo if err != nil { return false, nil } - s.recorder.Event(kusciaTask, v1.EventTypeNormal, "KusciaTaskSucceeded", "KusciaTask ran successfully") metrics.TaskResultStats.WithLabelValues(metrics.Succeeded).Inc() return needUpdate, nil } diff --git a/pkg/controllers/kusciatask/handler/succeeded_handler_test.go b/pkg/controllers/kusciatask/handler/succeeded_handler_test.go index adeadab99..aa3aaa72d 100644 --- a/pkg/controllers/kusciatask/handler/succeeded_handler_test.go +++ b/pkg/controllers/kusciatask/handler/succeeded_handler_test.go @@ -18,14 +18,11 @@ import ( "testing" "github.com/stretchr/testify/assert" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" kubeinformers "k8s.io/client-go/informers" kubefake "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/kubernetes/scheme" - typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1" - "k8s.io/client-go/tools/record" kusciaapisv1alpha1 "github.com/secretflow/kuscia/pkg/crd/apis/kuscia/v1alpha1" kusciafake "github.com/secretflow/kuscia/pkg/crd/clientset/versioned/fake" @@ -47,9 +44,6 @@ func TestSucceededHandler_Handle(t *testing.T) { kubeInformersFactory := kubeinformers.NewSharedInformerFactory(kubeClient, 0) kusciaInformerFactory := kusciainformers.NewSharedInformerFactory(kusciaClient, 0) go kubeInformersFactory.Start(wait.NeverStop) - eventBroadcaster := record.NewBroadcaster() - eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{Interface: kubeClient.CoreV1().Events("default")}) - recorder := eventBroadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: "kuscia-task-controller"}) deps := Dependencies{ KubeClient: kubeClient, @@ -60,7 +54,7 @@ func TestSucceededHandler_Handle(t *testing.T) { } finishHandler := NewFinishedHandler(&deps) - succeededHandler := NewSucceededHandler(&Dependencies{Recorder: recorder}, finishHandler) + succeededHandler := NewSucceededHandler(finishHandler) needUpdate, err := succeededHandler.Handle(testKusciaTask) assert.NoError(t, err) assert.Equal(t, true, needUpdate) diff --git a/pkg/controllers/taskresourcegroup/controller.go b/pkg/controllers/taskresourcegroup/controller.go index 7aa8f03c3..5bfa5942c 100644 --- a/pkg/controllers/taskresourcegroup/controller.go +++ b/pkg/controllers/taskresourcegroup/controller.go @@ -387,12 +387,6 @@ func (c *Controller) syncHandler(ctx context.Context, key string) (err error) { return nil } - defer func() { - if err != nil { - c.recorder.Event(trg, corev1.EventTypeWarning, "ErrorHandleTaskResourceGroup", err.Error()) - } - }() - phase := trg.Status.Phase if phase == "" { phase = kusciaapisv1alpha1.TaskResourceGroupPhasePending diff --git a/pkg/gateway/clusters/master.go b/pkg/gateway/clusters/master.go index 3ff90936e..1137a6d5d 100644 --- a/pkg/gateway/clusters/master.go +++ b/pkg/gateway/clusters/master.go @@ -65,7 +65,7 @@ func AddMasterClusters(ctx context.Context, namespace string, config *config.Mas waitMasterProxyReady(ctx) } else { if config.APIServer != nil { - if err := addMasterCluster(ServiceAPIServer, namespace, config.APIServer, config.ApiWhitelist); err != nil { + if err := addMasterCluster(ServiceAPIServer, namespace, config.APIServer, config.APIWhitelist); err != nil { return err } } @@ -173,7 +173,7 @@ func generateMasterInternalVirtualHost(cluster, service string, domains []string }, } if service == ServiceAPIServer { - regex := getMasterApiWhitelistRegex(apiWhitelist) + regex := getMasterAPIWhitelistRegex(apiWhitelist) if len(regex) > 0 { virtualHost.Routes[0].Match.PathSpecifier = &route.RouteMatch_SafeRegex{ SafeRegex: &matcherv3.RegexMatcher{ @@ -328,7 +328,7 @@ func addMasterHandshakeRoute(routeName string) { } } -func getMasterApiWhitelistRegex(apiWhitelist []string) string { +func getMasterAPIWhitelistRegex(apiWhitelist []string) string { var result = "" if len(apiWhitelist) > 0 { result = "(" + strings.Join(apiWhitelist, ")|(") + ")" diff --git a/pkg/gateway/config/cluster_config.go b/pkg/gateway/config/cluster_config.go index 7ddddb06b..7f78a5817 100644 --- a/pkg/gateway/config/cluster_config.go +++ b/pkg/gateway/config/cluster_config.go @@ -36,5 +36,5 @@ type MasterConfig struct { MasterProxy *ClusterConfig APIServer *ClusterConfig KusciaStorage *ClusterConfig - ApiWhitelist []string + APIWhitelist []string } diff --git a/pkg/gateway/config/inner_config.go b/pkg/gateway/config/inner_config.go index 3c3c6cc6a..e70d8fd7d 100644 --- a/pkg/gateway/config/inner_config.go +++ b/pkg/gateway/config/inner_config.go @@ -60,7 +60,7 @@ func LoadMasterConfig(masterConfig *kusciaconfig.MasterConfig, kubeConfig *restc TLSCert: apiCert, }, KusciaStorage: storageCluster, - ApiWhitelist: masterConfig.ApiWhitelist, + APIWhitelist: masterConfig.APIWhitelist, }, nil } diff --git a/pkg/gateway/controller/handshake.go b/pkg/gateway/controller/handshake.go index b56746a24..875500472 100644 --- a/pkg/gateway/controller/handshake.go +++ b/pkg/gateway/controller/handshake.go @@ -33,7 +33,6 @@ import ( "time" jwt "github.com/golang-jwt/jwt/v5" - corev1 "k8s.io/api/core/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" @@ -41,6 +40,7 @@ import ( "k8s.io/client-go/tools/cache" kusciatokenauth "github.com/secretflow/kuscia-envoy/kuscia/api/filters/http/kuscia_token_auth/v3" + "github.com/secretflow/kuscia/pkg/common" kusciaapisv1alpha1 "github.com/secretflow/kuscia/pkg/crd/apis/kuscia/v1alpha1" "github.com/secretflow/kuscia/pkg/gateway/clusters" @@ -430,7 +430,6 @@ func (c *DomainRouteController) parseTokenRSA(dr *kusciaapisv1alpha1.DomainRoute if (c.gateway.Namespace == dr.Spec.Source && dr.Spec.TokenConfig.SourcePublicKey != c.gateway.Status.PublicKey) || (c.gateway.Namespace == dr.Spec.Destination && dr.Spec.TokenConfig.DestinationPublicKey != c.gateway.Status.PublicKey) { err := fmt.Errorf("DomainRoute %s mismatch public key", key) - c.recorder.Event(c.gateway, corev1.EventTypeWarning, syncFailed, err.Error()) return tokens, err } diff --git a/pkg/utils/kusciaconfig/service_config.go b/pkg/utils/kusciaconfig/service_config.go index a07d1a3da..6c2658be7 100644 --- a/pkg/utils/kusciaconfig/service_config.go +++ b/pkg/utils/kusciaconfig/service_config.go @@ -31,8 +31,8 @@ type APIServerConfig struct { type MasterConfig struct { ServiceConfig `yaml:",inline"` APIServer *APIServerConfig `yaml:"apiserver,omitempty"` - KusciaStorage *ServiceConfig `yaml:"kusciastorage,omitempty"` - ApiWhitelist []string `yaml:"api-whitelist,omitempty"` + KusciaStorage *ServiceConfig `yaml:"kusciaStorage,omitempty"` + APIWhitelist []string `yaml:"apiWhitelist,omitempty"` } func CheckServiceConfig(config *ServiceConfig, name string) error { diff --git a/pkg/web/constants/constants.go b/pkg/web/constants/constants.go index 990da82dd..a5c5f413d 100644 --- a/pkg/web/constants/constants.go +++ b/pkg/web/constants/constants.go @@ -15,6 +15,9 @@ package constants const ( + LocalhostIP = "127.0.0.1" + SchemaHTTPS = "https" + SchemaHTTP = "http" HealthAPI = "/healthZ" TokenHeader = "Token" ContentTypeHeader = "Content-Type" diff --git a/pkg/web/errorcode/errs.go b/pkg/web/errorcode/errs.go index 1359e8b58..1e34a1a27 100644 --- a/pkg/web/errorcode/errs.go +++ b/pkg/web/errorcode/errs.go @@ -16,6 +16,13 @@ package errorcode type Errs []error +func NoError(errs *Errs) bool { + if errs == nil || len(*errs) == 0 { + return true + } + return false +} + func (errs *Errs) AppendErr(err error) { if err != nil { newErrs := append(*errs, err) diff --git a/pkg/web/framework/beans/gin_bean.go b/pkg/web/framework/beans/gin_bean.go index e4cb6972a..754ae640f 100644 --- a/pkg/web/framework/beans/gin_bean.go +++ b/pkg/web/framework/beans/gin_bean.go @@ -35,10 +35,9 @@ import ( type GinBean struct { framework.ConfigLoader // Configs - Port int `name:"port" usage:"Server port" default:"8080"` - Debug bool `name:"debug" usage:"Debug mode"` - LogPath string `name:"logpath" usage:"Gin Log path"` - TLSConfig *config.TLSConfig + Port int `name:"port" usage:"Server port" default:"8080"` + Debug bool `name:"debug" usage:"Debug mode"` + LogPath string `name:"logpath" usage:"Gin Log path"` GinBeanConfig *gin.Engine } @@ -126,7 +125,7 @@ func (b *GinBean) Start(ctx context.Context, e framework.ConfBeanRegistry) error return s.ListenAndServeTLS(b.TLSConfig.ServerCertPath, b.TLSConfig.ServerKeyPath) } - logs.GetLogger().Infof("server started %s", addr) + logs.GetLogger().Infof("http server started %s", addr) return s.ListenAndServe() } diff --git a/proto/api/v1alpha1/appconfig/BUILD.bazel b/proto/api/v1alpha1/appconfig/BUILD.bazel new file mode 100644 index 000000000..39189954e --- /dev/null +++ b/proto/api/v1alpha1/appconfig/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_cc//cc:defs.bzl", "cc_proto_library") + +package(default_visibility = ["//visibility:public"]) + +proto_library( + name = "app_config_proto", + srcs = ["app_config.proto"], + import_prefix = "kuscia", +) + +cc_proto_library( + name = "app_config_cc_proto", + deps = [":app_config_proto"], +) diff --git a/proto/api/v1alpha1/kusciatask/kuscia_task.pb.go b/proto/api/v1alpha1/appconfig/app_config.pb.go similarity index 51% rename from proto/api/v1alpha1/kusciatask/kuscia_task.pb.go rename to proto/api/v1alpha1/appconfig/app_config.pb.go index b2ea8e59e..dfe10b8d6 100644 --- a/proto/api/v1alpha1/kusciatask/kuscia_task.pb.go +++ b/proto/api/v1alpha1/appconfig/app_config.pb.go @@ -16,9 +16,9 @@ // versions: // protoc-gen-go v1.28.1 // protoc v3.21.8 -// source: kuscia/proto/api/v1alpha1/kusciatask/kuscia_task.proto +// source: kuscia/proto/api/v1alpha1/appconfig/app_config.proto -package kusciatask +package appconfig import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -49,7 +49,7 @@ type Service struct { func (x *Service) Reset() { *x = Service{} if protoimpl.UnsafeEnabled { - mi := &file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes[0] + mi := &file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -62,7 +62,7 @@ func (x *Service) String() string { func (*Service) ProtoMessage() {} func (x *Service) ProtoReflect() protoreflect.Message { - mi := &file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes[0] + mi := &file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -75,7 +75,7 @@ func (x *Service) ProtoReflect() protoreflect.Message { // Deprecated: Use Service.ProtoReflect.Descriptor instead. func (*Service) Descriptor() ([]byte, []int) { - return file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_rawDescGZIP(), []int{0} + return file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_rawDescGZIP(), []int{0} } func (x *Service) GetPortName() string { @@ -109,7 +109,7 @@ type Party struct { func (x *Party) Reset() { *x = Party{} if protoimpl.UnsafeEnabled { - mi := &file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes[1] + mi := &file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -122,7 +122,7 @@ func (x *Party) String() string { func (*Party) ProtoMessage() {} func (x *Party) ProtoReflect() protoreflect.Message { - mi := &file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes[1] + mi := &file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -135,7 +135,7 @@ func (x *Party) ProtoReflect() protoreflect.Message { // Deprecated: Use Party.ProtoReflect.Descriptor instead. func (*Party) Descriptor() ([]byte, []int) { - return file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_rawDescGZIP(), []int{1} + return file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_rawDescGZIP(), []int{1} } func (x *Party) GetName() string { @@ -159,7 +159,7 @@ func (x *Party) GetServices() []*Service { return nil } -// ClusterDefine represents the information of all parties required by the task. +// ClusterDefine represents the information of all parties. type ClusterDefine struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -176,7 +176,7 @@ type ClusterDefine struct { func (x *ClusterDefine) Reset() { *x = ClusterDefine{} if protoimpl.UnsafeEnabled { - mi := &file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes[2] + mi := &file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -189,7 +189,7 @@ func (x *ClusterDefine) String() string { func (*ClusterDefine) ProtoMessage() {} func (x *ClusterDefine) ProtoReflect() protoreflect.Message { - mi := &file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes[2] + mi := &file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -202,7 +202,7 @@ func (x *ClusterDefine) ProtoReflect() protoreflect.Message { // Deprecated: Use ClusterDefine.ProtoReflect.Descriptor instead. func (*ClusterDefine) Descriptor() ([]byte, []int) { - return file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_rawDescGZIP(), []int{2} + return file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_rawDescGZIP(), []int{2} } func (x *ClusterDefine) GetParties() []*Party { @@ -249,7 +249,7 @@ type Port struct { func (x *Port) Reset() { *x = Port{} if protoimpl.UnsafeEnabled { - mi := &file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes[3] + mi := &file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -262,7 +262,7 @@ func (x *Port) String() string { func (*Port) ProtoMessage() {} func (x *Port) ProtoReflect() protoreflect.Message { - mi := &file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes[3] + mi := &file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -275,7 +275,7 @@ func (x *Port) ProtoReflect() protoreflect.Message { // Deprecated: Use Port.ProtoReflect.Descriptor instead. func (*Port) Descriptor() ([]byte, []int) { - return file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_rawDescGZIP(), []int{3} + return file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_rawDescGZIP(), []int{3} } func (x *Port) GetName() string { @@ -319,7 +319,7 @@ type AllocatedPorts struct { func (x *AllocatedPorts) Reset() { *x = AllocatedPorts{} if protoimpl.UnsafeEnabled { - mi := &file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes[4] + mi := &file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -332,7 +332,7 @@ func (x *AllocatedPorts) String() string { func (*AllocatedPorts) ProtoMessage() {} func (x *AllocatedPorts) ProtoReflect() protoreflect.Message { - mi := &file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes[4] + mi := &file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -345,7 +345,7 @@ func (x *AllocatedPorts) ProtoReflect() protoreflect.Message { // Deprecated: Use AllocatedPorts.ProtoReflect.Descriptor instead. func (*AllocatedPorts) Descriptor() ([]byte, []int) { - return file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_rawDescGZIP(), []int{4} + return file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_rawDescGZIP(), []int{4} } func (x *AllocatedPorts) GetPorts() []*Port { @@ -355,82 +355,82 @@ func (x *AllocatedPorts) GetPorts() []*Port { return nil } -var File_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto protoreflect.FileDescriptor - -var file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_rawDesc = []byte{ - 0x0a, 0x36, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6b, 0x75, 0x73, 0x63, - 0x69, 0x61, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x5f, 0x74, 0x61, - 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x24, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x74, 0x61, 0x73, 0x6b, 0x22, 0x44, - 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x72, - 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, - 0x72, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x73, 0x22, 0x7a, 0x0a, 0x05, 0x50, 0x61, 0x72, 0x74, 0x79, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x49, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x22, 0xa8, 0x01, 0x0a, 0x0d, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, - 0x6e, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x61, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x79, - 0x52, 0x07, 0x70, 0x61, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x73, 0x65, 0x6c, - 0x66, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0c, 0x73, 0x65, 0x6c, 0x66, 0x50, 0x61, 0x72, 0x74, 0x79, 0x49, 0x64, 0x78, 0x12, - 0x2a, 0x0a, 0x11, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x5f, 0x69, 0x64, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x73, 0x65, 0x6c, 0x66, - 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x64, 0x78, 0x22, 0x60, 0x0a, 0x04, 0x50, - 0x6f, 0x72, 0x74, 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, 0x6f, 0x72, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, - 0x63, 0x6f, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22, 0x52, 0x0a, - 0x0e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x73, 0x12, - 0x40, 0x0a, 0x05, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, - 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, - 0x61, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x05, 0x70, 0x6f, 0x72, 0x74, - 0x73, 0x42, 0x60, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x66, - 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x6b, 0x75, 0x73, - 0x63, 0x69, 0x61, 0x74, 0x61, 0x73, 0x6b, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x6b, - 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x74, - 0x61, 0x73, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_kuscia_proto_api_v1alpha1_appconfig_app_config_proto protoreflect.FileDescriptor + +var file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_rawDesc = []byte{ + 0x0a, 0x34, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x61, 0x70, 0x70, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x44, 0x0a, 0x07, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x72, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x73, 0x22, 0x79, 0x0a, 0x05, 0x50, 0x61, 0x72, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, + 0x6c, 0x65, 0x12, 0x48, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x61, 0x70, 0x70, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0xa7, 0x01, 0x0a, + 0x0d, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x12, 0x44, + 0x0a, 0x07, 0x70, 0x61, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2a, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x61, 0x70, 0x70, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x79, 0x52, 0x07, 0x70, 0x61, 0x72, + 0x74, 0x69, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x70, 0x61, 0x72, + 0x74, 0x79, 0x5f, 0x69, 0x64, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x73, 0x65, + 0x6c, 0x66, 0x50, 0x61, 0x72, 0x74, 0x79, 0x49, 0x64, 0x78, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x65, + 0x6c, 0x66, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x78, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x73, 0x65, 0x6c, 0x66, 0x45, 0x6e, 0x64, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x49, 0x64, 0x78, 0x22, 0x60, 0x0a, 0x04, 0x50, 0x6f, 0x72, 0x74, 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, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22, 0x51, 0x0a, 0x0e, 0x41, 0x6c, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x3f, 0x0a, 0x05, 0x70, 0x6f, + 0x72, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6b, 0x75, 0x73, 0x63, + 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x61, 0x70, 0x70, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, + 0x50, 0x6f, 0x72, 0x74, 0x52, 0x05, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x42, 0x5e, 0x0a, 0x21, 0x63, + 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x61, 0x70, 0x70, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x63, + 0x72, 0x65, 0x74, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2f, 0x61, 0x70, 0x70, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( - file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_rawDescOnce sync.Once - file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_rawDescData = file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_rawDesc + file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_rawDescOnce sync.Once + file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_rawDescData = file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_rawDesc ) -func file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_rawDescGZIP() []byte { - file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_rawDescOnce.Do(func() { - file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_rawDescData = protoimpl.X.CompressGZIP(file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_rawDescData) +func file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_rawDescGZIP() []byte { + file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_rawDescOnce.Do(func() { + file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_rawDescData) }) - return file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_rawDescData + return file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_rawDescData } -var file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_goTypes = []interface{}{ - (*Service)(nil), // 0: kuscia.proto.api.v1alpha1.kusciatask.Service - (*Party)(nil), // 1: kuscia.proto.api.v1alpha1.kusciatask.Party - (*ClusterDefine)(nil), // 2: kuscia.proto.api.v1alpha1.kusciatask.ClusterDefine - (*Port)(nil), // 3: kuscia.proto.api.v1alpha1.kusciatask.Port - (*AllocatedPorts)(nil), // 4: kuscia.proto.api.v1alpha1.kusciatask.AllocatedPorts +var file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_goTypes = []interface{}{ + (*Service)(nil), // 0: kuscia.proto.api.v1alpha1.appconfig.Service + (*Party)(nil), // 1: kuscia.proto.api.v1alpha1.appconfig.Party + (*ClusterDefine)(nil), // 2: kuscia.proto.api.v1alpha1.appconfig.ClusterDefine + (*Port)(nil), // 3: kuscia.proto.api.v1alpha1.appconfig.Port + (*AllocatedPorts)(nil), // 4: kuscia.proto.api.v1alpha1.appconfig.AllocatedPorts } -var file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_depIdxs = []int32{ - 0, // 0: kuscia.proto.api.v1alpha1.kusciatask.Party.services:type_name -> kuscia.proto.api.v1alpha1.kusciatask.Service - 1, // 1: kuscia.proto.api.v1alpha1.kusciatask.ClusterDefine.parties:type_name -> kuscia.proto.api.v1alpha1.kusciatask.Party - 3, // 2: kuscia.proto.api.v1alpha1.kusciatask.AllocatedPorts.ports:type_name -> kuscia.proto.api.v1alpha1.kusciatask.Port +var file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_depIdxs = []int32{ + 0, // 0: kuscia.proto.api.v1alpha1.appconfig.Party.services:type_name -> kuscia.proto.api.v1alpha1.appconfig.Service + 1, // 1: kuscia.proto.api.v1alpha1.appconfig.ClusterDefine.parties:type_name -> kuscia.proto.api.v1alpha1.appconfig.Party + 3, // 2: kuscia.proto.api.v1alpha1.appconfig.AllocatedPorts.ports:type_name -> kuscia.proto.api.v1alpha1.appconfig.Port 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 @@ -438,13 +438,13 @@ var file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_depIdxs = []int3 0, // [0:3] is the sub-list for field type_name } -func init() { file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_init() } -func file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_init() { - if File_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto != nil { +func init() { file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_init() } +func file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_init() { + if File_kuscia_proto_api_v1alpha1_appconfig_app_config_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Service); i { case 0: return &v.state @@ -456,7 +456,7 @@ func file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_init() { return nil } } - file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Party); i { case 0: return &v.state @@ -468,7 +468,7 @@ func file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_init() { return nil } } - file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClusterDefine); i { case 0: return &v.state @@ -480,7 +480,7 @@ func file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_init() { return nil } } - file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Port); i { case 0: return &v.state @@ -492,7 +492,7 @@ func file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_init() { return nil } } - file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AllocatedPorts); i { case 0: return &v.state @@ -509,18 +509,18 @@ func file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_rawDesc, + RawDescriptor: file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_rawDesc, NumEnums: 0, NumMessages: 5, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_goTypes, - DependencyIndexes: file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_depIdxs, - MessageInfos: file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_msgTypes, + GoTypes: file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_goTypes, + DependencyIndexes: file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_depIdxs, + MessageInfos: file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_msgTypes, }.Build() - File_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto = out.File - file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_rawDesc = nil - file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_goTypes = nil - file_kuscia_proto_api_v1alpha1_kusciatask_kuscia_task_proto_depIdxs = nil + File_kuscia_proto_api_v1alpha1_appconfig_app_config_proto = out.File + file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_rawDesc = nil + file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_goTypes = nil + file_kuscia_proto_api_v1alpha1_appconfig_app_config_proto_depIdxs = nil } diff --git a/proto/api/v1alpha1/kusciatask/kuscia_task.proto b/proto/api/v1alpha1/appconfig/app_config.proto similarity index 90% rename from proto/api/v1alpha1/kusciatask/kuscia_task.proto rename to proto/api/v1alpha1/appconfig/app_config.proto index 9aaa00c6b..4bdf6d1e0 100644 --- a/proto/api/v1alpha1/kusciatask/kuscia_task.proto +++ b/proto/api/v1alpha1/appconfig/app_config.proto @@ -14,10 +14,10 @@ syntax = "proto3"; -package kuscia.proto.api.v1alpha1.kusciatask; +package kuscia.proto.api.v1alpha1.appconfig; -option go_package = "github.com/secretflow/kuscia/proto/api/v1alpha1/kusciatask"; -option java_package = "com.secretflow.v1alpha1.kusciatask"; +option go_package = "github.com/secretflow/kuscia/proto/api/v1alpha1/appconfig"; +option java_package = "com.secretflow.v1alpha1.appconfig"; // Service represents the service address corresponding to the port. message Service { @@ -37,7 +37,7 @@ message Party { repeated Service services = 3; } -// ClusterDefine represents the information of all parties required by the task. +// ClusterDefine represents the information of all parties. message ClusterDefine { // Basic information of all parties. repeated Party parties = 1; diff --git a/proto/api/v1alpha1/common.pb.go b/proto/api/v1alpha1/common.pb.go index 5c4234c6e..d9d95ef72 100644 --- a/proto/api/v1alpha1/common.pb.go +++ b/proto/api/v1alpha1/common.pb.go @@ -35,6 +35,52 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type FileFormat int32 + +const ( + FileFormat_UNKNOWN FileFormat = 0 + FileFormat_CSV FileFormat = 1 +) + +// Enum value maps for FileFormat. +var ( + FileFormat_name = map[int32]string{ + 0: "UNKNOWN", + 1: "CSV", + } + FileFormat_value = map[string]int32{ + "UNKNOWN": 0, + "CSV": 1, + } +) + +func (x FileFormat) Enum() *FileFormat { + p := new(FileFormat) + *p = x + return p +} + +func (x FileFormat) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FileFormat) Descriptor() protoreflect.EnumDescriptor { + return file_kuscia_proto_api_v1alpha1_common_proto_enumTypes[0].Descriptor() +} + +func (FileFormat) Type() protoreflect.EnumType { + return &file_kuscia_proto_api_v1alpha1_common_proto_enumTypes[0] +} + +func (x FileFormat) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FileFormat.Descriptor instead. +func (FileFormat) EnumDescriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_common_proto_rawDescGZIP(), []int{0} +} + // RequestHeader carries the user custom headers. type RequestHeader struct { state protoimpl.MessageState @@ -219,6 +265,9 @@ type DataColumn struct { Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` // The description of column Comment string `protobuf:"bytes,3,opt,name=comment,proto3" json:"comment,omitempty"` + // can the column could be nullable, default is false; note that nullable column is common case, which you + // should set explicitly + Nullable bool `protobuf:"varint,4,opt,name=nullable,proto3" json:"nullable,omitempty"` } func (x *DataColumn) Reset() { @@ -274,6 +323,13 @@ func (x *DataColumn) GetComment() string { return "" } +func (x *DataColumn) GetNullable() bool { + if x != nil { + return x.Nullable + } + return false +} + var File_kuscia_proto_api_v1alpha1_common_proto protoreflect.FileDescriptor var file_kuscia_proto_api_v1alpha1_common_proto_rawDesc = []byte{ @@ -306,12 +362,16 @@ var file_kuscia_proto_api_v1alpha1_common_proto_rawDesc = []byte{ 0x3d, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, - 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0x4e, + 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0x6a, 0x0a, 0x0a, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 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, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x51, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1a, + 0x0a, 0x08, 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2a, 0x22, 0x0a, 0x0a, 0x46, 0x69, + 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, + 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x43, 0x53, 0x56, 0x10, 0x01, 0x42, 0x51, 0x0a, 0x1e, 0x6f, 0x72, 0x67, 0x2e, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x63, @@ -332,19 +392,21 @@ func file_kuscia_proto_api_v1alpha1_common_proto_rawDescGZIP() []byte { return file_kuscia_proto_api_v1alpha1_common_proto_rawDescData } +var file_kuscia_proto_api_v1alpha1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_kuscia_proto_api_v1alpha1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_kuscia_proto_api_v1alpha1_common_proto_goTypes = []interface{}{ - (*RequestHeader)(nil), // 0: kuscia.proto.api.v1alpha1.RequestHeader - (*Status)(nil), // 1: kuscia.proto.api.v1alpha1.Status - (*Partition)(nil), // 2: kuscia.proto.api.v1alpha1.Partition - (*DataColumn)(nil), // 3: kuscia.proto.api.v1alpha1.DataColumn - nil, // 4: kuscia.proto.api.v1alpha1.RequestHeader.CustomHeadersEntry - (*anypb.Any)(nil), // 5: google.protobuf.Any + (FileFormat)(0), // 0: kuscia.proto.api.v1alpha1.FileFormat + (*RequestHeader)(nil), // 1: kuscia.proto.api.v1alpha1.RequestHeader + (*Status)(nil), // 2: kuscia.proto.api.v1alpha1.Status + (*Partition)(nil), // 3: kuscia.proto.api.v1alpha1.Partition + (*DataColumn)(nil), // 4: kuscia.proto.api.v1alpha1.DataColumn + nil, // 5: kuscia.proto.api.v1alpha1.RequestHeader.CustomHeadersEntry + (*anypb.Any)(nil), // 6: google.protobuf.Any } var file_kuscia_proto_api_v1alpha1_common_proto_depIdxs = []int32{ - 4, // 0: kuscia.proto.api.v1alpha1.RequestHeader.custom_headers:type_name -> kuscia.proto.api.v1alpha1.RequestHeader.CustomHeadersEntry - 5, // 1: kuscia.proto.api.v1alpha1.Status.details:type_name -> google.protobuf.Any - 3, // 2: kuscia.proto.api.v1alpha1.Partition.fields:type_name -> kuscia.proto.api.v1alpha1.DataColumn + 5, // 0: kuscia.proto.api.v1alpha1.RequestHeader.custom_headers:type_name -> kuscia.proto.api.v1alpha1.RequestHeader.CustomHeadersEntry + 6, // 1: kuscia.proto.api.v1alpha1.Status.details:type_name -> google.protobuf.Any + 4, // 2: kuscia.proto.api.v1alpha1.Partition.fields:type_name -> kuscia.proto.api.v1alpha1.DataColumn 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 @@ -412,13 +474,14 @@ func file_kuscia_proto_api_v1alpha1_common_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_kuscia_proto_api_v1alpha1_common_proto_rawDesc, - NumEnums: 0, + NumEnums: 1, NumMessages: 5, NumExtensions: 0, NumServices: 0, }, GoTypes: file_kuscia_proto_api_v1alpha1_common_proto_goTypes, DependencyIndexes: file_kuscia_proto_api_v1alpha1_common_proto_depIdxs, + EnumInfos: file_kuscia_proto_api_v1alpha1_common_proto_enumTypes, MessageInfos: file_kuscia_proto_api_v1alpha1_common_proto_msgTypes, }.Build() File_kuscia_proto_api_v1alpha1_common_proto = out.File diff --git a/proto/api/v1alpha1/common.proto b/proto/api/v1alpha1/common.proto index 70a9b241e..f30411508 100644 --- a/proto/api/v1alpha1/common.proto +++ b/proto/api/v1alpha1/common.proto @@ -51,4 +51,12 @@ message DataColumn { string type = 2; // The description of column string comment = 3; -} \ No newline at end of file + // can the column could be nullable, default is false; note that nullable column is common case, which you + // should set explicitly + bool nullable = 4; +} + +enum FileFormat { + UNKNOWN = 0; + CSV = 1; +} diff --git a/proto/api/v1alpha1/confmanager/configuration.pb.go b/proto/api/v1alpha1/confmanager/configuration.pb.go new file mode 100644 index 000000000..99d3f59ca --- /dev/null +++ b/proto/api/v1alpha1/confmanager/configuration.pb.go @@ -0,0 +1,536 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: kuscia/proto/api/v1alpha1/confmanager/configuration.proto + +package confmanager + +import ( + v1alpha1 "github.com/secretflow/kuscia/proto/api/v1alpha1" + 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) +) + +type CreateConfigurationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *v1alpha1.RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` +} + +func (x *CreateConfigurationRequest) Reset() { + *x = CreateConfigurationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateConfigurationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateConfigurationRequest) ProtoMessage() {} + +func (x *CreateConfigurationRequest) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_confmanager_configuration_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 CreateConfigurationRequest.ProtoReflect.Descriptor instead. +func (*CreateConfigurationRequest) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateConfigurationRequest) GetHeader() *v1alpha1.RequestHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *CreateConfigurationRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *CreateConfigurationRequest) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +type CreateConfigurationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status *v1alpha1.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *CreateConfigurationResponse) Reset() { + *x = CreateConfigurationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateConfigurationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateConfigurationResponse) ProtoMessage() {} + +func (x *CreateConfigurationResponse) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_confmanager_configuration_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 CreateConfigurationResponse.ProtoReflect.Descriptor instead. +func (*CreateConfigurationResponse) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateConfigurationResponse) GetStatus() *v1alpha1.Status { + if x != nil { + return x.Status + } + return nil +} + +type QueryConfigurationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` + GroupName string `protobuf:"bytes,2,opt,name=group_name,json=groupName,proto3" json:"group_name,omitempty"` +} + +func (x *QueryConfigurationRequest) Reset() { + *x = QueryConfigurationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryConfigurationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryConfigurationRequest) ProtoMessage() {} + +func (x *QueryConfigurationRequest) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_confmanager_configuration_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 QueryConfigurationRequest.ProtoReflect.Descriptor instead. +func (*QueryConfigurationRequest) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryConfigurationRequest) GetIds() []string { + if x != nil { + return x.Ids + } + return nil +} + +func (x *QueryConfigurationRequest) GetGroupName() string { + if x != nil { + return x.GroupName + } + return "" +} + +type QueryConfigurationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status *v1alpha1.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Configurations map[string]*QueryConfigurationResult `protobuf:"bytes,2,rep,name=configurations,proto3" json:"configurations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *QueryConfigurationResponse) Reset() { + *x = QueryConfigurationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryConfigurationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryConfigurationResponse) ProtoMessage() {} + +func (x *QueryConfigurationResponse) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_confmanager_configuration_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 QueryConfigurationResponse.ProtoReflect.Descriptor instead. +func (*QueryConfigurationResponse) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryConfigurationResponse) GetStatus() *v1alpha1.Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *QueryConfigurationResponse) GetConfigurations() map[string]*QueryConfigurationResult { + if x != nil { + return x.Configurations + } + return nil +} + +type QueryConfigurationResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg,proto3" json:"err_msg,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` +} + +func (x *QueryConfigurationResult) Reset() { + *x = QueryConfigurationResult{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryConfigurationResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryConfigurationResult) ProtoMessage() {} + +func (x *QueryConfigurationResult) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_confmanager_configuration_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 QueryConfigurationResult.ProtoReflect.Descriptor instead. +func (*QueryConfigurationResult) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryConfigurationResult) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *QueryConfigurationResult) GetErrMsg() string { + if x != nil { + return x.ErrMsg + } + return "" +} + +func (x *QueryConfigurationResult) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +var File_kuscia_proto_api_v1alpha1_confmanager_configuration_proto protoreflect.FileDescriptor + +var file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_rawDesc = []byte{ + 0x0a, 0x39, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x25, 0x6b, 0x75, 0x73, + 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x1a, 0x26, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x88, 0x01, 0x0a, 0x1a, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x75, 0x73, 0x63, + 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x58, 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, + 0x4c, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, + 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 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, 0x22, 0xdb, 0x02, + 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6b, + 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x7d, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x55, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x66, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x82, 0x01, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x55, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x3f, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x66, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x67, 0x0a, 0x18, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x32, 0xd1, 0x02, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x9c, 0x01, + 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, + 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x99, 0x01, 0x0a, + 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x62, 0x0a, 0x23, 0x6f, 0x72, 0x67, 0x2e, + 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x5a, + 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x63, 0x72, + 0x65, 0x74, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_rawDescOnce sync.Once + file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_rawDescData = file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_rawDesc +) + +func file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_rawDescGZIP() []byte { + file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_rawDescOnce.Do(func() { + file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_rawDescData = protoimpl.X.CompressGZIP(file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_rawDescData) + }) + return file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_rawDescData +} + +var file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_goTypes = []interface{}{ + (*CreateConfigurationRequest)(nil), // 0: kuscia.proto.api.v1alpha1.confmanager.CreateConfigurationRequest + (*CreateConfigurationResponse)(nil), // 1: kuscia.proto.api.v1alpha1.confmanager.CreateConfigurationResponse + (*QueryConfigurationRequest)(nil), // 2: kuscia.proto.api.v1alpha1.confmanager.QueryConfigurationRequest + (*QueryConfigurationResponse)(nil), // 3: kuscia.proto.api.v1alpha1.confmanager.QueryConfigurationResponse + (*QueryConfigurationResult)(nil), // 4: kuscia.proto.api.v1alpha1.confmanager.QueryConfigurationResult + nil, // 5: kuscia.proto.api.v1alpha1.confmanager.QueryConfigurationResponse.ConfigurationsEntry + (*v1alpha1.RequestHeader)(nil), // 6: kuscia.proto.api.v1alpha1.RequestHeader + (*v1alpha1.Status)(nil), // 7: kuscia.proto.api.v1alpha1.Status +} +var file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_depIdxs = []int32{ + 6, // 0: kuscia.proto.api.v1alpha1.confmanager.CreateConfigurationRequest.header:type_name -> kuscia.proto.api.v1alpha1.RequestHeader + 7, // 1: kuscia.proto.api.v1alpha1.confmanager.CreateConfigurationResponse.status:type_name -> kuscia.proto.api.v1alpha1.Status + 7, // 2: kuscia.proto.api.v1alpha1.confmanager.QueryConfigurationResponse.status:type_name -> kuscia.proto.api.v1alpha1.Status + 5, // 3: kuscia.proto.api.v1alpha1.confmanager.QueryConfigurationResponse.configurations:type_name -> kuscia.proto.api.v1alpha1.confmanager.QueryConfigurationResponse.ConfigurationsEntry + 4, // 4: kuscia.proto.api.v1alpha1.confmanager.QueryConfigurationResponse.ConfigurationsEntry.value:type_name -> kuscia.proto.api.v1alpha1.confmanager.QueryConfigurationResult + 0, // 5: kuscia.proto.api.v1alpha1.confmanager.ConfigurationService.CreateConfiguration:input_type -> kuscia.proto.api.v1alpha1.confmanager.CreateConfigurationRequest + 2, // 6: kuscia.proto.api.v1alpha1.confmanager.ConfigurationService.QueryConfiguration:input_type -> kuscia.proto.api.v1alpha1.confmanager.QueryConfigurationRequest + 1, // 7: kuscia.proto.api.v1alpha1.confmanager.ConfigurationService.CreateConfiguration:output_type -> kuscia.proto.api.v1alpha1.confmanager.CreateConfigurationResponse + 3, // 8: kuscia.proto.api.v1alpha1.confmanager.ConfigurationService.QueryConfiguration:output_type -> kuscia.proto.api.v1alpha1.confmanager.QueryConfigurationResponse + 7, // [7:9] is the sub-list for method output_type + 5, // [5:7] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_init() } +func file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_init() { + if File_kuscia_proto_api_v1alpha1_confmanager_configuration_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateConfigurationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateConfigurationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryConfigurationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryConfigurationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryConfigurationResult); 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_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_goTypes, + DependencyIndexes: file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_depIdxs, + MessageInfos: file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_msgTypes, + }.Build() + File_kuscia_proto_api_v1alpha1_confmanager_configuration_proto = out.File + file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_rawDesc = nil + file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_goTypes = nil + file_kuscia_proto_api_v1alpha1_confmanager_configuration_proto_depIdxs = nil +} diff --git a/proto/api/v1alpha1/confmanager/configuration.proto b/proto/api/v1alpha1/confmanager/configuration.proto new file mode 100644 index 000000000..0cc1a4c1f --- /dev/null +++ b/proto/api/v1alpha1/confmanager/configuration.proto @@ -0,0 +1,54 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package kuscia.proto.api.v1alpha1.confmanager; + +import "kuscia/proto/api/v1alpha1/common.proto"; + +option go_package = "github.com/secretflow/kuscia/proto/api/v1alpha1/confmanager"; +option java_package = "org.secretflow.v1alpha1.confmanager"; + +service ConfigurationService { + rpc CreateConfiguration(CreateConfigurationRequest) returns (CreateConfigurationResponse); + + rpc QueryConfiguration(QueryConfigurationRequest) returns (QueryConfigurationResponse); +} + +message CreateConfigurationRequest { + RequestHeader header = 1; + string id = 2; + string content = 3; +} + +message CreateConfigurationResponse { + Status status = 1; +} + +message QueryConfigurationRequest { + repeated string ids = 1; + string group_name = 2; +} + +message QueryConfigurationResponse { + Status status = 1; + map configurations = 2; +} + +message QueryConfigurationResult { + bool success=1; + string err_msg=2; + string content=3; +} diff --git a/proto/api/v1alpha1/confmanager/configuration_grpc.pb.go b/proto/api/v1alpha1/confmanager/configuration_grpc.pb.go new file mode 100644 index 000000000..41a2fed52 --- /dev/null +++ b/proto/api/v1alpha1/confmanager/configuration_grpc.pb.go @@ -0,0 +1,160 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v3.21.8 +// source: kuscia/proto/api/v1alpha1/confmanager/configuration.proto + +package confmanager + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ConfigurationService_CreateConfiguration_FullMethodName = "/kuscia.proto.api.v1alpha1.confmanager.ConfigurationService/CreateConfiguration" + ConfigurationService_QueryConfiguration_FullMethodName = "/kuscia.proto.api.v1alpha1.confmanager.ConfigurationService/QueryConfiguration" +) + +// ConfigurationServiceClient is the client API for ConfigurationService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ConfigurationServiceClient interface { + CreateConfiguration(ctx context.Context, in *CreateConfigurationRequest, opts ...grpc.CallOption) (*CreateConfigurationResponse, error) + QueryConfiguration(ctx context.Context, in *QueryConfigurationRequest, opts ...grpc.CallOption) (*QueryConfigurationResponse, error) +} + +type configurationServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewConfigurationServiceClient(cc grpc.ClientConnInterface) ConfigurationServiceClient { + return &configurationServiceClient{cc} +} + +func (c *configurationServiceClient) CreateConfiguration(ctx context.Context, in *CreateConfigurationRequest, opts ...grpc.CallOption) (*CreateConfigurationResponse, error) { + out := new(CreateConfigurationResponse) + err := c.cc.Invoke(ctx, ConfigurationService_CreateConfiguration_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *configurationServiceClient) QueryConfiguration(ctx context.Context, in *QueryConfigurationRequest, opts ...grpc.CallOption) (*QueryConfigurationResponse, error) { + out := new(QueryConfigurationResponse) + err := c.cc.Invoke(ctx, ConfigurationService_QueryConfiguration_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ConfigurationServiceServer is the server API for ConfigurationService service. +// All implementations must embed UnimplementedConfigurationServiceServer +// for forward compatibility +type ConfigurationServiceServer interface { + CreateConfiguration(context.Context, *CreateConfigurationRequest) (*CreateConfigurationResponse, error) + QueryConfiguration(context.Context, *QueryConfigurationRequest) (*QueryConfigurationResponse, error) + mustEmbedUnimplementedConfigurationServiceServer() +} + +// UnimplementedConfigurationServiceServer must be embedded to have forward compatible implementations. +type UnimplementedConfigurationServiceServer struct { +} + +func (UnimplementedConfigurationServiceServer) CreateConfiguration(context.Context, *CreateConfigurationRequest) (*CreateConfigurationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateConfiguration not implemented") +} +func (UnimplementedConfigurationServiceServer) QueryConfiguration(context.Context, *QueryConfigurationRequest) (*QueryConfigurationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryConfiguration not implemented") +} +func (UnimplementedConfigurationServiceServer) mustEmbedUnimplementedConfigurationServiceServer() {} + +// UnsafeConfigurationServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ConfigurationServiceServer will +// result in compilation errors. +type UnsafeConfigurationServiceServer interface { + mustEmbedUnimplementedConfigurationServiceServer() +} + +func RegisterConfigurationServiceServer(s grpc.ServiceRegistrar, srv ConfigurationServiceServer) { + s.RegisterService(&ConfigurationService_ServiceDesc, srv) +} + +func _ConfigurationService_CreateConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateConfigurationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConfigurationServiceServer).CreateConfiguration(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ConfigurationService_CreateConfiguration_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConfigurationServiceServer).CreateConfiguration(ctx, req.(*CreateConfigurationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ConfigurationService_QueryConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryConfigurationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConfigurationServiceServer).QueryConfiguration(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ConfigurationService_QueryConfiguration_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConfigurationServiceServer).QueryConfiguration(ctx, req.(*QueryConfigurationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ConfigurationService_ServiceDesc is the grpc.ServiceDesc for ConfigurationService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ConfigurationService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "kuscia.proto.api.v1alpha1.confmanager.ConfigurationService", + HandlerType: (*ConfigurationServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateConfiguration", + Handler: _ConfigurationService_CreateConfiguration_Handler, + }, + { + MethodName: "QueryConfiguration", + Handler: _ConfigurationService_QueryConfiguration_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "kuscia/proto/api/v1alpha1/confmanager/configuration.proto", +} diff --git a/proto/api/v1alpha1/datamesh/domaindata.pb.go b/proto/api/v1alpha1/datamesh/domaindata.pb.go index 06fb492dc..587f3331c 100644 --- a/proto/api/v1alpha1/datamesh/domaindata.pb.go +++ b/proto/api/v1alpha1/datamesh/domaindata.pb.go @@ -700,6 +700,8 @@ type DomainData struct { // The vendor is the one who outputs the domain data, it may be the SecretFlow engine, // another vendor's engine, or manually registered. it's could be manual, secretflow or other vendor string. Vendor string `protobuf:"bytes,9,opt,name=vendor,proto3" json:"vendor,omitempty"` + // if the data is stored with file format, file_format describe file format + FileFormat v1alpha1.FileFormat `protobuf:"varint,10,opt,name=file_format,json=fileFormat,proto3,enum=kuscia.proto.api.v1alpha1.FileFormat" json:"file_format,omitempty"` } func (x *DomainData) Reset() { @@ -797,6 +799,13 @@ func (x *DomainData) GetVendor() string { return "" } +func (x *DomainData) GetFileFormat() v1alpha1.FileFormat { + if x != nil { + return x.FileFormat + } + return v1alpha1.FileFormat(0) +} + var File_kuscia_proto_api_v1alpha1_datamesh_domaindata_proto protoreflect.FileDescriptor var file_kuscia_proto_api_v1alpha1_datamesh_domaindata_proto_rawDesc = []byte{ @@ -931,7 +940,7 @@ var file_kuscia_proto_api_v1alpha1_datamesh_domaindata_proto_rawDesc = []byte{ 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, - 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xdd, 0x03, 0x0a, 0x0a, 0x44, 0x6f, + 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xa5, 0x04, 0x0a, 0x0a, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x49, 0x64, 0x12, 0x12, 0x0a, @@ -957,55 +966,59 @@ var file_kuscia_proto_api_v1alpha1_datamesh_domaindata_proto_rawDesc = []byte{ 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0xd0, 0x04, 0x0a, 0x11, 0x44, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x8d, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x44, 0x61, 0x74, 0x61, 0x12, 0x3b, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x3c, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, - 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, - 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x8a, 0x01, 0x0a, 0x0f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, - 0x61, 0x74, 0x61, 0x12, 0x3a, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x3b, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, - 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8d, 0x01, 0x0a, - 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, - 0x61, 0x12, 0x3b, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, - 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, - 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, - 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, - 0x65, 0x73, 0x68, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8d, 0x01, 0x0a, - 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, - 0x61, 0x12, 0x3b, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, - 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, 0x6d, - 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, - 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, - 0x65, 0x73, 0x68, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x5c, 0x0a, 0x20, - 0x6f, 0x72, 0x67, 0x2e, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, + 0x28, 0x09, 0x52, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x12, 0x46, 0x0a, 0x0b, 0x66, 0x69, + 0x6c, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x25, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, + 0x61, 0x74, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x32, 0xd0, 0x04, 0x0a, 0x11, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8d, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x3b, 0x2e, 0x6b, + 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, + 0x68, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, + 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x6b, 0x75, 0x73, 0x63, + 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8a, 0x01, 0x0a, 0x0f, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x3a, 0x2e, 0x6b, 0x75, + 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, - 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x63, - 0x72, 0x65, 0x74, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8d, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x3b, 0x2e, 0x6b, 0x75, 0x73, 0x63, + 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8d, 0x01, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x3b, 0x2e, 0x6b, 0x75, 0x73, 0x63, + 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x5c, 0x0a, 0x20, 0x6f, 0x72, 0x67, 0x2e, 0x73, 0x65, 0x63, 0x72, + 0x65, 0x74, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x66, 0x6c, 0x6f, 0x77, 0x2f, + 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, + 0x73, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1039,6 +1052,7 @@ var file_kuscia_proto_api_v1alpha1_datamesh_domaindata_proto_goTypes = []interfa (*v1alpha1.Partition)(nil), // 14: kuscia.proto.api.v1alpha1.Partition (*v1alpha1.DataColumn)(nil), // 15: kuscia.proto.api.v1alpha1.DataColumn (*v1alpha1.Status)(nil), // 16: kuscia.proto.api.v1alpha1.Status + (v1alpha1.FileFormat)(0), // 17: kuscia.proto.api.v1alpha1.FileFormat } var file_kuscia_proto_api_v1alpha1_datamesh_domaindata_proto_depIdxs = []int32{ 13, // 0: kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataRequest.header:type_name -> kuscia.proto.api.v1alpha1.RequestHeader @@ -1060,19 +1074,20 @@ var file_kuscia_proto_api_v1alpha1_datamesh_domaindata_proto_depIdxs = []int32{ 12, // 16: kuscia.proto.api.v1alpha1.datamesh.DomainData.attributes:type_name -> kuscia.proto.api.v1alpha1.datamesh.DomainData.AttributesEntry 14, // 17: kuscia.proto.api.v1alpha1.datamesh.DomainData.partition:type_name -> kuscia.proto.api.v1alpha1.Partition 15, // 18: kuscia.proto.api.v1alpha1.datamesh.DomainData.columns:type_name -> kuscia.proto.api.v1alpha1.DataColumn - 0, // 19: kuscia.proto.api.v1alpha1.datamesh.DomainDataService.CreateDomainData:input_type -> kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataRequest - 7, // 20: kuscia.proto.api.v1alpha1.datamesh.DomainDataService.QueryDomainData:input_type -> kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataRequest - 3, // 21: kuscia.proto.api.v1alpha1.datamesh.DomainDataService.UpdateDomainData:input_type -> kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataRequest - 5, // 22: kuscia.proto.api.v1alpha1.datamesh.DomainDataService.DeleteDomainData:input_type -> kuscia.proto.api.v1alpha1.datamesh.DeleteDomainDataRequest - 1, // 23: kuscia.proto.api.v1alpha1.datamesh.DomainDataService.CreateDomainData:output_type -> kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataResponse - 8, // 24: kuscia.proto.api.v1alpha1.datamesh.DomainDataService.QueryDomainData:output_type -> kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataResponse - 4, // 25: kuscia.proto.api.v1alpha1.datamesh.DomainDataService.UpdateDomainData:output_type -> kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataResponse - 6, // 26: kuscia.proto.api.v1alpha1.datamesh.DomainDataService.DeleteDomainData:output_type -> kuscia.proto.api.v1alpha1.datamesh.DeleteDomainDataResponse - 23, // [23:27] is the sub-list for method output_type - 19, // [19:23] is the sub-list for method input_type - 19, // [19:19] is the sub-list for extension type_name - 19, // [19:19] is the sub-list for extension extendee - 0, // [0:19] is the sub-list for field type_name + 17, // 19: kuscia.proto.api.v1alpha1.datamesh.DomainData.file_format:type_name -> kuscia.proto.api.v1alpha1.FileFormat + 0, // 20: kuscia.proto.api.v1alpha1.datamesh.DomainDataService.CreateDomainData:input_type -> kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataRequest + 7, // 21: kuscia.proto.api.v1alpha1.datamesh.DomainDataService.QueryDomainData:input_type -> kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataRequest + 3, // 22: kuscia.proto.api.v1alpha1.datamesh.DomainDataService.UpdateDomainData:input_type -> kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataRequest + 5, // 23: kuscia.proto.api.v1alpha1.datamesh.DomainDataService.DeleteDomainData:input_type -> kuscia.proto.api.v1alpha1.datamesh.DeleteDomainDataRequest + 1, // 24: kuscia.proto.api.v1alpha1.datamesh.DomainDataService.CreateDomainData:output_type -> kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataResponse + 8, // 25: kuscia.proto.api.v1alpha1.datamesh.DomainDataService.QueryDomainData:output_type -> kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataResponse + 4, // 26: kuscia.proto.api.v1alpha1.datamesh.DomainDataService.UpdateDomainData:output_type -> kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataResponse + 6, // 27: kuscia.proto.api.v1alpha1.datamesh.DomainDataService.DeleteDomainData:output_type -> kuscia.proto.api.v1alpha1.datamesh.DeleteDomainDataResponse + 24, // [24:28] is the sub-list for method output_type + 20, // [20:24] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_kuscia_proto_api_v1alpha1_datamesh_domaindata_proto_init() } diff --git a/proto/api/v1alpha1/datamesh/domaindata.proto b/proto/api/v1alpha1/datamesh/domaindata.proto index 481d8c0a6..e2abbf0d5 100644 --- a/proto/api/v1alpha1/datamesh/domaindata.proto +++ b/proto/api/v1alpha1/datamesh/domaindata.proto @@ -148,4 +148,7 @@ message DomainData { // The vendor is the one who outputs the domain data, it may be the SecretFlow engine, // another vendor's engine, or manually registered. it's could be manual, secretflow or other vendor string. string vendor = 9; + + // if the data is stored with file format, file_format describe file format + FileFormat file_format = 10; } \ No newline at end of file diff --git a/proto/api/v1alpha1/datamesh/domaindatasource.pb.go b/proto/api/v1alpha1/datamesh/domaindatasource.pb.go index 4973abf3a..ce8e68240 100644 --- a/proto/api/v1alpha1/datamesh/domaindatasource.pb.go +++ b/proto/api/v1alpha1/datamesh/domaindatasource.pb.go @@ -40,11 +40,13 @@ type CreateDomainDataSourceRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Header *v1alpha1.RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - DatasourceId string `protobuf:"bytes,2,opt,name=datasource_id,json=datasourceId,proto3" json:"datasource_id,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` - Info *DataSourceInfo `protobuf:"bytes,5,opt,name=info,proto3" json:"info,omitempty"` + Header *v1alpha1.RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + DatasourceId string `protobuf:"bytes,2,opt,name=datasource_id,json=datasourceId,proto3" json:"datasource_id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` + Info *DataSourceInfo `protobuf:"bytes,5,opt,name=info,proto3" json:"info,omitempty"` + InfoKey string `protobuf:"bytes,6,opt,name=info_key,json=infoKey,proto3" json:"info_key,omitempty"` + AccessDirectly bool `protobuf:"varint,7,opt,name=access_directly,json=accessDirectly,proto3" json:"access_directly,omitempty"` } func (x *CreateDomainDataSourceRequest) Reset() { @@ -114,6 +116,20 @@ func (x *CreateDomainDataSourceRequest) GetInfo() *DataSourceInfo { return nil } +func (x *CreateDomainDataSourceRequest) GetInfoKey() string { + if x != nil { + return x.InfoKey + } + return "" +} + +func (x *CreateDomainDataSourceRequest) GetAccessDirectly() bool { + if x != nil { + return x.AccessDirectly + } + return false +} + type CreateDomainDataSourceResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -222,11 +238,13 @@ type UpdateDomainDataSourceRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Header *v1alpha1.RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - DatasourceId string `protobuf:"bytes,2,opt,name=datasource_id,json=datasourceId,proto3" json:"datasource_id,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` - Info *DataSourceInfo `protobuf:"bytes,5,opt,name=info,proto3" json:"info,omitempty"` + Header *v1alpha1.RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + DatasourceId string `protobuf:"bytes,2,opt,name=datasource_id,json=datasourceId,proto3" json:"datasource_id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` + Info *DataSourceInfo `protobuf:"bytes,5,opt,name=info,proto3" json:"info,omitempty"` + InfoKey string `protobuf:"bytes,6,opt,name=info_key,json=infoKey,proto3" json:"info_key,omitempty"` + AccessDirectly bool `protobuf:"varint,7,opt,name=access_directly,json=accessDirectly,proto3" json:"access_directly,omitempty"` } func (x *UpdateDomainDataSourceRequest) Reset() { @@ -296,6 +314,20 @@ func (x *UpdateDomainDataSourceRequest) GetInfo() *DataSourceInfo { return nil } +func (x *UpdateDomainDataSourceRequest) GetInfoKey() string { + if x != nil { + return x.InfoKey + } + return "" +} + +func (x *UpdateDomainDataSourceRequest) GetAccessDirectly() bool { + if x != nil { + return x.AccessDirectly + } + return false +} + type UpdateDomainDataSourceResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -565,12 +597,20 @@ type DomainDataSource struct { DatasourceId string `protobuf:"bytes,1,opt,name=datasource_id,json=datasourceId,proto3" json:"datasource_id,omitempty"` // datasource name Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // datasource type, enum [localfs, oss] , oss not support now + // datasource type, enum [localfs, oss, mysql] Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` // datasource status, enum [Available,Unavailable] Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` - // datasource info + // datasource info, for domain secretBackend which support set interface in clientSDK, you can set info directly when + // create or update domainDataSource, you can also set an info_key already existed in secretBackend instead. + // if you set info and info_key simultaneously, only info_key will take effect. Info *DataSourceInfo `protobuf:"bytes,5,opt,name=info,proto3" json:"info,omitempty"` + // datasource info key, for domain secretBackend which nonsupport set interface in clientSDK, use an secret key + // instead of info when create or update DomainDataSource, the value refers to info_key is a json format string of + // DataSourceInfo varies by datasource type + InfoKey string `protobuf:"bytes,6,opt,name=info_key,json=infoKey,proto3" json:"info_key,omitempty"` + // access directly to datasource or proxy_pass to DataProxy, default is false + AccessDirectly bool `protobuf:"varint,7,opt,name=access_directly,json=accessDirectly,proto3" json:"access_directly,omitempty"` } func (x *DomainDataSource) Reset() { @@ -640,6 +680,20 @@ func (x *DomainDataSource) GetInfo() *DataSourceInfo { return nil } +func (x *DomainDataSource) GetInfoKey() string { + if x != nil { + return x.InfoKey + } + return "" +} + +func (x *DomainDataSource) GetAccessDirectly() bool { + if x != nil { + return x.AccessDirectly + } + return false +} + type DataSourceInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -651,6 +705,8 @@ type DataSourceInfo struct { Localfs *LocalDataSourceInfo `protobuf:"bytes,1,opt,name=localfs,proto3" json:"localfs,omitempty"` // oss not support now Oss *OssDataSourceInfo `protobuf:"bytes,2,opt,name=oss,proto3" json:"oss,omitempty"` + // Relational database info, such as Mysql/oracle/postgres + Database *DatabaseDataSourceInfo `protobuf:"bytes,3,opt,name=database,proto3" json:"database,omitempty"` } func (x *DataSourceInfo) Reset() { @@ -699,6 +755,13 @@ func (x *DataSourceInfo) GetOss() *OssDataSourceInfo { return nil } +func (x *DataSourceInfo) GetDatabase() *DatabaseDataSourceInfo { + if x != nil { + return x.Database + } + return nil +} + // datasource info for local path type LocalDataSourceInfo struct { state protoimpl.MessageState @@ -861,6 +924,73 @@ func (x *OssDataSourceInfo) GetStorageType() string { return "" } +// datasource info for mysql/oracle/postgres +type DatabaseDataSourceInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // endpoint for database, such as localhost:3306 + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + // user name of account to access database + User string `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` + // password of account to access database + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` +} + +func (x *DatabaseDataSourceInfo) Reset() { + *x = DatabaseDataSourceInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DatabaseDataSourceInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DatabaseDataSourceInfo) ProtoMessage() {} + +func (x *DatabaseDataSourceInfo) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DatabaseDataSourceInfo.ProtoReflect.Descriptor instead. +func (*DatabaseDataSourceInfo) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_rawDescGZIP(), []int{13} +} + +func (x *DatabaseDataSourceInfo) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *DatabaseDataSourceInfo) GetUser() string { + if x != nil { + return x.User + } + return "" +} + +func (x *DatabaseDataSourceInfo) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + var File_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto protoreflect.FileDescriptor var file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_rawDesc = []byte{ @@ -872,7 +1002,7 @@ var file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_rawDesc = []b 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x1a, 0x26, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf6, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xba, 0x02, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x75, 0x73, 0x63, @@ -888,169 +1018,193 @@ var file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_rawDesc = []b 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, - 0x22, 0xb7, 0x01, 0x0a, 0x1e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x5a, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x46, 0x2e, 0x6b, - 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, - 0x68, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, - 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x49, 0x0a, 0x22, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x49, 0x64, 0x22, 0xf6, 0x01, 0x0a, 0x1d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, + 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x69, 0x6e, 0x66, 0x6f, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x44, 0x69, 0x72, 0x65, + 0x63, 0x74, 0x6c, 0x79, 0x22, 0xb7, 0x01, 0x0a, 0x1e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x74, - 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 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, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x46, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x5b, - 0x0a, 0x1e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x5a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x46, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, + 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, + 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x49, + 0x0a, 0x22, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x39, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x86, 0x01, 0x0a, 0x1d, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, - 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, - 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, - 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, - 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x49, 0x64, 0x22, 0x5b, 0x0a, 0x1e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x22, 0x85, 0x01, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x40, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x61, 0x74, - 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x22, 0xa4, 0x01, 0x0a, 0x1d, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6b, 0x75, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x61, 0x74, + 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x22, 0xba, 0x02, 0x0a, 0x1d, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x06, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x48, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x22, 0xbf, 0x01, 0x0a, 0x10, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x61, - 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 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, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x46, 0x0a, 0x04, 0x69, 0x6e, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x23, 0x0a, + 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 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, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x46, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, - 0x66, 0x6f, 0x22, 0xac, 0x01, 0x0a, 0x0e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x51, 0x0a, 0x07, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x66, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x4c, 0x6f, 0x63, 0x61, - 0x6c, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x07, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x66, 0x73, 0x12, 0x47, 0x0a, 0x03, 0x6f, 0x73, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x4f, 0x73, 0x73, 0x44, 0x61, - 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x03, 0x6f, 0x73, - 0x73, 0x22, 0x29, 0x0a, 0x13, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x8e, 0x02, 0x0a, - 0x11, 0x4f, 0x73, 0x73, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x22, - 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, - 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, - 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x20, - 0x0a, 0x0b, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0b, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, - 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x32, 0x9e, 0x05, - 0x0a, 0x17, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x9f, 0x01, 0x0a, 0x16, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0x41, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x69, 0x6e, 0x66, 0x6f, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, + 0x0f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x44, 0x69, + 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x22, 0x5b, 0x0a, 0x1e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x9c, 0x01, 0x0a, 0x15, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x40, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x9f, 0x01, 0x0a, 0x16, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x41, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x9f, 0x01, 0x0a, - 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, - 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x41, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x6b, 0x75, 0x73, - 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x22, 0x86, 0x01, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, + 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, + 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x22, 0x5b, 0x0a, 0x1e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, - 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x5c, - 0x0a, 0x20, 0x6f, 0x72, 0x67, 0x2e, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x66, 0x6c, 0x6f, 0x77, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, - 0x73, 0x68, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, - 0x65, 0x63, 0x72, 0x65, 0x74, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x1c, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x06, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x75, 0x73, + 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, + 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, + 0x64, 0x22, 0xa4, 0x01, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x48, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x6b, + 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, + 0x68, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x83, 0x02, 0x0a, 0x10, 0x44, 0x6f, 0x6d, + 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x23, 0x0a, + 0x0d, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 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, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x46, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x32, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, + 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, + 0x66, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x69, 0x6e, + 0x66, 0x6f, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, + 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x22, 0x84, + 0x02, 0x0a, 0x0e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x51, 0x0a, 0x07, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x66, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x44, 0x61, 0x74, + 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x6c, 0x6f, 0x63, + 0x61, 0x6c, 0x66, 0x73, 0x12, 0x47, 0x0a, 0x03, 0x6f, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x35, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x4f, 0x73, 0x73, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x03, 0x6f, 0x73, 0x73, 0x12, 0x56, 0x0a, + 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x3a, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, + 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x44, 0x61, 0x74, + 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x64, 0x61, 0x74, + 0x61, 0x62, 0x61, 0x73, 0x65, 0x22, 0x29, 0x0a, 0x13, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x44, 0x61, + 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x22, 0x8e, 0x02, 0x0a, 0x11, 0x4f, 0x73, 0x73, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, + 0x65, 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, + 0x69, 0x78, 0x12, 0x22, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, + 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x53, 0x65, 0x63, 0x72, + 0x65, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x68, 0x6f, 0x73, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, + 0x68, 0x6f, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, + 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x22, 0x64, 0x0a, 0x16, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x44, 0x61, 0x74, + 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x32, 0x9e, 0x05, 0x0a, 0x17, 0x44, 0x6f, 0x6d, 0x61, + 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x9f, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, + 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x41, + 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, + 0x65, 0x73, 0x68, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x42, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, + 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x9c, 0x01, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x40, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, + 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x41, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, + 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x9f, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x41, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, + 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, + 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x9f, 0x01, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x12, 0x41, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, 0x6d, + 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x5c, 0x0a, 0x20, 0x6f, 0x72, 0x67, 0x2e, + 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x5a, 0x38, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x66, + 0x6c, 0x6f, 0x77, 0x2f, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x64, 0x61, + 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1065,7 +1219,7 @@ func file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_rawDescGZIP( return file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_rawDescData } -var file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_goTypes = []interface{}{ (*CreateDomainDataSourceRequest)(nil), // 0: kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceRequest (*CreateDomainDataSourceResponse)(nil), // 1: kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceResponse @@ -1080,38 +1234,40 @@ var file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_goTypes = []i (*DataSourceInfo)(nil), // 10: kuscia.proto.api.v1alpha1.datamesh.DataSourceInfo (*LocalDataSourceInfo)(nil), // 11: kuscia.proto.api.v1alpha1.datamesh.LocalDataSourceInfo (*OssDataSourceInfo)(nil), // 12: kuscia.proto.api.v1alpha1.datamesh.OssDataSourceInfo - (*v1alpha1.RequestHeader)(nil), // 13: kuscia.proto.api.v1alpha1.RequestHeader - (*v1alpha1.Status)(nil), // 14: kuscia.proto.api.v1alpha1.Status + (*DatabaseDataSourceInfo)(nil), // 13: kuscia.proto.api.v1alpha1.datamesh.DatabaseDataSourceInfo + (*v1alpha1.RequestHeader)(nil), // 14: kuscia.proto.api.v1alpha1.RequestHeader + (*v1alpha1.Status)(nil), // 15: kuscia.proto.api.v1alpha1.Status } var file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_depIdxs = []int32{ - 13, // 0: kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceRequest.header:type_name -> kuscia.proto.api.v1alpha1.RequestHeader + 14, // 0: kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceRequest.header:type_name -> kuscia.proto.api.v1alpha1.RequestHeader 10, // 1: kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceRequest.info:type_name -> kuscia.proto.api.v1alpha1.datamesh.DataSourceInfo - 14, // 2: kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceResponse.status:type_name -> kuscia.proto.api.v1alpha1.Status + 15, // 2: kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceResponse.status:type_name -> kuscia.proto.api.v1alpha1.Status 2, // 3: kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceResponse.data:type_name -> kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceResponseData - 13, // 4: kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataSourceRequest.header:type_name -> kuscia.proto.api.v1alpha1.RequestHeader + 14, // 4: kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataSourceRequest.header:type_name -> kuscia.proto.api.v1alpha1.RequestHeader 10, // 5: kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataSourceRequest.info:type_name -> kuscia.proto.api.v1alpha1.datamesh.DataSourceInfo - 14, // 6: kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataSourceResponse.status:type_name -> kuscia.proto.api.v1alpha1.Status - 13, // 7: kuscia.proto.api.v1alpha1.datamesh.DeleteDomainDataSourceRequest.header:type_name -> kuscia.proto.api.v1alpha1.RequestHeader - 14, // 8: kuscia.proto.api.v1alpha1.datamesh.DeleteDomainDataSourceResponse.status:type_name -> kuscia.proto.api.v1alpha1.Status - 13, // 9: kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataSourceRequest.header:type_name -> kuscia.proto.api.v1alpha1.RequestHeader - 14, // 10: kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataSourceResponse.status:type_name -> kuscia.proto.api.v1alpha1.Status + 15, // 6: kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataSourceResponse.status:type_name -> kuscia.proto.api.v1alpha1.Status + 14, // 7: kuscia.proto.api.v1alpha1.datamesh.DeleteDomainDataSourceRequest.header:type_name -> kuscia.proto.api.v1alpha1.RequestHeader + 15, // 8: kuscia.proto.api.v1alpha1.datamesh.DeleteDomainDataSourceResponse.status:type_name -> kuscia.proto.api.v1alpha1.Status + 14, // 9: kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataSourceRequest.header:type_name -> kuscia.proto.api.v1alpha1.RequestHeader + 15, // 10: kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataSourceResponse.status:type_name -> kuscia.proto.api.v1alpha1.Status 9, // 11: kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataSourceResponse.data:type_name -> kuscia.proto.api.v1alpha1.datamesh.DomainDataSource 10, // 12: kuscia.proto.api.v1alpha1.datamesh.DomainDataSource.info:type_name -> kuscia.proto.api.v1alpha1.datamesh.DataSourceInfo 11, // 13: kuscia.proto.api.v1alpha1.datamesh.DataSourceInfo.localfs:type_name -> kuscia.proto.api.v1alpha1.datamesh.LocalDataSourceInfo 12, // 14: kuscia.proto.api.v1alpha1.datamesh.DataSourceInfo.oss:type_name -> kuscia.proto.api.v1alpha1.datamesh.OssDataSourceInfo - 0, // 15: kuscia.proto.api.v1alpha1.datamesh.DomainDataSourceService.CreateDomainDataSource:input_type -> kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceRequest - 7, // 16: kuscia.proto.api.v1alpha1.datamesh.DomainDataSourceService.QueryDomainDataSource:input_type -> kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataSourceRequest - 3, // 17: kuscia.proto.api.v1alpha1.datamesh.DomainDataSourceService.UpdateDomainDataSource:input_type -> kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataSourceRequest - 5, // 18: kuscia.proto.api.v1alpha1.datamesh.DomainDataSourceService.DeleteDomainDataSource:input_type -> kuscia.proto.api.v1alpha1.datamesh.DeleteDomainDataSourceRequest - 1, // 19: kuscia.proto.api.v1alpha1.datamesh.DomainDataSourceService.CreateDomainDataSource:output_type -> kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceResponse - 8, // 20: kuscia.proto.api.v1alpha1.datamesh.DomainDataSourceService.QueryDomainDataSource:output_type -> kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataSourceResponse - 4, // 21: kuscia.proto.api.v1alpha1.datamesh.DomainDataSourceService.UpdateDomainDataSource:output_type -> kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataSourceResponse - 6, // 22: kuscia.proto.api.v1alpha1.datamesh.DomainDataSourceService.DeleteDomainDataSource:output_type -> kuscia.proto.api.v1alpha1.datamesh.DeleteDomainDataSourceResponse - 19, // [19:23] is the sub-list for method output_type - 15, // [15:19] is the sub-list for method input_type - 15, // [15:15] is the sub-list for extension type_name - 15, // [15:15] is the sub-list for extension extendee - 0, // [0:15] is the sub-list for field type_name + 13, // 15: kuscia.proto.api.v1alpha1.datamesh.DataSourceInfo.database:type_name -> kuscia.proto.api.v1alpha1.datamesh.DatabaseDataSourceInfo + 0, // 16: kuscia.proto.api.v1alpha1.datamesh.DomainDataSourceService.CreateDomainDataSource:input_type -> kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceRequest + 7, // 17: kuscia.proto.api.v1alpha1.datamesh.DomainDataSourceService.QueryDomainDataSource:input_type -> kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataSourceRequest + 3, // 18: kuscia.proto.api.v1alpha1.datamesh.DomainDataSourceService.UpdateDomainDataSource:input_type -> kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataSourceRequest + 5, // 19: kuscia.proto.api.v1alpha1.datamesh.DomainDataSourceService.DeleteDomainDataSource:input_type -> kuscia.proto.api.v1alpha1.datamesh.DeleteDomainDataSourceRequest + 1, // 20: kuscia.proto.api.v1alpha1.datamesh.DomainDataSourceService.CreateDomainDataSource:output_type -> kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceResponse + 8, // 21: kuscia.proto.api.v1alpha1.datamesh.DomainDataSourceService.QueryDomainDataSource:output_type -> kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataSourceResponse + 4, // 22: kuscia.proto.api.v1alpha1.datamesh.DomainDataSourceService.UpdateDomainDataSource:output_type -> kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataSourceResponse + 6, // 23: kuscia.proto.api.v1alpha1.datamesh.DomainDataSourceService.DeleteDomainDataSource:output_type -> kuscia.proto.api.v1alpha1.datamesh.DeleteDomainDataSourceResponse + 20, // [20:24] is the sub-list for method output_type + 16, // [16:20] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_init() } @@ -1276,6 +1432,18 @@ func file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_init() { return nil } } + file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DatabaseDataSourceInfo); 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{ @@ -1283,7 +1451,7 @@ func file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_rawDesc, NumEnums: 0, - NumMessages: 13, + NumMessages: 14, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/api/v1alpha1/datamesh/domaindatasource.proto b/proto/api/v1alpha1/datamesh/domaindatasource.proto index 5eaa1b5a8..976761ce2 100644 --- a/proto/api/v1alpha1/datamesh/domaindatasource.proto +++ b/proto/api/v1alpha1/datamesh/domaindatasource.proto @@ -37,6 +37,8 @@ message CreateDomainDataSourceRequest { string name = 3; string type = 4; DataSourceInfo info = 5; + string info_key = 6; + bool access_directly = 7; } message CreateDomainDataSourceResponse { @@ -55,6 +57,8 @@ message UpdateDomainDataSourceRequest { string name = 3; string type = 4; DataSourceInfo info = 5; + string info_key = 6; + bool access_directly = 7; } message UpdateDomainDataSourceResponse { @@ -86,12 +90,23 @@ message DomainDataSource { string datasource_id = 1; // datasource name string name = 2; - // datasource type, enum [localfs, oss] , oss not support now + // datasource type, enum [localfs, oss, mysql] string type = 3; // datasource status, enum [Available,Unavailable] string status = 4; - // datasource info + + // datasource info, for domain secretBackend which support set interface in clientSDK, you can set info directly when + // create or update domainDataSource, you can also set an info_key already existed in secretBackend instead. + // if you set info and info_key simultaneously, only info_key will take effect. DataSourceInfo info = 5; + + // datasource info key, for domain secretBackend which nonsupport set interface in clientSDK, use an secret key + // instead of info when create or update DomainDataSource, the value refers to info_key is a json format string of + // DataSourceInfo varies by datasource type + string info_key = 6; + + // access directly to datasource or proxy_pass to DataProxy, default is false + bool access_directly = 7; } message DataSourceInfo { @@ -101,6 +116,9 @@ message DataSourceInfo { LocalDataSourceInfo localfs = 1; // oss not support now OssDataSourceInfo oss = 2; + + // Relational database info, such as Mysql/oracle/postgres + DatabaseDataSourceInfo database = 3; } // datasource info for local path @@ -128,4 +146,14 @@ message OssDataSourceInfo { string version = 7; // optional enum[oss,minio] , default oss string storage_type = 8; -} \ No newline at end of file +} + +// datasource info for mysql/oracle/postgres +message DatabaseDataSourceInfo { + // endpoint for database, such as localhost:3306 + string endpoint = 1; + // user name of account to access database + string user = 2; + // password of account to access database + string password = 3; +} diff --git a/proto/api/v1alpha1/datamesh/flightdm.pb.go b/proto/api/v1alpha1/datamesh/flightdm.pb.go new file mode 100644 index 000000000..f9b6c50d8 --- /dev/null +++ b/proto/api/v1alpha1/datamesh/flightdm.pb.go @@ -0,0 +1,1611 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: kuscia/proto/api/v1alpha1/datamesh/flightdm.proto + +package datamesh + +import ( + 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) +) + +type ContentFormat_Type int32 + +const ( + ContentFormat_Table ContentFormat_Type = 0 + // read raw data from datasource + ContentFormat_RAW ContentFormat_Type = 1 + // convert data to csv file format, and return file content as dummy schema + ContentFormat_CSV ContentFormat_Type = 2 +) + +// Enum value maps for ContentFormat_Type. +var ( + ContentFormat_Type_name = map[int32]string{ + 0: "Table", + 1: "RAW", + 2: "CSV", + } + ContentFormat_Type_value = map[string]int32{ + "Table": 0, + "RAW": 1, + "CSV": 2, + } +) + +func (x ContentFormat_Type) Enum() *ContentFormat_Type { + p := new(ContentFormat_Type) + *p = x + return p +} + +func (x ContentFormat_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ContentFormat_Type) Descriptor() protoreflect.EnumDescriptor { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_enumTypes[0].Descriptor() +} + +func (ContentFormat_Type) Type() protoreflect.EnumType { + return &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_enumTypes[0] +} + +func (x ContentFormat_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ContentFormat_Type.Descriptor instead. +func (ContentFormat_Type) EnumDescriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{2, 0} +} + +// write options of csv file +type CSVWriteOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // field delimiter of csv file, default is comma + FieldDelimiter string `protobuf:"bytes,1,opt,name=field_delimiter,json=fieldDelimiter,proto3" json:"field_delimiter,omitempty"` +} + +func (x *CSVWriteOptions) Reset() { + *x = CSVWriteOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CSVWriteOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CSVWriteOptions) ProtoMessage() {} + +func (x *CSVWriteOptions) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_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 CSVWriteOptions.ProtoReflect.Descriptor instead. +func (*CSVWriteOptions) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{0} +} + +func (x *CSVWriteOptions) GetFieldDelimiter() string { + if x != nil { + return x.FieldDelimiter + } + return "" +} + +// write options varies by file format +type FileWriteOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Options: + // + // *FileWriteOptions_CsvOptions + Options isFileWriteOptions_Options `protobuf_oneof:"Options"` +} + +func (x *FileWriteOptions) Reset() { + *x = FileWriteOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FileWriteOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FileWriteOptions) ProtoMessage() {} + +func (x *FileWriteOptions) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_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 FileWriteOptions.ProtoReflect.Descriptor instead. +func (*FileWriteOptions) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{1} +} + +func (m *FileWriteOptions) GetOptions() isFileWriteOptions_Options { + if m != nil { + return m.Options + } + return nil +} + +func (x *FileWriteOptions) GetCsvOptions() *CSVWriteOptions { + if x, ok := x.GetOptions().(*FileWriteOptions_CsvOptions); ok { + return x.CsvOptions + } + return nil +} + +type isFileWriteOptions_Options interface { + isFileWriteOptions_Options() +} + +type FileWriteOptions_CsvOptions struct { + CsvOptions *CSVWriteOptions `protobuf:"bytes,1,opt,name=csv_options,json=csvOptions,proto3,oneof"` +} + +func (*FileWriteOptions_CsvOptions) isFileWriteOptions_Options() {} + +// ContentFormat describe the schema of ArrowRecordBatch response from DataProxy +// Only for Table Type, the schema is defined by DomainData's columns +// And for rest types, the schema is a dummy schema which only contains one column of arrow::Binary type +type ContentFormat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type ContentFormat_Type `protobuf:"varint,1,opt,name=type,proto3,enum=kuscia.proto.api.v1alpha1.datamesh.ContentFormat_Type" json:"type,omitempty"` + FileWriteOptions *FileWriteOptions `protobuf:"bytes,2,opt,name=file_write_options,json=fileWriteOptions,proto3" json:"file_write_options,omitempty"` +} + +func (x *ContentFormat) Reset() { + *x = ContentFormat{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContentFormat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContentFormat) ProtoMessage() {} + +func (x *ContentFormat) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_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 ContentFormat.ProtoReflect.Descriptor instead. +func (*ContentFormat) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{2} +} + +func (x *ContentFormat) GetType() ContentFormat_Type { + if x != nil { + return x.Type + } + return ContentFormat_Table +} + +func (x *ContentFormat) GetFileWriteOptions() *FileWriteOptions { + if x != nil { + return x.FileWriteOptions + } + return nil +} + +// call with GetSchema, return SchemaResult, extension attributes are set with metadata +type CommandGetDomainDataSchema struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DomaindataId string `protobuf:"bytes,1,opt,name=domaindata_id,json=domaindataId,proto3" json:"domaindata_id,omitempty"` +} + +func (x *CommandGetDomainDataSchema) Reset() { + *x = CommandGetDomainDataSchema{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommandGetDomainDataSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommandGetDomainDataSchema) ProtoMessage() {} + +func (x *CommandGetDomainDataSchema) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_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 CommandGetDomainDataSchema.ProtoReflect.Descriptor instead. +func (*CommandGetDomainDataSchema) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{3} +} + +func (x *CommandGetDomainDataSchema) GetDomaindataId() string { + if x != nil { + return x.DomaindataId + } + return "" +} + +// call GetFlightInfo with CommandDomainDataQuery, return TicketDomainDataQuery +// and then call DoGet with TicketDomainDataQuery +type CommandDomainDataQuery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DomaindataId string `protobuf:"bytes,1,opt,name=domaindata_id,json=domaindataId,proto3" json:"domaindata_id,omitempty"` + // column name of DomainData's columns + Columns []string `protobuf:"bytes,2,rep,name=columns,proto3" json:"columns,omitempty"` + // expected result format + ResultFormat *ContentFormat `protobuf:"bytes,3,opt,name=result_format,json=resultFormat,proto3" json:"result_format,omitempty"` +} + +func (x *CommandDomainDataQuery) Reset() { + *x = CommandDomainDataQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommandDomainDataQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommandDomainDataQuery) ProtoMessage() {} + +func (x *CommandDomainDataQuery) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_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 CommandDomainDataQuery.ProtoReflect.Descriptor instead. +func (*CommandDomainDataQuery) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{4} +} + +func (x *CommandDomainDataQuery) GetDomaindataId() string { + if x != nil { + return x.DomaindataId + } + return "" +} + +func (x *CommandDomainDataQuery) GetColumns() []string { + if x != nil { + return x.Columns + } + return nil +} + +func (x *CommandDomainDataQuery) GetResultFormat() *ContentFormat { + if x != nil { + return x.ResultFormat + } + return nil +} + +// call GetFlightInfo with CommandDomainDataUpdate, return TicketDomainDataQuery which is an update query +// and then call DoPut with TicketDomainDataQuery +type CommandDomainDataUpdate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DomaindataId string `protobuf:"bytes,1,opt,name=domaindata_id,json=domaindataId,proto3" json:"domaindata_id,omitempty"` + // create an nonexistent domaindata and get a update ticket + DomaindataRequest *CreateDomainDataRequest `protobuf:"bytes,2,opt,name=domaindata_request,json=domaindataRequest,proto3" json:"domaindata_request,omitempty"` + // for domaindata stored with file format , you can specify file_write_options + FileWriteOptions *FileWriteOptions `protobuf:"bytes,3,opt,name=file_write_options,json=fileWriteOptions,proto3" json:"file_write_options,omitempty"` + // extra options varies by datasource type + ExtraOptions map[string]string `protobuf:"bytes,4,rep,name=extra_options,json=extraOptions,proto3" json:"extra_options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *CommandDomainDataUpdate) Reset() { + *x = CommandDomainDataUpdate{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommandDomainDataUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommandDomainDataUpdate) ProtoMessage() {} + +func (x *CommandDomainDataUpdate) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommandDomainDataUpdate.ProtoReflect.Descriptor instead. +func (*CommandDomainDataUpdate) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{5} +} + +func (x *CommandDomainDataUpdate) GetDomaindataId() string { + if x != nil { + return x.DomaindataId + } + return "" +} + +func (x *CommandDomainDataUpdate) GetDomaindataRequest() *CreateDomainDataRequest { + if x != nil { + return x.DomaindataRequest + } + return nil +} + +func (x *CommandDomainDataUpdate) GetFileWriteOptions() *FileWriteOptions { + if x != nil { + return x.FileWriteOptions + } + return nil +} + +func (x *CommandDomainDataUpdate) GetExtraOptions() map[string]string { + if x != nil { + return x.ExtraOptions + } + return nil +} + +type TicketDomainDataQuery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // a unique identifier related to a DomainData query + DomaindataHandle string `protobuf:"bytes,1,opt,name=domaindata_handle,json=domaindataHandle,proto3" json:"domaindata_handle,omitempty"` +} + +func (x *TicketDomainDataQuery) Reset() { + *x = TicketDomainDataQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TicketDomainDataQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TicketDomainDataQuery) ProtoMessage() {} + +func (x *TicketDomainDataQuery) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TicketDomainDataQuery.ProtoReflect.Descriptor instead. +func (*TicketDomainDataQuery) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{6} +} + +func (x *TicketDomainDataQuery) GetDomaindataHandle() string { + if x != nil { + return x.DomaindataHandle + } + return "" +} + +// call DoAction with ActionCreateDomainDataRequest, return ActionCreateDomainDataResponse +type ActionCreateDomainDataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Request *CreateDomainDataRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` +} + +func (x *ActionCreateDomainDataRequest) Reset() { + *x = ActionCreateDomainDataRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActionCreateDomainDataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActionCreateDomainDataRequest) ProtoMessage() {} + +func (x *ActionCreateDomainDataRequest) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActionCreateDomainDataRequest.ProtoReflect.Descriptor instead. +func (*ActionCreateDomainDataRequest) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{7} +} + +func (x *ActionCreateDomainDataRequest) GetRequest() *CreateDomainDataRequest { + if x != nil { + return x.Request + } + return nil +} + +type ActionCreateDomainDataResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Response *CreateDomainDataResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` +} + +func (x *ActionCreateDomainDataResponse) Reset() { + *x = ActionCreateDomainDataResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActionCreateDomainDataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActionCreateDomainDataResponse) ProtoMessage() {} + +func (x *ActionCreateDomainDataResponse) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActionCreateDomainDataResponse.ProtoReflect.Descriptor instead. +func (*ActionCreateDomainDataResponse) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{8} +} + +func (x *ActionCreateDomainDataResponse) GetResponse() *CreateDomainDataResponse { + if x != nil { + return x.Response + } + return nil +} + +// call DoAction with ActionQueryDomainDataRequest, return ActionQueryDomainDataResponse +type ActionQueryDomainDataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Request *QueryDomainDataRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` +} + +func (x *ActionQueryDomainDataRequest) Reset() { + *x = ActionQueryDomainDataRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActionQueryDomainDataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActionQueryDomainDataRequest) ProtoMessage() {} + +func (x *ActionQueryDomainDataRequest) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActionQueryDomainDataRequest.ProtoReflect.Descriptor instead. +func (*ActionQueryDomainDataRequest) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{9} +} + +func (x *ActionQueryDomainDataRequest) GetRequest() *QueryDomainDataRequest { + if x != nil { + return x.Request + } + return nil +} + +type ActionQueryDomainDataResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Response *QueryDomainDataResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` +} + +func (x *ActionQueryDomainDataResponse) Reset() { + *x = ActionQueryDomainDataResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActionQueryDomainDataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActionQueryDomainDataResponse) ProtoMessage() {} + +func (x *ActionQueryDomainDataResponse) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActionQueryDomainDataResponse.ProtoReflect.Descriptor instead. +func (*ActionQueryDomainDataResponse) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{10} +} + +func (x *ActionQueryDomainDataResponse) GetResponse() *QueryDomainDataResponse { + if x != nil { + return x.Response + } + return nil +} + +// call DoAction with ActionUpdateDomainDataRequest, return ActionUpdateDomainDataResponse +type ActionUpdateDomainDataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Request *UpdateDomainDataRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` +} + +func (x *ActionUpdateDomainDataRequest) Reset() { + *x = ActionUpdateDomainDataRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActionUpdateDomainDataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActionUpdateDomainDataRequest) ProtoMessage() {} + +func (x *ActionUpdateDomainDataRequest) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActionUpdateDomainDataRequest.ProtoReflect.Descriptor instead. +func (*ActionUpdateDomainDataRequest) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{11} +} + +func (x *ActionUpdateDomainDataRequest) GetRequest() *UpdateDomainDataRequest { + if x != nil { + return x.Request + } + return nil +} + +type ActionUpdateDomainDataResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Response *UpdateDomainDataResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` +} + +func (x *ActionUpdateDomainDataResponse) Reset() { + *x = ActionUpdateDomainDataResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActionUpdateDomainDataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActionUpdateDomainDataResponse) ProtoMessage() {} + +func (x *ActionUpdateDomainDataResponse) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActionUpdateDomainDataResponse.ProtoReflect.Descriptor instead. +func (*ActionUpdateDomainDataResponse) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{12} +} + +func (x *ActionUpdateDomainDataResponse) GetResponse() *UpdateDomainDataResponse { + if x != nil { + return x.Response + } + return nil +} + +// call DoAction with ActionDeleteDomainDataRequest, return ActionDeleteDomainDataResponse +type ActionDeleteDomainDataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Request *DeleteDomainDataRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` + // not supported now + PhysicalDeletion bool `protobuf:"varint,2,opt,name=physical_deletion,json=physicalDeletion,proto3" json:"physical_deletion,omitempty"` +} + +func (x *ActionDeleteDomainDataRequest) Reset() { + *x = ActionDeleteDomainDataRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActionDeleteDomainDataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActionDeleteDomainDataRequest) ProtoMessage() {} + +func (x *ActionDeleteDomainDataRequest) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActionDeleteDomainDataRequest.ProtoReflect.Descriptor instead. +func (*ActionDeleteDomainDataRequest) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{13} +} + +func (x *ActionDeleteDomainDataRequest) GetRequest() *DeleteDomainDataRequest { + if x != nil { + return x.Request + } + return nil +} + +func (x *ActionDeleteDomainDataRequest) GetPhysicalDeletion() bool { + if x != nil { + return x.PhysicalDeletion + } + return false +} + +type ActionDeleteDomainDataResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Response *DeleteDomainDataResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` +} + +func (x *ActionDeleteDomainDataResponse) Reset() { + *x = ActionDeleteDomainDataResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActionDeleteDomainDataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActionDeleteDomainDataResponse) ProtoMessage() {} + +func (x *ActionDeleteDomainDataResponse) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_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 ActionDeleteDomainDataResponse.ProtoReflect.Descriptor instead. +func (*ActionDeleteDomainDataResponse) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{14} +} + +func (x *ActionDeleteDomainDataResponse) GetResponse() *DeleteDomainDataResponse { + if x != nil { + return x.Response + } + return nil +} + +// call DoAction with ActionCreateDomainDataSourceRequest, return ActionCreateDomainDataSourceResponse +type ActionCreateDomainDataSourceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Request *CreateDomainDataSourceRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` +} + +func (x *ActionCreateDomainDataSourceRequest) Reset() { + *x = ActionCreateDomainDataSourceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActionCreateDomainDataSourceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActionCreateDomainDataSourceRequest) ProtoMessage() {} + +func (x *ActionCreateDomainDataSourceRequest) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_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 ActionCreateDomainDataSourceRequest.ProtoReflect.Descriptor instead. +func (*ActionCreateDomainDataSourceRequest) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{15} +} + +func (x *ActionCreateDomainDataSourceRequest) GetRequest() *CreateDomainDataSourceRequest { + if x != nil { + return x.Request + } + return nil +} + +type ActionCreateDomainDataSourceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Response *CreateDomainDataSourceResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` +} + +func (x *ActionCreateDomainDataSourceResponse) Reset() { + *x = ActionCreateDomainDataSourceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActionCreateDomainDataSourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActionCreateDomainDataSourceResponse) ProtoMessage() {} + +func (x *ActionCreateDomainDataSourceResponse) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActionCreateDomainDataSourceResponse.ProtoReflect.Descriptor instead. +func (*ActionCreateDomainDataSourceResponse) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{16} +} + +func (x *ActionCreateDomainDataSourceResponse) GetResponse() *CreateDomainDataSourceResponse { + if x != nil { + return x.Response + } + return nil +} + +// call DoAction with ActionQueryDomainDataSourceRequest, return ActionQueryDomainDataSourceResponse +type ActionQueryDomainDataSourceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Request *QueryDomainDataSourceRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` +} + +func (x *ActionQueryDomainDataSourceRequest) Reset() { + *x = ActionQueryDomainDataSourceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActionQueryDomainDataSourceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActionQueryDomainDataSourceRequest) ProtoMessage() {} + +func (x *ActionQueryDomainDataSourceRequest) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActionQueryDomainDataSourceRequest.ProtoReflect.Descriptor instead. +func (*ActionQueryDomainDataSourceRequest) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{17} +} + +func (x *ActionQueryDomainDataSourceRequest) GetRequest() *QueryDomainDataSourceRequest { + if x != nil { + return x.Request + } + return nil +} + +type ActionQueryDomainDataSourceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Response *QueryDomainDataSourceResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` +} + +func (x *ActionQueryDomainDataSourceResponse) Reset() { + *x = ActionQueryDomainDataSourceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActionQueryDomainDataSourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActionQueryDomainDataSourceResponse) ProtoMessage() {} + +func (x *ActionQueryDomainDataSourceResponse) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActionQueryDomainDataSourceResponse.ProtoReflect.Descriptor instead. +func (*ActionQueryDomainDataSourceResponse) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP(), []int{18} +} + +func (x *ActionQueryDomainDataSourceResponse) GetResponse() *QueryDomainDataSourceResponse { + if x != nil { + return x.Response + } + return nil +} + +var File_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto protoreflect.FileDescriptor + +var file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDesc = []byte{ + 0x0a, 0x31, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, + 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x66, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x64, 0x6d, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x22, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x1a, 0x33, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x64, 0x6f, 0x6d, 0x61, + 0x69, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x39, 0x6b, 0x75, + 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, + 0x2f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3a, 0x0a, 0x0f, 0x43, 0x53, 0x56, 0x57, 0x72, + 0x69, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x65, 0x72, 0x22, 0x75, 0x0a, 0x10, 0x46, 0x69, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x56, 0x0a, 0x0b, 0x63, 0x73, 0x76, 0x5f, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x6b, + 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, + 0x68, 0x2e, 0x43, 0x53, 0x56, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x73, 0x76, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, + 0x09, 0x0a, 0x07, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x0d, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x4a, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x6b, 0x75, 0x73, + 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x62, 0x0a, 0x12, 0x66, 0x69, 0x6c, 0x65, + 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x57, 0x72, + 0x69, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x10, 0x66, 0x69, 0x6c, 0x65, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x23, 0x0a, 0x04, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x10, 0x00, 0x12, + 0x07, 0x0a, 0x03, 0x52, 0x41, 0x57, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x43, 0x53, 0x56, 0x10, + 0x02, 0x22, 0x41, 0x0a, 0x1a, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x47, 0x65, 0x74, 0x44, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, + 0x23, 0x0a, 0x0d, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x61, + 0x74, 0x61, 0x49, 0x64, 0x22, 0xaf, 0x01, 0x0a, 0x16, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, + 0x23, 0x0a, 0x0d, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x61, + 0x74, 0x61, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x56, + 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0xc3, 0x03, 0x0a, 0x17, 0x43, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x61, 0x74, 0x61, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x64, 0x61, 0x74, 0x61, 0x49, 0x64, 0x12, 0x6a, 0x0a, 0x12, 0x64, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x52, 0x11, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x62, 0x0a, 0x12, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x77, 0x72, 0x69, 0x74, + 0x65, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x34, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, + 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x10, 0x66, 0x69, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x72, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x72, 0x61, + 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4d, + 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, + 0x65, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x44, 0x61, 0x74, 0x61, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x45, 0x78, 0x74, 0x72, + 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x65, + 0x78, 0x74, 0x72, 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x45, + 0x78, 0x74, 0x72, 0x61, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x44, 0x0a, 0x15, + 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2b, 0x0a, 0x11, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x64, + 0x61, 0x74, 0x61, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x10, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x48, 0x61, 0x6e, 0x64, + 0x6c, 0x65, 0x22, 0x76, 0x0a, 0x1d, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x55, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x7a, 0x0a, 0x1e, 0x41, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x08, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, + 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, + 0x65, 0x73, 0x68, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x74, 0x0a, 0x1c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x54, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x78, 0x0a, 0x1d, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, + 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x3b, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, + 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x76, 0x0a, 0x1d, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x55, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, + 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x7a, + 0x0a, 0x1e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, + 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x58, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, + 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa3, 0x01, 0x0a, 0x1d, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x55, 0x0a, 0x07, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, + 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, + 0x73, 0x68, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, + 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6c, 0x5f, + 0x64, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, + 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x7a, 0x0a, 0x1e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x58, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x82, 0x01, 0x0a, + 0x23, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, + 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x5b, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x86, 0x01, 0x0a, 0x24, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5e, 0x0a, 0x08, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x6b, + 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, + 0x68, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, + 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x80, 0x01, 0x0a, 0x22, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x5a, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x6d, + 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x84, 0x01, + 0x0a, 0x23, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x6d, + 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x5c, 0x0a, 0x20, 0x6f, 0x72, 0x67, 0x2e, 0x73, 0x65, 0x63, 0x72, + 0x65, 0x74, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x66, 0x6c, 0x6f, 0x77, 0x2f, + 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, + 0x73, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescOnce sync.Once + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescData = file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDesc +) + +func file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescGZIP() []byte { + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescOnce.Do(func() { + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescData = protoimpl.X.CompressGZIP(file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescData) + }) + return file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDescData +} + +var file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_goTypes = []interface{}{ + (ContentFormat_Type)(0), // 0: kuscia.proto.api.v1alpha1.datamesh.ContentFormat.Type + (*CSVWriteOptions)(nil), // 1: kuscia.proto.api.v1alpha1.datamesh.CSVWriteOptions + (*FileWriteOptions)(nil), // 2: kuscia.proto.api.v1alpha1.datamesh.FileWriteOptions + (*ContentFormat)(nil), // 3: kuscia.proto.api.v1alpha1.datamesh.ContentFormat + (*CommandGetDomainDataSchema)(nil), // 4: kuscia.proto.api.v1alpha1.datamesh.CommandGetDomainDataSchema + (*CommandDomainDataQuery)(nil), // 5: kuscia.proto.api.v1alpha1.datamesh.CommandDomainDataQuery + (*CommandDomainDataUpdate)(nil), // 6: kuscia.proto.api.v1alpha1.datamesh.CommandDomainDataUpdate + (*TicketDomainDataQuery)(nil), // 7: kuscia.proto.api.v1alpha1.datamesh.TicketDomainDataQuery + (*ActionCreateDomainDataRequest)(nil), // 8: kuscia.proto.api.v1alpha1.datamesh.ActionCreateDomainDataRequest + (*ActionCreateDomainDataResponse)(nil), // 9: kuscia.proto.api.v1alpha1.datamesh.ActionCreateDomainDataResponse + (*ActionQueryDomainDataRequest)(nil), // 10: kuscia.proto.api.v1alpha1.datamesh.ActionQueryDomainDataRequest + (*ActionQueryDomainDataResponse)(nil), // 11: kuscia.proto.api.v1alpha1.datamesh.ActionQueryDomainDataResponse + (*ActionUpdateDomainDataRequest)(nil), // 12: kuscia.proto.api.v1alpha1.datamesh.ActionUpdateDomainDataRequest + (*ActionUpdateDomainDataResponse)(nil), // 13: kuscia.proto.api.v1alpha1.datamesh.ActionUpdateDomainDataResponse + (*ActionDeleteDomainDataRequest)(nil), // 14: kuscia.proto.api.v1alpha1.datamesh.ActionDeleteDomainDataRequest + (*ActionDeleteDomainDataResponse)(nil), // 15: kuscia.proto.api.v1alpha1.datamesh.ActionDeleteDomainDataResponse + (*ActionCreateDomainDataSourceRequest)(nil), // 16: kuscia.proto.api.v1alpha1.datamesh.ActionCreateDomainDataSourceRequest + (*ActionCreateDomainDataSourceResponse)(nil), // 17: kuscia.proto.api.v1alpha1.datamesh.ActionCreateDomainDataSourceResponse + (*ActionQueryDomainDataSourceRequest)(nil), // 18: kuscia.proto.api.v1alpha1.datamesh.ActionQueryDomainDataSourceRequest + (*ActionQueryDomainDataSourceResponse)(nil), // 19: kuscia.proto.api.v1alpha1.datamesh.ActionQueryDomainDataSourceResponse + nil, // 20: kuscia.proto.api.v1alpha1.datamesh.CommandDomainDataUpdate.ExtraOptionsEntry + (*CreateDomainDataRequest)(nil), // 21: kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataRequest + (*CreateDomainDataResponse)(nil), // 22: kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataResponse + (*QueryDomainDataRequest)(nil), // 23: kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataRequest + (*QueryDomainDataResponse)(nil), // 24: kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataResponse + (*UpdateDomainDataRequest)(nil), // 25: kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataRequest + (*UpdateDomainDataResponse)(nil), // 26: kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataResponse + (*DeleteDomainDataRequest)(nil), // 27: kuscia.proto.api.v1alpha1.datamesh.DeleteDomainDataRequest + (*DeleteDomainDataResponse)(nil), // 28: kuscia.proto.api.v1alpha1.datamesh.DeleteDomainDataResponse + (*CreateDomainDataSourceRequest)(nil), // 29: kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceRequest + (*CreateDomainDataSourceResponse)(nil), // 30: kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceResponse + (*QueryDomainDataSourceRequest)(nil), // 31: kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataSourceRequest + (*QueryDomainDataSourceResponse)(nil), // 32: kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataSourceResponse +} +var file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_depIdxs = []int32{ + 1, // 0: kuscia.proto.api.v1alpha1.datamesh.FileWriteOptions.csv_options:type_name -> kuscia.proto.api.v1alpha1.datamesh.CSVWriteOptions + 0, // 1: kuscia.proto.api.v1alpha1.datamesh.ContentFormat.type:type_name -> kuscia.proto.api.v1alpha1.datamesh.ContentFormat.Type + 2, // 2: kuscia.proto.api.v1alpha1.datamesh.ContentFormat.file_write_options:type_name -> kuscia.proto.api.v1alpha1.datamesh.FileWriteOptions + 3, // 3: kuscia.proto.api.v1alpha1.datamesh.CommandDomainDataQuery.result_format:type_name -> kuscia.proto.api.v1alpha1.datamesh.ContentFormat + 21, // 4: kuscia.proto.api.v1alpha1.datamesh.CommandDomainDataUpdate.domaindata_request:type_name -> kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataRequest + 2, // 5: kuscia.proto.api.v1alpha1.datamesh.CommandDomainDataUpdate.file_write_options:type_name -> kuscia.proto.api.v1alpha1.datamesh.FileWriteOptions + 20, // 6: kuscia.proto.api.v1alpha1.datamesh.CommandDomainDataUpdate.extra_options:type_name -> kuscia.proto.api.v1alpha1.datamesh.CommandDomainDataUpdate.ExtraOptionsEntry + 21, // 7: kuscia.proto.api.v1alpha1.datamesh.ActionCreateDomainDataRequest.request:type_name -> kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataRequest + 22, // 8: kuscia.proto.api.v1alpha1.datamesh.ActionCreateDomainDataResponse.response:type_name -> kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataResponse + 23, // 9: kuscia.proto.api.v1alpha1.datamesh.ActionQueryDomainDataRequest.request:type_name -> kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataRequest + 24, // 10: kuscia.proto.api.v1alpha1.datamesh.ActionQueryDomainDataResponse.response:type_name -> kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataResponse + 25, // 11: kuscia.proto.api.v1alpha1.datamesh.ActionUpdateDomainDataRequest.request:type_name -> kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataRequest + 26, // 12: kuscia.proto.api.v1alpha1.datamesh.ActionUpdateDomainDataResponse.response:type_name -> kuscia.proto.api.v1alpha1.datamesh.UpdateDomainDataResponse + 27, // 13: kuscia.proto.api.v1alpha1.datamesh.ActionDeleteDomainDataRequest.request:type_name -> kuscia.proto.api.v1alpha1.datamesh.DeleteDomainDataRequest + 28, // 14: kuscia.proto.api.v1alpha1.datamesh.ActionDeleteDomainDataResponse.response:type_name -> kuscia.proto.api.v1alpha1.datamesh.DeleteDomainDataResponse + 29, // 15: kuscia.proto.api.v1alpha1.datamesh.ActionCreateDomainDataSourceRequest.request:type_name -> kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceRequest + 30, // 16: kuscia.proto.api.v1alpha1.datamesh.ActionCreateDomainDataSourceResponse.response:type_name -> kuscia.proto.api.v1alpha1.datamesh.CreateDomainDataSourceResponse + 31, // 17: kuscia.proto.api.v1alpha1.datamesh.ActionQueryDomainDataSourceRequest.request:type_name -> kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataSourceRequest + 32, // 18: kuscia.proto.api.v1alpha1.datamesh.ActionQueryDomainDataSourceResponse.response:type_name -> kuscia.proto.api.v1alpha1.datamesh.QueryDomainDataSourceResponse + 19, // [19:19] is the sub-list for method output_type + 19, // [19:19] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name +} + +func init() { file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_init() } +func file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_init() { + if File_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto != nil { + return + } + file_kuscia_proto_api_v1alpha1_datamesh_domaindata_proto_init() + file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_init() + if !protoimpl.UnsafeEnabled { + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CSVWriteOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FileWriteOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContentFormat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommandGetDomainDataSchema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommandDomainDataQuery); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommandDomainDataUpdate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TicketDomainDataQuery); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActionCreateDomainDataRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActionCreateDomainDataResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActionQueryDomainDataRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActionQueryDomainDataResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActionUpdateDomainDataRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActionUpdateDomainDataResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActionDeleteDomainDataRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActionDeleteDomainDataResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActionCreateDomainDataSourceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActionCreateDomainDataSourceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActionQueryDomainDataSourceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActionQueryDomainDataSourceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*FileWriteOptions_CsvOptions)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDesc, + NumEnums: 1, + NumMessages: 20, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_goTypes, + DependencyIndexes: file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_depIdxs, + EnumInfos: file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_enumTypes, + MessageInfos: file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_msgTypes, + }.Build() + File_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto = out.File + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_rawDesc = nil + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_goTypes = nil + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_depIdxs = nil +} diff --git a/proto/api/v1alpha1/datamesh/flightdm.proto b/proto/api/v1alpha1/datamesh/flightdm.proto new file mode 100644 index 000000000..e5069215c --- /dev/null +++ b/proto/api/v1alpha1/datamesh/flightdm.proto @@ -0,0 +1,139 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package kuscia.proto.api.v1alpha1.datamesh; + +import "kuscia/proto/api/v1alpha1/datamesh/domaindata.proto"; +import "kuscia/proto/api/v1alpha1/datamesh/domaindatasource.proto"; + +option go_package = "github.com/secretflow/kuscia/proto/api/v1alpha1/datamesh"; +option java_package = "org.secretflow.v1alpha1.datamesh"; + +// write options of csv file +message CSVWriteOptions { + // field delimiter of csv file, default is comma + string field_delimiter = 1; +} + +// write options varies by file format +message FileWriteOptions { + oneof Options { + CSVWriteOptions csv_options = 1; + } +} + +// ContentFormat describe the schema of ArrowRecordBatch response from DataProxy +// Only for Table Type, the schema is defined by DomainData's columns +// And for rest types, the schema is a dummy schema which only contains one column of arrow::Binary type +message ContentFormat { + enum Type { + Table = 0; + // read raw data from datasource + RAW = 1; + // convert data to csv file format, and return file content as dummy schema + CSV = 2; + } + Type type = 1; + FileWriteOptions file_write_options = 2; +} + +// call with GetSchema, return SchemaResult, extension attributes are set with metadata +message CommandGetDomainDataSchema { + string domaindata_id = 1; +} + +// call GetFlightInfo with CommandDomainDataQuery, return TicketDomainDataQuery +// and then call DoGet with TicketDomainDataQuery +message CommandDomainDataQuery { + string domaindata_id = 1; + // column name of DomainData's columns + repeated string columns = 2; + // expected result format + ContentFormat result_format = 3; +} + +// call GetFlightInfo with CommandDomainDataUpdate, return TicketDomainDataQuery which is an update query +// and then call DoPut with TicketDomainDataQuery +message CommandDomainDataUpdate { + string domaindata_id = 1; + // create an nonexistent domaindata and get a update ticket + CreateDomainDataRequest domaindata_request = 2; + // for domaindata stored with file format , you can specify file_write_options + FileWriteOptions file_write_options = 3; + // extra options varies by datasource type + map extra_options = 4; +} + +message TicketDomainDataQuery { + // a unique identifier related to a DomainData query + string domaindata_handle = 1; +} + +// call DoAction with ActionCreateDomainDataRequest, return ActionCreateDomainDataResponse +message ActionCreateDomainDataRequest { + CreateDomainDataRequest request = 1; +} + +message ActionCreateDomainDataResponse { + CreateDomainDataResponse response = 1; +} + +// call DoAction with ActionQueryDomainDataRequest, return ActionQueryDomainDataResponse +message ActionQueryDomainDataRequest { + QueryDomainDataRequest request = 1; +} + +message ActionQueryDomainDataResponse { + QueryDomainDataResponse response = 1; +} + +// call DoAction with ActionUpdateDomainDataRequest, return ActionUpdateDomainDataResponse +message ActionUpdateDomainDataRequest { + UpdateDomainDataRequest request = 1; +} + +message ActionUpdateDomainDataResponse { + UpdateDomainDataResponse response = 1; +} + +// call DoAction with ActionDeleteDomainDataRequest, return ActionDeleteDomainDataResponse +message ActionDeleteDomainDataRequest { + DeleteDomainDataRequest request = 1; + // not supported now + bool physical_deletion = 2; +} + +message ActionDeleteDomainDataResponse { + DeleteDomainDataResponse response = 1; +} + +// call DoAction with ActionCreateDomainDataSourceRequest, return ActionCreateDomainDataSourceResponse +message ActionCreateDomainDataSourceRequest { + CreateDomainDataSourceRequest request = 1; +} + +message ActionCreateDomainDataSourceResponse { + CreateDomainDataSourceResponse response = 1; +} + +// call DoAction with ActionQueryDomainDataSourceRequest, return ActionQueryDomainDataSourceResponse +message ActionQueryDomainDataSourceRequest { + QueryDomainDataSourceRequest request = 1; +} + +message ActionQueryDomainDataSourceResponse { + QueryDomainDataSourceResponse response = 1; +} diff --git a/proto/api/v1alpha1/datamesh/flightinner.pb.go b/proto/api/v1alpha1/datamesh/flightinner.pb.go new file mode 100644 index 000000000..60a0e6c5f --- /dev/null +++ b/proto/api/v1alpha1/datamesh/flightinner.pb.go @@ -0,0 +1,312 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: kuscia/proto/api/v1alpha1/datamesh/flightinner.proto + +package datamesh + +import ( + 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) +) + +type CommandDataMeshQuery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Query *CommandDomainDataQuery `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + Domaindata *DomainData `protobuf:"bytes,2,opt,name=domaindata,proto3" json:"domaindata,omitempty"` + Datasource *DomainDataSource `protobuf:"bytes,3,opt,name=datasource,proto3" json:"datasource,omitempty"` +} + +func (x *CommandDataMeshQuery) Reset() { + *x = CommandDataMeshQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommandDataMeshQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommandDataMeshQuery) ProtoMessage() {} + +func (x *CommandDataMeshQuery) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightinner_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 CommandDataMeshQuery.ProtoReflect.Descriptor instead. +func (*CommandDataMeshQuery) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_rawDescGZIP(), []int{0} +} + +func (x *CommandDataMeshQuery) GetQuery() *CommandDomainDataQuery { + if x != nil { + return x.Query + } + return nil +} + +func (x *CommandDataMeshQuery) GetDomaindata() *DomainData { + if x != nil { + return x.Domaindata + } + return nil +} + +func (x *CommandDataMeshQuery) GetDatasource() *DomainDataSource { + if x != nil { + return x.Datasource + } + return nil +} + +type CommandDataMeshUpdate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Update *CommandDomainDataUpdate `protobuf:"bytes,1,opt,name=update,proto3" json:"update,omitempty"` + Domaindata *DomainData `protobuf:"bytes,2,opt,name=domaindata,proto3" json:"domaindata,omitempty"` + Datasource *DomainDataSource `protobuf:"bytes,3,opt,name=datasource,proto3" json:"datasource,omitempty"` +} + +func (x *CommandDataMeshUpdate) Reset() { + *x = CommandDataMeshUpdate{} + if protoimpl.UnsafeEnabled { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommandDataMeshUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommandDataMeshUpdate) ProtoMessage() {} + +func (x *CommandDataMeshUpdate) ProtoReflect() protoreflect.Message { + mi := &file_kuscia_proto_api_v1alpha1_datamesh_flightinner_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 CommandDataMeshUpdate.ProtoReflect.Descriptor instead. +func (*CommandDataMeshUpdate) Descriptor() ([]byte, []int) { + return file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_rawDescGZIP(), []int{1} +} + +func (x *CommandDataMeshUpdate) GetUpdate() *CommandDomainDataUpdate { + if x != nil { + return x.Update + } + return nil +} + +func (x *CommandDataMeshUpdate) GetDomaindata() *DomainData { + if x != nil { + return x.Domaindata + } + return nil +} + +func (x *CommandDataMeshUpdate) GetDatasource() *DomainDataSource { + if x != nil { + return x.Datasource + } + return nil +} + +var File_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto protoreflect.FileDescriptor + +var file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_rawDesc = []byte{ + 0x0a, 0x34, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, + 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x66, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x69, 0x6e, 0x6e, 0x65, 0x72, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x22, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x1a, 0x33, 0x6b, 0x75, 0x73, 0x63, + 0x69, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x64, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x39, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, + 0x65, 0x73, 0x68, 0x2f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x31, 0x6b, 0x75, 0x73, 0x63, + 0x69, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x66, + 0x6c, 0x69, 0x67, 0x68, 0x74, 0x64, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8e, 0x02, + 0x0a, 0x14, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, + 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x50, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x4e, 0x0a, 0x0a, 0x64, 0x6f, 0x6d, 0x61, + 0x69, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x6b, + 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, + 0x68, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x64, 0x6f, + 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x12, 0x54, 0x0a, 0x0a, 0x64, 0x61, 0x74, 0x61, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x6b, + 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, + 0x68, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x92, + 0x02, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, + 0x73, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x53, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, + 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4e, 0x0a, + 0x0a, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2e, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, + 0x61, 0x52, 0x0a, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x12, 0x54, 0x0a, + 0x0a, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x34, 0x2e, 0x6b, 0x75, 0x73, 0x63, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, + 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x42, 0x5c, 0x0a, 0x20, 0x6f, 0x72, 0x67, 0x2e, 0x73, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, 0x68, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x6b, + 0x75, 0x73, 0x63, 0x69, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x65, 0x73, + 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_rawDescOnce sync.Once + file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_rawDescData = file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_rawDesc +) + +func file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_rawDescGZIP() []byte { + file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_rawDescOnce.Do(func() { + file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_rawDescData = protoimpl.X.CompressGZIP(file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_rawDescData) + }) + return file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_rawDescData +} + +var file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_goTypes = []interface{}{ + (*CommandDataMeshQuery)(nil), // 0: kuscia.proto.api.v1alpha1.datamesh.CommandDataMeshQuery + (*CommandDataMeshUpdate)(nil), // 1: kuscia.proto.api.v1alpha1.datamesh.CommandDataMeshUpdate + (*CommandDomainDataQuery)(nil), // 2: kuscia.proto.api.v1alpha1.datamesh.CommandDomainDataQuery + (*DomainData)(nil), // 3: kuscia.proto.api.v1alpha1.datamesh.DomainData + (*DomainDataSource)(nil), // 4: kuscia.proto.api.v1alpha1.datamesh.DomainDataSource + (*CommandDomainDataUpdate)(nil), // 5: kuscia.proto.api.v1alpha1.datamesh.CommandDomainDataUpdate +} +var file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_depIdxs = []int32{ + 2, // 0: kuscia.proto.api.v1alpha1.datamesh.CommandDataMeshQuery.query:type_name -> kuscia.proto.api.v1alpha1.datamesh.CommandDomainDataQuery + 3, // 1: kuscia.proto.api.v1alpha1.datamesh.CommandDataMeshQuery.domaindata:type_name -> kuscia.proto.api.v1alpha1.datamesh.DomainData + 4, // 2: kuscia.proto.api.v1alpha1.datamesh.CommandDataMeshQuery.datasource:type_name -> kuscia.proto.api.v1alpha1.datamesh.DomainDataSource + 5, // 3: kuscia.proto.api.v1alpha1.datamesh.CommandDataMeshUpdate.update:type_name -> kuscia.proto.api.v1alpha1.datamesh.CommandDomainDataUpdate + 3, // 4: kuscia.proto.api.v1alpha1.datamesh.CommandDataMeshUpdate.domaindata:type_name -> kuscia.proto.api.v1alpha1.datamesh.DomainData + 4, // 5: kuscia.proto.api.v1alpha1.datamesh.CommandDataMeshUpdate.datasource:type_name -> kuscia.proto.api.v1alpha1.datamesh.DomainDataSource + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_init() } +func file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_init() { + if File_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto != nil { + return + } + file_kuscia_proto_api_v1alpha1_datamesh_domaindata_proto_init() + file_kuscia_proto_api_v1alpha1_datamesh_domaindatasource_proto_init() + file_kuscia_proto_api_v1alpha1_datamesh_flightdm_proto_init() + if !protoimpl.UnsafeEnabled { + file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommandDataMeshQuery); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommandDataMeshUpdate); 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_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_goTypes, + DependencyIndexes: file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_depIdxs, + MessageInfos: file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_msgTypes, + }.Build() + File_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto = out.File + file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_rawDesc = nil + file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_goTypes = nil + file_kuscia_proto_api_v1alpha1_datamesh_flightinner_proto_depIdxs = nil +} diff --git a/proto/api/v1alpha1/datamesh/flightinner.proto b/proto/api/v1alpha1/datamesh/flightinner.proto new file mode 100644 index 000000000..8761c4278 --- /dev/null +++ b/proto/api/v1alpha1/datamesh/flightinner.proto @@ -0,0 +1,35 @@ +// Copyright 2023 Ant Group Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package kuscia.proto.api.v1alpha1.datamesh; +import "kuscia/proto/api/v1alpha1/datamesh/domaindata.proto"; +import "kuscia/proto/api/v1alpha1/datamesh/domaindatasource.proto"; +import "kuscia/proto/api/v1alpha1/datamesh/flightdm.proto"; + +option go_package = "github.com/secretflow/kuscia/proto/api/v1alpha1/datamesh"; +option java_package = "org.secretflow.v1alpha1.datamesh"; + +message CommandDataMeshQuery { + CommandDomainDataQuery query = 1; + DomainData domaindata = 2 ; + DomainDataSource datasource = 3; +} + +message CommandDataMeshUpdate { + CommandDomainDataUpdate update = 1; + DomainData domaindata = 2 ; + DomainDataSource datasource = 3; +} diff --git a/scripts/deploy/init_confmanager_cert.sh b/scripts/deploy/init_confmanager_cert.sh new file mode 100755 index 000000000..af93f3c24 --- /dev/null +++ b/scripts/deploy/init_confmanager_cert.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# Copyright 2023 Ant Group Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P) +IP=$(ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}') +pushd ${ROOT}/etc/certs || exit + +DAYS=1000 +SERVER=confmanager-server +subjectAltName="IP:127.0.0.1,IP:${IP},DNS:localhost" +echo "subjectAltName=${subjectAltName}" > /tmp/confmanager-openssl.conf + +#create a PKCS#1 key for server, default is PKCS#1 +openssl genrsa -out ${SERVER}.key 2048 + +#generate the Certificate Signing Request +openssl req -new -key ${SERVER}.key -days ${DAYS} -out ${SERVER}.csr \ + -subj "/CN=ConfManager" + +#sign it with Root CA +openssl x509 -req -in ${SERVER}.csr \ + -extfile /tmp/confmanager-openssl.conf \ + -CA ca.crt -CAkey ca.key \ + -days ${DAYS} -sha256 -CAcreateserial \ + -out ${SERVER}.crt + +rm -rf /tmp/confmanager-openssl.conf \ No newline at end of file diff --git a/scripts/deploy/start_autonomy.sh b/scripts/deploy/start_autonomy.sh index 5e261a7e1..e559dc3ec 100755 --- a/scripts/deploy/start_autonomy.sh +++ b/scripts/deploy/start_autonomy.sh @@ -68,7 +68,7 @@ master: certFile: ${ROOT}/etc/certs/domain.crt keyFile: ${ROOT}/etc/certs/domain.key caFile: ${ROOT}/etc/certs/master.ca.crt - api-whitelist: + apiWhitelist: - /(api(s)?(/[0-9A-Za-z_.-]+)?/v1(alpha1)?/namespaces/[0-9A-Za-z_.-]+/(pods|gateways|domainroutes|endpoints|services|events|configmaps|leases|taskresources|secrets|domaindatas|domaindatagrants|domaindatasources)(/[0-9A-Za-z_.-]+(/status$)?)?) - /api/v1/namespaces/[0-9A-Za-z_.-]+ - /api/v1/nodes(/.*)? diff --git a/scripts/deploy/start_standalone.sh b/scripts/deploy/start_standalone.sh index 48759adf2..7de4d986f 100755 --- a/scripts/deploy/start_standalone.sh +++ b/scripts/deploy/start_standalone.sh @@ -469,6 +469,7 @@ function start_lite() { csrToken=$(docker exec -it "${MASTER_CTR}" scripts/deploy/add_domain_lite.sh "${domain_id}") docker run -it --rm --mount source="${certs_volume}",target="${CTR_CERT_ROOT}" "${IMAGE}" scripts/deploy/init_domain_certs.sh "${domain_id}" "${csrToken}" docker run -it --rm --mount source=${certs_volume},target=${CTR_CERT_ROOT} ${IMAGE} scripts/deploy/init_external_tls_cert.sh ${domain_id} + docker run -it --rm --mount source=${certs_volume},target=${CTR_CERT_ROOT} ${IMAGE} scripts/deploy/init_confmanager_cert.sh copy_container_file_to_volume ${MASTER_CTR}:${CTR_CERT_ROOT}/ca.crt $certs_volume master.ca.crt docker run -dit --privileged --name=${domain_ctr} --hostname=${domain_ctr} --restart=always --network=${NETWORK_NAME} -m $LITE_MEMORY_LIMIT ${env_flag} \ @@ -567,6 +568,7 @@ function run_centralized() { docker run -it --rm --mount source=${certs_volume},target=${CTR_CERT_ROOT} ${IMAGE} scripts/deploy/init_domain_certs.sh ${MASTER_DOMAIN} ${csrToken} docker run -it --rm --mount source=${certs_volume},target=${CTR_CERT_ROOT} ${IMAGE} scripts/deploy/init_external_tls_cert.sh ${MASTER_DOMAIN} docker run -it --rm --mount source=${certs_volume},target=${CTR_CERT_ROOT} --network=${NETWORK_NAME} ${IMAGE} scripts/deploy/init_kusciaapi_cert.sh ${MASTER_CTR} ${host_ip} + docker run -it --rm --mount source=${certs_volume},target=${CTR_CERT_ROOT} ${IMAGE} scripts/deploy/init_confmanager_cert.sh docker run -dit --name=${MASTER_CTR} --hostname=${MASTER_CTR} --restart=always --network=${NETWORK_NAME} -m $MASTER_MEMORY_LIMIT ${env_flag} \ -p 18080:1080 \ -p 18082:8082 \ diff --git a/scripts/test/suite/center/base.sh b/scripts/test/suite/center/base.sh index e320d9c50..1fa13298a 100755 --- a/scripts/test/suite/center/base.sh +++ b/scripts/test/suite/center/base.sh @@ -48,19 +48,19 @@ function test_centralized_example_kuscia_job() { } function test_centralized_kuscia_api_http_available() { - local master_container_ip=$(get_container_ip "${MASTER_CONTAINER}") - local http_status_code=$(get_kuscia_api_healthz_http_status_code "${master_container_ip}" "${TEST_SUITE_RUN_KUSCIA_DIR}"/master) + local ipv4=($(get_ipv4_address)) + local http_status_code=$(get_kuscia_api_healthz_http_status_code "${ipv4}":18082 "${TEST_SUITE_RUN_KUSCIA_DIR}"/master) assertEquals "KusciaApi healthZ http code" "200" "${http_status_code}" - unset master_container_ip http_status_code + unset ipv4 http_status_code } function test_centralized_kuscia_api_grpc_available() { - local master_container_ip=$(get_container_ip "${MASTER_CONTAINER}") - local status_message=$(get_kuscia_api_healthz_grpc_status_message "${TEST_BIN_DIR}"/grpcurl "${master_container_ip}" "${TEST_SUITE_RUN_KUSCIA_DIR}"/master) + local ipv4=($(get_ipv4_address)) + local status_message=$(get_kuscia_api_healthz_grpc_status_message "${TEST_BIN_DIR}"/grpcurl "${ipv4}":18083 "${TEST_SUITE_RUN_KUSCIA_DIR}"/master) assertEquals "KusciaApi healthZ grpc status message" "success" "$(echo "${status_message}" | "${TEST_BIN_DIR}"/jq .status.message | sed -e 's/"//g')" - unset master_container_ip status_message + unset ipv4 status_message } . ./test/vendor/shunit2 \ No newline at end of file diff --git a/scripts/test/suite/core/functions.sh b/scripts/test/suite/core/functions.sh index 906940f0a..7eeb4ea3d 100644 --- a/scripts/test/suite/core/functions.sh +++ b/scripts/test/suite/core/functions.sh @@ -69,39 +69,39 @@ function wait_kuscia_job_until() { # Get kuscia api http code on http for healrhZ # # Args: -# ip: the kuscia api ip. +# addr: the kuscia api ip. # kuscia_cert_dir: cert and key location. # Return: # http_code: string function get_kuscia_api_healthz_http_status_code() { - local ip=$1 + local addr=$1 local kuscia_cert_dir=$2 curl --cert "${kuscia_cert_dir}"/kusciaapi-client.crt --key "${kuscia_cert_dir}"/kusciaapi-client.key \ - --cacert "${kuscia_cert_dir}"/ca.crt -X POST "https://${ip}:8082/api/v1/domain/query" --header "Token: $(cat "${kuscia_cert_dir}"/token)" \ + --cacert "${kuscia_cert_dir}"/ca.crt -X POST "https://${addr}/api/v1/domain/query" --header "Token: $(cat "${kuscia_cert_dir}"/token)" \ --header 'Content-Type: application/json' -s -o /dev/null --write-out '%{http_code}' -d '{"domain_id": "alice"}' - unset ip kuscia_cert_dir + unset addr kuscia_cert_dir } # Get kuscia api grpc status message on http for healrhZ # # Args: # grpcurl_path: grpcurl bin path. -# ip: the kuscia api ip. +# addr: the kuscia api ip. # kuscia_cert_dir: cert and key location. # Return: # status_message: string function get_kuscia_api_healthz_grpc_status_message() { local bin=$1 - local ip=$2 + local addr=$2 local kuscia_cert_dir=$3 ${bin} --cert "${kuscia_cert_dir}"/kusciaapi-client.crt --key "${kuscia_cert_dir}"/kusciaapi-client.key \ --cacert "${kuscia_cert_dir}"/ca.crt -H "Token: $(cat "${kuscia_cert_dir}"/token)" -d '{}' \ - "${ip}":8083 kuscia.proto.api.v1alpha1.kusciaapi.HealthService.healthZ + "${addr}" kuscia.proto.api.v1alpha1.kusciaapi.HealthService.healthZ - unset bin ip kuscia_cert_dir + unset bin addr kuscia_cert_dir } # Get container state, the state is from jsonpath=.state @@ -156,7 +156,7 @@ function start_center_mode() { # Run as Center ./start_standalone.sh center - # Check centralized container Up + # Check centralized container Up local master_container_state=$(get_container_state "${MASTER_CONTAINER}") assertEquals "Container ${MASTER_CONTAINER} not running}" running "${master_container_state}" local lite_alice_container_state=$(get_container_state "${LITE_ALICE_CONTAINER}") @@ -217,4 +217,19 @@ function start_p2p_mode() { function stop_p2p_mode() { docker stop "${AUTONOMY_ALICE_CONTAINER}" "${AUTONOMY_BOB_CONTAINER}" docker rm "${AUTONOMY_ALICE_CONTAINER}" "${AUTONOMY_BOB_CONTAINER}" +} + +# Get IpV4 Address +function get_ipv4_address() { + local ipv4="" + arch=$(uname -s || true) + case $arch in + "Linux") + ipv4=$(ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}') || true + ;; + "Darwin") + ipv4=$(ipconfig getifaddr en0) || true + ;; + esac + echo $ipv4 } \ No newline at end of file diff --git a/scripts/test/suite/p2p/base.sh b/scripts/test/suite/p2p/base.sh index 886cb1fc3..1eb8f1814 100755 --- a/scripts/test/suite/p2p/base.sh +++ b/scripts/test/suite/p2p/base.sh @@ -47,31 +47,37 @@ function test_p2p_kuscia_job() { } function test_p2p_kuscia_api_http_available() { - local autonomy_alice_container_ip=$(get_container_ip "${AUTONOMY_ALICE_CONTAINER}") - local alice_http_status_code=$(get_kuscia_api_healthz_http_status_code "${autonomy_alice_container_ip}" "${TEST_SUITE_P2P_TEST_RUN_KUSCIA_DIR}"/alice) + local ipv4=($(get_ipv4_address)) + + local alice_http_status_code=$(get_kuscia_api_healthz_http_status_code "${ipv4}":11082 "${TEST_SUITE_P2P_TEST_RUN_KUSCIA_DIR}"/alice) assertEquals "KusciaApi healthZ http code" "200" "${alice_http_status_code}" - unset autonomy_alice_container_ip alice_http_status_code + unset alice_http_status_code local autonomy_bob_container_ip=$(get_container_ip "${AUTONOMY_BOB_CONTAINER}") - local bob_http_status_code=$(get_kuscia_api_healthz_http_status_code "${autonomy_bob_container_ip}" "${TEST_SUITE_P2P_TEST_RUN_KUSCIA_DIR}"/bob) + local bob_http_status_code=$(get_kuscia_api_healthz_http_status_code "${ipv4}":12082 "${TEST_SUITE_P2P_TEST_RUN_KUSCIA_DIR}"/bob) assertEquals "KusciaApi healthZ http code" "200" "${bob_http_status_code}" - unset autonomy_bob_container_ip bob_http_status_code + unset bob_http_status_code + + unset ipv4 } function test_p2p_kuscia_api_grpc_available() { - local autonomy_alice_container_ip=$(get_container_ip "${AUTONOMY_ALICE_CONTAINER}") - local alice_status_message=$(get_kuscia_api_healthz_grpc_status_message "${TEST_BIN_DIR}"/grpcurl "${autonomy_alice_container_ip}" "${TEST_SUITE_P2P_TEST_RUN_KUSCIA_DIR}"/alice) + local ipv4=($(get_ipv4_address)) + + local alice_status_message=$(get_kuscia_api_healthz_grpc_status_message "${TEST_BIN_DIR}"/grpcurl "${ipv4}":11083 "${TEST_SUITE_P2P_TEST_RUN_KUSCIA_DIR}"/alice) assertEquals "KusciaApi healthZ grpc status message" "success" "$(echo "${alice_status_message}" | "${TEST_BIN_DIR}"/jq .status.message | sed -e 's/"//g')" - unset autonomy_alice_container_ip alice_status_message + unset alice_status_message local autonomy_bob_container_ip=$(get_container_ip "${AUTONOMY_BOB_CONTAINER}") - local bob_status_message=$(get_kuscia_api_healthz_grpc_status_message "${TEST_BIN_DIR}"/grpcurl "${autonomy_bob_container_ip}" "${TEST_SUITE_P2P_TEST_RUN_KUSCIA_DIR}"/bob) + local bob_status_message=$(get_kuscia_api_healthz_grpc_status_message "${TEST_BIN_DIR}"/grpcurl "${ipv4}":12083 "${TEST_SUITE_P2P_TEST_RUN_KUSCIA_DIR}"/bob) assertEquals "KusciaApi healthZ grpc status message" "success" "$(echo "${bob_status_message}" | "${TEST_BIN_DIR}"/jq .status.message | sed -e 's/"//g')" - unset autonomy_bob_container_ip bob_status_message + unset bob_status_message + + unset ipv4 } . ./test/vendor/shunit2 \ No newline at end of file diff --git a/scripts/user/create_confmanager_client_cert.sh b/scripts/user/create_confmanager_client_cert.sh new file mode 100755 index 000000000..b418ce0d9 --- /dev/null +++ b/scripts/user/create_confmanager_client_cert.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# +# Copyright 2023 Ant Group Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P) +pushd "${ROOT}"/etc/certs || exit + +common_name=$1 +organizational_unit=$2 +DAYS=1000 + +#create a PKCS#1 key for server, default is PKCS#1 +openssl genrsa -out "${common_name}".key 2048 + +#generate the Certificate Signing Request +openssl req -new -key "${common_name}".key -days ${DAYS} -out "${common_name}".csr \ + -subj "/CN=${common_name}/OU=${organizational_unit}" + +#sign it with Root CA +openssl x509 -req -in "${common_name}".csr \ + -CA ca.crt -CAkey ca.key \ + -days ${DAYS} -sha256 -CAcreateserial \ + -out "${common_name}".crt